ASN1_BIT_STRING_set:
   17|     68|{
   18|     68|    return ASN1_STRING_set(x, d, len);
   19|     68|}
ossl_i2c_ASN1_BIT_STRING:
   22|   242k|{
   23|   242k|    int ret, j, bits, len;
   24|   242k|    unsigned char *p, *d;
   25|       |
   26|   242k|    if (a == NULL)
  ------------------
  |  Branch (26:9): [True: 0, False: 242k]
  ------------------
   27|      0|        return 0;
   28|       |
   29|   242k|    len = a->length;
   30|       |
   31|   242k|    if (len > 0) {
  ------------------
  |  Branch (31:9): [True: 198k, False: 43.9k]
  ------------------
   32|   198k|        if (a->flags & ASN1_STRING_FLAG_BITS_LEFT) {
  ------------------
  |  |  161|   198k|# define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
  ------------------
  |  Branch (32:13): [True: 198k, False: 0]
  ------------------
   33|   198k|            bits = (int)a->flags & 0x07;
   34|   198k|        } else {
   35|      0|            for (; len > 0; len--) {
  ------------------
  |  Branch (35:20): [True: 0, False: 0]
  ------------------
   36|      0|                if (a->data[len - 1])
  ------------------
  |  Branch (36:21): [True: 0, False: 0]
  ------------------
   37|      0|                    break;
   38|      0|            }
   39|       |
   40|      0|            if (len == 0) {
  ------------------
  |  Branch (40:17): [True: 0, False: 0]
  ------------------
   41|      0|                bits = 0;
   42|      0|            } else {
   43|      0|                j = a->data[len - 1];
   44|      0|                if (j & 0x01)
  ------------------
  |  Branch (44:21): [True: 0, False: 0]
  ------------------
   45|      0|                    bits = 0;
   46|      0|                else if (j & 0x02)
  ------------------
  |  Branch (46:26): [True: 0, False: 0]
  ------------------
   47|      0|                    bits = 1;
   48|      0|                else if (j & 0x04)
  ------------------
  |  Branch (48:26): [True: 0, False: 0]
  ------------------
   49|      0|                    bits = 2;
   50|      0|                else if (j & 0x08)
  ------------------
  |  Branch (50:26): [True: 0, False: 0]
  ------------------
   51|      0|                    bits = 3;
   52|      0|                else if (j & 0x10)
  ------------------
  |  Branch (52:26): [True: 0, False: 0]
  ------------------
   53|      0|                    bits = 4;
   54|      0|                else if (j & 0x20)
  ------------------
  |  Branch (54:26): [True: 0, False: 0]
  ------------------
   55|      0|                    bits = 5;
   56|      0|                else if (j & 0x40)
  ------------------
  |  Branch (56:26): [True: 0, False: 0]
  ------------------
   57|      0|                    bits = 6;
   58|      0|                else if (j & 0x80)
  ------------------
  |  Branch (58:26): [True: 0, False: 0]
  ------------------
   59|      0|                    bits = 7;
   60|      0|                else
   61|      0|                    bits = 0;       /* should not happen */
   62|      0|            }
   63|      0|        }
   64|   198k|    } else
   65|  43.9k|        bits = 0;
   66|       |
   67|   242k|    ret = 1 + len;
   68|   242k|    if (pp == NULL)
  ------------------
  |  Branch (68:9): [True: 193k, False: 48.4k]
  ------------------
   69|   193k|        return ret;
   70|       |
   71|  48.4k|    p = *pp;
   72|       |
   73|  48.4k|    *(p++) = (unsigned char)bits;
   74|  48.4k|    d = a->data;
   75|  48.4k|    if (len > 0) {
  ------------------
  |  Branch (75:9): [True: 38.6k, False: 9.79k]
  ------------------
   76|  38.6k|        memcpy(p, d, len);
   77|  38.6k|        p += len;
   78|  38.6k|        p[-1] &= (0xff << bits);
   79|  38.6k|    }
   80|  48.4k|    *pp = p;
   81|  48.4k|    return ret;
   82|   242k|}
ossl_c2i_ASN1_BIT_STRING:
   86|   139k|{
   87|   139k|    ASN1_BIT_STRING *ret = NULL;
   88|   139k|    const unsigned char *p;
   89|   139k|    unsigned char *s;
   90|   139k|    int i = 0;
   91|       |
   92|   139k|    if (len < 1) {
  ------------------
  |  Branch (92:9): [True: 203, False: 139k]
  ------------------
   93|    203|        i = ASN1_R_STRING_TOO_SHORT;
  ------------------
  |  |  116|    203|# define ASN1_R_STRING_TOO_SHORT                          152
  ------------------
   94|    203|        goto err;
   95|    203|    }
   96|       |
   97|   139k|    if (len > INT_MAX) {
  ------------------
  |  Branch (97:9): [True: 0, False: 139k]
  ------------------
   98|      0|        i = ASN1_R_STRING_TOO_LONG;
  ------------------
  |  |  115|      0|# define ASN1_R_STRING_TOO_LONG                           151
  ------------------
   99|      0|        goto err;
  100|      0|    }
  101|       |
  102|   139k|    if ((a == NULL) || ((*a) == NULL)) {
  ------------------
  |  Branch (102:9): [True: 0, False: 139k]
  |  Branch (102:24): [True: 34.3k, False: 105k]
  ------------------
  103|  34.3k|        if ((ret = ASN1_BIT_STRING_new()) == NULL)
  ------------------
  |  Branch (103:13): [True: 0, False: 34.3k]
  ------------------
  104|      0|            return NULL;
  105|  34.3k|    } else
  106|   105k|        ret = (*a);
  107|       |
  108|   139k|    p = *pp;
  109|   139k|    i = *(p++);
  110|   139k|    if (i > 7) {
  ------------------
  |  Branch (110:9): [True: 370, False: 139k]
  ------------------
  111|    370|        i = ASN1_R_INVALID_BIT_STRING_BITS_LEFT;
  ------------------
  |  |   72|    370|# define ASN1_R_INVALID_BIT_STRING_BITS_LEFT              220
  ------------------
  112|    370|        goto err;
  113|    370|    }
  114|       |    /*
  115|       |     * We do this to preserve the settings.  If we modify the settings, via
  116|       |     * the _set_bit function, we will recalculate on output
  117|       |     */
  118|   139k|    ossl_asn1_string_set_bits_left(ret, i);
  119|       |
  120|   139k|    if (len-- > 1) {            /* using one because of the bits left byte */
  ------------------
  |  Branch (120:9): [True: 101k, False: 37.9k]
  ------------------
  121|   101k|        s = OPENSSL_malloc((int)len);
  ------------------
  |  |  102|   101k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   101k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   101k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  122|   101k|        if (s == NULL) {
  ------------------
  |  Branch (122:13): [True: 0, False: 101k]
  ------------------
  123|      0|            goto err;
  124|      0|        }
  125|   101k|        memcpy(s, p, (int)len);
  126|   101k|        s[len - 1] &= (0xff << i);
  127|   101k|        p += len;
  128|   101k|    } else
  129|  37.9k|        s = NULL;
  130|       |
  131|   139k|    ASN1_STRING_set0(ret, s, (int)len);
  132|   139k|    ret->type = V_ASN1_BIT_STRING;
  ------------------
  |  |   65|   139k|# define V_ASN1_BIT_STRING               3
  ------------------
  133|   139k|    if (a != NULL)
  ------------------
  |  Branch (133:9): [True: 139k, False: 0]
  ------------------
  134|   139k|        (*a) = ret;
  135|   139k|    *pp = p;
  136|   139k|    return ret;
  137|    573| err:
  138|    573|    if (i != 0)
  ------------------
  |  Branch (138:9): [True: 573, False: 0]
  ------------------
  139|    573|        ERR_raise(ERR_LIB_ASN1, i);
  ------------------
  |  |  401|    573|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    573|    (ERR_new(),                                                 \
  |  |  |  |  404|    573|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    573|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    573|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    573|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    573|     ERR_set_error)
  |  |  ------------------
  ------------------
  140|    573|    if ((a == NULL) || (*a != ret))
  ------------------
  |  Branch (140:9): [True: 0, False: 573]
  |  Branch (140:24): [True: 259, False: 314]
  ------------------
  141|    259|        ASN1_BIT_STRING_free(ret);
  142|    573|    return NULL;
  143|   139k|}
ASN1_BIT_STRING_get_bit:
  185|  14.6k|{
  186|  14.6k|    int w, v;
  187|       |
  188|  14.6k|    if (n < 0)
  ------------------
  |  Branch (188:9): [True: 0, False: 14.6k]
  ------------------
  189|      0|        return 0;
  190|       |
  191|  14.6k|    w = n / 8;
  192|  14.6k|    v = 1 << (7 - (n & 0x07));
  193|  14.6k|    if ((a == NULL) || (a->length < (w + 1)) || (a->data == NULL))
  ------------------
  |  Branch (193:9): [True: 0, False: 14.6k]
  |  Branch (193:24): [True: 3.55k, False: 11.0k]
  |  Branch (193:49): [True: 0, False: 11.0k]
  ------------------
  194|  3.55k|        return 0;
  195|  11.0k|    return ((a->data[w] & v) != 0);
  196|  14.6k|}

asn1_d2i_read_bio:
  110|   466k|{
  111|   466k|    BUF_MEM *b;
  112|   466k|    unsigned char *p;
  113|   466k|    int i;
  114|   466k|    size_t want = HEADER_SIZE;
  ------------------
  |  |  107|   466k|#define HEADER_SIZE   8
  ------------------
  115|   466k|    uint32_t eos = 0;
  116|   466k|    size_t off = 0;
  117|   466k|    size_t len = 0;
  118|   466k|    size_t diff;
  119|       |
  120|   466k|    const unsigned char *q;
  121|   466k|    long slen;
  122|   466k|    int inf, tag, xclass;
  123|       |
  124|   466k|    b = BUF_MEM_new();
  125|   466k|    if (b == NULL) {
  ------------------
  |  Branch (125:9): [True: 0, False: 466k]
  ------------------
  126|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  127|      0|        return -1;
  128|      0|    }
  129|       |
  130|   466k|    ERR_set_mark();
  131|   182M|    for (;;) {
  132|   182M|        diff = len - off;
  133|   182M|        if (want >= diff) {
  ------------------
  |  Branch (133:13): [True: 182M, False: 49.9k]
  ------------------
  134|   182M|            want -= diff;
  135|       |
  136|   182M|            if (len + want < len || !BUF_MEM_grow_clean(b, len + want)) {
  ------------------
  |  Branch (136:17): [True: 0, False: 182M]
  |  Branch (136:37): [True: 0, False: 182M]
  ------------------
  137|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  138|      0|                goto err;
  139|      0|            }
  140|   182M|            i = BIO_read(in, &(b->data[len]), want);
  141|   182M|            if (i < 0 && diff == 0) {
  ------------------
  |  Branch (141:17): [True: 0, False: 182M]
  |  Branch (141:26): [True: 0, False: 0]
  ------------------
  142|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  143|      0|                goto err;
  144|      0|            }
  145|   182M|            if (i > 0) {
  ------------------
  |  Branch (145:17): [True: 181M, False: 562k]
  ------------------
  146|   181M|                if (len + i < len) {
  ------------------
  |  Branch (146:21): [True: 0, False: 181M]
  ------------------
  147|      0|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  148|      0|                    goto err;
  149|      0|                }
  150|   181M|                len += i;
  151|   181M|                if ((size_t)i < want)
  ------------------
  |  Branch (151:21): [True: 217k, False: 181M]
  ------------------
  152|   217k|                    continue;
  153|       |
  154|   181M|            }
  155|   182M|        }
  156|       |        /* else data already loaded */
  157|       |
  158|   182M|        p = (unsigned char *)&(b->data[off]);
  159|   182M|        q = p;
  160|   182M|        diff = len - off;
  161|   182M|        if (diff == 0)
  ------------------
  |  Branch (161:13): [True: 37.3k, False: 182M]
  ------------------
  162|  37.3k|            goto err;
  163|   182M|        inf = ASN1_get_object(&q, &slen, &tag, &xclass, diff);
  164|   182M|        if (inf & 0x80) {
  ------------------
  |  Branch (164:13): [True: 11.0M, False: 171M]
  ------------------
  165|  11.0M|            unsigned long e;
  166|       |
  167|  11.0M|            e = ERR_GET_REASON(ERR_peek_last_error());
  168|  11.0M|            if (e != ASN1_R_TOO_LONG)
  ------------------
  |  |  120|  11.0M|# define ASN1_R_TOO_LONG                                  155
  ------------------
  |  Branch (168:17): [True: 33.7k, False: 10.9M]
  ------------------
  169|  33.7k|                goto err;
  170|  10.9M|            ERR_pop_to_mark();
  171|  10.9M|        }
  172|   182M|        i = q - p;            /* header length */
  173|   182M|        off += i;               /* end of data */
  174|       |
  175|   182M|        if (inf & 1) {
  ------------------
  |  Branch (175:13): [True: 35.7M, False: 146M]
  ------------------
  176|       |            /* no data body so go round again */
  177|  35.7M|            if (eos == UINT32_MAX) {
  ------------------
  |  Branch (177:17): [True: 0, False: 35.7M]
  ------------------
  178|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  179|      0|                goto err;
  180|      0|            }
  181|  35.7M|            eos++;
  182|  35.7M|            want = HEADER_SIZE;
  ------------------
  |  |  107|  35.7M|#define HEADER_SIZE   8
  ------------------
  183|   146M|        } else if (eos && (slen == 0) && (tag == V_ASN1_EOC)) {
  ------------------
  |  |   62|   104M|# define V_ASN1_EOC                      0
  ------------------
  |  Branch (183:20): [True: 146M, False: 151k]
  |  Branch (183:27): [True: 104M, False: 41.6M]
  |  Branch (183:42): [True: 24.6M, False: 79.9M]
  ------------------
  184|       |            /* eos value, so go back and read another header */
  185|  24.6M|            eos--;
  186|  24.6M|            if (eos == 0)
  ------------------
  |  Branch (186:17): [True: 227k, False: 24.3M]
  ------------------
  187|   227k|                break;
  188|  24.3M|            else
  189|  24.3M|                want = HEADER_SIZE;
  ------------------
  |  |  107|  24.3M|#define HEADER_SIZE   8
  ------------------
  190|   121M|        } else {
  191|       |            /* suck in slen bytes of data */
  192|   121M|            want = slen;
  193|   121M|            if (want > (len - off)) {
  ------------------
  |  Branch (193:17): [True: 10.9M, False: 110M]
  ------------------
  194|  10.9M|                size_t chunk_max = ASN1_CHUNK_INITIAL_SIZE;
  ------------------
  |  |  108|  10.9M|#define ASN1_CHUNK_INITIAL_SIZE (16 * 1024)
  ------------------
  195|       |
  196|  10.9M|                want -= (len - off);
  197|  10.9M|                if (want > INT_MAX /* BIO_read takes an int length */  ||
  ------------------
  |  Branch (197:21): [True: 1.55k, False: 10.9M]
  ------------------
  198|  10.9M|                    len + want < len) {
  ------------------
  |  Branch (198:21): [True: 0, False: 10.9M]
  ------------------
  199|  1.55k|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|  1.55k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.55k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.55k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.55k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.55k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.55k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.55k|     ERR_set_error)
  |  |  ------------------
  ------------------
  200|  1.55k|                    goto err;
  201|  1.55k|                }
  202|  21.9M|                while (want > 0) {
  ------------------
  |  Branch (202:24): [True: 11.0M, False: 10.9M]
  ------------------
  203|       |                    /*
  204|       |                     * Read content in chunks of increasing size
  205|       |                     * so we can return an error for EOF without
  206|       |                     * having to allocate the entire content length
  207|       |                     * in one go.
  208|       |                     */
  209|  11.0M|                    size_t chunk = want > chunk_max ? chunk_max : want;
  ------------------
  |  Branch (209:36): [True: 44.2k, False: 10.9M]
  ------------------
  210|       |
  211|  11.0M|                    if (!BUF_MEM_grow_clean(b, len + chunk)) {
  ------------------
  |  Branch (211:25): [True: 0, False: 11.0M]
  ------------------
  212|      0|                        ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  213|      0|                        goto err;
  214|      0|                    }
  215|  11.0M|                    want -= chunk;
  216|  22.0M|                    while (chunk > 0) {
  ------------------
  |  Branch (216:28): [True: 11.0M, False: 11.0M]
  ------------------
  217|  11.0M|                        i = BIO_read(in, &(b->data[len]), chunk);
  218|  11.0M|                        if (i <= 0) {
  ------------------
  |  Branch (218:29): [True: 19.9k, False: 11.0M]
  ------------------
  219|  19.9k|                            ERR_raise(ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA);
  ------------------
  |  |  401|  19.9k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  19.9k|    (ERR_new(),                                                 \
  |  |  |  |  404|  19.9k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  19.9k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  19.9k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  19.9k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  19.9k|     ERR_set_error)
  |  |  ------------------
  ------------------
  220|  19.9k|                            goto err;
  221|  19.9k|                        }
  222|       |                    /*
  223|       |                     * This can't overflow because |len+want| didn't
  224|       |                     * overflow.
  225|       |                     */
  226|  11.0M|                        len += i;
  227|  11.0M|                        chunk -= i;
  228|  11.0M|                    }
  229|  11.0M|                    if (chunk_max < INT_MAX/2)
  ------------------
  |  Branch (229:25): [True: 11.0M, False: 0]
  ------------------
  230|  11.0M|                        chunk_max *= 2;
  231|  11.0M|                }
  232|  10.9M|            }
  233|   121M|            if (off + slen < off) {
  ------------------
  |  Branch (233:17): [True: 0, False: 121M]
  ------------------
  234|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  235|      0|                goto err;
  236|      0|            }
  237|   121M|            off += slen;
  238|   121M|            if (eos == 0) {
  ------------------
  |  Branch (238:17): [True: 145k, False: 121M]
  ------------------
  239|   145k|                break;
  240|   145k|            } else
  241|   121M|                want = HEADER_SIZE;
  ------------------
  |  |  107|   121M|#define HEADER_SIZE   8
  ------------------
  242|   121M|        }
  243|   182M|    }
  244|       |
  245|   373k|    if (off > INT_MAX) {
  ------------------
  |  Branch (245:9): [True: 0, False: 373k]
  ------------------
  246|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  247|      0|        goto err;
  248|      0|    }
  249|       |
  250|   373k|    *pb = b;
  251|   373k|    return off;
  252|  92.5k| err:
  253|  92.5k|    ERR_clear_last_mark();
  254|  92.5k|    BUF_MEM_free(b);
  255|  92.5k|    return -1;
  256|   373k|}

ossl_asn1_item_digest_ex:
   57|  6.59k|{
   58|  6.59k|    int i, ret = 0;
   59|  6.59k|    unsigned char *str = NULL;
   60|  6.59k|    EVP_MD *fetched_md = (EVP_MD *)md;
   61|       |
   62|  6.59k|    i = ASN1_item_i2d(asn, &str, it);
   63|  6.59k|    if (i < 0 || str == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 6.59k]
  |  Branch (63:18): [True: 0, False: 6.59k]
  ------------------
   64|      0|        return 0;
   65|       |
   66|  6.59k|    if (EVP_MD_get0_provider(md) == NULL) {
  ------------------
  |  Branch (66:9): [True: 6.59k, False: 0]
  ------------------
   67|  6.59k|#if !defined(OPENSSL_NO_ENGINE)
   68|  6.59k|        ENGINE *tmpeng = ENGINE_get_digest_engine(EVP_MD_get_type(md));
   69|       |
   70|  6.59k|        if (tmpeng != NULL)
  ------------------
  |  Branch (70:13): [True: 0, False: 6.59k]
  ------------------
   71|      0|            ENGINE_finish(tmpeng);
   72|  6.59k|        else
   73|  6.59k|#endif
   74|  6.59k|            fetched_md = EVP_MD_fetch(libctx, EVP_MD_get0_name(md), propq);
   75|  6.59k|    }
   76|  6.59k|    if (fetched_md == NULL)
  ------------------
  |  Branch (76:9): [True: 0, False: 6.59k]
  ------------------
   77|      0|        goto err;
   78|       |
   79|  6.59k|    ret = EVP_Digest(str, i, data, len, fetched_md, NULL);
   80|  6.59k|err:
   81|  6.59k|    OPENSSL_free(str);
  ------------------
  |  |  115|  6.59k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  6.59k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  6.59k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   82|  6.59k|    if (fetched_md != md)
  ------------------
  |  Branch (82:9): [True: 6.59k, False: 0]
  ------------------
   83|  6.59k|        EVP_MD_free(fetched_md);
   84|  6.59k|    return ret;
   85|  6.59k|}

ASN1_item_dup:
   51|  1.61k|{
   52|  1.61k|    ASN1_aux_cb *asn1_cb = NULL;
   53|  1.61k|    unsigned char *b = NULL;
   54|  1.61k|    const unsigned char *p;
   55|  1.61k|    long i;
   56|  1.61k|    ASN1_VALUE *ret;
   57|  1.61k|    OSSL_LIB_CTX *libctx = NULL;
   58|  1.61k|    const char *propq = NULL;
   59|       |
   60|  1.61k|    if (x == NULL)
  ------------------
  |  Branch (60:9): [True: 0, False: 1.61k]
  ------------------
   61|      0|        return NULL;
   62|       |
   63|  1.61k|    if (it->itype == ASN1_ITYPE_SEQUENCE || it->itype == ASN1_ITYPE_CHOICE
  ------------------
  |  |   81|  3.22k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
                  if (it->itype == ASN1_ITYPE_SEQUENCE || it->itype == ASN1_ITYPE_CHOICE
  ------------------
  |  |   82|  1.85k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (63:9): [True: 1.37k, False: 239]
  |  Branch (63:45): [True: 0, False: 239]
  ------------------
   64|  1.61k|        || it->itype == ASN1_ITYPE_NDEF_SEQUENCE) {
  ------------------
  |  |   86|    239|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (64:12): [True: 0, False: 239]
  ------------------
   65|  1.37k|        const ASN1_AUX *aux = it->funcs;
   66|       |
   67|  1.37k|        asn1_cb = aux != NULL ? aux->asn1_cb : NULL;
  ------------------
  |  Branch (67:19): [True: 0, False: 1.37k]
  ------------------
   68|  1.37k|    }
   69|       |
   70|  1.61k|    if (asn1_cb != NULL) {
  ------------------
  |  Branch (70:9): [True: 0, False: 1.61k]
  ------------------
   71|      0|        if (!asn1_cb(ASN1_OP_DUP_PRE, (ASN1_VALUE **)&x, it, NULL)
  ------------------
  |  |  756|      0|# define ASN1_OP_DUP_PRE         14
  ------------------
  |  Branch (71:13): [True: 0, False: 0]
  ------------------
   72|      0|                || !asn1_cb(ASN1_OP_GET0_LIBCTX, (ASN1_VALUE **)&x, it, &libctx)
  ------------------
  |  |  758|      0|# define ASN1_OP_GET0_LIBCTX     16
  ------------------
  |  Branch (72:20): [True: 0, False: 0]
  ------------------
   73|      0|                || !asn1_cb(ASN1_OP_GET0_PROPQ, (ASN1_VALUE **)&x, it, &propq))
  ------------------
  |  |  759|      0|# define ASN1_OP_GET0_PROPQ      17
  ------------------
  |  Branch (73:20): [True: 0, False: 0]
  ------------------
   74|      0|            goto auxerr;
   75|      0|    }
   76|       |
   77|  1.61k|    i = ASN1_item_i2d(x, &b, it);
   78|  1.61k|    if (i < 0 || b == NULL) {
  ------------------
  |  Branch (78:9): [True: 0, False: 1.61k]
  |  Branch (78:18): [True: 0, False: 1.61k]
  ------------------
   79|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   80|      0|        return NULL;
   81|      0|    }
   82|  1.61k|    p = b;
   83|  1.61k|    ret = ASN1_item_d2i_ex(NULL, &p, i, it, libctx, propq);
   84|  1.61k|    OPENSSL_free(b);
  ------------------
  |  |  115|  1.61k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.61k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.61k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   85|       |
   86|  1.61k|    if (asn1_cb != NULL
  ------------------
  |  Branch (86:9): [True: 0, False: 1.61k]
  ------------------
   87|  1.61k|        && !asn1_cb(ASN1_OP_DUP_POST, &ret, it, (void *)x))
  ------------------
  |  |  757|      0|# define ASN1_OP_DUP_POST        15
  ------------------
  |  Branch (87:12): [True: 0, False: 0]
  ------------------
   88|      0|        goto auxerr;
   89|       |
   90|  1.61k|    return ret;
   91|       |
   92|      0| auxerr:
   93|      0|    ERR_raise_data(ERR_LIB_ASN1, ASN1_R_AUX_ERROR, "Type=%s", it->sname);
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                  ERR_raise_data(ERR_LIB_ASN1, ASN1_R_AUX_ERROR, "Type=%s", it->sname);
  ------------------
  |  |   83|      0|# define ERR_LIB_ASN1            13
  ------------------
                  ERR_raise_data(ERR_LIB_ASN1, ASN1_R_AUX_ERROR, "Type=%s", it->sname);
  ------------------
  |  |   27|      0|# define ASN1_R_AUX_ERROR                                 100
  ------------------
   94|      0|    return NULL;
   95|  1.61k|}

ASN1_GENERALIZEDTIME_print:
   82|  18.0k|{
   83|  18.0k|    if (tm->type != V_ASN1_GENERALIZEDTIME)
  ------------------
  |  |   83|  18.0k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (83:9): [True: 0, False: 18.0k]
  ------------------
   84|      0|        return 0;
   85|  18.0k|    return ASN1_TIME_print(bp, tm);
   86|  18.0k|}

ASN1_i2d_bio:
   35|     23|{
   36|     23|    char *b;
   37|     23|    unsigned char *p;
   38|     23|    int i, j = 0, n, ret = 1;
   39|       |
   40|     23|    n = i2d(x, NULL);
   41|     23|    if (n <= 0)
  ------------------
  |  Branch (41:9): [True: 0, False: 23]
  ------------------
   42|      0|        return 0;
   43|       |
   44|     23|    b = OPENSSL_malloc(n);
  ------------------
  |  |  102|     23|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     23|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     23|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|     23|    if (b == NULL)
  ------------------
  |  Branch (45:9): [True: 0, False: 23]
  ------------------
   46|      0|        return 0;
   47|       |
   48|     23|    p = (unsigned char *)b;
   49|     23|    i2d(x, &p);
   50|       |
   51|     23|    for (;;) {
   52|     23|        i = BIO_write(out, &(b[j]), n);
   53|     23|        if (i == n)
  ------------------
  |  Branch (53:13): [True: 23, False: 0]
  ------------------
   54|     23|            break;
   55|      0|        if (i <= 0) {
  ------------------
  |  Branch (55:13): [True: 0, False: 0]
  ------------------
   56|      0|            ret = 0;
   57|      0|            break;
   58|      0|        }
   59|      0|        j += i;
   60|      0|        n -= i;
   61|      0|    }
   62|     23|    OPENSSL_free(b);
  ------------------
  |  |  115|     23|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     23|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     23|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   63|     23|    return ret;
   64|     23|}

ossl_i2c_ASN1_INTEGER:
  208|  97.5k|{
  209|  97.5k|    return i2c_ibuf(a->data, a->length, a->type & V_ASN1_NEG, pp);
  ------------------
  |  |   97|  97.5k|# define V_ASN1_NEG                      0x100
  ------------------
  210|  97.5k|}
ossl_c2i_ASN1_INTEGER:
  292|   593k|{
  293|   593k|    ASN1_INTEGER *ret = NULL;
  294|   593k|    size_t r;
  295|   593k|    int neg;
  296|       |
  297|   593k|    r = c2i_ibuf(NULL, NULL, *pp, len);
  298|       |
  299|   593k|    if (r == 0)
  ------------------
  |  Branch (299:9): [True: 91.2k, False: 501k]
  ------------------
  300|  91.2k|        return NULL;
  301|       |
  302|   501k|    if ((a == NULL) || ((*a) == NULL)) {
  ------------------
  |  Branch (302:9): [True: 0, False: 501k]
  |  Branch (302:24): [True: 228k, False: 273k]
  ------------------
  303|   228k|        ret = ASN1_INTEGER_new();
  304|   228k|        if (ret == NULL)
  ------------------
  |  Branch (304:13): [True: 0, False: 228k]
  ------------------
  305|      0|            return NULL;
  306|   228k|        ret->type = V_ASN1_INTEGER;
  ------------------
  |  |   64|   228k|# define V_ASN1_INTEGER                  2
  ------------------
  307|   228k|    } else
  308|   273k|        ret = *a;
  309|       |
  310|   501k|    if (ASN1_STRING_set(ret, NULL, r) == 0) {
  ------------------
  |  Branch (310:9): [True: 0, False: 501k]
  ------------------
  311|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  312|      0|        goto err;
  313|      0|    }
  314|       |
  315|   501k|    c2i_ibuf(ret->data, &neg, *pp, len);
  316|       |
  317|   501k|    if (neg != 0)
  ------------------
  |  Branch (317:9): [True: 125k, False: 376k]
  ------------------
  318|   125k|        ret->type |= V_ASN1_NEG;
  ------------------
  |  |   97|   125k|# define V_ASN1_NEG                      0x100
  ------------------
  319|   376k|    else
  320|   376k|        ret->type &= ~V_ASN1_NEG;
  ------------------
  |  |   97|   376k|# define V_ASN1_NEG                      0x100
  ------------------
  321|       |
  322|   501k|    *pp += len;
  323|   501k|    if (a != NULL)
  ------------------
  |  Branch (323:9): [True: 501k, False: 0]
  ------------------
  324|   501k|        (*a) = ret;
  325|   501k|    return ret;
  326|      0| err:
  327|      0|    if (a == NULL || *a != ret)
  ------------------
  |  Branch (327:9): [True: 0, False: 0]
  |  Branch (327:22): [True: 0, False: 0]
  ------------------
  328|      0|        ASN1_INTEGER_free(ret);
  329|      0|    return NULL;
  330|   501k|}
ASN1_INTEGER_get_int64:
  530|  7.49k|{
  531|  7.49k|    return asn1_string_get_int64(pr, a, V_ASN1_INTEGER);
  ------------------
  |  |   64|  7.49k|# define V_ASN1_INTEGER                  2
  ------------------
  532|  7.49k|}
ASN1_INTEGER_set_int64:
  535|     27|{
  536|     27|    return asn1_string_set_int64(a, r, V_ASN1_INTEGER);
  ------------------
  |  |   64|     27|# define V_ASN1_INTEGER                  2
  ------------------
  537|     27|}
ASN1_INTEGER_set:
  550|     27|{
  551|     27|    return ASN1_INTEGER_set_int64(a, v);
  552|     27|}
ASN1_INTEGER_get:
  555|  6.85k|{
  556|  6.85k|    int i;
  557|  6.85k|    int64_t r;
  558|  6.85k|    if (a == NULL)
  ------------------
  |  Branch (558:9): [True: 0, False: 6.85k]
  ------------------
  559|      0|        return 0;
  560|  6.85k|    i = ASN1_INTEGER_get_int64(&r, a);
  561|  6.85k|    if (i == 0)
  ------------------
  |  Branch (561:9): [True: 348, False: 6.51k]
  ------------------
  562|    348|        return -1;
  563|  6.51k|    if (r > LONG_MAX || r < LONG_MIN)
  ------------------
  |  Branch (563:9): [True: 0, False: 6.51k]
  |  Branch (563:25): [True: 0, False: 6.51k]
  ------------------
  564|      0|        return -1;
  565|  6.51k|    return (long)r;
  566|  6.51k|}
BN_to_ASN1_INTEGER:
  569|    825|{
  570|    825|    return bn_to_asn1_string(bn, ai, V_ASN1_INTEGER);
  ------------------
  |  |   64|    825|# define V_ASN1_INTEGER                  2
  ------------------
  571|    825|}
ASN1_INTEGER_to_BN:
  574|  19.1k|{
  575|  19.1k|    return asn1_string_to_bn(ai, bn, V_ASN1_INTEGER);
  ------------------
  |  |   64|  19.1k|# define V_ASN1_INTEGER                  2
  ------------------
  576|  19.1k|}
ASN1_ENUMERATED_get_int64:
  579|  13.1k|{
  580|  13.1k|    return asn1_string_get_int64(pr, a, V_ASN1_ENUMERATED);
  ------------------
  |  |   72|  13.1k|# define V_ASN1_ENUMERATED               10
  ------------------
  581|  13.1k|}
ASN1_ENUMERATED_get:
  594|  13.2k|{
  595|  13.2k|    int i;
  596|  13.2k|    int64_t r;
  597|  13.2k|    if (a == NULL)
  ------------------
  |  Branch (597:9): [True: 0, False: 13.2k]
  ------------------
  598|      0|        return 0;
  599|  13.2k|    if ((a->type & ~V_ASN1_NEG) != V_ASN1_ENUMERATED)
  ------------------
  |  |   97|  13.2k|# define V_ASN1_NEG                      0x100
  ------------------
                  if ((a->type & ~V_ASN1_NEG) != V_ASN1_ENUMERATED)
  ------------------
  |  |   72|  13.2k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (599:9): [True: 0, False: 13.2k]
  ------------------
  600|      0|        return -1;
  601|  13.2k|    if (a->length > (int)sizeof(long))
  ------------------
  |  Branch (601:9): [True: 73, False: 13.1k]
  ------------------
  602|     73|        return 0xffffffffL;
  603|  13.1k|    i = ASN1_ENUMERATED_get_int64(&r, a);
  604|  13.1k|    if (i == 0)
  ------------------
  |  Branch (604:9): [True: 185, False: 12.9k]
  ------------------
  605|    185|        return -1;
  606|  12.9k|    if (r > LONG_MAX || r < LONG_MIN)
  ------------------
  |  Branch (606:9): [True: 0, False: 12.9k]
  |  Branch (606:25): [True: 0, False: 12.9k]
  ------------------
  607|      0|        return -1;
  608|  12.9k|    return (long)r;
  609|  12.9k|}
ASN1_ENUMERATED_to_BN:
  617|    376|{
  618|    376|    return asn1_string_to_bn(ai, bn, V_ASN1_ENUMERATED);
  ------------------
  |  |   72|    376|# define V_ASN1_ENUMERATED               10
  ------------------
  619|    376|}
ossl_c2i_uint64_int:
  624|  82.2k|{
  625|  82.2k|    unsigned char buf[sizeof(uint64_t)];
  626|  82.2k|    size_t buflen;
  627|       |
  628|  82.2k|    buflen = c2i_ibuf(NULL, NULL, *pp, len);
  629|  82.2k|    if (buflen == 0)
  ------------------
  |  Branch (629:9): [True: 1.04k, False: 81.1k]
  ------------------
  630|  1.04k|        return 0;
  631|  81.1k|    if (buflen > sizeof(uint64_t)) {
  ------------------
  |  Branch (631:9): [True: 1.66k, False: 79.5k]
  ------------------
  632|  1.66k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|  1.66k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.66k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.66k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.66k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.66k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.66k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.66k|     ERR_set_error)
  |  |  ------------------
  ------------------
  633|  1.66k|        return 0;
  634|  1.66k|    }
  635|  79.5k|    (void)c2i_ibuf(buf, neg, *pp, len);
  636|  79.5k|    return asn1_get_uint64(ret, buf, buflen);
  637|  81.1k|}
ossl_i2c_uint64_int:
  640|  52.9k|{
  641|  52.9k|    unsigned char buf[sizeof(uint64_t)];
  642|  52.9k|    size_t off;
  643|       |
  644|  52.9k|    off = asn1_put_uint64(buf, r);
  645|  52.9k|    return i2c_ibuf(buf + off, sizeof(buf) - off, neg, &p);
  646|  52.9k|}
a_int.c:i2c_ibuf:
   99|   150k|{
  100|   150k|    unsigned int pad = 0;
  101|   150k|    size_t ret, i;
  102|   150k|    unsigned char *p, pb = 0;
  103|       |
  104|   150k|    if (b != NULL && blen) {
  ------------------
  |  Branch (104:9): [True: 150k, False: 0]
  |  Branch (104:22): [True: 150k, False: 0]
  ------------------
  105|   150k|        ret = blen;
  106|   150k|        i = b[0];
  107|   150k|        if (!neg && (i > 127)) {
  ------------------
  |  Branch (107:13): [True: 112k, False: 38.1k]
  |  Branch (107:21): [True: 10.0k, False: 102k]
  ------------------
  108|  10.0k|            pad = 1;
  109|  10.0k|            pb = 0;
  110|   140k|        } else if (neg) {
  ------------------
  |  Branch (110:20): [True: 38.1k, False: 102k]
  ------------------
  111|  38.1k|            pb = 0xFF;
  112|  38.1k|            if (i > 128) {
  ------------------
  |  Branch (112:17): [True: 3.76k, False: 34.3k]
  ------------------
  113|  3.76k|                pad = 1;
  114|  34.3k|            } else if (i == 128) {
  ------------------
  |  Branch (114:24): [True: 13.0k, False: 21.3k]
  ------------------
  115|       |                /*
  116|       |                 * Special case [of minimal negative for given length]:
  117|       |                 * if any other bytes non zero we pad, otherwise we don't.
  118|       |                 */
  119|  25.0k|                for (pad = 0, i = 1; i < blen; i++)
  ------------------
  |  Branch (119:38): [True: 11.9k, False: 13.0k]
  ------------------
  120|  11.9k|                    pad |= b[i];
  121|  13.0k|                pb = pad != 0 ? 0xffU : 0;
  ------------------
  |  Branch (121:22): [True: 5.88k, False: 7.14k]
  ------------------
  122|  13.0k|                pad = pb & 1;
  123|  13.0k|            }
  124|  38.1k|        }
  125|   150k|        ret += pad;
  126|   150k|    } else {
  127|      0|        ret = 1;
  128|      0|        blen = 0;   /* reduce '(b == NULL || blen == 0)' to '(blen == 0)' */
  129|      0|    }
  130|       |
  131|   150k|    if (pp == NULL || (p = *pp) == NULL)
  ------------------
  |  Branch (131:9): [True: 76.8k, False: 73.5k]
  |  Branch (131:23): [True: 42.5k, False: 31.0k]
  ------------------
  132|   119k|        return ret;
  133|       |
  134|       |    /*
  135|       |     * This magically handles all corner cases, such as '(b == NULL ||
  136|       |     * blen == 0)', non-negative value, "negative" zero, 0x80 followed
  137|       |     * by any number of zeros...
  138|       |     */
  139|  31.0k|    *p = pb;
  140|  31.0k|    p += pad;       /* yes, p[0] can be written twice, but it's little
  141|       |                     * price to pay for eliminated branches */
  142|  31.0k|    twos_complement(p, b, blen, pb);
  143|       |
  144|  31.0k|    *pp += ret;
  145|  31.0k|    return ret;
  146|   150k|}
a_int.c:twos_complement:
   78|   324k|{
   79|   324k|    unsigned int carry = pad & 1;
   80|       |
   81|       |    /* Begin at the end of the encoding */
   82|   324k|    if (len != 0) {
  ------------------
  |  Branch (82:9): [True: 324k, False: 0]
  ------------------
   83|       |        /*
   84|       |         * if len == 0 then src/dst could be NULL, and this would be undefined
   85|       |         * behaviour.
   86|       |         */
   87|   324k|        dst += len;
   88|   324k|        src += len;
   89|   324k|    }
   90|       |    /* two's complement value: ~value + 1 */
   91|   115M|    while (len-- != 0) {
  ------------------
  |  Branch (91:12): [True: 115M, False: 324k]
  ------------------
   92|   115M|        *(--dst) = (unsigned char)(carry += *(--src) ^ pad);
   93|   115M|        carry >>= 8;
   94|   115M|    }
   95|   324k|}
a_int.c:c2i_ibuf:
  156|  1.25M|{
  157|  1.25M|    int neg, pad;
  158|       |    /* Zero content length is illegal */
  159|  1.25M|    if (plen == 0) {
  ------------------
  |  Branch (159:9): [True: 86.6k, False: 1.17M]
  ------------------
  160|  86.6k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
  ------------------
  |  |  401|  86.6k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  86.6k|    (ERR_new(),                                                 \
  |  |  |  |  404|  86.6k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  86.6k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  86.6k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  86.6k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  86.6k|     ERR_set_error)
  |  |  ------------------
  ------------------
  161|  86.6k|        return 0;
  162|  86.6k|    }
  163|  1.17M|    neg = p[0] & 0x80;
  164|  1.17M|    if (pneg)
  ------------------
  |  Branch (164:9): [True: 581k, False: 588k]
  ------------------
  165|   581k|        *pneg = neg;
  166|       |    /* Handle common case where length is 1 octet separately */
  167|  1.17M|    if (plen == 1) {
  ------------------
  |  Branch (167:9): [True: 575k, False: 594k]
  ------------------
  168|   575k|        if (b != NULL) {
  ------------------
  |  Branch (168:13): [True: 287k, False: 287k]
  ------------------
  169|   287k|            if (neg)
  ------------------
  |  Branch (169:17): [True: 72.9k, False: 214k]
  ------------------
  170|  72.9k|                b[0] = (p[0] ^ 0xFF) + 1;
  171|   214k|            else
  172|   214k|                b[0] = p[0];
  173|   287k|        }
  174|   575k|        return 1;
  175|   575k|    }
  176|       |
  177|   594k|    pad = 0;
  178|   594k|    if (p[0] == 0) {
  ------------------
  |  Branch (178:9): [True: 57.8k, False: 536k]
  ------------------
  179|  57.8k|        pad = 1;
  180|   536k|    } else if (p[0] == 0xFF) {
  ------------------
  |  Branch (180:16): [True: 31.4k, False: 505k]
  ------------------
  181|  31.4k|        size_t i;
  182|       |
  183|       |        /*
  184|       |         * Special case [of "one less minimal negative" for given length]:
  185|       |         * if any other bytes non zero it was padded, otherwise not.
  186|       |         */
  187|  12.1M|        for (pad = 0, i = 1; i < plen; i++)
  ------------------
  |  Branch (187:30): [True: 12.0M, False: 31.4k]
  ------------------
  188|  12.0M|            pad |= p[i];
  189|  31.4k|        pad = pad != 0 ? 1 : 0;
  ------------------
  |  Branch (189:15): [True: 29.9k, False: 1.56k]
  ------------------
  190|  31.4k|    }
  191|       |    /* reject illegal padding: first two octets MSB can't match */
  192|   594k|    if (pad && (neg == (p[1] & 0x80))) {
  ------------------
  |  Branch (192:9): [True: 87.8k, False: 506k]
  |  Branch (192:16): [True: 5.58k, False: 82.2k]
  ------------------
  193|  5.58k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING);
  ------------------
  |  |  401|  5.58k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  5.58k|    (ERR_new(),                                                 \
  |  |  |  |  404|  5.58k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  5.58k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  5.58k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  5.58k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  5.58k|     ERR_set_error)
  |  |  ------------------
  ------------------
  194|  5.58k|        return 0;
  195|  5.58k|    }
  196|       |
  197|       |    /* skip over pad */
  198|   589k|    p += pad;
  199|   589k|    plen -= pad;
  200|       |
  201|   589k|    if (b != NULL)
  ------------------
  |  Branch (201:9): [True: 293k, False: 295k]
  ------------------
  202|   293k|        twos_complement(b, p, plen, neg ? 0xffU : 0);
  ------------------
  |  Branch (202:37): [True: 70.8k, False: 222k]
  ------------------
  203|       |
  204|   589k|    return plen;
  205|   594k|}
a_int.c:asn1_string_get_int64:
  333|  20.6k|{
  334|  20.6k|    if (a == NULL) {
  ------------------
  |  Branch (334:9): [True: 0, False: 20.6k]
  ------------------
  335|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  336|      0|        return 0;
  337|      0|    }
  338|  20.6k|    if ((a->type & ~V_ASN1_NEG) != itype) {
  ------------------
  |  |   97|  20.6k|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (338:9): [True: 0, False: 20.6k]
  ------------------
  339|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  340|      0|        return 0;
  341|      0|    }
  342|  20.6k|    return asn1_get_int64(pr, a->data, a->length, a->type & V_ASN1_NEG);
  ------------------
  |  |   97|  20.6k|# define V_ASN1_NEG                      0x100
  ------------------
  343|  20.6k|}
a_int.c:asn1_get_int64:
  257|  20.6k|{
  258|  20.6k|    uint64_t r;
  259|  20.6k|    if (asn1_get_uint64(&r, b, blen) == 0)
  ------------------
  |  Branch (259:9): [True: 84, False: 20.5k]
  ------------------
  260|     84|        return 0;
  261|  20.5k|    if (neg) {
  ------------------
  |  Branch (261:9): [True: 2.39k, False: 18.1k]
  ------------------
  262|  2.39k|        if (r <= INT64_MAX) {
  ------------------
  |  Branch (262:13): [True: 2.19k, False: 206]
  ------------------
  263|       |            /*
  264|       |             * Most significant bit is guaranteed to be clear, negation
  265|       |             * is guaranteed to be meaningful in platform-neutral sense.
  266|       |             */
  267|  2.19k|            *pr = -(int64_t)r;
  268|  2.19k|        } else if (r == ABS_INT64_MIN) {
  ------------------
  |  |  252|    206|#define ABS_INT64_MIN ((uint64_t)INT64_MAX + (-(INT64_MIN + INT64_MAX)))
  ------------------
  |  Branch (268:20): [True: 36, False: 170]
  ------------------
  269|       |            /*
  270|       |             * This never happens if INT64_MAX == ABS_INT64_MIN, e.g.
  271|       |             * on ones'-complement system.
  272|       |             */
  273|     36|            *pr = (int64_t)(0 - r);
  274|    170|        } else {
  275|    170|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|    170|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    170|    (ERR_new(),                                                 \
  |  |  |  |  404|    170|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    170|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    170|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    170|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    170|     ERR_set_error)
  |  |  ------------------
  ------------------
  276|    170|            return 0;
  277|    170|        }
  278|  18.1k|    } else {
  279|  18.1k|        if (r <= INT64_MAX) {
  ------------------
  |  Branch (279:13): [True: 17.9k, False: 280]
  ------------------
  280|  17.9k|            *pr = (int64_t)r;
  281|  17.9k|        } else {
  282|    280|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|    280|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    280|    (ERR_new(),                                                 \
  |  |  |  |  404|    280|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    280|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    280|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    280|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    280|     ERR_set_error)
  |  |  ------------------
  ------------------
  283|    280|            return 0;
  284|    280|        }
  285|  18.1k|    }
  286|  20.1k|    return 1;
  287|  20.5k|}
a_int.c:asn1_string_set_int64:
  346|     27|{
  347|     27|    unsigned char tbuf[sizeof(r)];
  348|     27|    size_t off;
  349|       |
  350|     27|    a->type = itype;
  351|     27|    if (r < 0) {
  ------------------
  |  Branch (351:9): [True: 0, False: 27]
  ------------------
  352|       |        /*
  353|       |         * Most obvious '-r' triggers undefined behaviour for most
  354|       |         * common INT64_MIN. Even though below '0 - (uint64_t)r' can
  355|       |         * appear two's-complement centric, it does produce correct/
  356|       |         * expected result even on ones' complement. This is because
  357|       |         * cast to unsigned has to change bit pattern...
  358|       |         */
  359|      0|        off = asn1_put_uint64(tbuf, 0 - (uint64_t)r);
  360|      0|        a->type |= V_ASN1_NEG;
  ------------------
  |  |   97|      0|# define V_ASN1_NEG                      0x100
  ------------------
  361|     27|    } else {
  362|     27|        off = asn1_put_uint64(tbuf, r);
  363|     27|        a->type &= ~V_ASN1_NEG;
  ------------------
  |  |   97|     27|# define V_ASN1_NEG                      0x100
  ------------------
  364|     27|    }
  365|     27|    return ASN1_STRING_set(a, tbuf + off, sizeof(tbuf) - off);
  366|     27|}
a_int.c:bn_to_asn1_string:
  467|    825|{
  468|    825|    ASN1_INTEGER *ret;
  469|    825|    int len;
  470|       |
  471|    825|    if (ai == NULL) {
  ------------------
  |  Branch (471:9): [True: 556, False: 269]
  ------------------
  472|    556|        ret = ASN1_STRING_type_new(atype);
  473|    556|    } else {
  474|    269|        ret = ai;
  475|    269|        ret->type = atype;
  476|    269|    }
  477|       |
  478|    825|    if (ret == NULL) {
  ------------------
  |  Branch (478:9): [True: 0, False: 825]
  ------------------
  479|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  480|      0|        goto err;
  481|      0|    }
  482|       |
  483|    825|    if (BN_is_negative(bn) && !BN_is_zero(bn))
  ------------------
  |  Branch (483:9): [True: 11, False: 814]
  |  Branch (483:31): [True: 11, False: 0]
  ------------------
  484|     11|        ret->type |= V_ASN1_NEG_INTEGER;
  ------------------
  |  |   98|     11|# define V_ASN1_NEG_INTEGER              (2 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|     11|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
  485|       |
  486|    825|    len = BN_num_bytes(bn);
  ------------------
  |  |  189|    825|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  487|       |
  488|    825|    if (len == 0)
  ------------------
  |  Branch (488:9): [True: 166, False: 659]
  ------------------
  489|    166|        len = 1;
  490|       |
  491|    825|    if (ASN1_STRING_set(ret, NULL, len) == 0) {
  ------------------
  |  Branch (491:9): [True: 0, False: 825]
  ------------------
  492|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  493|      0|        goto err;
  494|      0|    }
  495|       |
  496|       |    /* Correct zero case */
  497|    825|    if (BN_is_zero(bn))
  ------------------
  |  Branch (497:9): [True: 166, False: 659]
  ------------------
  498|    166|        ret->data[0] = 0;
  499|    659|    else
  500|    659|        len = BN_bn2bin(bn, ret->data);
  501|    825|    ret->length = len;
  502|    825|    return ret;
  503|      0| err:
  504|      0|    if (ret != ai)
  ------------------
  |  Branch (504:9): [True: 0, False: 0]
  ------------------
  505|      0|        ASN1_INTEGER_free(ret);
  506|      0|    return NULL;
  507|    825|}
a_int.c:asn1_string_to_bn:
  511|  19.5k|{
  512|  19.5k|    BIGNUM *ret;
  513|       |
  514|  19.5k|    if ((ai->type & ~V_ASN1_NEG) != itype) {
  ------------------
  |  |   97|  19.5k|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (514:9): [True: 60, False: 19.4k]
  ------------------
  515|     60|        ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE);
  ------------------
  |  |  401|     60|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     60|    (ERR_new(),                                                 \
  |  |  |  |  404|     60|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     60|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     60|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     60|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     60|     ERR_set_error)
  |  |  ------------------
  ------------------
  516|     60|        return NULL;
  517|     60|    }
  518|       |
  519|  19.4k|    ret = BN_bin2bn(ai->data, ai->length, bn);
  520|  19.4k|    if (ret == NULL) {
  ------------------
  |  Branch (520:9): [True: 0, False: 19.4k]
  ------------------
  521|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  522|      0|        return NULL;
  523|      0|    }
  524|  19.4k|    if (ai->type & V_ASN1_NEG)
  ------------------
  |  |   97|  19.4k|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (524:9): [True: 4.74k, False: 14.7k]
  ------------------
  525|  4.74k|        BN_set_negative(ret, 1);
  526|  19.4k|    return ret;
  527|  19.4k|}
a_int.c:asn1_get_uint64:
  214|   100k|{
  215|   100k|    size_t i;
  216|   100k|    uint64_t r;
  217|       |
  218|   100k|    if (blen > sizeof(*pr)) {
  ------------------
  |  Branch (218:9): [True: 84, False: 100k]
  ------------------
  219|     84|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|     84|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     84|    (ERR_new(),                                                 \
  |  |  |  |  404|     84|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     84|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     84|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     84|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     84|     ERR_set_error)
  |  |  ------------------
  ------------------
  220|     84|        return 0;
  221|     84|    }
  222|   100k|    if (b == NULL)
  ------------------
  |  Branch (222:9): [True: 0, False: 100k]
  ------------------
  223|      0|        return 0;
  224|   286k|    for (r = 0, i = 0; i < blen; i++) {
  ------------------
  |  Branch (224:24): [True: 186k, False: 100k]
  ------------------
  225|   186k|        r <<= 8;
  226|   186k|        r |= b[i];
  227|   186k|    }
  228|   100k|    *pr = r;
  229|   100k|    return 1;
  230|   100k|}
a_int.c:asn1_put_uint64:
  238|  52.9k|{
  239|  52.9k|    size_t off = sizeof(uint64_t);
  240|       |
  241|  91.1k|    do {
  242|  91.1k|        b[--off] = (unsigned char)r;
  243|  91.1k|    } while (r >>= 8);
  ------------------
  |  Branch (243:14): [True: 38.1k, False: 52.9k]
  ------------------
  244|       |
  245|  52.9k|    return off;
  246|  52.9k|}

ASN1_mbstring_copy:
   38|   117k|{
   39|   117k|    return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0);
   40|   117k|}
ASN1_mbstring_ncopy:
   45|   117k|{
   46|   117k|    int str_type;
   47|   117k|    int ret;
   48|   117k|    char free_out;
   49|   117k|    int outform, outlen = 0;
   50|   117k|    ASN1_STRING *dest;
   51|   117k|    unsigned char *p;
   52|   117k|    int nchar;
   53|   117k|    int (*cpyfunc) (unsigned long, void *) = NULL;
   54|   117k|    if (len == -1)
  ------------------
  |  Branch (54:9): [True: 0, False: 117k]
  ------------------
   55|      0|        len = strlen((const char *)in);
   56|   117k|    if (!mask)
  ------------------
  |  Branch (56:9): [True: 0, False: 117k]
  ------------------
   57|      0|        mask = DIRSTRING_TYPE;
  ------------------
  |  |  223|      0| (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
  |  |  ------------------
  |  |  |  |  103|      0|# define B_ASN1_PRINTABLESTRING  0x0002
  |  |  ------------------
  |  |                (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
  |  |  ------------------
  |  |  |  |  104|      0|# define B_ASN1_T61STRING        0x0004
  |  |  ------------------
  |  |                (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
  |  |  ------------------
  |  |  |  |  115|      0|# define B_ASN1_BMPSTRING        0x0800
  |  |  ------------------
  |  |                (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
  |  |  ------------------
  |  |  |  |  117|      0|# define B_ASN1_UTF8STRING       0x2000
  |  |  ------------------
  ------------------
   58|   117k|    if (len < 0)
  ------------------
  |  Branch (58:9): [True: 0, False: 117k]
  ------------------
   59|      0|        return -1;
   60|       |
   61|       |    /* First do a string check and work out the number of characters */
   62|   117k|    switch (inform) {
   63|       |
   64|  12.1k|    case MBSTRING_BMP:
  ------------------
  |  |  125|  12.1k|# define MBSTRING_BMP            (MBSTRING_FLAG|2)
  |  |  ------------------
  |  |  |  |  122|  12.1k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (64:5): [True: 12.1k, False: 105k]
  ------------------
   65|  12.1k|        if (len & 1) {
  ------------------
  |  Branch (65:13): [True: 0, False: 12.1k]
  ------------------
   66|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   67|      0|            return -1;
   68|      0|        }
   69|  12.1k|        nchar = len >> 1;
   70|  12.1k|        break;
   71|       |
   72|  8.00k|    case MBSTRING_UNIV:
  ------------------
  |  |  126|  8.00k|# define MBSTRING_UNIV           (MBSTRING_FLAG|4)
  |  |  ------------------
  |  |  |  |  122|  8.00k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (72:5): [True: 8.00k, False: 109k]
  ------------------
   73|  8.00k|        if (len & 3) {
  ------------------
  |  Branch (73:13): [True: 0, False: 8.00k]
  ------------------
   74|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   75|      0|            return -1;
   76|      0|        }
   77|  8.00k|        nchar = len >> 2;
   78|  8.00k|        break;
   79|       |
   80|  6.31k|    case MBSTRING_UTF8:
  ------------------
  |  |  123|  6.31k|# define MBSTRING_UTF8           (MBSTRING_FLAG)
  |  |  ------------------
  |  |  |  |  122|  6.31k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (80:5): [True: 6.31k, False: 111k]
  ------------------
   81|  6.31k|        nchar = 0;
   82|       |        /* This counts the characters and does utf8 syntax checking */
   83|  6.31k|        ret = traverse_string(in, len, MBSTRING_UTF8, in_utf8, &nchar);
  ------------------
  |  |  123|  6.31k|# define MBSTRING_UTF8           (MBSTRING_FLAG)
  |  |  ------------------
  |  |  |  |  122|  6.31k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
   84|  6.31k|        if (ret < 0) {
  ------------------
  |  Branch (84:13): [True: 72, False: 6.24k]
  ------------------
   85|     72|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING);
  ------------------
  |  |  401|     72|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     72|    (ERR_new(),                                                 \
  |  |  |  |  404|     72|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     72|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     72|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     72|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     72|     ERR_set_error)
  |  |  ------------------
  ------------------
   86|     72|            return -1;
   87|     72|        }
   88|  6.24k|        break;
   89|       |
   90|  91.0k|    case MBSTRING_ASC:
  ------------------
  |  |  124|  91.0k|# define MBSTRING_ASC            (MBSTRING_FLAG|1)
  |  |  ------------------
  |  |  |  |  122|  91.0k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (90:5): [True: 91.0k, False: 26.4k]
  ------------------
   91|  91.0k|        nchar = len;
   92|  91.0k|        break;
   93|       |
   94|      0|    default:
  ------------------
  |  Branch (94:5): [True: 0, False: 117k]
  ------------------
   95|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_UNKNOWN_FORMAT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   96|      0|        return -1;
   97|   117k|    }
   98|       |
   99|   117k|    if ((minsize > 0) && (nchar < minsize)) {
  ------------------
  |  Branch (99:9): [True: 0, False: 117k]
  |  Branch (99:26): [True: 0, False: 0]
  ------------------
  100|      0|        ERR_raise_data(ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT,
  ------------------
  |  |   83|      0|# define ERR_LIB_ASN1            13
  ------------------
                      ERR_raise_data(ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT,
  ------------------
  |  |  116|      0|# define ASN1_R_STRING_TOO_SHORT                          152
  ------------------
  101|      0|                       "minsize=%ld", minsize);
  102|      0|        return -1;
  103|      0|    }
  104|       |
  105|   117k|    if ((maxsize > 0) && (nchar > maxsize)) {
  ------------------
  |  Branch (105:9): [True: 0, False: 117k]
  |  Branch (105:26): [True: 0, False: 0]
  ------------------
  106|      0|        ERR_raise_data(ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG,
  ------------------
  |  |   83|      0|# define ERR_LIB_ASN1            13
  ------------------
                      ERR_raise_data(ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG,
  ------------------
  |  |  115|      0|# define ASN1_R_STRING_TOO_LONG                           151
  ------------------
  107|      0|                       "maxsize=%ld", maxsize);
  108|      0|        return -1;
  109|      0|    }
  110|       |
  111|       |    /* Now work out minimal type (if any) */
  112|   117k|    if (traverse_string(in, len, inform, type_str, &mask) < 0) {
  ------------------
  |  Branch (112:9): [True: 60, False: 117k]
  ------------------
  113|     60|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_CHARACTERS);
  ------------------
  |  |  401|     60|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     60|    (ERR_new(),                                                 \
  |  |  |  |  404|     60|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     60|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     60|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     60|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     60|     ERR_set_error)
  |  |  ------------------
  ------------------
  114|     60|        return -1;
  115|     60|    }
  116|       |
  117|       |    /* Now work out output format and string type */
  118|   117k|    outform = MBSTRING_ASC;
  ------------------
  |  |  124|   117k|# define MBSTRING_ASC            (MBSTRING_FLAG|1)
  |  |  ------------------
  |  |  |  |  122|   117k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  119|   117k|    if (mask & B_ASN1_NUMERICSTRING)
  ------------------
  |  |  102|   117k|# define B_ASN1_NUMERICSTRING    0x0001
  ------------------
  |  Branch (119:9): [True: 0, False: 117k]
  ------------------
  120|      0|        str_type = V_ASN1_NUMERICSTRING;
  ------------------
  |  |   76|      0|# define V_ASN1_NUMERICSTRING            18
  ------------------
  121|   117k|    else if (mask & B_ASN1_PRINTABLESTRING)
  ------------------
  |  |  103|   117k|# define B_ASN1_PRINTABLESTRING  0x0002
  ------------------
  |  Branch (121:14): [True: 0, False: 117k]
  ------------------
  122|      0|        str_type = V_ASN1_PRINTABLESTRING;
  ------------------
  |  |   77|      0|# define V_ASN1_PRINTABLESTRING          19
  ------------------
  123|   117k|    else if (mask & B_ASN1_IA5STRING)
  ------------------
  |  |  107|   117k|# define B_ASN1_IA5STRING        0x0010
  ------------------
  |  Branch (123:14): [True: 0, False: 117k]
  ------------------
  124|      0|        str_type = V_ASN1_IA5STRING;
  ------------------
  |  |   81|      0|# define V_ASN1_IA5STRING                22
  ------------------
  125|   117k|    else if (mask & B_ASN1_T61STRING)
  ------------------
  |  |  104|   117k|# define B_ASN1_T61STRING        0x0004
  ------------------
  |  Branch (125:14): [True: 0, False: 117k]
  ------------------
  126|      0|        str_type = V_ASN1_T61STRING;
  ------------------
  |  |   78|      0|# define V_ASN1_T61STRING                20
  ------------------
  127|   117k|    else if (mask & B_ASN1_BMPSTRING) {
  ------------------
  |  |  115|   117k|# define B_ASN1_BMPSTRING        0x0800
  ------------------
  |  Branch (127:14): [True: 0, False: 117k]
  ------------------
  128|      0|        str_type = V_ASN1_BMPSTRING;
  ------------------
  |  |   89|      0|# define V_ASN1_BMPSTRING                30
  ------------------
  129|      0|        outform = MBSTRING_BMP;
  ------------------
  |  |  125|      0|# define MBSTRING_BMP            (MBSTRING_FLAG|2)
  |  |  ------------------
  |  |  |  |  122|      0|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  130|   117k|    } else if (mask & B_ASN1_UNIVERSALSTRING) {
  ------------------
  |  |  112|   117k|# define B_ASN1_UNIVERSALSTRING  0x0100
  ------------------
  |  Branch (130:16): [True: 0, False: 117k]
  ------------------
  131|      0|        str_type = V_ASN1_UNIVERSALSTRING;
  ------------------
  |  |   88|      0|# define V_ASN1_UNIVERSALSTRING          28
  ------------------
  132|      0|        outform = MBSTRING_UNIV;
  ------------------
  |  |  126|      0|# define MBSTRING_UNIV           (MBSTRING_FLAG|4)
  |  |  ------------------
  |  |  |  |  122|      0|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  133|   117k|    } else {
  134|   117k|        str_type = V_ASN1_UTF8STRING;
  ------------------
  |  |   73|   117k|# define V_ASN1_UTF8STRING               12
  ------------------
  135|   117k|        outform = MBSTRING_UTF8;
  ------------------
  |  |  123|   117k|# define MBSTRING_UTF8           (MBSTRING_FLAG)
  |  |  ------------------
  |  |  |  |  122|   117k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  136|   117k|    }
  137|   117k|    if (!out)
  ------------------
  |  Branch (137:9): [True: 0, False: 117k]
  ------------------
  138|      0|        return str_type;
  139|   117k|    if (*out) {
  ------------------
  |  Branch (139:9): [True: 117k, False: 0]
  ------------------
  140|   117k|        free_out = 0;
  141|   117k|        dest = *out;
  142|   117k|        ASN1_STRING_set0(dest, NULL, 0);
  143|   117k|        dest->type = str_type;
  144|   117k|    } else {
  145|      0|        free_out = 1;
  146|      0|        dest = ASN1_STRING_type_new(str_type);
  147|      0|        if (dest == NULL) {
  ------------------
  |  Branch (147:13): [True: 0, False: 0]
  ------------------
  148|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  149|      0|            return -1;
  150|      0|        }
  151|      0|        *out = dest;
  152|      0|    }
  153|       |    /* If both the same type just copy across */
  154|   117k|    if (inform == outform) {
  ------------------
  |  Branch (154:9): [True: 6.24k, False: 111k]
  ------------------
  155|  6.24k|        if (!ASN1_STRING_set(dest, in, len)) {
  ------------------
  |  Branch (155:13): [True: 0, False: 6.24k]
  ------------------
  156|      0|            if (free_out) {
  ------------------
  |  Branch (156:17): [True: 0, False: 0]
  ------------------
  157|      0|                ASN1_STRING_free(dest);
  158|      0|                *out = NULL;
  159|      0|            }
  160|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  161|      0|            return -1;
  162|      0|        }
  163|  6.24k|        return str_type;
  164|  6.24k|    }
  165|       |
  166|       |    /* Work out how much space the destination will need */
  167|   111k|    switch (outform) {
  ------------------
  |  Branch (167:13): [True: 0, False: 111k]
  ------------------
  168|      0|    case MBSTRING_ASC:
  ------------------
  |  |  124|      0|# define MBSTRING_ASC            (MBSTRING_FLAG|1)
  |  |  ------------------
  |  |  |  |  122|      0|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (168:5): [True: 0, False: 111k]
  ------------------
  169|      0|        outlen = nchar;
  170|      0|        cpyfunc = cpy_asc;
  171|      0|        break;
  172|       |
  173|      0|    case MBSTRING_BMP:
  ------------------
  |  |  125|      0|# define MBSTRING_BMP            (MBSTRING_FLAG|2)
  |  |  ------------------
  |  |  |  |  122|      0|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (173:5): [True: 0, False: 111k]
  ------------------
  174|      0|        outlen = nchar << 1;
  175|      0|        cpyfunc = cpy_bmp;
  176|      0|        break;
  177|       |
  178|      0|    case MBSTRING_UNIV:
  ------------------
  |  |  126|      0|# define MBSTRING_UNIV           (MBSTRING_FLAG|4)
  |  |  ------------------
  |  |  |  |  122|      0|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (178:5): [True: 0, False: 111k]
  ------------------
  179|      0|        outlen = nchar << 2;
  180|      0|        cpyfunc = cpy_univ;
  181|      0|        break;
  182|       |
  183|   111k|    case MBSTRING_UTF8:
  ------------------
  |  |  123|   111k|# define MBSTRING_UTF8           (MBSTRING_FLAG)
  |  |  ------------------
  |  |  |  |  122|   111k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (183:5): [True: 111k, False: 0]
  ------------------
  184|   111k|        outlen = 0;
  185|   111k|        traverse_string(in, len, inform, out_utf8, &outlen);
  186|   111k|        cpyfunc = cpy_utf8;
  187|   111k|        break;
  188|   111k|    }
  189|   111k|    if ((p = OPENSSL_malloc(outlen + 1)) == NULL) {
  ------------------
  |  |  102|   111k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   111k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   111k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (189:9): [True: 0, False: 111k]
  ------------------
  190|      0|        if (free_out) {
  ------------------
  |  Branch (190:13): [True: 0, False: 0]
  ------------------
  191|      0|            ASN1_STRING_free(dest);
  192|      0|            *out = NULL;
  193|      0|        }
  194|      0|        return -1;
  195|      0|    }
  196|   111k|    dest->length = outlen;
  197|   111k|    dest->data = p;
  198|   111k|    p[outlen] = 0;
  199|   111k|    traverse_string(in, len, inform, cpyfunc, &p);
  200|   111k|    return str_type;
  201|   111k|}
a_mbstr.c:traverse_string:
  211|   346k|{
  212|   346k|    unsigned long value;
  213|   346k|    int ret;
  214|  37.8M|    while (len) {
  ------------------
  |  Branch (214:12): [True: 37.5M, False: 345k]
  ------------------
  215|  37.5M|        if (inform == MBSTRING_ASC) {
  ------------------
  |  |  124|  37.5M|# define MBSTRING_ASC            (MBSTRING_FLAG|1)
  |  |  ------------------
  |  |  |  |  122|  37.5M|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (215:13): [True: 37.4M, False: 13.6k]
  ------------------
  216|  37.4M|            value = *p++;
  217|  37.4M|            len--;
  218|  37.4M|        } else if (inform == MBSTRING_BMP) {
  ------------------
  |  |  125|  13.6k|# define MBSTRING_BMP            (MBSTRING_FLAG|2)
  |  |  ------------------
  |  |  |  |  122|  13.6k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (218:20): [True: 3.69k, False: 9.98k]
  ------------------
  219|  3.69k|            value = *p++ << 8;
  220|  3.69k|            value |= *p++;
  221|  3.69k|            len -= 2;
  222|  9.98k|        } else if (inform == MBSTRING_UNIV) {
  ------------------
  |  |  126|  9.98k|# define MBSTRING_UNIV           (MBSTRING_FLAG|4)
  |  |  ------------------
  |  |  |  |  122|  9.98k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (222:20): [True: 2.15k, False: 7.83k]
  ------------------
  223|  2.15k|            value = ((unsigned long)*p++) << 24;
  224|  2.15k|            value |= ((unsigned long)*p++) << 16;
  225|  2.15k|            value |= *p++ << 8;
  226|  2.15k|            value |= *p++;
  227|  2.15k|            len -= 4;
  228|  7.83k|        } else {
  229|  7.83k|            ret = UTF8_getc(p, len, &value);
  230|  7.83k|            if (ret < 0)
  ------------------
  |  Branch (230:17): [True: 69, False: 7.76k]
  ------------------
  231|     69|                return -1;
  232|  7.76k|            len -= ret;
  233|  7.76k|            p += ret;
  234|  7.76k|        }
  235|  37.5M|        if (rfunc) {
  ------------------
  |  Branch (235:13): [True: 37.5M, False: 0]
  ------------------
  236|  37.5M|            ret = rfunc(value, arg);
  237|  37.5M|            if (ret <= 0)
  ------------------
  |  Branch (237:17): [True: 63, False: 37.5M]
  ------------------
  238|     63|                return ret;
  239|  37.5M|        }
  240|  37.5M|    }
  241|   345k|    return 1;
  242|   346k|}
a_mbstr.c:in_utf8:
  249|  3.96k|{
  250|  3.96k|    int *nchar;
  251|       |
  252|  3.96k|    if (!is_unicode_valid(value))
  ------------------
  |  Branch (252:9): [True: 3, False: 3.96k]
  ------------------
  253|      3|        return -2;
  254|  3.96k|    nchar = arg;
  255|  3.96k|    (*nchar)++;
  256|  3.96k|    return 1;
  257|  3.96k|}
a_mbstr.c:out_utf8:
  262|  12.4M|{
  263|  12.4M|    int *outlen, len;
  264|       |
  265|  12.4M|    len = UTF8_putc(NULL, -1, value);
  266|  12.4M|    if (len <= 0)
  ------------------
  |  Branch (266:9): [True: 0, False: 12.4M]
  ------------------
  267|      0|        return len;
  268|  12.4M|    outlen = arg;
  269|  12.4M|    *outlen += len;
  270|  12.4M|    return 1;
  271|  12.4M|}
a_mbstr.c:type_str:
  279|  12.5M|{
  280|  12.5M|    unsigned long types = *((unsigned long *)arg);
  281|  12.5M|    const int native = value > INT_MAX ? INT_MAX : ossl_fromascii(value);
  ------------------
  |  |   57|  25.0M|#  define ossl_fromascii(c)     (c)
  ------------------
  |  Branch (281:24): [True: 9, False: 12.5M]
  ------------------
  282|       |
  283|  12.5M|    if ((types & B_ASN1_NUMERICSTRING) && !(ossl_isdigit(native)
  ------------------
  |  |  102|  12.5M|# define B_ASN1_NUMERICSTRING    0x0001
  ------------------
  |  Branch (283:9): [True: 0, False: 12.5M]
  |  Branch (283:45): [True: 0, False: 0]
  ------------------
  284|      0|                                            || native == ' '))
  ------------------
  |  Branch (284:48): [True: 0, False: 0]
  ------------------
  285|      0|        types &= ~B_ASN1_NUMERICSTRING;
  ------------------
  |  |  102|      0|# define B_ASN1_NUMERICSTRING    0x0001
  ------------------
  286|  12.5M|    if ((types & B_ASN1_PRINTABLESTRING) && !ossl_isasn1print(native))
  ------------------
  |  |  103|  12.5M|# define B_ASN1_PRINTABLESTRING  0x0002
  ------------------
                  if ((types & B_ASN1_PRINTABLESTRING) && !ossl_isasn1print(native))
  ------------------
  |  |   85|      0|# define ossl_isasn1print(c)    (ossl_ctype_check((c), CTYPE_MASK_asn1print))
  |  |  ------------------
  |  |  |  |   38|      0|# define CTYPE_MASK_asn1print   0x800
  |  |  ------------------
  ------------------
  |  Branch (286:9): [True: 0, False: 12.5M]
  |  Branch (286:45): [True: 0, False: 0]
  ------------------
  287|      0|        types &= ~B_ASN1_PRINTABLESTRING;
  ------------------
  |  |  103|      0|# define B_ASN1_PRINTABLESTRING  0x0002
  ------------------
  288|  12.5M|    if ((types & B_ASN1_IA5STRING) && !ossl_isascii(native))
  ------------------
  |  |  107|  12.5M|# define B_ASN1_IA5STRING        0x0010
  ------------------
                  if ((types & B_ASN1_IA5STRING) && !ossl_isascii(native))
  ------------------
  |  |   75|      0|# define ossl_isascii(c)        (((c) & ~127) == 0)
  ------------------
  |  Branch (288:9): [True: 0, False: 12.5M]
  |  Branch (288:39): [True: 0, False: 0]
  ------------------
  289|      0|        types &= ~B_ASN1_IA5STRING;
  ------------------
  |  |  107|      0|# define B_ASN1_IA5STRING        0x0010
  ------------------
  290|  12.5M|    if ((types & B_ASN1_T61STRING) && (value > 0xff))
  ------------------
  |  |  104|  12.5M|# define B_ASN1_T61STRING        0x0004
  ------------------
  |  Branch (290:9): [True: 0, False: 12.5M]
  |  Branch (290:39): [True: 0, False: 0]
  ------------------
  291|      0|        types &= ~B_ASN1_T61STRING;
  ------------------
  |  |  104|      0|# define B_ASN1_T61STRING        0x0004
  ------------------
  292|  12.5M|    if ((types & B_ASN1_BMPSTRING) && (value > 0xffff))
  ------------------
  |  |  115|  12.5M|# define B_ASN1_BMPSTRING        0x0800
  ------------------
  |  Branch (292:9): [True: 0, False: 12.5M]
  |  Branch (292:39): [True: 0, False: 0]
  ------------------
  293|      0|        types &= ~B_ASN1_BMPSTRING;
  ------------------
  |  |  115|      0|# define B_ASN1_BMPSTRING        0x0800
  ------------------
  294|  12.5M|    if ((types & B_ASN1_UTF8STRING) && !is_unicode_valid(value))
  ------------------
  |  |  117|  12.5M|# define B_ASN1_UTF8STRING       0x2000
  ------------------
  |  Branch (294:9): [True: 12.5M, False: 0]
  |  Branch (294:40): [True: 60, False: 12.5M]
  ------------------
  295|     60|        types &= ~B_ASN1_UTF8STRING;
  ------------------
  |  |  117|     60|# define B_ASN1_UTF8STRING       0x2000
  ------------------
  296|  12.5M|    if (!types)
  ------------------
  |  Branch (296:9): [True: 60, False: 12.5M]
  ------------------
  297|     60|        return -1;
  298|  12.5M|    *((unsigned long *)arg) = types;
  299|  12.5M|    return 1;
  300|  12.5M|}
a_mbstr.c:cpy_utf8:
  345|  12.4M|{
  346|  12.4M|    unsigned char **p;
  347|  12.4M|    int ret;
  348|  12.4M|    p = arg;
  349|       |    /* We already know there is enough room so pass 0xff as the length */
  350|  12.4M|    ret = UTF8_putc(*p, 0xff, value);
  351|  12.4M|    *p += ret;
  352|  12.4M|    return 1;
  353|  12.4M|}

i2t_ASN1_OBJECT:
  178|   309k|{
  179|   309k|    return OBJ_obj2txt(buf, buf_len, a, 0);
  180|   309k|}
i2a_ASN1_OBJECT:
  183|   302k|{
  184|   302k|    char buf[80], *p = buf;
  185|   302k|    int i;
  186|       |
  187|   302k|    if ((a == NULL) || (a->data == NULL))
  ------------------
  |  Branch (187:9): [True: 0, False: 302k]
  |  Branch (187:24): [True: 0, False: 302k]
  ------------------
  188|      0|        return BIO_write(bp, "NULL", 4);
  189|   302k|    i = i2t_ASN1_OBJECT(buf, sizeof(buf), a);
  190|   302k|    if (i > (int)(sizeof(buf) - 1)) {
  ------------------
  |  Branch (190:9): [True: 1.20k, False: 301k]
  ------------------
  191|  1.20k|        if (i > INT_MAX - 1) {  /* catch an integer overflow */
  ------------------
  |  Branch (191:13): [True: 0, False: 1.20k]
  ------------------
  192|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_LENGTH_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  193|      0|            return -1;
  194|      0|        }
  195|  1.20k|        if ((p = OPENSSL_malloc(i + 1)) == NULL)
  ------------------
  |  |  102|  1.20k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.20k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.20k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (195:13): [True: 0, False: 1.20k]
  ------------------
  196|      0|            return -1;
  197|  1.20k|        i2t_ASN1_OBJECT(p, i + 1, a);
  198|  1.20k|    }
  199|   302k|    if (i <= 0) {
  ------------------
  |  Branch (199:9): [True: 89, False: 302k]
  ------------------
  200|     89|        i = BIO_write(bp, "<INVALID>", 9);
  201|     89|        if (i > 0)
  ------------------
  |  Branch (201:13): [True: 89, False: 0]
  ------------------
  202|     89|            i += BIO_dump(bp, (const char *)a->data, a->length);
  203|     89|        return i;
  204|     89|    }
  205|   302k|    BIO_write(bp, p, i);
  206|   302k|    if (p != buf)
  ------------------
  |  Branch (206:9): [True: 1.20k, False: 301k]
  ------------------
  207|  1.20k|        OPENSSL_free(p);
  ------------------
  |  |  115|  1.20k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.20k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.20k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  208|   302k|    return i;
  209|   302k|}
d2i_ASN1_OBJECT:
  213|   265k|{
  214|   265k|    const unsigned char *p;
  215|   265k|    long len;
  216|   265k|    int tag, xclass;
  217|   265k|    int inf, i;
  218|   265k|    ASN1_OBJECT *ret = NULL;
  219|   265k|    p = *pp;
  220|   265k|    inf = ASN1_get_object(&p, &len, &tag, &xclass, length);
  221|   265k|    if (inf & 0x80) {
  ------------------
  |  Branch (221:9): [True: 201, False: 264k]
  ------------------
  222|    201|        i = ASN1_R_BAD_OBJECT_HEADER;
  ------------------
  |  |   28|    201|# define ASN1_R_BAD_OBJECT_HEADER                         102
  ------------------
  223|    201|        goto err;
  224|    201|    }
  225|       |
  226|   264k|    if (tag != V_ASN1_OBJECT) {
  ------------------
  |  |   68|   264k|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (226:9): [True: 0, False: 264k]
  ------------------
  227|      0|        i = ASN1_R_EXPECTING_AN_OBJECT;
  ------------------
  |  |   45|      0|# define ASN1_R_EXPECTING_AN_OBJECT                       116
  ------------------
  228|      0|        goto err;
  229|      0|    }
  230|   264k|    ret = ossl_c2i_ASN1_OBJECT(a, &p, len);
  231|   264k|    if (ret)
  ------------------
  |  Branch (231:9): [True: 259k, False: 5.28k]
  ------------------
  232|   259k|        *pp = p;
  233|   264k|    return ret;
  234|    201| err:
  235|    201|    ERR_raise(ERR_LIB_ASN1, i);
  ------------------
  |  |  401|    201|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    201|    (ERR_new(),                                                 \
  |  |  |  |  404|    201|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    201|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    201|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    201|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    201|     ERR_set_error)
  |  |  ------------------
  ------------------
  236|    201|    return NULL;
  237|   264k|}
ossl_c2i_ASN1_OBJECT:
  241|   999k|{
  242|   999k|    ASN1_OBJECT *ret = NULL, tobj;
  243|   999k|    const unsigned char *p;
  244|   999k|    unsigned char *data;
  245|   999k|    int i, length;
  246|       |
  247|       |    /*
  248|       |     * Sanity check OID encoding. Need at least one content octet. MSB must
  249|       |     * be clear in the last octet. can't have leading 0x80 in subidentifiers,
  250|       |     * see: X.690 8.19.2
  251|       |     */
  252|   999k|    if (len <= 0 || len > INT_MAX || pp == NULL || (p = *pp) == NULL ||
  ------------------
  |  Branch (252:9): [True: 1.35k, False: 998k]
  |  Branch (252:21): [True: 0, False: 998k]
  |  Branch (252:38): [True: 0, False: 998k]
  |  Branch (252:52): [True: 0, False: 998k]
  ------------------
  253|   999k|        p[len - 1] & 0x80) {
  ------------------
  |  Branch (253:9): [True: 3.69k, False: 994k]
  ------------------
  254|  5.04k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING);
  ------------------
  |  |  401|  5.04k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  5.04k|    (ERR_new(),                                                 \
  |  |  |  |  404|  5.04k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  5.04k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  5.04k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  5.04k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  5.04k|     ERR_set_error)
  |  |  ------------------
  ------------------
  255|  5.04k|        return NULL;
  256|  5.04k|    }
  257|       |    /* Now 0 < len <= INT_MAX, so the cast is safe. */
  258|   994k|    length = (int)len;
  259|       |    /*
  260|       |     * Try to lookup OID in table: these are all valid encodings so if we get
  261|       |     * a match we know the OID is valid.
  262|       |     */
  263|   994k|    tobj.nid = NID_undef;
  ------------------
  |  |   18|   994k|#define NID_undef                       0
  ------------------
  264|   994k|    tobj.data = p;
  265|   994k|    tobj.length = length;
  266|   994k|    tobj.flags = 0;
  267|   994k|    i = OBJ_obj2nid(&tobj);
  268|   994k|    if (i != NID_undef) {
  ------------------
  |  |   18|   994k|#define NID_undef                       0
  ------------------
  |  Branch (268:9): [True: 508k, False: 485k]
  ------------------
  269|       |        /*
  270|       |         * Return shared registered OID object: this improves efficiency
  271|       |         * because we don't have to return a dynamically allocated OID
  272|       |         * and NID lookups can use the cached value.
  273|       |         */
  274|   508k|        ret = OBJ_nid2obj(i);
  275|   508k|        if (a) {
  ------------------
  |  Branch (275:13): [True: 508k, False: 0]
  ------------------
  276|   508k|            ASN1_OBJECT_free(*a);
  277|   508k|            *a = ret;
  278|   508k|        }
  279|   508k|        *pp += len;
  280|   508k|        return ret;
  281|   508k|    }
  282|  32.5M|    for (i = 0; i < length; i++, p++) {
  ------------------
  |  Branch (282:17): [True: 32.0M, False: 484k]
  ------------------
  283|  32.0M|        if (*p == 0x80 && (!i || !(p[-1] & 0x80))) {
  ------------------
  |  Branch (283:13): [True: 25.3k, False: 32.0M]
  |  Branch (283:28): [True: 261, False: 25.0k]
  |  Branch (283:34): [True: 728, False: 24.3k]
  ------------------
  284|    989|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING);
  ------------------
  |  |  401|    989|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    989|    (ERR_new(),                                                 \
  |  |  |  |  404|    989|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    989|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    989|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    989|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    989|     ERR_set_error)
  |  |  ------------------
  ------------------
  285|    989|            return NULL;
  286|    989|        }
  287|  32.0M|    }
  288|       |
  289|   484k|    if ((a == NULL) || ((*a) == NULL) ||
  ------------------
  |  Branch (289:9): [True: 0, False: 484k]
  |  Branch (289:24): [True: 108k, False: 376k]
  ------------------
  290|   484k|        !((*a)->flags & ASN1_OBJECT_FLAG_DYNAMIC)) {
  ------------------
  |  |  110|   376k|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
  |  Branch (290:9): [True: 373k, False: 3.32k]
  ------------------
  291|   481k|        if ((ret = ASN1_OBJECT_new()) == NULL)
  ------------------
  |  Branch (291:13): [True: 0, False: 481k]
  ------------------
  292|      0|            return NULL;
  293|   481k|    } else {
  294|  3.32k|        ret = (*a);
  295|  3.32k|    }
  296|       |
  297|   484k|    p = *pp;
  298|       |    /* detach data from object */
  299|   484k|    data = (unsigned char *)ret->data;
  300|   484k|    ret->data = NULL;
  301|       |    /* once detached we can change it */
  302|   484k|    if ((data == NULL) || (ret->length < length)) {
  ------------------
  |  Branch (302:9): [True: 481k, False: 3.32k]
  |  Branch (302:27): [True: 599, False: 2.72k]
  ------------------
  303|   482k|        ret->length = 0;
  304|   482k|        OPENSSL_free(data);
  ------------------
  |  |  115|   482k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   482k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   482k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  305|   482k|        data = OPENSSL_malloc(length);
  ------------------
  |  |  102|   482k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   482k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   482k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  306|   482k|        if (data == NULL)
  ------------------
  |  Branch (306:13): [True: 0, False: 482k]
  ------------------
  307|      0|            goto err;
  308|   482k|        ret->flags |= ASN1_OBJECT_FLAG_DYNAMIC_DATA;
  ------------------
  |  |  113|   482k|# define ASN1_OBJECT_FLAG_DYNAMIC_DATA    0x08/* internal use */
  ------------------
  309|   482k|    }
  310|   484k|    memcpy(data, p, length);
  311|       |    /* If there are dynamic strings, free them here, and clear the flag */
  312|   484k|    if ((ret->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) != 0) {
  ------------------
  |  |  112|   484k|# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
  ------------------
  |  Branch (312:9): [True: 0, False: 484k]
  ------------------
  313|      0|        OPENSSL_free((char *)ret->sn);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  314|      0|        OPENSSL_free((char *)ret->ln);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  315|      0|        ret->flags &= ~ASN1_OBJECT_FLAG_DYNAMIC_STRINGS;
  ------------------
  |  |  112|      0|# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
  ------------------
  316|      0|    }
  317|       |    /* reattach data to object, after which it remains const */
  318|   484k|    ret->data = data;
  319|   484k|    ret->length = length;
  320|   484k|    ret->sn = NULL;
  321|   484k|    ret->ln = NULL;
  322|       |    /* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */
  323|   484k|    p += length;
  324|       |
  325|   484k|    if (a != NULL)
  ------------------
  |  Branch (325:9): [True: 484k, False: 0]
  ------------------
  326|   484k|        (*a) = ret;
  327|   484k|    *pp = p;
  328|   484k|    return ret;
  329|      0| err:
  330|      0|    ERR_raise(ERR_LIB_ASN1, i);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  331|      0|    if ((a == NULL) || (*a != ret))
  ------------------
  |  Branch (331:9): [True: 0, False: 0]
  |  Branch (331:24): [True: 0, False: 0]
  ------------------
  332|      0|        ASN1_OBJECT_free(ret);
  333|      0|    return NULL;
  334|   484k|}
ASN1_OBJECT_new:
  337|   676k|{
  338|   676k|    ASN1_OBJECT *ret;
  339|       |
  340|   676k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|   676k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   676k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   676k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  341|   676k|    if (ret == NULL)
  ------------------
  |  Branch (341:9): [True: 0, False: 676k]
  ------------------
  342|      0|        return NULL;
  343|   676k|    ret->flags = ASN1_OBJECT_FLAG_DYNAMIC;
  ------------------
  |  |  110|   676k|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
  344|   676k|    return ret;
  345|   676k|}
ASN1_OBJECT_free:
  348|  2.80M|{
  349|  2.80M|    if (a == NULL)
  ------------------
  |  Branch (349:9): [True: 541k, False: 2.26M]
  ------------------
  350|   541k|        return;
  351|  2.26M|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) {
  ------------------
  |  |  112|  2.26M|# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
  ------------------
  |  Branch (351:9): [True: 194k, False: 2.06M]
  ------------------
  352|   194k|#ifndef CONST_STRICT
  353|       |        /*
  354|       |         * Disable purely for compile-time strict const checking.  Doing this
  355|       |         * on a "real" compile will cause memory leaks
  356|       |         */
  357|   194k|        OPENSSL_free((void*)a->sn);
  ------------------
  |  |  115|   194k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   194k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   194k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  358|   194k|        OPENSSL_free((void*)a->ln);
  ------------------
  |  |  115|   194k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   194k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   194k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  359|   194k|#endif
  360|   194k|        a->sn = a->ln = NULL;
  361|   194k|    }
  362|  2.26M|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA) {
  ------------------
  |  |  113|  2.26M|# define ASN1_OBJECT_FLAG_DYNAMIC_DATA    0x08/* internal use */
  ------------------
  |  Branch (362:9): [True: 676k, False: 1.58M]
  ------------------
  363|   676k|        OPENSSL_free((void*)a->data);
  ------------------
  |  |  115|   676k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   676k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   676k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  364|   676k|        a->data = NULL;
  365|   676k|        a->length = 0;
  366|   676k|    }
  367|  2.26M|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC)
  ------------------
  |  |  110|  2.26M|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
  |  Branch (367:9): [True: 676k, False: 1.58M]
  ------------------
  368|   676k|        OPENSSL_free(a);
  ------------------
  |  |  115|   676k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   676k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   676k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  369|  2.26M|}

ASN1_OCTET_STRING_set:
   27|    684|{
   28|    684|    return ASN1_STRING_set(x, d, len);
   29|    684|}

ASN1_STRING_print:
   70|  28.6k|{
   71|  28.6k|    int i, n;
   72|  28.6k|    char buf[80];
   73|  28.6k|    const char *p;
   74|       |
   75|  28.6k|    if (v == NULL)
  ------------------
  |  Branch (75:9): [True: 0, False: 28.6k]
  ------------------
   76|      0|        return 0;
   77|  28.6k|    n = 0;
   78|  28.6k|    p = (const char *)v->data;
   79|   667k|    for (i = 0; i < v->length; i++) {
  ------------------
  |  Branch (79:17): [True: 638k, False: 28.6k]
  ------------------
   80|   638k|        if ((p[i] > '~') || ((p[i] < ' ') &&
  ------------------
  |  Branch (80:13): [True: 1.33k, False: 637k]
  |  Branch (80:30): [True: 313k, False: 323k]
  ------------------
   81|   637k|                             (p[i] != '\n') && (p[i] != '\r')))
  ------------------
  |  Branch (81:30): [True: 313k, False: 494]
  |  Branch (81:48): [True: 311k, False: 2.19k]
  ------------------
   82|   312k|            buf[n] = '.';
   83|   325k|        else
   84|   325k|            buf[n] = p[i];
   85|   638k|        n++;
   86|   638k|        if (n >= 80) {
  ------------------
  |  Branch (86:13): [True: 416, False: 638k]
  ------------------
   87|    416|            if (BIO_write(bp, buf, n) <= 0)
  ------------------
  |  Branch (87:17): [True: 0, False: 416]
  ------------------
   88|      0|                return 0;
   89|    416|            n = 0;
   90|    416|        }
   91|   638k|    }
   92|  28.6k|    if (n > 0)
  ------------------
  |  Branch (92:9): [True: 26.5k, False: 2.08k]
  ------------------
   93|  26.5k|        if (BIO_write(bp, buf, n) <= 0)
  ------------------
  |  Branch (93:13): [True: 0, False: 26.5k]
  ------------------
   94|      0|            return 0;
   95|  28.6k|    return 1;
   96|  28.6k|}

X509_NAME_print_ex:
  564|  6.36k|{
  565|  6.36k|    if (flags == XN_FLAG_COMPAT)
  ------------------
  |  |  319|  6.36k|# define XN_FLAG_COMPAT          0/* Traditional; use old X509_NAME_print */
  ------------------
  |  Branch (565:9): [True: 2.79k, False: 3.56k]
  ------------------
  566|  2.79k|        return X509_NAME_print(out, nm, indent);
  567|  3.56k|    return do_name_ex(send_bio_chars, out, nm, indent, flags);
  568|  6.36k|}
ASN1_STRING_print_ex:
  589|  10.4k|{
  590|  10.4k|    return do_print_ex(send_bio_chars, out, flags, str);
  591|  10.4k|}
ASN1_STRING_to_UTF8:
  606|   117k|{
  607|   117k|    ASN1_STRING stmp, *str = &stmp;
  608|   117k|    int mbflag, type, ret;
  609|   117k|    if (!in)
  ------------------
  |  Branch (609:9): [True: 0, False: 117k]
  ------------------
  610|      0|        return -1;
  611|   117k|    type = in->type;
  612|   117k|    if ((type < 0) || (type > 30))
  ------------------
  |  Branch (612:9): [True: 0, False: 117k]
  |  Branch (612:23): [True: 0, False: 117k]
  ------------------
  613|      0|        return -1;
  614|   117k|    mbflag = tag2nbyte[type];
  615|   117k|    if (mbflag == -1)
  ------------------
  |  Branch (615:9): [True: 0, False: 117k]
  ------------------
  616|      0|        return -1;
  617|   117k|    mbflag |= MBSTRING_FLAG;
  ------------------
  |  |  122|   117k|# define MBSTRING_FLAG           0x1000
  ------------------
  618|   117k|    stmp.data = NULL;
  619|   117k|    stmp.length = 0;
  620|   117k|    stmp.flags = 0;
  621|   117k|    ret =
  622|   117k|        ASN1_mbstring_copy(&str, in->data, in->length, mbflag,
  623|   117k|                           B_ASN1_UTF8STRING);
  ------------------
  |  |  117|   117k|# define B_ASN1_UTF8STRING       0x2000
  ------------------
  624|   117k|    if (ret < 0)
  ------------------
  |  Branch (624:9): [True: 132, False: 117k]
  ------------------
  625|    132|        return ret;
  626|   117k|    *out = stmp.data;
  627|   117k|    return stmp.length;
  628|   117k|}
a_strex.c:do_name_ex:
  426|  3.56k|{
  427|  3.56k|    int i, prev = -1, orflags, cnt;
  428|  3.56k|    int fn_opt, fn_nid;
  429|  3.56k|    ASN1_OBJECT *fn;
  430|  3.56k|    const ASN1_STRING *val;
  431|  3.56k|    const X509_NAME_ENTRY *ent;
  432|  3.56k|    char objtmp[80];
  433|  3.56k|    const char *objbuf;
  434|  3.56k|    int outlen, len;
  435|  3.56k|    char *sep_dn, *sep_mv, *sep_eq;
  436|  3.56k|    int sep_dn_len, sep_mv_len, sep_eq_len;
  437|  3.56k|    if (indent < 0)
  ------------------
  |  Branch (437:9): [True: 0, False: 3.56k]
  ------------------
  438|      0|        indent = 0;
  439|  3.56k|    outlen = indent;
  440|  3.56k|    if (!do_indent(io_ch, arg, indent))
  ------------------
  |  Branch (440:9): [True: 0, False: 3.56k]
  ------------------
  441|      0|        return -1;
  442|  3.56k|    switch (flags & XN_FLAG_SEP_MASK) {
  ------------------
  |  |  317|  3.56k|# define XN_FLAG_SEP_MASK        (0xf << 16)
  ------------------
  443|      0|    case XN_FLAG_SEP_MULTILINE:
  ------------------
  |  |  323|      0|# define XN_FLAG_SEP_MULTILINE   (4 << 16)/* One line per field */
  ------------------
  |  Branch (443:5): [True: 0, False: 3.56k]
  ------------------
  444|      0|        sep_dn = "\n";
  445|      0|        sep_dn_len = 1;
  446|      0|        sep_mv = " + ";
  447|      0|        sep_mv_len = 3;
  448|      0|        break;
  449|       |
  450|      0|    case XN_FLAG_SEP_COMMA_PLUS:
  ------------------
  |  |  320|      0|# define XN_FLAG_SEP_COMMA_PLUS  (1 << 16)/* RFC2253 ,+ */
  ------------------
  |  Branch (450:5): [True: 0, False: 3.56k]
  ------------------
  451|      0|        sep_dn = ",";
  452|      0|        sep_dn_len = 1;
  453|      0|        sep_mv = "+";
  454|      0|        sep_mv_len = 1;
  455|      0|        indent = 0;
  456|      0|        break;
  457|       |
  458|  3.56k|    case XN_FLAG_SEP_CPLUS_SPC:
  ------------------
  |  |  321|  3.56k|# define XN_FLAG_SEP_CPLUS_SPC   (2 << 16)/* ,+ spaced: more readable */
  ------------------
  |  Branch (458:5): [True: 3.56k, False: 0]
  ------------------
  459|  3.56k|        sep_dn = ", ";
  460|  3.56k|        sep_dn_len = 2;
  461|  3.56k|        sep_mv = " + ";
  462|  3.56k|        sep_mv_len = 3;
  463|  3.56k|        indent = 0;
  464|  3.56k|        break;
  465|       |
  466|      0|    case XN_FLAG_SEP_SPLUS_SPC:
  ------------------
  |  |  322|      0|# define XN_FLAG_SEP_SPLUS_SPC   (3 << 16)/* ;+ spaced */
  ------------------
  |  Branch (466:5): [True: 0, False: 3.56k]
  ------------------
  467|      0|        sep_dn = "; ";
  468|      0|        sep_dn_len = 2;
  469|      0|        sep_mv = " + ";
  470|      0|        sep_mv_len = 3;
  471|      0|        indent = 0;
  472|      0|        break;
  473|       |
  474|      0|    default:
  ------------------
  |  Branch (474:5): [True: 0, False: 3.56k]
  ------------------
  475|      0|        return -1;
  476|  3.56k|    }
  477|       |
  478|  3.56k|    if (flags & XN_FLAG_SPC_EQ) {
  ------------------
  |  |  336|  3.56k|# define XN_FLAG_SPC_EQ          (1 << 23)/* Put spaces round '=' */
  ------------------
  |  Branch (478:9): [True: 3.56k, False: 0]
  ------------------
  479|  3.56k|        sep_eq = " = ";
  480|  3.56k|        sep_eq_len = 3;
  481|  3.56k|    } else {
  482|      0|        sep_eq = "=";
  483|      0|        sep_eq_len = 1;
  484|      0|    }
  485|       |
  486|  3.56k|    fn_opt = flags & XN_FLAG_FN_MASK;
  ------------------
  |  |  329|  3.56k|# define XN_FLAG_FN_MASK         (0x3 << 21)
  ------------------
  487|       |
  488|  3.56k|    cnt = X509_NAME_entry_count(n);
  489|  10.6k|    for (i = 0; i < cnt; i++) {
  ------------------
  |  Branch (489:17): [True: 7.11k, False: 3.56k]
  ------------------
  490|  7.11k|        if (flags & XN_FLAG_DN_REV)
  ------------------
  |  |  325|  7.11k|# define XN_FLAG_DN_REV          (1 << 20)/* Reverse DN order */
  ------------------
  |  Branch (490:13): [True: 0, False: 7.11k]
  ------------------
  491|      0|            ent = X509_NAME_get_entry(n, cnt - i - 1);
  492|  7.11k|        else
  493|  7.11k|            ent = X509_NAME_get_entry(n, i);
  494|  7.11k|        if (prev != -1) {
  ------------------
  |  Branch (494:13): [True: 4.21k, False: 2.90k]
  ------------------
  495|  4.21k|            if (prev == X509_NAME_ENTRY_set(ent)) {
  ------------------
  |  Branch (495:17): [True: 4.21k, False: 0]
  ------------------
  496|  4.21k|                if (!io_ch(arg, sep_mv, sep_mv_len))
  ------------------
  |  Branch (496:21): [True: 0, False: 4.21k]
  ------------------
  497|      0|                    return -1;
  498|  4.21k|                outlen += sep_mv_len;
  499|  4.21k|            } else {
  500|      0|                if (!io_ch(arg, sep_dn, sep_dn_len))
  ------------------
  |  Branch (500:21): [True: 0, False: 0]
  ------------------
  501|      0|                    return -1;
  502|      0|                outlen += sep_dn_len;
  503|      0|                if (!do_indent(io_ch, arg, indent))
  ------------------
  |  Branch (503:21): [True: 0, False: 0]
  ------------------
  504|      0|                    return -1;
  505|      0|                outlen += indent;
  506|      0|            }
  507|  4.21k|        }
  508|  7.11k|        prev = X509_NAME_ENTRY_set(ent);
  509|  7.11k|        fn = X509_NAME_ENTRY_get_object(ent);
  510|  7.11k|        val = X509_NAME_ENTRY_get_data(ent);
  511|  7.11k|        fn_nid = OBJ_obj2nid(fn);
  512|  7.11k|        if (fn_opt != XN_FLAG_FN_NONE) {
  ------------------
  |  |  334|  7.11k|# define XN_FLAG_FN_NONE         (3 << 21)/* No field names */
  ------------------
  |  Branch (512:13): [True: 7.11k, False: 0]
  ------------------
  513|  7.11k|            int objlen, fld_len;
  514|  7.11k|            if ((fn_opt == XN_FLAG_FN_OID) || (fn_nid == NID_undef)) {
  ------------------
  |  |  333|  7.11k|# define XN_FLAG_FN_OID          (2 << 21)/* Always use OIDs */
  ------------------
                          if ((fn_opt == XN_FLAG_FN_OID) || (fn_nid == NID_undef)) {
  ------------------
  |  |   18|  7.11k|#define NID_undef                       0
  ------------------
  |  Branch (514:17): [True: 0, False: 7.11k]
  |  Branch (514:47): [True: 6.48k, False: 630]
  ------------------
  515|  6.48k|                OBJ_obj2txt(objtmp, sizeof(objtmp), fn, 1);
  516|  6.48k|                fld_len = 0;    /* XXX: what should this be? */
  517|  6.48k|                objbuf = objtmp;
  518|  6.48k|            } else {
  519|    630|                if (fn_opt == XN_FLAG_FN_SN) {
  ------------------
  |  |  331|    630|# define XN_FLAG_FN_SN           0/* Object short name */
  ------------------
  |  Branch (519:21): [True: 630, False: 0]
  ------------------
  520|    630|                    fld_len = FN_WIDTH_SN;
  ------------------
  |  |  422|    630|#define FN_WIDTH_SN     10
  ------------------
  521|    630|                    objbuf = OBJ_nid2sn(fn_nid);
  522|    630|                } else if (fn_opt == XN_FLAG_FN_LN) {
  ------------------
  |  |  332|      0|# define XN_FLAG_FN_LN           (1 << 21)/* Object long name */
  ------------------
  |  Branch (522:28): [True: 0, False: 0]
  ------------------
  523|      0|                    fld_len = FN_WIDTH_LN;
  ------------------
  |  |  421|      0|#define FN_WIDTH_LN     25
  ------------------
  524|      0|                    objbuf = OBJ_nid2ln(fn_nid);
  525|      0|                } else {
  526|      0|                    fld_len = 0; /* XXX: what should this be? */
  527|      0|                    objbuf = "";
  528|      0|                }
  529|    630|            }
  530|  7.11k|            objlen = strlen(objbuf);
  531|  7.11k|            if (!io_ch(arg, objbuf, objlen))
  ------------------
  |  Branch (531:17): [True: 0, False: 7.11k]
  ------------------
  532|      0|                return -1;
  533|  7.11k|            if ((objlen < fld_len) && (flags & XN_FLAG_FN_ALIGN)) {
  ------------------
  |  |  345|    491|# define XN_FLAG_FN_ALIGN        (1 << 25)/* Align field names to 20
  ------------------
  |  Branch (533:17): [True: 491, False: 6.62k]
  |  Branch (533:39): [True: 0, False: 491]
  ------------------
  534|      0|                if (!do_indent(io_ch, arg, fld_len - objlen))
  ------------------
  |  Branch (534:21): [True: 0, False: 0]
  ------------------
  535|      0|                    return -1;
  536|      0|                outlen += fld_len - objlen;
  537|      0|            }
  538|  7.11k|            if (!io_ch(arg, sep_eq, sep_eq_len))
  ------------------
  |  Branch (538:17): [True: 0, False: 7.11k]
  ------------------
  539|      0|                return -1;
  540|  7.11k|            outlen += objlen + sep_eq_len;
  541|  7.11k|        }
  542|       |        /*
  543|       |         * If the field name is unknown then fix up the DER dump flag. We
  544|       |         * might want to limit this further so it will DER dump on anything
  545|       |         * other than a few 'standard' fields.
  546|       |         */
  547|  7.11k|        if ((fn_nid == NID_undef) && (flags & XN_FLAG_DUMP_UNKNOWN_FIELDS))
  ------------------
  |  |   18|  7.11k|#define NID_undef                       0
  ------------------
                      if ((fn_nid == NID_undef) && (flags & XN_FLAG_DUMP_UNKNOWN_FIELDS))
  ------------------
  |  |  343|  6.48k|# define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24)
  ------------------
  |  Branch (547:13): [True: 6.48k, False: 630]
  |  Branch (547:38): [True: 0, False: 6.48k]
  ------------------
  548|      0|            orflags = ASN1_STRFLGS_DUMP_ALL;
  ------------------
  |  |  496|      0|# define ASN1_STRFLGS_DUMP_ALL           0x80
  ------------------
  549|  7.11k|        else
  550|  7.11k|            orflags = 0;
  551|       |
  552|  7.11k|        len = do_print_ex(io_ch, arg, flags | orflags, val);
  553|  7.11k|        if (len < 0)
  ------------------
  |  Branch (553:13): [True: 0, False: 7.11k]
  ------------------
  554|      0|            return -1;
  555|  7.11k|        outlen += len;
  556|  7.11k|    }
  557|  3.56k|    return outlen;
  558|  3.56k|}
a_strex.c:do_indent:
  413|  3.56k|{
  414|  3.56k|    int i;
  415|  3.56k|    for (i = 0; i < indent; i++)
  ------------------
  |  Branch (415:17): [True: 0, False: 3.56k]
  ------------------
  416|      0|        if (!io_ch(arg, " ", 1))
  ------------------
  |  Branch (416:13): [True: 0, False: 0]
  ------------------
  417|      0|            return 0;
  418|  3.56k|    return 1;
  419|  3.56k|}
a_strex.c:send_bio_chars:
   40|   230k|{
   41|   230k|    if (!arg)
  ------------------
  |  Branch (41:9): [True: 57.8k, False: 172k]
  ------------------
   42|  57.8k|        return 1;
   43|   172k|    if (BIO_write(arg, buf, len) != len)
  ------------------
  |  Branch (43:9): [True: 0, False: 172k]
  ------------------
   44|      0|        return 0;
   45|   172k|    return 1;
   46|   172k|}
a_strex.c:do_print_ex:
  331|  17.5k|{
  332|  17.5k|    int outlen, len;
  333|  17.5k|    int type;
  334|  17.5k|    char quotes;
  335|  17.5k|    unsigned short flags;
  336|  17.5k|    quotes = 0;
  337|       |    /* Keep a copy of escape flags */
  338|  17.5k|    flags = (unsigned short)(lflags & ESC_FLAGS);
  ------------------
  |  |   29|  17.5k|#define ESC_FLAGS (ASN1_STRFLGS_ESC_2253 | \
  |  |  ------------------
  |  |  |  |  441|  17.5k|# define ASN1_STRFLGS_ESC_2253           1
  |  |  ------------------
  |  |   30|  17.5k|                  ASN1_STRFLGS_ESC_2254 | \
  |  |  ------------------
  |  |  |  |  509|  17.5k|#define ASN1_STRFLGS_ESC_2254           0x400
  |  |  ------------------
  |  |   31|  17.5k|                  ASN1_STRFLGS_ESC_QUOTE | \
  |  |  ------------------
  |  |  |  |  455|  17.5k|# define ASN1_STRFLGS_ESC_QUOTE          8
  |  |  ------------------
  |  |   32|  17.5k|                  ASN1_STRFLGS_ESC_CTRL | \
  |  |  ------------------
  |  |  |  |  442|  17.5k|# define ASN1_STRFLGS_ESC_CTRL           2
  |  |  ------------------
  |  |   33|  17.5k|                  ASN1_STRFLGS_ESC_MSB)
  |  |  ------------------
  |  |  |  |  443|  17.5k|# define ASN1_STRFLGS_ESC_MSB            4
  |  |  ------------------
  ------------------
  339|       |
  340|  17.5k|    type = str->type;
  341|       |
  342|  17.5k|    outlen = 0;
  343|       |
  344|  17.5k|    if (lflags & ASN1_STRFLGS_SHOW_TYPE) {
  ------------------
  |  |  486|  17.5k|# define ASN1_STRFLGS_SHOW_TYPE          0x40
  ------------------
  |  Branch (344:9): [True: 4.48k, False: 13.0k]
  ------------------
  345|  4.48k|        const char *tagname;
  346|       |
  347|  4.48k|        tagname = ASN1_tag2str(type);
  348|       |        /* We can directly cast here as tagname will never be too large. */
  349|  4.48k|        outlen += (int)strlen(tagname);
  350|  4.48k|        if (!io_ch(arg, tagname, outlen) || !io_ch(arg, ":", 1))
  ------------------
  |  Branch (350:13): [True: 0, False: 4.48k]
  |  Branch (350:45): [True: 0, False: 4.48k]
  ------------------
  351|      0|            return -1;
  352|  4.48k|        outlen++;
  353|  4.48k|    }
  354|       |
  355|       |    /* Decide what to do with type, either dump content or display it */
  356|       |
  357|       |    /* Dump everything */
  358|  17.5k|    if (lflags & ASN1_STRFLGS_DUMP_ALL)
  ------------------
  |  |  496|  17.5k|# define ASN1_STRFLGS_DUMP_ALL           0x80
  ------------------
  |  Branch (358:9): [True: 4.48k, False: 13.0k]
  ------------------
  359|  4.48k|        type = -1;
  360|       |    /* Ignore the string type */
  361|  13.0k|    else if (lflags & ASN1_STRFLGS_IGNORE_TYPE)
  ------------------
  |  |  483|  13.0k|# define ASN1_STRFLGS_IGNORE_TYPE        0x20
  ------------------
  |  Branch (361:14): [True: 0, False: 13.0k]
  ------------------
  362|      0|        type = 1;
  363|  13.0k|    else {
  364|       |        /* Else determine width based on type */
  365|  13.0k|        if ((type > 0) && (type < 31))
  ------------------
  |  Branch (365:13): [True: 13.0k, False: 0]
  |  Branch (365:27): [True: 13.0k, False: 0]
  ------------------
  366|  13.0k|            type = tag2nbyte[type];
  367|      0|        else
  368|      0|            type = -1;
  369|  13.0k|        if ((type == -1) && !(lflags & ASN1_STRFLGS_DUMP_UNKNOWN))
  ------------------
  |  |  497|  1.87k|# define ASN1_STRFLGS_DUMP_UNKNOWN       0x100
  ------------------
  |  Branch (369:13): [True: 1.87k, False: 11.1k]
  |  Branch (369:29): [True: 0, False: 1.87k]
  ------------------
  370|      0|            type = 1;
  371|  13.0k|    }
  372|       |
  373|  17.5k|    if (type == -1) {
  ------------------
  |  Branch (373:9): [True: 6.35k, False: 11.1k]
  ------------------
  374|  6.35k|        len = do_dump(lflags, io_ch, arg, str);
  375|  6.35k|        if (len < 0 || len > INT_MAX - outlen)
  ------------------
  |  Branch (375:13): [True: 0, False: 6.35k]
  |  Branch (375:24): [True: 0, False: 6.35k]
  ------------------
  376|      0|            return -1;
  377|  6.35k|        outlen += len;
  378|  6.35k|        return outlen;
  379|  6.35k|    }
  380|       |
  381|  11.1k|    if (lflags & ASN1_STRFLGS_UTF8_CONVERT) {
  ------------------
  |  |  475|  11.1k|# define ASN1_STRFLGS_UTF8_CONVERT       0x10
  ------------------
  |  Branch (381:9): [True: 5.24k, False: 5.93k]
  ------------------
  382|       |        /*
  383|       |         * Note: if string is UTF8 and we want to convert to UTF8 then we
  384|       |         * just interpret it as 1 byte per character to avoid converting
  385|       |         * twice.
  386|       |         */
  387|  5.24k|        if (!type)
  ------------------
  |  Branch (387:13): [True: 77, False: 5.16k]
  ------------------
  388|     77|            type = 1;
  389|  5.16k|        else
  390|  5.16k|            type |= BUF_TYPE_CONVUTF8;
  ------------------
  |  |  131|  5.16k|#define BUF_TYPE_CONVUTF8       0x8
  ------------------
  391|  5.24k|    }
  392|       |
  393|  11.1k|    len = do_buf(str->data, str->length, type, flags, &quotes, io_ch, NULL);
  394|  11.1k|    if (len < 0 || len > INT_MAX - 2 - outlen)
  ------------------
  |  Branch (394:9): [True: 3.44k, False: 7.74k]
  |  Branch (394:20): [True: 0, False: 7.74k]
  ------------------
  395|  3.44k|        return -1;
  396|  7.74k|    outlen += len;
  397|  7.74k|    if (quotes)
  ------------------
  |  Branch (397:9): [True: 743, False: 6.99k]
  ------------------
  398|    743|        outlen += 2;
  399|  7.74k|    if (!arg)
  ------------------
  |  Branch (399:9): [True: 0, False: 7.74k]
  ------------------
  400|      0|        return outlen;
  401|  7.74k|    if (quotes && !io_ch(arg, "\"", 1))
  ------------------
  |  Branch (401:9): [True: 743, False: 6.99k]
  |  Branch (401:19): [True: 0, False: 743]
  ------------------
  402|      0|        return -1;
  403|  7.74k|    if (do_buf(str->data, str->length, type, flags, NULL, io_ch, arg) < 0)
  ------------------
  |  Branch (403:9): [True: 0, False: 7.74k]
  ------------------
  404|      0|        return -1;
  405|  7.74k|    if (quotes && !io_ch(arg, "\"", 1))
  ------------------
  |  Branch (405:9): [True: 743, False: 6.99k]
  |  Branch (405:19): [True: 0, False: 743]
  ------------------
  406|      0|        return -1;
  407|  7.74k|    return outlen;
  408|  7.74k|}
a_strex.c:do_dump:
  262|  6.35k|{
  263|       |    /*
  264|       |     * Placing the ASN1_STRING in a temp ASN1_TYPE allows the DER encoding to
  265|       |     * readily obtained
  266|       |     */
  267|  6.35k|    ASN1_TYPE t;
  268|  6.35k|    unsigned char *der_buf, *p;
  269|  6.35k|    int outlen, der_len;
  270|       |
  271|  6.35k|    if (!io_ch(arg, "#", 1))
  ------------------
  |  Branch (271:9): [True: 0, False: 6.35k]
  ------------------
  272|      0|        return -1;
  273|       |    /* If we don't dump DER encoding just dump content octets */
  274|  6.35k|    if (!(lflags & ASN1_STRFLGS_DUMP_DER)) {
  ------------------
  |  |  504|  6.35k|# define ASN1_STRFLGS_DUMP_DER           0x200
  ------------------
  |  Branch (274:9): [True: 4.48k, False: 1.87k]
  ------------------
  275|  4.48k|        outlen = do_hex_dump(io_ch, arg, str->data, str->length);
  276|  4.48k|        if (outlen < 0)
  ------------------
  |  Branch (276:13): [True: 0, False: 4.48k]
  ------------------
  277|      0|            return -1;
  278|  4.48k|        return outlen + 1;
  279|  4.48k|    }
  280|  1.87k|    t.type = str->type;
  281|  1.87k|    t.value.ptr = (char *)str;
  282|  1.87k|    der_len = i2d_ASN1_TYPE(&t, NULL);
  283|  1.87k|    if (der_len <= 0)
  ------------------
  |  Branch (283:9): [True: 0, False: 1.87k]
  ------------------
  284|      0|        return -1;
  285|  1.87k|    if ((der_buf = OPENSSL_malloc(der_len)) == NULL)
  ------------------
  |  |  102|  1.87k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.87k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.87k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (285:9): [True: 0, False: 1.87k]
  ------------------
  286|      0|        return -1;
  287|  1.87k|    p = der_buf;
  288|  1.87k|    i2d_ASN1_TYPE(&t, &p);
  289|  1.87k|    outlen = do_hex_dump(io_ch, arg, der_buf, der_len);
  290|  1.87k|    OPENSSL_free(der_buf);
  ------------------
  |  |  115|  1.87k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.87k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.87k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  291|  1.87k|    if (outlen < 0)
  ------------------
  |  Branch (291:9): [True: 0, False: 1.87k]
  ------------------
  292|      0|        return -1;
  293|  1.87k|    return outlen + 1;
  294|  1.87k|}
a_strex.c:do_hex_dump:
  237|  6.35k|{
  238|  6.35k|    unsigned char *p, *q;
  239|  6.35k|    char hextmp[2];
  240|       |
  241|  6.35k|    if (arg) {
  ------------------
  |  Branch (241:9): [True: 6.35k, False: 0]
  ------------------
  242|  6.35k|        p = buf;
  243|  6.35k|        q = buf + buflen;
  244|  87.3k|        while (p != q) {
  ------------------
  |  Branch (244:16): [True: 80.9k, False: 6.35k]
  ------------------
  245|  80.9k|            ossl_to_hex(hextmp, *p);
  246|  80.9k|            if (!io_ch(arg, hextmp, 2))
  ------------------
  |  Branch (246:17): [True: 0, False: 80.9k]
  ------------------
  247|      0|                return -1;
  248|  80.9k|            p++;
  249|  80.9k|        }
  250|  6.35k|    }
  251|  6.35k|    return buflen << 1;
  252|  6.35k|}
a_strex.c:do_buf:
  142|  18.9k|{
  143|  18.9k|    int i, outlen, len, charwidth;
  144|  18.9k|    unsigned short orflags;
  145|  18.9k|    unsigned char *p, *q;
  146|  18.9k|    unsigned long c;
  147|       |
  148|  18.9k|    p = buf;
  149|  18.9k|    q = buf + buflen;
  150|  18.9k|    outlen = 0;
  151|  18.9k|    charwidth = type & BUF_TYPE_WIDTH_MASK;
  ------------------
  |  |  130|  18.9k|#define BUF_TYPE_WIDTH_MASK     0x7
  ------------------
  152|       |
  153|  18.9k|    switch (charwidth) {
  154|  3.72k|    case 4:
  ------------------
  |  Branch (154:5): [True: 3.72k, False: 15.1k]
  ------------------
  155|  3.72k|        if (buflen & 3) {
  ------------------
  |  Branch (155:13): [True: 0, False: 3.72k]
  ------------------
  156|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  157|      0|            return -1;
  158|      0|        }
  159|  3.72k|        break;
  160|  6.54k|    case 2:
  ------------------
  |  Branch (160:5): [True: 6.54k, False: 12.3k]
  ------------------
  161|  6.54k|        if (buflen & 1) {
  ------------------
  |  Branch (161:13): [True: 0, False: 6.54k]
  ------------------
  162|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  163|      0|            return -1;
  164|      0|        }
  165|  6.54k|        break;
  166|  8.65k|    default:
  ------------------
  |  Branch (166:5): [True: 8.65k, False: 10.2k]
  ------------------
  167|  8.65k|        break;
  168|  18.9k|    }
  169|       |
  170|  65.7k|    while (p != q) {
  ------------------
  |  Branch (170:12): [True: 50.2k, False: 15.4k]
  ------------------
  171|  50.2k|        if (p == buf && flags & ASN1_STRFLGS_ESC_2253)
  ------------------
  |  |  441|  10.7k|# define ASN1_STRFLGS_ESC_2253           1
  ------------------
  |  Branch (171:13): [True: 10.7k, False: 39.5k]
  |  Branch (171:25): [True: 4.87k, False: 5.87k]
  ------------------
  172|  4.87k|            orflags = CHARTYPE_FIRST_ESC_2253;
  ------------------
  |  |  462|  4.87k|# define CHARTYPE_FIRST_ESC_2253         0x20
  ------------------
  173|  45.4k|        else
  174|  45.4k|            orflags = 0;
  175|       |
  176|  50.2k|        switch (charwidth) {
  177|    266|        case 4:
  ------------------
  |  Branch (177:9): [True: 266, False: 50.0k]
  ------------------
  178|    266|            c = ((unsigned long)*p++) << 24;
  179|    266|            c |= ((unsigned long)*p++) << 16;
  180|    266|            c |= ((unsigned long)*p++) << 8;
  181|    266|            c |= *p++;
  182|    266|            break;
  183|       |
  184|  37.4k|        case 2:
  ------------------
  |  Branch (184:9): [True: 37.4k, False: 12.8k]
  ------------------
  185|  37.4k|            c = ((unsigned long)*p++) << 8;
  186|  37.4k|            c |= *p++;
  187|  37.4k|            break;
  188|       |
  189|  3.21k|        case 1:
  ------------------
  |  Branch (189:9): [True: 3.21k, False: 47.0k]
  ------------------
  190|  3.21k|            c = *p++;
  191|  3.21k|            break;
  192|       |
  193|  9.34k|        case 0:
  ------------------
  |  Branch (193:9): [True: 9.34k, False: 40.9k]
  ------------------
  194|  9.34k|            i = UTF8_getc(p, buflen, &c);
  195|  9.34k|            if (i < 0)
  ------------------
  |  Branch (195:17): [True: 3.44k, False: 5.90k]
  ------------------
  196|  3.44k|                return -1;      /* Invalid UTF8String */
  197|  5.90k|            buflen -= i;
  198|  5.90k|            p += i;
  199|  5.90k|            break;
  200|      0|        default:
  ------------------
  |  Branch (200:9): [True: 0, False: 50.2k]
  ------------------
  201|      0|            return -1;          /* invalid width */
  202|  50.2k|        }
  203|  46.8k|        if (p == q && flags & ASN1_STRFLGS_ESC_2253)
  ------------------
  |  |  441|  7.30k|# define ASN1_STRFLGS_ESC_2253           1
  ------------------
  |  Branch (203:13): [True: 7.30k, False: 39.5k]
  |  Branch (203:23): [True: 4.87k, False: 2.43k]
  ------------------
  204|  4.87k|            orflags = CHARTYPE_LAST_ESC_2253;
  ------------------
  |  |  464|  4.87k|# define CHARTYPE_LAST_ESC_2253          0x40
  ------------------
  205|  46.8k|        if (type & BUF_TYPE_CONVUTF8) {
  ------------------
  |  |  131|  46.8k|#define BUF_TYPE_CONVUTF8       0x8
  ------------------
  |  Branch (205:13): [True: 39.4k, False: 7.38k]
  ------------------
  206|  39.4k|            unsigned char utfbuf[6];
  207|  39.4k|            int utflen;
  208|  39.4k|            utflen = UTF8_putc(utfbuf, sizeof(utfbuf), c);
  209|   146k|            for (i = 0; i < utflen; i++) {
  ------------------
  |  Branch (209:25): [True: 106k, False: 39.4k]
  ------------------
  210|       |                /*
  211|       |                 * We don't need to worry about setting orflags correctly
  212|       |                 * because if utflen==1 its value will be correct anyway
  213|       |                 * otherwise each character will be > 0x7f and so the
  214|       |                 * character will never be escaped on first and last.
  215|       |                 */
  216|   106k|                len = do_esc_char(utfbuf[i], flags | orflags, quotes,
  217|   106k|                                  io_ch, arg);
  218|   106k|                if (len < 0)
  ------------------
  |  Branch (218:21): [True: 0, False: 106k]
  ------------------
  219|      0|                    return -1;
  220|   106k|                outlen += len;
  221|   106k|            }
  222|  39.4k|        } else {
  223|  7.38k|            len = do_esc_char(c, flags | orflags, quotes,
  224|  7.38k|                              io_ch, arg);
  225|  7.38k|            if (len < 0)
  ------------------
  |  Branch (225:17): [True: 0, False: 7.38k]
  ------------------
  226|      0|                return -1;
  227|  7.38k|            outlen += len;
  228|  7.38k|        }
  229|  46.8k|    }
  230|  15.4k|    return outlen;
  231|  18.9k|}
a_strex.c:do_esc_char:
   69|   114k|{
   70|   114k|    unsigned short chflgs;
   71|   114k|    unsigned char chtmp;
   72|   114k|    char tmphex[HEX_SIZE(long) + 3];
   73|       |
   74|   114k|    if (c > 0xffffffffL)
  ------------------
  |  Branch (74:9): [True: 0, False: 114k]
  ------------------
   75|      0|        return -1;
   76|   114k|    if (c > 0xffff) {
  ------------------
  |  Branch (76:9): [True: 194, False: 114k]
  ------------------
   77|    194|        BIO_snprintf(tmphex, sizeof(tmphex), "\\W%08lX", c);
   78|    194|        if (!io_ch(arg, tmphex, 10))
  ------------------
  |  Branch (78:13): [True: 0, False: 194]
  ------------------
   79|      0|            return -1;
   80|    194|        return 10;
   81|    194|    }
   82|   114k|    if (c > 0xff) {
  ------------------
  |  Branch (82:9): [True: 1.07k, False: 112k]
  ------------------
   83|  1.07k|        BIO_snprintf(tmphex, sizeof(tmphex), "\\U%04lX", c);
   84|  1.07k|        if (!io_ch(arg, tmphex, 6))
  ------------------
  |  Branch (84:13): [True: 0, False: 1.07k]
  ------------------
   85|      0|            return -1;
   86|  1.07k|        return 6;
   87|  1.07k|    }
   88|   112k|    chtmp = (unsigned char)c;
   89|   112k|    if (chtmp > 0x7f)
  ------------------
  |  Branch (89:9): [True: 102k, False: 10.5k]
  ------------------
   90|   102k|        chflgs = flags & ASN1_STRFLGS_ESC_MSB;
  ------------------
  |  |  443|   102k|# define ASN1_STRFLGS_ESC_MSB            4
  ------------------
   91|  10.5k|    else
   92|  10.5k|        chflgs = char_type[chtmp] & flags;
   93|   112k|    if (chflgs & CHARTYPE_BS_ESC) {
  ------------------
  |  |   27|   112k|#define CHARTYPE_BS_ESC         (ASN1_STRFLGS_ESC_2253 | CHARTYPE_FIRST_ESC_2253 | CHARTYPE_LAST_ESC_2253)
  |  |  ------------------
  |  |  |  |  441|   112k|# define ASN1_STRFLGS_ESC_2253           1
  |  |  ------------------
  |  |               #define CHARTYPE_BS_ESC         (ASN1_STRFLGS_ESC_2253 | CHARTYPE_FIRST_ESC_2253 | CHARTYPE_LAST_ESC_2253)
  |  |  ------------------
  |  |  |  |  462|   112k|# define CHARTYPE_FIRST_ESC_2253         0x20
  |  |  ------------------
  |  |               #define CHARTYPE_BS_ESC         (ASN1_STRFLGS_ESC_2253 | CHARTYPE_FIRST_ESC_2253 | CHARTYPE_LAST_ESC_2253)
  |  |  ------------------
  |  |  |  |  464|   112k|# define CHARTYPE_LAST_ESC_2253          0x40
  |  |  ------------------
  ------------------
  |  Branch (93:9): [True: 2.02k, False: 110k]
  ------------------
   94|       |        /* If we don't escape with quotes, signal we need quotes */
   95|  2.02k|        if (chflgs & ASN1_STRFLGS_ESC_QUOTE) {
  ------------------
  |  |  455|  2.02k|# define ASN1_STRFLGS_ESC_QUOTE          8
  ------------------
  |  Branch (95:13): [True: 1.73k, False: 294]
  ------------------
   96|  1.73k|            if (do_quotes)
  ------------------
  |  Branch (96:17): [True: 866, False: 866]
  ------------------
   97|    866|                *do_quotes = 1;
   98|  1.73k|            if (!io_ch(arg, &chtmp, 1))
  ------------------
  |  Branch (98:17): [True: 0, False: 1.73k]
  ------------------
   99|      0|                return -1;
  100|  1.73k|            return 1;
  101|  1.73k|        }
  102|    294|        if (!io_ch(arg, "\\", 1))
  ------------------
  |  Branch (102:13): [True: 0, False: 294]
  ------------------
  103|      0|            return -1;
  104|    294|        if (!io_ch(arg, &chtmp, 1))
  ------------------
  |  Branch (104:13): [True: 0, False: 294]
  ------------------
  105|      0|            return -1;
  106|    294|        return 2;
  107|    294|    }
  108|   110k|    if (chflgs & (ASN1_STRFLGS_ESC_CTRL
  ------------------
  |  |  442|   110k|# define ASN1_STRFLGS_ESC_CTRL           2
  ------------------
  |  Branch (108:9): [True: 106k, False: 4.90k]
  ------------------
  109|   110k|                  | ASN1_STRFLGS_ESC_MSB
  ------------------
  |  |  443|   110k|# define ASN1_STRFLGS_ESC_MSB            4
  ------------------
  110|   110k|                  | ASN1_STRFLGS_ESC_2254)) {
  ------------------
  |  |  509|   110k|#define ASN1_STRFLGS_ESC_2254           0x400
  ------------------
  111|   106k|        BIO_snprintf(tmphex, 11, "\\%02X", chtmp);
  112|   106k|        if (!io_ch(arg, tmphex, 3))
  ------------------
  |  Branch (112:13): [True: 0, False: 106k]
  ------------------
  113|      0|            return -1;
  114|   106k|        return 3;
  115|   106k|    }
  116|       |    /*
  117|       |     * If we get this far and do any escaping at all must escape the escape
  118|       |     * character itself: backslash.
  119|       |     */
  120|  4.90k|    if (chtmp == '\\' && (flags & ESC_FLAGS)) {
  ------------------
  |  |   29|    227|#define ESC_FLAGS (ASN1_STRFLGS_ESC_2253 | \
  |  |  ------------------
  |  |  |  |  441|    227|# define ASN1_STRFLGS_ESC_2253           1
  |  |  ------------------
  |  |   30|    227|                  ASN1_STRFLGS_ESC_2254 | \
  |  |  ------------------
  |  |  |  |  509|    227|#define ASN1_STRFLGS_ESC_2254           0x400
  |  |  ------------------
  |  |   31|    227|                  ASN1_STRFLGS_ESC_QUOTE | \
  |  |  ------------------
  |  |  |  |  455|    227|# define ASN1_STRFLGS_ESC_QUOTE          8
  |  |  ------------------
  |  |   32|    227|                  ASN1_STRFLGS_ESC_CTRL | \
  |  |  ------------------
  |  |  |  |  442|    227|# define ASN1_STRFLGS_ESC_CTRL           2
  |  |  ------------------
  |  |   33|    227|                  ASN1_STRFLGS_ESC_MSB)
  |  |  ------------------
  |  |  |  |  443|    227|# define ASN1_STRFLGS_ESC_MSB            4
  |  |  ------------------
  ------------------
  |  Branch (120:9): [True: 227, False: 4.67k]
  |  Branch (120:26): [True: 0, False: 227]
  ------------------
  121|      0|        if (!io_ch(arg, "\\\\", 2))
  ------------------
  |  Branch (121:13): [True: 0, False: 0]
  ------------------
  122|      0|            return -1;
  123|      0|        return 2;
  124|      0|    }
  125|  4.90k|    if (!io_ch(arg, &chtmp, 1))
  ------------------
  |  Branch (125:9): [True: 0, False: 4.90k]
  ------------------
  126|      0|        return -1;
  127|  4.90k|    return 1;
  128|  4.90k|}

ossl_asn1_time_to_tm:
   77|  19.9k|{
   78|  19.9k|    static const int min[9] = { 0, 0, 1, 1, 0, 0, 0, 0, 0 };
   79|  19.9k|    static const int max[9] = { 99, 99, 12, 31, 23, 59, 59, 12, 59 };
   80|  19.9k|    static const int mdays[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
   81|  19.9k|    char *a;
   82|  19.9k|    int n, i, i2, l, o, min_l, strict = 0, end = 6, btz = 5, md;
   83|  19.9k|    struct tm tmp;
   84|       |#if defined(CHARSET_EBCDIC)
   85|       |    const char upper_z = 0x5A, num_zero = 0x30, period = 0x2E, minus = 0x2D, plus = 0x2B;
   86|       |#else
   87|  19.9k|    const char upper_z = 'Z', num_zero = '0', period = '.', minus = '-', plus = '+';
   88|  19.9k|#endif
   89|       |    /*
   90|       |     * ASN1_STRING_FLAG_X509_TIME is used to enforce RFC 5280
   91|       |     * time string format, in which:
   92|       |     *
   93|       |     * 1. "seconds" is a 'MUST'
   94|       |     * 2. "Zulu" timezone is a 'MUST'
   95|       |     * 3. "+|-" is not allowed to indicate a timezone
   96|       |     */
   97|  19.9k|    if (d->type == V_ASN1_UTCTIME) {
  ------------------
  |  |   82|  19.9k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (97:9): [True: 1.92k, False: 18.0k]
  ------------------
   98|  1.92k|        min_l = 13;
   99|  1.92k|        if (d->flags & ASN1_STRING_FLAG_X509_TIME) {
  ------------------
  |  |  184|  1.92k|# define ASN1_STRING_FLAG_X509_TIME 0x100
  ------------------
  |  Branch (99:13): [True: 0, False: 1.92k]
  ------------------
  100|      0|            strict = 1;
  101|      0|        }
  102|  18.0k|    } else if (d->type == V_ASN1_GENERALIZEDTIME) {
  ------------------
  |  |   83|  18.0k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (102:16): [True: 18.0k, False: 0]
  ------------------
  103|  18.0k|        end = 7;
  104|  18.0k|        btz = 6;
  105|  18.0k|        min_l = 15;
  106|  18.0k|        if (d->flags & ASN1_STRING_FLAG_X509_TIME) {
  ------------------
  |  |  184|  18.0k|# define ASN1_STRING_FLAG_X509_TIME 0x100
  ------------------
  |  Branch (106:13): [True: 0, False: 18.0k]
  ------------------
  107|      0|            strict = 1;
  108|      0|        }
  109|  18.0k|    } else {
  110|      0|        return 0;
  111|      0|    }
  112|       |
  113|  19.9k|    l = d->length;
  114|  19.9k|    a = (char *)d->data;
  115|  19.9k|    o = 0;
  116|  19.9k|    memset(&tmp, 0, sizeof(tmp));
  117|       |
  118|       |    /*
  119|       |     * GENERALIZEDTIME is similar to UTCTIME except the year is represented
  120|       |     * as YYYY. This stuff treats everything as a two digit field so make
  121|       |     * first two fields 00 to 99
  122|       |     */
  123|       |
  124|  19.9k|    if (l < min_l)
  ------------------
  |  Branch (124:9): [True: 0, False: 19.9k]
  ------------------
  125|      0|        goto err;
  126|  99.4k|    for (i = 0; i < end; i++) {
  ------------------
  |  Branch (126:17): [True: 95.3k, False: 4.01k]
  ------------------
  127|  95.3k|        if (!strict && (i == btz) && ((a[o] == upper_z) || (a[o] == plus) || (a[o] == minus))) {
  ------------------
  |  Branch (127:13): [True: 95.3k, False: 0]
  |  Branch (127:24): [True: 9.79k, False: 85.6k]
  |  Branch (127:39): [True: 14, False: 9.78k]
  |  Branch (127:60): [True: 692, False: 9.08k]
  |  Branch (127:78): [True: 4.83k, False: 4.25k]
  ------------------
  128|  5.54k|            i++;
  129|  5.54k|            break;
  130|  5.54k|        }
  131|  89.8k|        if (!ossl_ascii_isdigit(a[o]))
  ------------------
  |  Branch (131:13): [True: 2.56k, False: 87.2k]
  ------------------
  132|  2.56k|            goto err;
  133|  87.2k|        n = a[o] - num_zero;
  134|       |        /* incomplete 2-digital number */
  135|  87.2k|        if (++o == l)
  ------------------
  |  Branch (135:13): [True: 0, False: 87.2k]
  ------------------
  136|      0|            goto err;
  137|       |
  138|  87.2k|        if (!ossl_ascii_isdigit(a[o]))
  ------------------
  |  Branch (138:13): [True: 6.22k, False: 81.0k]
  ------------------
  139|  6.22k|            goto err;
  140|  81.0k|        n = (n * 10) + a[o] - num_zero;
  141|       |        /* no more bytes to read, but we haven't seen time-zone yet */
  142|  81.0k|        if (++o == l)
  ------------------
  |  Branch (142:13): [True: 0, False: 81.0k]
  ------------------
  143|      0|            goto err;
  144|       |
  145|  81.0k|        i2 = (d->type == V_ASN1_UTCTIME) ? i + 1 : i;
  ------------------
  |  |   82|  81.0k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (145:14): [True: 9.72k, False: 71.3k]
  ------------------
  146|       |
  147|  81.0k|        if ((n < min[i2]) || (n > max[i2]))
  ------------------
  |  Branch (147:13): [True: 31, False: 81.0k]
  |  Branch (147:30): [True: 1.42k, False: 79.6k]
  ------------------
  148|  1.45k|            goto err;
  149|  79.6k|        switch (i2) {
  ------------------
  |  Branch (149:17): [True: 0, False: 79.6k]
  ------------------
  150|  16.9k|        case 0:
  ------------------
  |  Branch (150:9): [True: 16.9k, False: 62.6k]
  ------------------
  151|       |            /* UTC will never be here */
  152|  16.9k|            tmp.tm_year = n * 100 - 1900;
  153|  16.9k|            break;
  154|  17.2k|        case 1:
  ------------------
  |  Branch (154:9): [True: 17.2k, False: 62.4k]
  ------------------
  155|  17.2k|            if (d->type == V_ASN1_UTCTIME)
  ------------------
  |  |   82|  17.2k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (155:17): [True: 1.76k, False: 15.4k]
  ------------------
  156|  1.76k|                tmp.tm_year = n < 50 ? n + 100 : n;
  ------------------
  |  Branch (156:31): [True: 1.39k, False: 374]
  ------------------
  157|  15.4k|            else
  158|  15.4k|                tmp.tm_year += n;
  159|  17.2k|            break;
  160|  11.7k|        case 2:
  ------------------
  |  Branch (160:9): [True: 11.7k, False: 67.8k]
  ------------------
  161|  11.7k|            tmp.tm_mon = n - 1;
  162|  11.7k|            break;
  163|  10.0k|        case 3:
  ------------------
  |  Branch (163:9): [True: 10.0k, False: 69.5k]
  ------------------
  164|       |            /* check if tm_mday is valid in tm_mon */
  165|  10.0k|            if (tmp.tm_mon == 1) {
  ------------------
  |  Branch (165:17): [True: 1.16k, False: 8.92k]
  ------------------
  166|       |                /* it's February */
  167|  1.16k|                md = mdays[1] + leap_year(tmp.tm_year + 1900);
  168|  8.92k|            } else {
  169|  8.92k|                md = mdays[tmp.tm_mon];
  170|  8.92k|            }
  171|  10.0k|            if (n > md)
  ------------------
  |  Branch (171:17): [True: 172, False: 9.92k]
  ------------------
  172|    172|                goto err;
  173|  9.92k|            tmp.tm_mday = n;
  174|  9.92k|            determine_days(&tmp);
  175|  9.92k|            break;
  176|  9.81k|        case 4:
  ------------------
  |  Branch (176:9): [True: 9.81k, False: 69.7k]
  ------------------
  177|  9.81k|            tmp.tm_hour = n;
  178|  9.81k|            break;
  179|  9.79k|        case 5:
  ------------------
  |  Branch (179:9): [True: 9.79k, False: 69.8k]
  ------------------
  180|  9.79k|            tmp.tm_min = n;
  181|  9.79k|            break;
  182|  4.01k|        case 6:
  ------------------
  |  Branch (182:9): [True: 4.01k, False: 75.5k]
  ------------------
  183|  4.01k|            tmp.tm_sec = n;
  184|  4.01k|            break;
  185|  79.6k|        }
  186|  79.6k|    }
  187|       |
  188|       |    /*
  189|       |     * Optional fractional seconds: decimal point followed by one or more
  190|       |     * digits.
  191|       |     */
  192|  9.55k|    if (d->type == V_ASN1_GENERALIZEDTIME && a[o] == period) {
  ------------------
  |  |   83|  19.1k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (192:9): [True: 7.93k, False: 1.61k]
  |  Branch (192:46): [True: 1.24k, False: 6.69k]
  ------------------
  193|  1.24k|        if (strict)
  ------------------
  |  Branch (193:13): [True: 0, False: 1.24k]
  ------------------
  194|       |            /* RFC 5280 forbids fractional seconds */
  195|      0|            goto err;
  196|  1.24k|        if (++o == l)
  ------------------
  |  Branch (196:13): [True: 11, False: 1.23k]
  ------------------
  197|     11|            goto err;
  198|  1.23k|        i = o;
  199|  14.4k|        while ((o < l) && ossl_ascii_isdigit(a[o]))
  ------------------
  |  Branch (199:16): [True: 14.4k, False: 24]
  |  Branch (199:27): [True: 13.2k, False: 1.20k]
  ------------------
  200|  13.2k|            o++;
  201|       |        /* Must have at least one digit after decimal point */
  202|  1.23k|        if (i == o)
  ------------------
  |  Branch (202:13): [True: 13, False: 1.21k]
  ------------------
  203|     13|            goto err;
  204|       |        /* no more bytes to read, but we haven't seen time-zone yet */
  205|  1.21k|        if (o == l)
  ------------------
  |  Branch (205:13): [True: 24, False: 1.19k]
  ------------------
  206|     24|            goto err;
  207|  1.21k|    }
  208|       |
  209|       |    /*
  210|       |     * 'o' will never point to '\0' at this point, the only chance
  211|       |     * 'o' can point to '\0' is either the subsequent if or the first
  212|       |     * else if is true.
  213|       |     */
  214|  9.50k|    if (a[o] == upper_z) {
  ------------------
  |  Branch (214:9): [True: 1.47k, False: 8.02k]
  ------------------
  215|  1.47k|        o++;
  216|  8.02k|    } else if (!strict && ((a[o] == plus) || (a[o] == minus))) {
  ------------------
  |  Branch (216:16): [True: 8.02k, False: 0]
  |  Branch (216:28): [True: 1.80k, False: 6.22k]
  |  Branch (216:46): [True: 4.84k, False: 1.38k]
  ------------------
  217|  6.64k|        int offsign = a[o] == minus ? 1 : -1;
  ------------------
  |  Branch (217:23): [True: 4.84k, False: 1.80k]
  ------------------
  218|  6.64k|        int offset = 0;
  219|       |
  220|  6.64k|        o++;
  221|       |        /*
  222|       |         * if not equal, no need to do subsequent checks
  223|       |         * since the following for-loop will add 'o' by 4
  224|       |         * and the final return statement will check if 'l'
  225|       |         * and 'o' are equal.
  226|       |         */
  227|  6.64k|        if (o + 4 != l)
  ------------------
  |  Branch (227:13): [True: 58, False: 6.58k]
  ------------------
  228|     58|            goto err;
  229|  12.9k|        for (i = end; i < end + 2; i++) {
  ------------------
  |  Branch (229:23): [True: 10.9k, False: 2.05k]
  ------------------
  230|  10.9k|            if (!ossl_ascii_isdigit(a[o]))
  ------------------
  |  Branch (230:17): [True: 1.31k, False: 9.58k]
  ------------------
  231|  1.31k|                goto err;
  232|  9.58k|            n = a[o] - num_zero;
  233|  9.58k|            o++;
  234|  9.58k|            if (!ossl_ascii_isdigit(a[o]))
  ------------------
  |  Branch (234:17): [True: 2.34k, False: 7.24k]
  ------------------
  235|  2.34k|                goto err;
  236|  7.24k|            n = (n * 10) + a[o] - num_zero;
  237|  7.24k|            i2 = (d->type == V_ASN1_UTCTIME) ? i + 1 : i;
  ------------------
  |  |   82|  7.24k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (237:18): [True: 769, False: 6.47k]
  ------------------
  238|  7.24k|            if ((n < min[i2]) || (n > max[i2]))
  ------------------
  |  Branch (238:17): [True: 0, False: 7.24k]
  |  Branch (238:34): [True: 867, False: 6.37k]
  ------------------
  239|    867|                goto err;
  240|       |            /* if tm is NULL, no need to adjust */
  241|  6.37k|            if (tm != NULL) {
  ------------------
  |  Branch (241:17): [True: 6.37k, False: 0]
  ------------------
  242|  6.37k|                if (i == end)
  ------------------
  |  Branch (242:21): [True: 4.31k, False: 2.05k]
  ------------------
  243|  4.31k|                    offset = n * 3600;
  244|  2.05k|                else if (i == end + 1)
  ------------------
  |  Branch (244:26): [True: 2.05k, False: 0]
  ------------------
  245|  2.05k|                    offset += n * 60;
  246|  6.37k|            }
  247|  6.37k|            o++;
  248|  6.37k|        }
  249|  2.05k|        if (offset && !OPENSSL_gmtime_adj(&tmp, 0, offset * offsign))
  ------------------
  |  Branch (249:13): [True: 1.86k, False: 196]
  |  Branch (249:23): [True: 230, False: 1.63k]
  ------------------
  250|    230|            goto err;
  251|  2.05k|    } else {
  252|       |        /* not Z, or not +/- in non-strict mode */
  253|  1.38k|        goto err;
  254|  1.38k|    }
  255|  3.30k|    if (o == l) {
  ------------------
  |  Branch (255:9): [True: 3.28k, False: 19]
  ------------------
  256|       |        /* success, check if tm should be filled */
  257|  3.28k|        if (tm != NULL)
  ------------------
  |  Branch (257:13): [True: 3.28k, False: 0]
  ------------------
  258|  3.28k|            *tm = tmp;
  259|  3.28k|        return 1;
  260|  3.28k|    }
  261|  16.6k| err:
  262|  16.6k|    return 0;
  263|  3.30k|}
ASN1_TIME_print:
  477|  19.9k|{
  478|  19.9k|    return ASN1_TIME_print_ex(bp, tm, ASN1_DTFLGS_RFC822);
  ------------------
  |  |  447|  19.9k|# define ASN1_DTFLGS_RFC822       0x00UL
  ------------------
  479|  19.9k|}
ASN1_TIME_print_ex:
  483|  19.9k|{
  484|  19.9k|    return ossl_asn1_time_print_ex(bp, tm, flags) > 0;
  485|  19.9k|}
ossl_asn1_time_print_ex:
  491|  19.9k|{
  492|  19.9k|    char *v;
  493|  19.9k|    int l;
  494|  19.9k|    struct tm stm;
  495|  19.9k|    const char period = 0x2E;
  496|       |
  497|       |    /* ossl_asn1_time_to_tm will check the time type */
  498|  19.9k|    if (!ossl_asn1_time_to_tm(&stm, tm))
  ------------------
  |  Branch (498:9): [True: 16.6k, False: 3.28k]
  ------------------
  499|  16.6k|        return BIO_write(bp, "Bad time value", 14) ? -1 : 0;
  ------------------
  |  Branch (499:16): [True: 16.6k, False: 0]
  ------------------
  500|       |
  501|  3.28k|    l = tm->length;
  502|  3.28k|    v = (char *)tm->data;
  503|       |
  504|  3.28k|    if (tm->type == V_ASN1_GENERALIZEDTIME) {
  ------------------
  |  |   83|  3.28k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (504:9): [True: 1.76k, False: 1.52k]
  ------------------
  505|  1.76k|        char *f = NULL;
  506|  1.76k|        int f_len = 0;
  507|       |
  508|       |        /*
  509|       |         * Try to parse fractional seconds. '14' is the place of
  510|       |         * 'fraction point' in a GeneralizedTime string.
  511|       |         */
  512|  1.76k|        if (tm->length > 15 && v[14] == period) {
  ------------------
  |  Branch (512:13): [True: 1.50k, False: 260]
  |  Branch (512:32): [True: 1.09k, False: 404]
  ------------------
  513|       |            /* exclude the . itself */
  514|  1.09k|            f = &v[15];
  515|  1.09k|            f_len = 0;
  516|  13.7k|            while (15 + f_len < l && ossl_ascii_isdigit(f[f_len]))
  ------------------
  |  Branch (516:20): [True: 13.7k, False: 0]
  |  Branch (516:38): [True: 12.6k, False: 1.09k]
  ------------------
  517|  12.6k|                ++f_len;
  518|  1.09k|        }
  519|       |
  520|  1.76k|        if (f_len > 0) {
  ------------------
  |  Branch (520:13): [True: 1.09k, False: 664]
  ------------------
  521|  1.09k|            if ((flags & ASN1_DTFLGS_TYPE_MASK) == ASN1_DTFLGS_ISO8601) {
  ------------------
  |  |  446|  1.09k|# define ASN1_DTFLGS_TYPE_MASK    0x0FUL
  ------------------
                          if ((flags & ASN1_DTFLGS_TYPE_MASK) == ASN1_DTFLGS_ISO8601) {
  ------------------
  |  |  448|  1.09k|# define ASN1_DTFLGS_ISO8601      0x01UL
  ------------------
  |  Branch (521:17): [True: 0, False: 1.09k]
  ------------------
  522|      0|                return BIO_printf(bp, "%4d-%02d-%02d %02d:%02d:%02d.%.*sZ",
  523|      0|                                  stm.tm_year + 1900, stm.tm_mon + 1,
  524|      0|                                  stm.tm_mday, stm.tm_hour,
  525|      0|                                  stm.tm_min, stm.tm_sec, f_len, f) > 0;
  526|  1.09k|            } else {
  527|  1.09k|                return BIO_printf(bp, "%s %2d %02d:%02d:%02d.%.*s %d GMT",
  528|  1.09k|                                  _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour,
  529|  1.09k|                                  stm.tm_min, stm.tm_sec, f_len, f,
  530|  1.09k|                                  stm.tm_year + 1900) > 0;
  531|  1.09k|            }
  532|  1.09k|        }
  533|  1.76k|    }
  534|  2.18k|    if ((flags & ASN1_DTFLGS_TYPE_MASK) == ASN1_DTFLGS_ISO8601) {
  ------------------
  |  |  446|  2.18k|# define ASN1_DTFLGS_TYPE_MASK    0x0FUL
  ------------------
                  if ((flags & ASN1_DTFLGS_TYPE_MASK) == ASN1_DTFLGS_ISO8601) {
  ------------------
  |  |  448|  2.18k|# define ASN1_DTFLGS_ISO8601      0x01UL
  ------------------
  |  Branch (534:9): [True: 0, False: 2.18k]
  ------------------
  535|      0|        return BIO_printf(bp, "%4d-%02d-%02d %02d:%02d:%02dZ",
  536|      0|                          stm.tm_year + 1900, stm.tm_mon + 1,
  537|      0|                          stm.tm_mday, stm.tm_hour,
  538|      0|                          stm.tm_min, stm.tm_sec) > 0;
  539|  2.18k|    } else {
  540|  2.18k|        return BIO_printf(bp, "%s %2d %02d:%02d:%02d %d GMT",
  541|  2.18k|                          _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour,
  542|  2.18k|                          stm.tm_min, stm.tm_sec, stm.tm_year + 1900) > 0;
  543|  2.18k|    }
  544|  2.18k|}
a_time.c:leap_year:
   38|  9.62k|{
   39|  9.62k|    if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0))
  ------------------
  |  Branch (39:9): [True: 744, False: 8.88k]
  |  Branch (39:29): [True: 8.20k, False: 685]
  |  Branch (39:48): [True: 548, False: 7.65k]
  ------------------
   40|  1.29k|        return 1;
   41|  8.33k|    return 0;
   42|  9.62k|}
a_time.c:determine_days:
   51|  9.92k|{
   52|  9.92k|    static const int ydays[12] = {
   53|  9.92k|        0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
   54|  9.92k|    };
   55|  9.92k|    int y = tm->tm_year + 1900;
   56|  9.92k|    int m = tm->tm_mon;
   57|  9.92k|    int d = tm->tm_mday;
   58|  9.92k|    int c;
   59|       |
   60|  9.92k|    tm->tm_yday = ydays[m] + d - 1;
   61|  9.92k|    if (m >= 2) {
  ------------------
  |  Branch (61:9): [True: 8.46k, False: 1.45k]
  ------------------
   62|       |        /* March and onwards can be one day further into the year */
   63|  8.46k|        tm->tm_yday += leap_year(y);
   64|  8.46k|        m += 2;
   65|  8.46k|    } else {
   66|       |        /* Treat January and February as part of the previous year */
   67|  1.45k|        m += 14;
   68|  1.45k|        y--;
   69|  1.45k|    }
   70|  9.92k|    c = y / 100;
   71|  9.92k|    y %= 100;
   72|       |    /* Zeller's congruence */
   73|  9.92k|    tm->tm_wday = (d + (13 * m) / 5 + y + y / 4 + c / 4 + 5 * c + 6) % 7;
   74|  9.92k|}

ASN1_TYPE_set:
   27|  1.59M|{
   28|  1.59M|    if (a->type != V_ASN1_BOOLEAN
  ------------------
  |  |   63|  3.19M|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (28:9): [True: 1.59M, False: 0]
  ------------------
   29|  1.59M|            && a->type != V_ASN1_NULL
  ------------------
  |  |   67|  3.19M|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (29:16): [True: 1.59M, False: 0]
  ------------------
   30|  1.59M|            && a->value.ptr != NULL) {
  ------------------
  |  Branch (30:16): [True: 0, False: 1.59M]
  ------------------
   31|      0|        ASN1_TYPE **tmp_a = &a;
   32|      0|        ossl_asn1_primitive_free((ASN1_VALUE **)tmp_a, NULL, 0);
   33|      0|    }
   34|  1.59M|    a->type = type;
   35|  1.59M|    if (type == V_ASN1_BOOLEAN)
  ------------------
  |  |   63|  1.59M|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (35:9): [True: 991, False: 1.59M]
  ------------------
   36|    991|        a->value.boolean = value ? 0xff : 0;
  ------------------
  |  Branch (36:28): [True: 0, False: 991]
  ------------------
   37|  1.59M|    else
   38|  1.59M|        a->value.ptr = value;
   39|  1.59M|}
ASN1_TYPE_unpack_sequence:
  134|      9|{
  135|      9|    if (t == NULL || t->type != V_ASN1_SEQUENCE || t->value.sequence == NULL)
  ------------------
  |  |   74|     18|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (135:9): [True: 0, False: 9]
  |  Branch (135:22): [True: 0, False: 9]
  |  Branch (135:52): [True: 0, False: 9]
  ------------------
  136|      0|        return NULL;
  137|      9|    return ASN1_item_unpack(t->value.sequence, it);
  138|      9|}

ASN1_UTCTIME_print:
   97|  1.92k|{
   98|  1.92k|    if (tm->type != V_ASN1_UTCTIME)
  ------------------
  |  |   82|  1.92k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (98:9): [True: 0, False: 1.92k]
  ------------------
   99|      0|        return 0;
  100|  1.92k|    return ASN1_TIME_print(bp, tm);
  101|  1.92k|}

UTF8_getc:
   29|  17.1k|{
   30|  17.1k|    const unsigned char *p;
   31|  17.1k|    unsigned long value;
   32|  17.1k|    int ret;
   33|  17.1k|    if (len <= 0)
  ------------------
  |  Branch (33:9): [True: 0, False: 17.1k]
  ------------------
   34|      0|        return 0;
   35|  17.1k|    p = str;
   36|       |
   37|       |    /* Check syntax and work out the encoded value (if correct) */
   38|  17.1k|    if ((*p & 0x80) == 0) {
  ------------------
  |  Branch (38:9): [True: 11.0k, False: 6.16k]
  ------------------
   39|  11.0k|        value = *p++ & 0x7f;
   40|  11.0k|        ret = 1;
   41|  11.0k|    } else if ((*p & 0xe0) == 0xc0) {
  ------------------
  |  Branch (41:16): [True: 1.55k, False: 4.61k]
  ------------------
   42|  1.55k|        if (len < 2)
  ------------------
  |  Branch (42:13): [True: 386, False: 1.16k]
  ------------------
   43|    386|            return -1;
   44|  1.16k|        if ((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (44:13): [True: 272, False: 892]
  ------------------
   45|    272|            return -3;
   46|    892|        value = (*p++ & 0x1f) << 6;
   47|    892|        value |= *p++ & 0x3f;
   48|    892|        if (value < 0x80)
  ------------------
  |  Branch (48:13): [True: 194, False: 698]
  ------------------
   49|    194|            return -4;
   50|    698|        ret = 2;
   51|  4.61k|    } else if ((*p & 0xf0) == 0xe0) {
  ------------------
  |  Branch (51:16): [True: 2.40k, False: 2.20k]
  ------------------
   52|  2.40k|        if (len < 3)
  ------------------
  |  Branch (52:13): [True: 280, False: 2.12k]
  ------------------
   53|    280|            return -1;
   54|  2.12k|        if (((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (54:13): [True: 205, False: 1.92k]
  ------------------
   55|  2.12k|            || ((p[2] & 0xc0) != 0x80))
  ------------------
  |  Branch (55:16): [True: 231, False: 1.69k]
  ------------------
   56|    436|            return -3;
   57|  1.69k|        value = (*p++ & 0xf) << 12;
   58|  1.69k|        value |= (*p++ & 0x3f) << 6;
   59|  1.69k|        value |= *p++ & 0x3f;
   60|  1.69k|        if (value < 0x800)
  ------------------
  |  Branch (60:13): [True: 197, False: 1.49k]
  ------------------
   61|    197|            return -4;
   62|  1.49k|        if (is_unicode_surrogate(value))
  ------------------
  |  Branch (62:13): [True: 229, False: 1.26k]
  ------------------
   63|    229|            return -2;
   64|  1.26k|        ret = 3;
   65|  2.20k|    } else if ((*p & 0xf8) == 0xf0) {
  ------------------
  |  Branch (65:16): [True: 1.73k, False: 469]
  ------------------
   66|  1.73k|        if (len < 4)
  ------------------
  |  Branch (66:13): [True: 233, False: 1.50k]
  ------------------
   67|    233|            return -1;
   68|  1.50k|        if (((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (68:13): [True: 219, False: 1.28k]
  ------------------
   69|  1.50k|            || ((p[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (69:16): [True: 204, False: 1.08k]
  ------------------
   70|  1.50k|            || ((p[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (70:16): [True: 195, False: 888]
  ------------------
   71|    618|            return -3;
   72|    888|        value = ((unsigned long)(*p++ & 0x7)) << 18;
   73|    888|        value |= (*p++ & 0x3f) << 12;
   74|    888|        value |= (*p++ & 0x3f) << 6;
   75|    888|        value |= *p++ & 0x3f;
   76|    888|        if (value < 0x10000)
  ------------------
  |  Branch (76:13): [True: 195, False: 693]
  ------------------
   77|    195|            return -4;
   78|    693|        ret = 4;
   79|    693|    } else
   80|    469|        return -2;
   81|  13.6k|    *val = value;
   82|  13.6k|    return ret;
   83|  17.1k|}
UTF8_putc:
   94|  25.0M|{
   95|  25.0M|    if (!str)
  ------------------
  |  Branch (95:9): [True: 12.4M, False: 12.5M]
  ------------------
   96|  12.4M|        len = 4;                /* Maximum we will need */
   97|  12.5M|    else if (len <= 0)
  ------------------
  |  Branch (97:14): [True: 0, False: 12.5M]
  ------------------
   98|      0|        return -1;
   99|  25.0M|    if (value < 0x80) {
  ------------------
  |  Branch (99:9): [True: 1.10M, False: 23.9M]
  ------------------
  100|  1.10M|        if (str)
  ------------------
  |  Branch (100:13): [True: 554k, False: 549k]
  ------------------
  101|   554k|            *str = (unsigned char)value;
  102|  1.10M|        return 1;
  103|  1.10M|    }
  104|  23.9M|    if (value < 0x800) {
  ------------------
  |  Branch (104:9): [True: 23.8M, False: 36.9k]
  ------------------
  105|  23.8M|        if (len < 2)
  ------------------
  |  Branch (105:13): [True: 0, False: 23.8M]
  ------------------
  106|      0|            return -1;
  107|  23.8M|        if (str) {
  ------------------
  |  Branch (107:13): [True: 11.9M, False: 11.9M]
  ------------------
  108|  11.9M|            *str++ = (unsigned char)(((value >> 6) & 0x1f) | 0xc0);
  109|  11.9M|            *str = (unsigned char)((value & 0x3f) | 0x80);
  110|  11.9M|        }
  111|  23.8M|        return 2;
  112|  23.8M|    }
  113|  36.9k|    if (value < 0x10000) {
  ------------------
  |  Branch (113:9): [True: 35.8k, False: 1.11k]
  ------------------
  114|  35.8k|        if (is_unicode_surrogate(value))
  ------------------
  |  Branch (114:13): [True: 120, False: 35.7k]
  ------------------
  115|    120|            return -2;
  116|  35.7k|        if (len < 3)
  ------------------
  |  Branch (116:13): [True: 0, False: 35.7k]
  ------------------
  117|      0|            return -1;
  118|  35.7k|        if (str) {
  ------------------
  |  Branch (118:13): [True: 34.6k, False: 1.10k]
  ------------------
  119|  34.6k|            *str++ = (unsigned char)(((value >> 12) & 0xf) | 0xe0);
  120|  34.6k|            *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80);
  121|  34.6k|            *str = (unsigned char)((value & 0x3f) | 0x80);
  122|  34.6k|        }
  123|  35.7k|        return 3;
  124|  35.7k|    }
  125|  1.11k|    if (value < UNICODE_LIMIT) {
  ------------------
  |  Branch (125:9): [True: 864, False: 252]
  ------------------
  126|    864|        if (len < 4)
  ------------------
  |  Branch (126:13): [True: 0, False: 864]
  ------------------
  127|      0|            return -1;
  128|    864|        if (str) {
  ------------------
  |  Branch (128:13): [True: 433, False: 431]
  ------------------
  129|    433|            *str++ = (unsigned char)(((value >> 18) & 0x7) | 0xf0);
  130|    433|            *str++ = (unsigned char)(((value >> 12) & 0x3f) | 0x80);
  131|    433|            *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80);
  132|    433|            *str = (unsigned char)((value & 0x3f) | 0x80);
  133|    433|        }
  134|    864|        return 4;
  135|    864|    }
  136|    252|    return -2;
  137|  1.11k|}

EVP_PKEY_asn1_get_count:
   39|  34.9k|{
   40|  34.9k|    int num = OSSL_NELEM(standard_methods);
  ------------------
  |  |   14|  34.9k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   41|  34.9k|    if (app_methods)
  ------------------
  |  Branch (41:9): [True: 0, False: 34.9k]
  ------------------
   42|      0|        num += sk_EVP_PKEY_ASN1_METHOD_num(app_methods);
   43|  34.9k|    return num;
   44|  34.9k|}
EVP_PKEY_asn1_get0:
   47|   412k|{
   48|   412k|    int num = OSSL_NELEM(standard_methods);
  ------------------
  |  |   14|   412k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   49|   412k|    if (idx < 0)
  ------------------
  |  Branch (49:9): [True: 0, False: 412k]
  ------------------
   50|      0|        return NULL;
   51|   412k|    if (idx < num)
  ------------------
  |  Branch (51:9): [True: 412k, False: 0]
  ------------------
   52|   412k|        return standard_methods[idx];
   53|      0|    idx -= num;
   54|      0|    return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
   55|   412k|}
EVP_PKEY_asn1_find:
   82|  49.0k|{
   83|  49.0k|    const EVP_PKEY_ASN1_METHOD *t;
   84|       |
   85|  49.0k|    for (;;) {
   86|  49.0k|        t = pkey_asn1_find(type);
   87|  49.0k|        if (!t || !(t->pkey_flags & ASN1_PKEY_ALIAS))
  ------------------
  |  | 1606|  48.8k|# define ASN1_PKEY_ALIAS         0x1
  ------------------
  |  Branch (87:13): [True: 168, False: 48.8k]
  |  Branch (87:19): [True: 48.8k, False: 15]
  ------------------
   88|  49.0k|            break;
   89|     15|        type = t->pkey_base_id;
   90|     15|    }
   91|  49.0k|    if (pe) {
  ------------------
  |  Branch (91:9): [True: 49.0k, False: 0]
  ------------------
   92|  49.0k|#ifndef OPENSSL_NO_ENGINE
   93|  49.0k|        ENGINE *e;
   94|       |        /* type will contain the final unaliased type */
   95|  49.0k|        e = ENGINE_get_pkey_asn1_meth_engine(type);
   96|  49.0k|        if (e) {
  ------------------
  |  Branch (96:13): [True: 0, False: 49.0k]
  ------------------
   97|      0|            *pe = e;
   98|      0|            return ENGINE_get_pkey_asn1_meth(e, type);
   99|      0|        }
  100|  49.0k|#endif
  101|  49.0k|        *pe = NULL;
  102|  49.0k|    }
  103|  49.0k|    return t;
  104|  49.0k|}
EVP_PKEY_asn1_find_str:
  108|  34.9k|{
  109|  34.9k|    int i;
  110|  34.9k|    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
  111|       |
  112|  34.9k|    if (len == -1)
  ------------------
  |  Branch (112:9): [True: 0, False: 34.9k]
  ------------------
  113|      0|        len = strlen(str);
  114|  34.9k|    if (pe) {
  ------------------
  |  Branch (114:9): [True: 34.9k, False: 0]
  ------------------
  115|  34.9k|#ifndef OPENSSL_NO_ENGINE
  116|  34.9k|        ENGINE *e;
  117|  34.9k|        ameth = ENGINE_pkey_asn1_find_str(&e, str, len);
  118|  34.9k|        if (ameth) {
  ------------------
  |  Branch (118:13): [True: 0, False: 34.9k]
  ------------------
  119|       |            /*
  120|       |             * Convert structural into functional reference
  121|       |             */
  122|      0|            if (!ENGINE_init(e))
  ------------------
  |  Branch (122:17): [True: 0, False: 0]
  ------------------
  123|      0|                ameth = NULL;
  124|      0|            ENGINE_free(e);
  125|      0|            *pe = e;
  126|      0|            return ameth;
  127|      0|        }
  128|  34.9k|#endif
  129|  34.9k|        *pe = NULL;
  130|  34.9k|    }
  131|   430k|    for (i = EVP_PKEY_asn1_get_count(); i-- > 0; ) {
  ------------------
  |  Branch (131:41): [True: 412k, False: 18.3k]
  ------------------
  132|   412k|        ameth = EVP_PKEY_asn1_get0(i);
  133|   412k|        if (ameth->pkey_flags & ASN1_PKEY_ALIAS)
  ------------------
  |  | 1606|   412k|# define ASN1_PKEY_ALIAS         0x1
  ------------------
  |  Branch (133:13): [True: 110k, False: 301k]
  ------------------
  134|   110k|            continue;
  135|   301k|        if ((int)strlen(ameth->pem_str) == len
  ------------------
  |  Branch (135:13): [True: 18.1k, False: 283k]
  ------------------
  136|   301k|            && OPENSSL_strncasecmp(ameth->pem_str, str, len) == 0)
  ------------------
  |  Branch (136:16): [True: 16.5k, False: 1.58k]
  ------------------
  137|  16.5k|            return ameth;
  138|   301k|    }
  139|  18.3k|    return NULL;
  140|  34.9k|}
EVP_PKEY_asn1_get0_info:
  199|     15|{
  200|     15|    if (!ameth)
  ------------------
  |  Branch (200:9): [True: 0, False: 15]
  ------------------
  201|      0|        return 0;
  202|     15|    if (ppkey_id)
  ------------------
  |  Branch (202:9): [True: 15, False: 0]
  ------------------
  203|     15|        *ppkey_id = ameth->pkey_id;
  204|     15|    if (ppkey_base_id)
  ------------------
  |  Branch (204:9): [True: 15, False: 0]
  ------------------
  205|     15|        *ppkey_base_id = ameth->pkey_base_id;
  206|     15|    if (ppkey_flags)
  ------------------
  |  Branch (206:9): [True: 15, False: 0]
  ------------------
  207|     15|        *ppkey_flags = ameth->pkey_flags;
  208|     15|    if (pinfo)
  ------------------
  |  Branch (208:9): [True: 0, False: 15]
  ------------------
  209|      0|        *pinfo = ameth->info;
  210|     15|    if (ppem_str)
  ------------------
  |  Branch (210:9): [True: 15, False: 0]
  ------------------
  211|     15|        *ppem_str = ameth->pem_str;
  212|     15|    return 1;
  213|     15|}
ameth_lib.c:pkey_asn1_find:
   58|  49.0k|{
   59|  49.0k|    EVP_PKEY_ASN1_METHOD tmp;
   60|  49.0k|    const EVP_PKEY_ASN1_METHOD *t = &tmp, **ret;
   61|       |
   62|  49.0k|    tmp.pkey_id = type;
   63|  49.0k|    if (app_methods) {
  ------------------
  |  Branch (63:9): [True: 0, False: 49.0k]
  ------------------
   64|      0|        int idx;
   65|      0|        idx = sk_EVP_PKEY_ASN1_METHOD_find(app_methods, &tmp);
   66|      0|        if (idx >= 0)
  ------------------
  |  Branch (66:13): [True: 0, False: 0]
  ------------------
   67|      0|            return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
   68|      0|    }
   69|  49.0k|    ret = OBJ_bsearch_ameth(&t, standard_methods, OSSL_NELEM(standard_methods));
  ------------------
  |  |   14|  49.0k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   70|  49.0k|    if (ret == NULL || *ret == NULL)
  ------------------
  |  Branch (70:9): [True: 168, False: 48.8k]
  |  Branch (70:24): [True: 0, False: 48.8k]
  ------------------
   71|    168|        return NULL;
   72|  48.8k|    return *ret;
   73|  49.0k|}
ameth_lib.c:ameth_cmp:
   31|  83.1k|{
   32|  83.1k|    return ((*a)->pkey_id - (*b)->pkey_id);
   33|  83.1k|}

ossl_err_load_ASN1_strings:
  210|      2|{
  211|      2|#ifndef OPENSSL_NO_ERR
  212|      2|    if (ERR_reason_error_string(ASN1_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (212:9): [True: 2, False: 0]
  ------------------
  213|      2|        ERR_load_strings_const(ASN1_str_reasons);
  214|      2|#endif
  215|      2|    return 1;
  216|      2|}

ASN1_get_object:
   48|   226M|{
   49|   226M|    int i, ret;
   50|   226M|    long len;
   51|   226M|    const unsigned char *p = *pp;
   52|   226M|    int tag, xclass, inf;
   53|   226M|    long max = omax;
   54|       |
   55|   226M|    if (omax <= 0) {
  ------------------
  |  Branch (55:9): [True: 0, False: 226M]
  ------------------
   56|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   57|      0|        return 0x80;
   58|      0|    }
   59|   226M|    ret = (*p & V_ASN1_CONSTRUCTED);
  ------------------
  |  |   52|   226M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
   60|   226M|    xclass = (*p & V_ASN1_PRIVATE);
  ------------------
  |  |   50|   226M|# define V_ASN1_PRIVATE                  0xc0
  ------------------
   61|   226M|    i = *p & V_ASN1_PRIMITIVE_TAG;
  ------------------
  |  |   53|   226M|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
   62|   226M|    if (i == V_ASN1_PRIMITIVE_TAG) { /* high-tag */
  ------------------
  |  |   53|   226M|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  |  Branch (62:9): [True: 337k, False: 226M]
  ------------------
   63|   337k|        p++;
   64|   337k|        if (--max == 0)
  ------------------
  |  Branch (64:13): [True: 595, False: 337k]
  ------------------
   65|    595|            goto err;
   66|   337k|        len = 0;
   67|   629k|        while (*p & 0x80) {
  ------------------
  |  Branch (67:16): [True: 295k, False: 334k]
  ------------------
   68|   295k|            len <<= 7L;
   69|   295k|            len |= *(p++) & 0x7f;
   70|   295k|            if (--max == 0)
  ------------------
  |  Branch (70:17): [True: 1.85k, False: 293k]
  ------------------
   71|  1.85k|                goto err;
   72|   293k|            if (len > (INT_MAX >> 7L))
  ------------------
  |  Branch (72:17): [True: 735, False: 292k]
  ------------------
   73|    735|                goto err;
   74|   293k|        }
   75|   334k|        len <<= 7L;
   76|   334k|        len |= *(p++) & 0x7f;
   77|   334k|        tag = (int)len;
   78|   334k|        if (--max == 0)
  ------------------
  |  Branch (78:13): [True: 1.50k, False: 333k]
  ------------------
   79|  1.50k|            goto err;
   80|   226M|    } else {
   81|   226M|        tag = i;
   82|   226M|        p++;
   83|   226M|        if (--max == 0)
  ------------------
  |  Branch (83:13): [True: 21.5k, False: 226M]
  ------------------
   84|  21.5k|            goto err;
   85|   226M|    }
   86|   226M|    *ptag = tag;
   87|   226M|    *pclass = xclass;
   88|   226M|    if (!asn1_get_length(&p, &inf, plength, max))
  ------------------
  |  Branch (88:9): [True: 45.5k, False: 226M]
  ------------------
   89|  45.5k|        goto err;
   90|       |
   91|   226M|    if (inf && !(ret & V_ASN1_CONSTRUCTED))
  ------------------
  |  |   52|  47.0M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (91:9): [True: 47.0M, False: 179M]
  |  Branch (91:16): [True: 1.36k, False: 47.0M]
  ------------------
   92|  1.36k|        goto err;
   93|       |
   94|   226M|    if (*plength > (omax - (p - *pp))) {
  ------------------
  |  Branch (94:9): [True: 11.0M, False: 215M]
  ------------------
   95|  11.0M|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|  11.0M|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  11.0M|    (ERR_new(),                                                 \
  |  |  |  |  404|  11.0M|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  11.0M|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  11.0M|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  11.0M|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  11.0M|     ERR_set_error)
  |  |  ------------------
  ------------------
   96|       |        /*
   97|       |         * Set this so that even if things are not long enough the values are
   98|       |         * set correctly
   99|       |         */
  100|  11.0M|        ret |= 0x80;
  101|  11.0M|    }
  102|   226M|    *pp = p;
  103|   226M|    return ret | inf;
  104|  73.0k| err:
  105|  73.0k|    ERR_raise(ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG);
  ------------------
  |  |  401|  73.0k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  73.0k|    (ERR_new(),                                                 \
  |  |  |  |  404|  73.0k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  73.0k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  73.0k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  73.0k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  73.0k|     ERR_set_error)
  |  |  ------------------
  ------------------
  106|  73.0k|    return 0x80;
  107|   226M|}
ASN1_put_object:
  162|  1.32M|{
  163|  1.32M|    unsigned char *p = *pp;
  164|  1.32M|    int i, ttag;
  165|       |
  166|  1.32M|    i = (constructed) ? V_ASN1_CONSTRUCTED : 0;
  ------------------
  |  |   52|   495k|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (166:9): [True: 495k, False: 827k]
  ------------------
  167|  1.32M|    i |= (xclass & V_ASN1_PRIVATE);
  ------------------
  |  |   50|  1.32M|# define V_ASN1_PRIVATE                  0xc0
  ------------------
  168|  1.32M|    if (tag < 31) {
  ------------------
  |  Branch (168:9): [True: 1.32M, False: 1.35k]
  ------------------
  169|  1.32M|        *(p++) = i | (tag & V_ASN1_PRIMITIVE_TAG);
  ------------------
  |  |   53|  1.32M|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  170|  1.32M|    } else {
  171|  1.35k|        *(p++) = i | V_ASN1_PRIMITIVE_TAG;
  ------------------
  |  |   53|  1.35k|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  172|  4.51k|        for (i = 0, ttag = tag; ttag > 0; i++)
  ------------------
  |  Branch (172:33): [True: 3.15k, False: 1.35k]
  ------------------
  173|  3.15k|            ttag >>= 7;
  174|  1.35k|        ttag = i;
  175|  4.51k|        while (i-- > 0) {
  ------------------
  |  Branch (175:16): [True: 3.15k, False: 1.35k]
  ------------------
  176|  3.15k|            p[i] = tag & 0x7f;
  177|  3.15k|            if (i != (ttag - 1))
  ------------------
  |  Branch (177:17): [True: 1.79k, False: 1.35k]
  ------------------
  178|  1.79k|                p[i] |= 0x80;
  179|  3.15k|            tag >>= 7;
  180|  3.15k|        }
  181|  1.35k|        p += ttag;
  182|  1.35k|    }
  183|  1.32M|    if (constructed == 2)
  ------------------
  |  Branch (183:9): [True: 0, False: 1.32M]
  ------------------
  184|      0|        *(p++) = 0x80;
  185|  1.32M|    else
  186|  1.32M|        asn1_put_length(&p, length);
  187|  1.32M|    *pp = p;
  188|  1.32M|}
ASN1_object_size:
  223|  5.14M|{
  224|  5.14M|    int ret = 1;
  225|       |
  226|  5.14M|    if (length < 0)
  ------------------
  |  Branch (226:9): [True: 0, False: 5.14M]
  ------------------
  227|      0|        return -1;
  228|  5.14M|    if (tag >= 31) {
  ------------------
  |  Branch (228:9): [True: 5.40k, False: 5.14M]
  ------------------
  229|  18.0k|        while (tag > 0) {
  ------------------
  |  Branch (229:16): [True: 12.6k, False: 5.40k]
  ------------------
  230|  12.6k|            tag >>= 7;
  231|  12.6k|            ret++;
  232|  12.6k|        }
  233|  5.40k|    }
  234|  5.14M|    if (constructed == 2) {
  ------------------
  |  Branch (234:9): [True: 0, False: 5.14M]
  ------------------
  235|      0|        ret += 3;
  236|  5.14M|    } else {
  237|  5.14M|        ret++;
  238|  5.14M|        if (length > 127) {
  ------------------
  |  Branch (238:13): [True: 86.2k, False: 5.06M]
  ------------------
  239|  86.2k|            int tmplen = length;
  240|   231k|            while (tmplen > 0) {
  ------------------
  |  Branch (240:20): [True: 145k, False: 86.2k]
  ------------------
  241|   145k|                tmplen >>= 8;
  242|   145k|                ret++;
  243|   145k|            }
  244|  86.2k|        }
  245|  5.14M|    }
  246|  5.14M|    if (ret >= INT_MAX - length)
  ------------------
  |  Branch (246:9): [True: 0, False: 5.14M]
  ------------------
  247|      0|        return -1;
  248|  5.14M|    return ret + length;
  249|  5.14M|}
ossl_asn1_string_set_bits_left:
  252|   139k|{
  253|   139k|    str->flags &= ~0x07;
  254|   139k|    str->flags |= ASN1_STRING_FLAG_BITS_LEFT | (num & 0x07);
  ------------------
  |  |  161|   139k|# define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
  ------------------
  255|   139k|}
ASN1_STRING_copy:
  258|   109k|{
  259|   109k|    if (str == NULL)
  ------------------
  |  Branch (259:9): [True: 0, False: 109k]
  ------------------
  260|      0|        return 0;
  261|   109k|    dst->type = str->type;
  262|   109k|    if (!ASN1_STRING_set(dst, str->data, str->length))
  ------------------
  |  Branch (262:9): [True: 0, False: 109k]
  ------------------
  263|      0|        return 0;
  264|       |    /* Copy flags but preserve embed value */
  265|   109k|    dst->flags &= ASN1_STRING_FLAG_EMBED;
  ------------------
  |  |  182|   109k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  266|   109k|    dst->flags |= str->flags & ~ASN1_STRING_FLAG_EMBED;
  ------------------
  |  |  182|   109k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  267|   109k|    return 1;
  268|   109k|}
ASN1_STRING_set:
  287|  2.82M|{
  288|  2.82M|    unsigned char *c;
  289|  2.82M|    const char *data = _data;
  290|  2.82M|    size_t len;
  291|       |
  292|  2.82M|    if (len_in < 0) {
  ------------------
  |  Branch (292:9): [True: 0, False: 2.82M]
  ------------------
  293|      0|        if (data == NULL)
  ------------------
  |  Branch (293:13): [True: 0, False: 0]
  ------------------
  294|      0|            return 0;
  295|      0|        len = strlen(data);
  296|  2.82M|    } else {
  297|  2.82M|        len = (size_t)len_in;
  298|  2.82M|    }
  299|       |    /*
  300|       |     * Verify that the length fits within an integer for assignment to
  301|       |     * str->length below.  The additional 1 is subtracted to allow for the
  302|       |     * '\0' terminator even though this isn't strictly necessary.
  303|       |     */
  304|  2.82M|    if (len > INT_MAX - 1) {
  ------------------
  |  Branch (304:9): [True: 0, False: 2.82M]
  ------------------
  305|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  306|      0|        return 0;
  307|      0|    }
  308|  2.82M|    if ((size_t)str->length <= len || str->data == NULL) {
  ------------------
  |  Branch (308:9): [True: 2.82M, False: 0]
  |  Branch (308:39): [True: 0, False: 0]
  ------------------
  309|  2.82M|        c = str->data;
  310|  2.82M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  311|       |        /* No NUL terminator in fuzzing builds */
  312|  2.82M|        str->data = OPENSSL_realloc(c, len != 0 ? len : 1);
  ------------------
  |  |  109|  5.65M|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.82M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.82M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (109:30): [True: 2.52M, False: 305k]
  |  |  ------------------
  ------------------
  313|       |#else
  314|       |        str->data = OPENSSL_realloc(c, len + 1);
  315|       |#endif
  316|  2.82M|        if (str->data == NULL) {
  ------------------
  |  Branch (316:13): [True: 0, False: 2.82M]
  ------------------
  317|      0|            str->data = c;
  318|      0|            return 0;
  319|      0|        }
  320|  2.82M|    }
  321|  2.82M|    str->length = len;
  322|  2.82M|    if (data != NULL) {
  ------------------
  |  Branch (322:9): [True: 2.32M, False: 504k]
  ------------------
  323|  2.32M|        memcpy(str->data, data, len);
  324|  2.32M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  325|       |        /* Set the unused byte to something non NUL and printable. */
  326|  2.32M|        if (len == 0)
  ------------------
  |  Branch (326:13): [True: 303k, False: 2.02M]
  ------------------
  327|   303k|            str->data[len] = '~';
  328|       |#else
  329|       |        /*
  330|       |         * Add a NUL terminator. This should not be necessary - but we add it as
  331|       |         * a safety precaution
  332|       |         */
  333|       |        str->data[len] = '\0';
  334|       |#endif
  335|  2.32M|    }
  336|  2.82M|    return 1;
  337|  2.82M|}
ASN1_STRING_set0:
  340|   382k|{
  341|   382k|    OPENSSL_free(str->data);
  ------------------
  |  |  115|   382k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   382k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   382k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  342|   382k|    str->data = data;
  343|   382k|    str->length = len;
  344|   382k|}
ASN1_STRING_new:
  347|     72|{
  348|     72|    return ASN1_STRING_type_new(V_ASN1_OCTET_STRING);
  ------------------
  |  |   66|     72|# define V_ASN1_OCTET_STRING             4
  ------------------
  349|     72|}
ASN1_STRING_type_new:
  352|  4.27M|{
  353|  4.27M|    ASN1_STRING *ret;
  354|       |
  355|  4.27M|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  4.27M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.27M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.27M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  356|  4.27M|    if (ret == NULL)
  ------------------
  |  Branch (356:9): [True: 0, False: 4.27M]
  ------------------
  357|      0|        return NULL;
  358|  4.27M|    ret->type = type;
  359|  4.27M|    return ret;
  360|  4.27M|}
ossl_asn1_string_embed_free:
  363|  4.61M|{
  364|  4.61M|    if (a == NULL)
  ------------------
  |  Branch (364:9): [True: 0, False: 4.61M]
  ------------------
  365|      0|        return;
  366|  4.61M|    if (!(a->flags & ASN1_STRING_FLAG_NDEF))
  ------------------
  |  |  167|  4.61M|# define ASN1_STRING_FLAG_NDEF 0x010
  ------------------
  |  Branch (366:9): [True: 4.61M, False: 0]
  ------------------
  367|  4.61M|        OPENSSL_free(a->data);
  ------------------
  |  |  115|  4.61M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.61M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.61M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  368|  4.61M|    if (embed == 0)
  ------------------
  |  Branch (368:9): [True: 4.27M, False: 339k]
  ------------------
  369|  4.27M|        OPENSSL_free(a);
  ------------------
  |  |  115|  4.27M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.27M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.27M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  370|  4.61M|}
ASN1_STRING_free:
  373|  2.34M|{
  374|  2.34M|    if (a == NULL)
  ------------------
  |  Branch (374:9): [True: 1.91M, False: 435k]
  ------------------
  375|  1.91M|        return;
  376|   435k|    ossl_asn1_string_embed_free(a, a->flags & ASN1_STRING_FLAG_EMBED);
  ------------------
  |  |  182|   435k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  377|   435k|}
ASN1_STRING_clear_free:
  380|    528|{
  381|    528|    if (a == NULL)
  ------------------
  |  Branch (381:9): [True: 17, False: 511]
  ------------------
  382|     17|        return;
  383|    511|    if (a->data && !(a->flags & ASN1_STRING_FLAG_NDEF))
  ------------------
  |  |  167|    511|# define ASN1_STRING_FLAG_NDEF 0x010
  ------------------
  |  Branch (383:9): [True: 511, False: 0]
  |  Branch (383:20): [True: 511, False: 0]
  ------------------
  384|    511|        OPENSSL_cleanse(a->data, a->length);
  385|    511|    ASN1_STRING_free(a);
  386|    511|}
ASN1_STRING_length:
  406|  68.8k|{
  407|  68.8k|    return x->length;
  408|  68.8k|}
ASN1_STRING_get0_data:
  423|  68.8k|{
  424|  68.8k|    return x->data;
  425|  68.8k|}
asn1_lib.c:asn1_get_length:
  118|   226M|{
  119|   226M|    const unsigned char *p = *pp;
  120|   226M|    unsigned long ret = 0;
  121|   226M|    int i;
  122|       |
  123|   226M|    if (max-- < 1)
  ------------------
  |  Branch (123:9): [True: 0, False: 226M]
  ------------------
  124|      0|        return 0;
  125|   226M|    if (*p == 0x80) {
  ------------------
  |  Branch (125:9): [True: 47.0M, False: 179M]
  ------------------
  126|  47.0M|        *inf = 1;
  127|  47.0M|        p++;
  128|   179M|    } else {
  129|   179M|        *inf = 0;
  130|   179M|        i = *p & 0x7f;
  131|   179M|        if (*p++ & 0x80) {
  ------------------
  |  Branch (131:13): [True: 3.46M, False: 175M]
  ------------------
  132|  3.46M|            if (max < i + 1)
  ------------------
  |  Branch (132:17): [True: 32.7k, False: 3.42M]
  ------------------
  133|  32.7k|                return 0;
  134|       |            /* Skip leading zeroes */
  135|  3.56M|            while (i > 0 && *p == 0) {
  ------------------
  |  Branch (135:20): [True: 3.50M, False: 55.4k]
  |  Branch (135:29): [True: 131k, False: 3.37M]
  ------------------
  136|   131k|                p++;
  137|   131k|                i--;
  138|   131k|            }
  139|  3.42M|            if (i > (int)sizeof(long))
  ------------------
  |  Branch (139:17): [True: 2.25k, False: 3.42M]
  ------------------
  140|  2.25k|                return 0;
  141|  7.24M|            while (i > 0) {
  ------------------
  |  Branch (141:20): [True: 3.82M, False: 3.42M]
  ------------------
  142|  3.82M|                ret <<= 8;
  143|  3.82M|                ret |= *p++;
  144|  3.82M|                i--;
  145|  3.82M|            }
  146|  3.42M|            if (ret > LONG_MAX)
  ------------------
  |  Branch (146:17): [True: 10.5k, False: 3.41M]
  ------------------
  147|  10.5k|                return 0;
  148|   175M|        } else {
  149|   175M|            ret = i;
  150|   175M|        }
  151|   179M|    }
  152|   226M|    *pp = p;
  153|   226M|    *rl = (long)ret;
  154|   226M|    return 1;
  155|   226M|}
asn1_lib.c:asn1_put_length:
  201|  1.32M|{
  202|  1.32M|    unsigned char *p = *pp;
  203|  1.32M|    int i, len;
  204|       |
  205|  1.32M|    if (length <= 127) {
  ------------------
  |  Branch (205:9): [True: 1.29M, False: 25.8k]
  ------------------
  206|  1.29M|        *(p++) = (unsigned char)length;
  207|  1.29M|    } else {
  208|  25.8k|        len = length;
  209|  70.0k|        for (i = 0; len > 0; i++)
  ------------------
  |  Branch (209:21): [True: 44.1k, False: 25.8k]
  ------------------
  210|  44.1k|            len >>= 8;
  211|  25.8k|        *(p++) = i | 0x80;
  212|  25.8k|        len = i;
  213|  70.0k|        while (i-- > 0) {
  ------------------
  |  Branch (213:16): [True: 44.1k, False: 25.8k]
  ------------------
  214|  44.1k|            p[i] = length & 0xff;
  215|  44.1k|            length >>= 8;
  216|  44.1k|        }
  217|  25.8k|        p += len;
  218|  25.8k|    }
  219|  1.32M|    *pp = p;
  220|  1.32M|}

ASN1_parse_dump:
   90|  68.1k|{
   91|  68.1k|    return asn1_parse2(bp, &pp, len, 0, 0, indent, dump);
   92|  68.1k|}
ASN1_tag2str:
  361|  1.64M|{
  362|  1.64M|    static const char *const tag2str[] = {
  363|       |        /* 0-4 */
  364|  1.64M|        "EOC", "BOOLEAN", "INTEGER", "BIT STRING", "OCTET STRING",
  365|       |        /* 5-9 */
  366|  1.64M|        "NULL", "OBJECT", "OBJECT DESCRIPTOR", "EXTERNAL", "REAL",
  367|       |        /* 10-13 */
  368|  1.64M|        "ENUMERATED", "<ASN1 11>", "UTF8STRING", "<ASN1 13>",
  369|       |        /* 15-17 */
  370|  1.64M|        "<ASN1 14>", "<ASN1 15>", "SEQUENCE", "SET",
  371|       |        /* 18-20 */
  372|  1.64M|        "NUMERICSTRING", "PRINTABLESTRING", "T61STRING",
  373|       |        /* 21-24 */
  374|  1.64M|        "VIDEOTEXSTRING", "IA5STRING", "UTCTIME", "GENERALIZEDTIME",
  375|       |        /* 25-27 */
  376|  1.64M|        "GRAPHICSTRING", "VISIBLESTRING", "GENERALSTRING",
  377|       |        /* 28-30 */
  378|  1.64M|        "UNIVERSALSTRING", "<ASN1 29>", "BMPSTRING"
  379|  1.64M|    };
  380|       |
  381|  1.64M|    if ((tag == V_ASN1_NEG_INTEGER) || (tag == V_ASN1_NEG_ENUMERATED))
  ------------------
  |  |   98|  1.64M|# define V_ASN1_NEG_INTEGER              (2 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|  1.64M|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
                  if ((tag == V_ASN1_NEG_INTEGER) || (tag == V_ASN1_NEG_ENUMERATED))
  ------------------
  |  |   99|  1.64M|# define V_ASN1_NEG_ENUMERATED           (10 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|  1.64M|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
  |  Branch (381:9): [True: 744, False: 1.64M]
  |  Branch (381:40): [True: 264, False: 1.64M]
  ------------------
  382|  1.00k|        tag &= ~0x100;
  383|       |
  384|  1.64M|    if (tag < 0 || tag > 30)
  ------------------
  |  Branch (384:9): [True: 13.4k, False: 1.63M]
  |  Branch (384:20): [True: 1.70k, False: 1.62M]
  ------------------
  385|  15.1k|        return "(unknown)";
  386|  1.62M|    return tag2str[tag];
  387|  1.64M|}
asn1_parse.c:asn1_parse2:
   96|   542k|{
   97|   542k|    const unsigned char *p, *ep, *tot, *op, *opp;
   98|   542k|    long len;
   99|   542k|    int tag, xclass, ret = 0;
  100|   542k|    int nl, hl, j, r;
  101|   542k|    ASN1_OBJECT *o = NULL;
  102|   542k|    ASN1_OCTET_STRING *os = NULL;
  103|   542k|    ASN1_INTEGER *ai = NULL;
  104|   542k|    ASN1_ENUMERATED *ae = NULL;
  105|       |    /* ASN1_BMPSTRING *bmp=NULL; */
  106|   542k|    int dump_indent, dump_cont = 0;
  107|       |
  108|   542k|    if (depth > ASN1_PARSE_MAXDEPTH) {
  ------------------
  |  |   17|   542k|#define ASN1_PARSE_MAXDEPTH 128
  ------------------
  |  Branch (108:9): [True: 31, False: 542k]
  ------------------
  109|     31|        BIO_puts(bp, "BAD RECURSION DEPTH\n");
  110|     31|        return 0;
  111|     31|    }
  112|       |
  113|   542k|    dump_indent = 6;            /* Because we know BIO_dump_indent() */
  114|   542k|    p = *pp;
  115|   542k|    tot = p + length;
  116|  1.97M|    while (length > 0) {
  ------------------
  |  Branch (116:12): [True: 1.71M, False: 267k]
  ------------------
  117|  1.71M|        op = p;
  118|  1.71M|        j = ASN1_get_object(&p, &len, &tag, &xclass, length);
  119|  1.71M|        if (j & 0x80) {
  ------------------
  |  Branch (119:13): [True: 2.15k, False: 1.70M]
  ------------------
  120|  2.15k|            BIO_puts(bp, "Error in encoding\n");
  121|  2.15k|            goto end;
  122|  2.15k|        }
  123|  1.70M|        hl = (p - op);
  124|  1.70M|        length -= hl;
  125|       |        /*
  126|       |         * if j == 0x21 it is a constructed indefinite length object
  127|       |         */
  128|  1.70M|        if (!asn1_print_info(bp, (long)offset + (long)(op - *pp), depth,
  ------------------
  |  Branch (128:13): [True: 0, False: 1.70M]
  ------------------
  129|  1.70M|                             hl, len, tag, xclass, j, (indent) ? depth : 0))
  ------------------
  |  Branch (129:55): [True: 1.70M, False: 0]
  ------------------
  130|      0|            goto end;
  131|  1.70M|        if (j & V_ASN1_CONSTRUCTED) {
  ------------------
  |  |   52|  1.70M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (131:13): [True: 692k, False: 1.01M]
  ------------------
  132|   692k|            const unsigned char *sp = p;
  133|       |
  134|   692k|            ep = p + len;
  135|   692k|            if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (135:17): [True: 0, False: 692k]
  ------------------
  136|      0|                goto end;
  137|   692k|            if (len > length) {
  ------------------
  |  Branch (137:17): [True: 0, False: 692k]
  ------------------
  138|      0|                BIO_printf(bp, "length is greater than %ld\n", length);
  139|      0|                goto end;
  140|      0|            }
  141|   692k|            if ((j == 0x21) && (len == 0)) {
  ------------------
  |  Branch (141:17): [True: 267k, False: 424k]
  |  Branch (141:32): [True: 267k, False: 0]
  ------------------
  142|   267k|                for (;;) {
  143|   267k|                    r = asn1_parse2(bp, &p, (long)(tot - p),
  144|   267k|                                    offset + (p - *pp), depth + 1,
  145|   267k|                                    indent, dump);
  146|   267k|                    if (r == 0)
  ------------------
  |  Branch (146:25): [True: 14.8k, False: 252k]
  ------------------
  147|  14.8k|                        goto end;
  148|   252k|                    if ((r == 2) || (p >= tot)) {
  ------------------
  |  Branch (148:25): [True: 251k, False: 1.48k]
  |  Branch (148:37): [True: 1.48k, False: 0]
  ------------------
  149|   252k|                        len = p - sp;
  150|   252k|                        break;
  151|   252k|                    }
  152|   252k|                }
  153|   424k|            } else {
  154|   424k|                long tmp = len;
  155|       |
  156|   628k|                while (p < ep) {
  ------------------
  |  Branch (156:24): [True: 206k, False: 421k]
  ------------------
  157|   206k|                    sp = p;
  158|   206k|                    r = asn1_parse2(bp, &p, tmp,
  159|   206k|                                    offset + (p - *pp), depth + 1,
  160|   206k|                                    indent, dump);
  161|   206k|                    if (r == 0)
  ------------------
  |  Branch (161:25): [True: 2.99k, False: 203k]
  ------------------
  162|  2.99k|                        goto end;
  163|   203k|                    tmp -= p - sp;
  164|   203k|                }
  165|   424k|            }
  166|  1.01M|        } else if (xclass != 0) {
  ------------------
  |  Branch (166:20): [True: 22.0k, False: 995k]
  ------------------
  167|  22.0k|            p += len;
  168|  22.0k|            if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (168:17): [True: 0, False: 22.0k]
  ------------------
  169|      0|                goto end;
  170|   995k|        } else {
  171|   995k|            nl = 0;
  172|   995k|            if ((tag == V_ASN1_PRINTABLESTRING) ||
  ------------------
  |  |   77|   995k|# define V_ASN1_PRINTABLESTRING          19
  ------------------
  |  Branch (172:17): [True: 1.18k, False: 993k]
  ------------------
  173|   995k|                (tag == V_ASN1_T61STRING) ||
  ------------------
  |  |   78|   993k|# define V_ASN1_T61STRING                20
  ------------------
  |  Branch (173:17): [True: 433, False: 993k]
  ------------------
  174|   995k|                (tag == V_ASN1_IA5STRING) ||
  ------------------
  |  |   81|   993k|# define V_ASN1_IA5STRING                22
  ------------------
  |  Branch (174:17): [True: 2.27k, False: 991k]
  ------------------
  175|   995k|                (tag == V_ASN1_VISIBLESTRING) ||
  ------------------
  |  |   86|   991k|# define V_ASN1_VISIBLESTRING            26 /* alias */
  ------------------
  |  Branch (175:17): [True: 309, False: 990k]
  ------------------
  176|   995k|                (tag == V_ASN1_NUMERICSTRING) ||
  ------------------
  |  |   76|   990k|# define V_ASN1_NUMERICSTRING            18
  ------------------
  |  Branch (176:17): [True: 381, False: 990k]
  ------------------
  177|   995k|                (tag == V_ASN1_UTF8STRING) ||
  ------------------
  |  |   73|   990k|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (177:17): [True: 13.8k, False: 976k]
  ------------------
  178|   995k|                (tag == V_ASN1_UTCTIME) || (tag == V_ASN1_GENERALIZEDTIME)) {
  ------------------
  |  |   82|   976k|# define V_ASN1_UTCTIME                  23
  ------------------
                              (tag == V_ASN1_UTCTIME) || (tag == V_ASN1_GENERALIZEDTIME)) {
  ------------------
  |  |   83|   959k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (178:17): [True: 16.9k, False: 959k]
  |  Branch (178:44): [True: 5.86k, False: 953k]
  ------------------
  179|  41.1k|                if (BIO_write(bp, ":", 1) <= 0)
  ------------------
  |  Branch (179:21): [True: 0, False: 41.1k]
  ------------------
  180|      0|                    goto end;
  181|  41.1k|                if ((len > 0) && BIO_write(bp, (const char *)p, (int)len)
  ------------------
  |  Branch (181:21): [True: 35.3k, False: 5.82k]
  |  Branch (181:34): [True: 0, False: 35.3k]
  ------------------
  182|  35.3k|                    != (int)len)
  183|      0|                    goto end;
  184|   953k|            } else if (tag == V_ASN1_OBJECT) {
  ------------------
  |  |   68|   953k|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (184:24): [True: 265k, False: 688k]
  ------------------
  185|   265k|                opp = op;
  186|   265k|                if (d2i_ASN1_OBJECT(&o, &opp, len + hl) != NULL) {
  ------------------
  |  Branch (186:21): [True: 259k, False: 5.48k]
  ------------------
  187|   259k|                    if (BIO_write(bp, ":", 1) <= 0)
  ------------------
  |  Branch (187:25): [True: 0, False: 259k]
  ------------------
  188|      0|                        goto end;
  189|   259k|                    i2a_ASN1_OBJECT(bp, o);
  190|   259k|                } else {
  191|  5.48k|                    if (BIO_puts(bp, ":BAD OBJECT") <= 0)
  ------------------
  |  Branch (191:25): [True: 0, False: 5.48k]
  ------------------
  192|      0|                        goto end;
  193|  5.48k|                    dump_cont = 1;
  194|  5.48k|                }
  195|   688k|            } else if (tag == V_ASN1_BOOLEAN) {
  ------------------
  |  |   63|   688k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (195:24): [True: 14.0k, False: 674k]
  ------------------
  196|  14.0k|                if (len != 1) {
  ------------------
  |  Branch (196:21): [True: 1.22k, False: 12.8k]
  ------------------
  197|  1.22k|                    if (BIO_puts(bp, ":BAD BOOLEAN") <= 0)
  ------------------
  |  Branch (197:25): [True: 0, False: 1.22k]
  ------------------
  198|      0|                        goto end;
  199|  1.22k|                    dump_cont = 1;
  200|  1.22k|                }
  201|  14.0k|                if (len > 0)
  ------------------
  |  Branch (201:21): [True: 13.3k, False: 731]
  ------------------
  202|  13.3k|                    BIO_printf(bp, ":%u", p[0]);
  203|   674k|            } else if (tag == V_ASN1_BMPSTRING) {
  ------------------
  |  |   89|   674k|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (203:24): [True: 1.49k, False: 673k]
  ------------------
  204|       |                /* do the BMP thang */
  205|   673k|            } else if (tag == V_ASN1_OCTET_STRING) {
  ------------------
  |  |   66|   673k|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (205:24): [True: 174k, False: 498k]
  ------------------
  206|   174k|                int i, printable = 1;
  207|       |
  208|   174k|                opp = op;
  209|   174k|                os = d2i_ASN1_OCTET_STRING(NULL, &opp, len + hl);
  210|   174k|                if (os != NULL && os->length > 0) {
  ------------------
  |  Branch (210:21): [True: 172k, False: 1.38k]
  |  Branch (210:35): [True: 107k, False: 65.5k]
  ------------------
  211|   107k|                    opp = os->data;
  212|       |                    /*
  213|       |                     * testing whether the octet string is printable
  214|       |                     */
  215|   188k|                    for (i = 0; i < os->length; i++) {
  ------------------
  |  Branch (215:33): [True: 186k, False: 2.56k]
  ------------------
  216|   186k|                        if (((opp[i] < ' ') &&
  ------------------
  |  Branch (216:30): [True: 58.8k, False: 127k]
  ------------------
  217|   186k|                             (opp[i] != '\n') &&
  ------------------
  |  Branch (217:30): [True: 49.9k, False: 8.89k]
  ------------------
  218|   186k|                             (opp[i] != '\r') &&
  ------------------
  |  Branch (218:30): [True: 49.3k, False: 574]
  ------------------
  219|   186k|                             (opp[i] != '\t')) || (opp[i] > '~')) {
  ------------------
  |  Branch (219:30): [True: 48.9k, False: 385]
  |  Branch (219:51): [True: 55.8k, False: 81.5k]
  ------------------
  220|   104k|                            printable = 0;
  221|   104k|                            break;
  222|   104k|                        }
  223|   186k|                    }
  224|   107k|                    if (printable)
  ------------------
  |  Branch (224:25): [True: 2.56k, False: 104k]
  ------------------
  225|       |                        /* printable string */
  226|  2.56k|                    {
  227|  2.56k|                        if (BIO_write(bp, ":", 1) <= 0)
  ------------------
  |  Branch (227:29): [True: 0, False: 2.56k]
  ------------------
  228|      0|                            goto end;
  229|  2.56k|                        if (BIO_write(bp, (const char *)opp, os->length) <= 0)
  ------------------
  |  Branch (229:29): [True: 0, False: 2.56k]
  ------------------
  230|      0|                            goto end;
  231|   104k|                    } else if (!dump)
  ------------------
  |  Branch (231:32): [True: 104k, False: 0]
  ------------------
  232|       |                        /*
  233|       |                         * not printable => print octet string as hex dump
  234|       |                         */
  235|   104k|                    {
  236|   104k|                        if (BIO_write(bp, "[HEX DUMP]:", 11) <= 0)
  ------------------
  |  Branch (236:29): [True: 0, False: 104k]
  ------------------
  237|      0|                            goto end;
  238|  1.79M|                        for (i = 0; i < os->length; i++) {
  ------------------
  |  Branch (238:37): [True: 1.68M, False: 104k]
  ------------------
  239|  1.68M|                            if (BIO_printf(bp, "%02X", opp[i]) <= 0)
  ------------------
  |  Branch (239:33): [True: 0, False: 1.68M]
  ------------------
  240|      0|                                goto end;
  241|  1.68M|                        }
  242|   104k|                    } else
  243|       |                        /* print the normal dump */
  244|      0|                    {
  245|      0|                        if (!nl) {
  ------------------
  |  Branch (245:29): [True: 0, False: 0]
  ------------------
  246|      0|                            if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (246:33): [True: 0, False: 0]
  ------------------
  247|      0|                                goto end;
  248|      0|                        }
  249|      0|                        if (BIO_dump_indent(bp,
  ------------------
  |  Branch (249:29): [True: 0, False: 0]
  ------------------
  250|      0|                                            (const char *)opp,
  251|      0|                                            ((dump == -1 || dump >
  ------------------
  |  Branch (251:47): [True: 0, False: 0]
  |  Branch (251:61): [True: 0, False: 0]
  ------------------
  252|      0|                                              os->
  253|      0|                                              length) ? os->length : dump),
  254|      0|                                            dump_indent) <= 0)
  255|      0|                            goto end;
  256|      0|                        nl = 1;
  257|      0|                    }
  258|   107k|                }
  259|   174k|                ASN1_OCTET_STRING_free(os);
  260|   174k|                os = NULL;
  261|   498k|            } else if (tag == V_ASN1_INTEGER) {
  ------------------
  |  |   64|   498k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (261:24): [True: 189k, False: 309k]
  ------------------
  262|   189k|                int i;
  263|       |
  264|   189k|                opp = op;
  265|   189k|                ai = d2i_ASN1_INTEGER(NULL, &opp, len + hl);
  266|   189k|                if (ai != NULL) {
  ------------------
  |  Branch (266:21): [True: 141k, False: 47.7k]
  ------------------
  267|   141k|                    if (BIO_write(bp, ":", 1) <= 0)
  ------------------
  |  Branch (267:25): [True: 0, False: 141k]
  ------------------
  268|      0|                        goto end;
  269|   141k|                    if (ai->type == V_ASN1_NEG_INTEGER)
  ------------------
  |  |   98|   141k|# define V_ASN1_NEG_INTEGER              (2 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|   141k|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
  |  Branch (269:25): [True: 66.1k, False: 75.5k]
  ------------------
  270|  66.1k|                        if (BIO_write(bp, "-", 1) <= 0)
  ------------------
  |  Branch (270:29): [True: 0, False: 66.1k]
  ------------------
  271|      0|                            goto end;
  272|  1.30M|                    for (i = 0; i < ai->length; i++) {
  ------------------
  |  Branch (272:33): [True: 1.16M, False: 141k]
  ------------------
  273|  1.16M|                        if (BIO_printf(bp, "%02X", ai->data[i]) <= 0)
  ------------------
  |  Branch (273:29): [True: 0, False: 1.16M]
  ------------------
  274|      0|                            goto end;
  275|  1.16M|                    }
  276|   141k|                    if (ai->length == 0) {
  ------------------
  |  Branch (276:25): [True: 0, False: 141k]
  ------------------
  277|      0|                        if (BIO_write(bp, "00", 2) <= 0)
  ------------------
  |  Branch (277:29): [True: 0, False: 0]
  ------------------
  278|      0|                            goto end;
  279|      0|                    }
  280|   141k|                } else {
  281|  47.7k|                    if (BIO_puts(bp, ":BAD INTEGER") <= 0)
  ------------------
  |  Branch (281:25): [True: 0, False: 47.7k]
  ------------------
  282|      0|                        goto end;
  283|  47.7k|                    dump_cont = 1;
  284|  47.7k|                }
  285|   189k|                ASN1_INTEGER_free(ai);
  286|   189k|                ai = NULL;
  287|   309k|            } else if (tag == V_ASN1_ENUMERATED) {
  ------------------
  |  |   72|   309k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (287:24): [True: 5.87k, False: 303k]
  ------------------
  288|  5.87k|                int i;
  289|       |
  290|  5.87k|                opp = op;
  291|  5.87k|                ae = d2i_ASN1_ENUMERATED(NULL, &opp, len + hl);
  292|  5.87k|                if (ae != NULL) {
  ------------------
  |  Branch (292:21): [True: 5.23k, False: 632]
  ------------------
  293|  5.23k|                    if (BIO_write(bp, ":", 1) <= 0)
  ------------------
  |  Branch (293:25): [True: 0, False: 5.23k]
  ------------------
  294|      0|                        goto end;
  295|  5.23k|                    if (ae->type == V_ASN1_NEG_ENUMERATED)
  ------------------
  |  |   99|  5.23k|# define V_ASN1_NEG_ENUMERATED           (10 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|  5.23k|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
  |  Branch (295:25): [True: 781, False: 4.45k]
  ------------------
  296|    781|                        if (BIO_write(bp, "-", 1) <= 0)
  ------------------
  |  Branch (296:29): [True: 0, False: 781]
  ------------------
  297|      0|                            goto end;
  298|  21.2k|                    for (i = 0; i < ae->length; i++) {
  ------------------
  |  Branch (298:33): [True: 16.0k, False: 5.23k]
  ------------------
  299|  16.0k|                        if (BIO_printf(bp, "%02X", ae->data[i]) <= 0)
  ------------------
  |  Branch (299:29): [True: 0, False: 16.0k]
  ------------------
  300|      0|                            goto end;
  301|  16.0k|                    }
  302|  5.23k|                    if (ae->length == 0) {
  ------------------
  |  Branch (302:25): [True: 0, False: 5.23k]
  ------------------
  303|      0|                        if (BIO_write(bp, "00", 2) <= 0)
  ------------------
  |  Branch (303:29): [True: 0, False: 0]
  ------------------
  304|      0|                            goto end;
  305|      0|                    }
  306|  5.23k|                } else {
  307|    632|                    if (BIO_puts(bp, ":BAD ENUMERATED") <= 0)
  ------------------
  |  Branch (307:25): [True: 0, False: 632]
  ------------------
  308|      0|                        goto end;
  309|    632|                    dump_cont = 1;
  310|    632|                }
  311|  5.87k|                ASN1_ENUMERATED_free(ae);
  312|  5.87k|                ae = NULL;
  313|   303k|            } else if (len > 0 && dump) {
  ------------------
  |  Branch (313:24): [True: 34.2k, False: 269k]
  |  Branch (313:35): [True: 0, False: 34.2k]
  ------------------
  314|      0|                if (!nl) {
  ------------------
  |  Branch (314:21): [True: 0, False: 0]
  ------------------
  315|      0|                    if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (315:25): [True: 0, False: 0]
  ------------------
  316|      0|                        goto end;
  317|      0|                }
  318|      0|                if (BIO_dump_indent(bp, (const char *)p,
  ------------------
  |  Branch (318:21): [True: 0, False: 0]
  ------------------
  319|      0|                                    ((dump == -1 || dump > len) ? len : dump),
  ------------------
  |  Branch (319:39): [True: 0, False: 0]
  |  Branch (319:53): [True: 0, False: 0]
  ------------------
  320|      0|                                    dump_indent) <= 0)
  321|      0|                    goto end;
  322|      0|                nl = 1;
  323|      0|            }
  324|   995k|            if (dump_cont) {
  ------------------
  |  Branch (324:17): [True: 55.1k, False: 939k]
  ------------------
  325|  55.1k|                int i;
  326|  55.1k|                const unsigned char *tmp = op + hl;
  327|  55.1k|                if (BIO_puts(bp, ":[") <= 0)
  ------------------
  |  Branch (327:21): [True: 0, False: 55.1k]
  ------------------
  328|      0|                    goto end;
  329|   799k|                for (i = 0; i < len; i++) {
  ------------------
  |  Branch (329:29): [True: 744k, False: 55.1k]
  ------------------
  330|   744k|                    if (BIO_printf(bp, "%02X", tmp[i]) <= 0)
  ------------------
  |  Branch (330:25): [True: 0, False: 744k]
  ------------------
  331|      0|                        goto end;
  332|   744k|                }
  333|  55.1k|                if (BIO_puts(bp, "]") <= 0)
  ------------------
  |  Branch (333:21): [True: 0, False: 55.1k]
  ------------------
  334|      0|                    goto end;
  335|  55.1k|                dump_cont = 0;
  336|  55.1k|            }
  337|       |
  338|   995k|            if (!nl) {
  ------------------
  |  Branch (338:17): [True: 995k, False: 0]
  ------------------
  339|   995k|                if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (339:21): [True: 0, False: 995k]
  ------------------
  340|      0|                    goto end;
  341|   995k|            }
  342|   995k|            p += len;
  343|   995k|            if ((tag == V_ASN1_EOC) && (xclass == 0)) {
  ------------------
  |  |   62|   995k|# define V_ASN1_EOC                      0
  ------------------
  |  Branch (343:17): [True: 254k, False: 740k]
  |  Branch (343:40): [True: 254k, False: 0]
  ------------------
  344|   254k|                ret = 2;        /* End of sequence */
  345|   254k|                goto end;
  346|   254k|            }
  347|   995k|        }
  348|  1.43M|        length -= len;
  349|  1.43M|    }
  350|   267k|    ret = 1;
  351|   542k| end:
  352|   542k|    ASN1_OBJECT_free(o);
  353|   542k|    ASN1_OCTET_STRING_free(os);
  354|   542k|    ASN1_INTEGER_free(ai);
  355|   542k|    ASN1_ENUMERATED_free(ae);
  356|   542k|    *pp = p;
  357|   542k|    return ret;
  358|   267k|}
asn1_parse.c:asn1_print_info:
   24|  1.70M|{
   25|  1.70M|    char str[128];
   26|  1.70M|    const char *p;
   27|  1.70M|    int pop_f_prefix = 0;
   28|  1.70M|    long saved_indent = -1;
   29|  1.70M|    int i = 0;
   30|  1.70M|    BIO *bio = NULL;
   31|       |
   32|  1.70M|    if (constructed & V_ASN1_CONSTRUCTED)
  ------------------
  |  |   52|  1.70M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (32:9): [True: 692k, False: 1.01M]
  ------------------
   33|   692k|        p = "cons: ";
   34|  1.01M|    else
   35|  1.01M|        p = "prim: ";
   36|  1.70M|    if (constructed != (V_ASN1_CONSTRUCTED | 1)) {
  ------------------
  |  |   52|  1.70M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (36:9): [True: 1.44M, False: 267k]
  ------------------
   37|  1.44M|        if (BIO_snprintf(str, sizeof(str), "%5ld:d=%-2d hl=%ld l=%4ld %s",
  ------------------
  |  Branch (37:13): [True: 0, False: 1.44M]
  ------------------
   38|  1.44M|                         offset, depth, (long)hl, len, p) <= 0)
   39|      0|            goto err;
   40|  1.44M|    } else {
   41|   267k|        if (BIO_snprintf(str, sizeof(str), "%5ld:d=%-2d hl=%ld l=inf  %s",
  ------------------
  |  Branch (41:13): [True: 0, False: 267k]
  ------------------
   42|   267k|                         offset, depth, (long)hl, p) <= 0)
   43|      0|            goto err;
   44|   267k|    }
   45|  1.70M|    if (bp != NULL) {
  ------------------
  |  Branch (45:9): [True: 1.70M, False: 0]
  ------------------
   46|  1.70M|        if (BIO_set_prefix(bp, str) <= 0) {
  ------------------
  |  |  701|  1.70M|# define BIO_set_prefix(b,p) BIO_ctrl((b), BIO_CTRL_SET_PREFIX, 0, (void *)(p))
  |  |  ------------------
  |  |  |  |  175|  1.70M|# define BIO_CTRL_SET_PREFIX                    79
  |  |  ------------------
  ------------------
  |  Branch (46:13): [True: 1.70M, False: 0]
  ------------------
   47|  1.70M|            if ((bio = BIO_new(BIO_f_prefix())) == NULL
  ------------------
  |  Branch (47:17): [True: 0, False: 1.70M]
  ------------------
   48|  1.70M|                    || (bp = BIO_push(bio, bp)) == NULL)
  ------------------
  |  Branch (48:24): [True: 0, False: 1.70M]
  ------------------
   49|      0|                goto err;
   50|  1.70M|            pop_f_prefix = 1;
   51|  1.70M|        }
   52|  1.70M|        saved_indent = BIO_get_indent(bp);
  ------------------
  |  |  703|  1.70M|# define BIO_get_indent(b) BIO_ctrl((b), BIO_CTRL_GET_INDENT, 0, NULL)
  |  |  ------------------
  |  |  |  |  177|  1.70M|# define BIO_CTRL_GET_INDENT                    81
  |  |  ------------------
  ------------------
   53|  1.70M|        if (BIO_set_prefix(bp, str) <= 0 || BIO_set_indent(bp, indent) <= 0)
  ------------------
  |  |  701|  1.70M|# define BIO_set_prefix(b,p) BIO_ctrl((b), BIO_CTRL_SET_PREFIX, 0, (void *)(p))
  |  |  ------------------
  |  |  |  |  175|  1.70M|# define BIO_CTRL_SET_PREFIX                    79
  |  |  ------------------
  ------------------
                      if (BIO_set_prefix(bp, str) <= 0 || BIO_set_indent(bp, indent) <= 0)
  ------------------
  |  |  702|  1.70M|# define BIO_set_indent(b,i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL)
  |  |  ------------------
  |  |  |  |  176|  1.70M|# define BIO_CTRL_SET_INDENT                    80
  |  |  ------------------
  ------------------
  |  Branch (53:13): [True: 0, False: 1.70M]
  |  Branch (53:45): [True: 0, False: 1.70M]
  ------------------
   54|      0|            goto err;
   55|  1.70M|    }
   56|       |
   57|       |    /*
   58|       |     * BIO_set_prefix made a copy of |str|, so we can safely use it for
   59|       |     * something else, ASN.1 tag printout.
   60|       |     */
   61|  1.70M|    p = str;
   62|  1.70M|    if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
  ------------------
  |  |   50|  1.70M|# define V_ASN1_PRIVATE                  0xc0
  ------------------
                  if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
  ------------------
  |  |   50|  1.70M|# define V_ASN1_PRIVATE                  0xc0
  ------------------
  |  Branch (62:9): [True: 1.56k, False: 1.70M]
  ------------------
   63|  1.56k|        BIO_snprintf(str, sizeof(str), "priv [ %d ] ", tag);
   64|  1.70M|    else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)
  ------------------
  |  |   49|  1.70M|# define V_ASN1_CONTEXT_SPECIFIC         0x80
  ------------------
                  else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)
  ------------------
  |  |   49|  1.70M|# define V_ASN1_CONTEXT_SPECIFIC         0x80
  ------------------
  |  Branch (64:14): [True: 194k, False: 1.51M]
  ------------------
   65|   194k|        BIO_snprintf(str, sizeof(str), "cont [ %d ]", tag);
   66|  1.51M|    else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
  ------------------
  |  |   48|  1.51M|# define V_ASN1_APPLICATION              0x40
  ------------------
                  else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
  ------------------
  |  |   48|  1.51M|# define V_ASN1_APPLICATION              0x40
  ------------------
  |  Branch (66:14): [True: 4.10k, False: 1.50M]
  ------------------
   67|  4.10k|        BIO_snprintf(str, sizeof(str), "appl [ %d ]", tag);
   68|  1.50M|    else if (tag > 30)
  ------------------
  |  Branch (68:14): [True: 2.12k, False: 1.50M]
  ------------------
   69|  2.12k|        BIO_snprintf(str, sizeof(str), "<ASN1 %d>", tag);
   70|  1.50M|    else
   71|  1.50M|        p = ASN1_tag2str(tag);
   72|       |
   73|  1.70M|    i = (BIO_printf(bp, "%-18s", p) > 0);
   74|  1.70M| err:
   75|  1.70M|    if (saved_indent >= 0)
  ------------------
  |  Branch (75:9): [True: 1.70M, False: 0]
  ------------------
   76|  1.70M|        BIO_set_indent(bp, saved_indent);
  ------------------
  |  |  702|  1.70M|# define BIO_set_indent(b,i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL)
  |  |  ------------------
  |  |  |  |  176|  1.70M|# define BIO_CTRL_SET_INDENT                    80
  |  |  ------------------
  ------------------
   77|  1.70M|    if (pop_f_prefix)
  ------------------
  |  Branch (77:9): [True: 1.70M, False: 0]
  ------------------
   78|  1.70M|        BIO_pop(bp);
   79|  1.70M|    BIO_free(bio);
   80|  1.70M|    return i;
   81|  1.70M|}

ASN1_item_pack:
   17|      2|{
   18|      2|    ASN1_STRING *octmp;
   19|       |
   20|      2|    if (oct == NULL || *oct == NULL) {
  ------------------
  |  Branch (20:9): [True: 0, False: 2]
  |  Branch (20:24): [True: 2, False: 0]
  ------------------
   21|      2|        if ((octmp = ASN1_STRING_new()) == NULL) {
  ------------------
  |  Branch (21:13): [True: 0, False: 2]
  ------------------
   22|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   23|      0|            return NULL;
   24|      0|        }
   25|      2|    } else {
   26|      0|        octmp = *oct;
   27|      0|    }
   28|       |
   29|      2|    ASN1_STRING_set0(octmp, NULL, 0);
   30|       |
   31|      2|    if ((octmp->length = ASN1_item_i2d(obj, &octmp->data, it)) <= 0) {
  ------------------
  |  Branch (31:9): [True: 0, False: 2]
  ------------------
   32|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ENCODE_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   33|      0|        goto err;
   34|      0|    }
   35|      2|    if (octmp->data == NULL) {
  ------------------
  |  Branch (35:9): [True: 0, False: 2]
  ------------------
   36|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   37|      0|        goto err;
   38|      0|    }
   39|       |
   40|      2|    if (oct != NULL && *oct == NULL)
  ------------------
  |  Branch (40:9): [True: 2, False: 0]
  |  Branch (40:24): [True: 2, False: 0]
  ------------------
   41|      2|        *oct = octmp;
   42|       |
   43|      2|    return octmp;
   44|      0| err:
   45|      0|    if (oct == NULL || *oct == NULL)
  ------------------
  |  Branch (45:9): [True: 0, False: 0]
  |  Branch (45:24): [True: 0, False: 0]
  ------------------
   46|      0|        ASN1_STRING_free(octmp);
   47|      0|    return NULL;
   48|      2|}
ASN1_item_unpack:
   53|      9|{
   54|      9|    const unsigned char *p;
   55|      9|    void *ret;
   56|       |
   57|      9|    p = oct->data;
   58|      9|    if ((ret = ASN1_item_d2i(NULL, &p, oct->length, it)) == NULL)
  ------------------
  |  Branch (58:9): [True: 1, False: 8]
  ------------------
   59|      9|        ERR_raise(ERR_LIB_ASN1, ASN1_R_DECODE_ERROR);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
   60|      9|    return ret;
   61|      9|}

ossl_d2i_PrivateKey_legacy:
  104|  9.86k|{
  105|  9.86k|    EVP_PKEY *ret;
  106|  9.86k|    const unsigned char *p = *pp;
  107|       |
  108|  9.86k|    if (a == NULL || *a == NULL) {
  ------------------
  |  Branch (108:9): [True: 9.86k, False: 0]
  |  Branch (108:22): [True: 0, False: 0]
  ------------------
  109|  9.86k|        if ((ret = EVP_PKEY_new()) == NULL) {
  ------------------
  |  Branch (109:13): [True: 0, False: 9.86k]
  ------------------
  110|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  111|      0|            return NULL;
  112|      0|        }
  113|  9.86k|    } else {
  114|      0|        ret = *a;
  115|      0|#ifndef OPENSSL_NO_ENGINE
  116|      0|        ENGINE_finish(ret->engine);
  117|      0|        ret->engine = NULL;
  118|      0|#endif
  119|      0|    }
  120|       |
  121|  9.86k|    if (!EVP_PKEY_set_type(ret, keytype)) {
  ------------------
  |  Branch (121:9): [True: 0, False: 9.86k]
  ------------------
  122|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  123|      0|        goto err;
  124|      0|    }
  125|       |
  126|  9.86k|    ERR_set_mark();
  127|  9.86k|    if (!ret->ameth->old_priv_decode ||
  ------------------
  |  Branch (127:9): [True: 0, False: 9.86k]
  ------------------
  128|  9.86k|        !ret->ameth->old_priv_decode(ret, &p, length)) {
  ------------------
  |  Branch (128:9): [True: 9.49k, False: 370]
  ------------------
  129|  9.49k|        if (ret->ameth->priv_decode != NULL
  ------------------
  |  Branch (129:13): [True: 9.03k, False: 460]
  ------------------
  130|  9.49k|                || ret->ameth->priv_decode_ex != NULL) {
  ------------------
  |  Branch (130:20): [True: 460, False: 0]
  ------------------
  131|  9.49k|            EVP_PKEY *tmp;
  132|  9.49k|            PKCS8_PRIV_KEY_INFO *p8 = NULL;
  133|  9.49k|            p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
  134|  9.49k|            if (p8 == NULL) {
  ------------------
  |  Branch (134:17): [True: 9.48k, False: 4]
  ------------------
  135|  9.48k|                ERR_clear_last_mark();
  136|  9.48k|                goto err;
  137|  9.48k|            }
  138|      4|            tmp = evp_pkcs82pkey_legacy(p8, libctx, propq);
  139|      4|            PKCS8_PRIV_KEY_INFO_free(p8);
  140|      4|            if (tmp == NULL) {
  ------------------
  |  Branch (140:17): [True: 2, False: 2]
  ------------------
  141|      2|                ERR_clear_last_mark();
  142|      2|                goto err;
  143|      2|            }
  144|      2|            EVP_PKEY_free(ret);
  145|      2|            ret = tmp;
  146|      2|            ERR_pop_to_mark();
  147|      2|            if (EVP_PKEY_type(keytype) != EVP_PKEY_get_base_id(ret))
  ------------------
  |  Branch (147:17): [True: 1, False: 1]
  ------------------
  148|      1|                goto err;
  149|      2|        } else {
  150|      0|            ERR_clear_last_mark();
  151|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  152|      0|            goto err;
  153|      0|        }
  154|  9.49k|    } else {
  155|    370|      ERR_clear_last_mark();
  156|    370|    }
  157|    371|    *pp = p;
  158|    371|    if (a != NULL)
  ------------------
  |  Branch (158:9): [True: 0, False: 371]
  ------------------
  159|      0|        *a = ret;
  160|    371|    return ret;
  161|  9.48k| err:
  162|  9.48k|    if (a == NULL || *a != ret)
  ------------------
  |  Branch (162:9): [True: 9.48k, False: 0]
  |  Branch (162:22): [True: 0, False: 0]
  ------------------
  163|  9.48k|        EVP_PKEY_free(ret);
  164|  9.48k|    return NULL;
  165|  9.86k|}
d2i_AutoPrivateKey_ex:
  245|  12.7k|{
  246|  12.7k|    EVP_PKEY *ret;
  247|       |
  248|  12.7k|    ret = d2i_PrivateKey_decoder(EVP_PKEY_NONE, a, pp, length, libctx, propq);
  ------------------
  |  |   62|  12.7k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  12.7k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  249|       |    /* try the legacy path if the decoder failed */
  250|  12.7k|    if (ret == NULL)
  ------------------
  |  Branch (250:9): [True: 11.3k, False: 1.40k]
  ------------------
  251|  11.3k|        ret = d2i_AutoPrivateKey_legacy(a, pp, length, libctx, propq);
  252|  12.7k|    return ret;
  253|  12.7k|}
d2i_AutoPrivateKey:
  257|  12.7k|{
  258|  12.7k|    return d2i_AutoPrivateKey_ex(a, pp, length, NULL, NULL);
  259|  12.7k|}
d2i_pr.c:d2i_PrivateKey_decoder:
   31|  12.7k|{
   32|  12.7k|    OSSL_DECODER_CTX *dctx = NULL;
   33|  12.7k|    size_t len = length;
   34|  12.7k|    EVP_PKEY *pkey = NULL, *bak_a = NULL;
   35|  12.7k|    EVP_PKEY **ppkey = &pkey;
   36|  12.7k|    const char *key_name = NULL;
   37|  12.7k|    char keytypebuf[OSSL_MAX_NAME_SIZE];
   38|  12.7k|    int ret;
   39|  12.7k|    const unsigned char *p = *pp;
   40|  12.7k|    const char *structure;
   41|  12.7k|    PKCS8_PRIV_KEY_INFO *p8info;
   42|  12.7k|    const ASN1_OBJECT *algoid;
   43|       |
   44|  12.7k|    if (keytype != EVP_PKEY_NONE) {
  ------------------
  |  |   62|  12.7k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  12.7k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (44:9): [True: 0, False: 12.7k]
  ------------------
   45|      0|        key_name = evp_pkey_type2name(keytype);
   46|      0|        if (key_name == NULL)
  ------------------
  |  Branch (46:13): [True: 0, False: 0]
  ------------------
   47|      0|            return NULL;
   48|      0|    }
   49|       |
   50|       |    /* This is just a probe. It might fail, so we ignore errors */
   51|  12.7k|    ERR_set_mark();
   52|  12.7k|    p8info = d2i_PKCS8_PRIV_KEY_INFO(NULL, pp, len);
   53|  12.7k|    ERR_pop_to_mark();
   54|  12.7k|    if (p8info != NULL) {
  ------------------
  |  Branch (54:9): [True: 639, False: 12.1k]
  ------------------
   55|    639|        int64_t v;
   56|       |
   57|       |        /* ascertain version is 0 or 1 as per RFC5958 */
   58|    639|        if (!ASN1_INTEGER_get_int64(&v, p8info->version)
  ------------------
  |  Branch (58:13): [True: 0, False: 639]
  ------------------
   59|    639|            || (v != 0 && v != 1)) {
  ------------------
  |  Branch (59:17): [True: 89, False: 550]
  |  Branch (59:27): [True: 29, False: 60]
  ------------------
   60|     29|            *pp = p;
   61|     29|            ERR_raise(ERR_LIB_ASN1, ASN1_R_ASN1_PARSE_ERROR);
  ------------------
  |  |  401|     29|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     29|    (ERR_new(),                                                 \
  |  |  |  |  404|     29|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     29|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     29|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     29|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     29|     ERR_set_error)
  |  |  ------------------
  ------------------
   62|     29|            PKCS8_PRIV_KEY_INFO_free(p8info);
   63|     29|            return NULL;
   64|     29|        }
   65|    610|        if (key_name == NULL
  ------------------
  |  Branch (65:13): [True: 610, False: 0]
  ------------------
   66|    610|                && PKCS8_pkey_get0(&algoid, NULL, NULL, NULL, p8info)
  ------------------
  |  Branch (66:20): [True: 610, False: 0]
  ------------------
   67|    610|                && OBJ_obj2txt(keytypebuf, sizeof(keytypebuf), algoid, 0))
  ------------------
  |  Branch (67:20): [True: 610, False: 0]
  ------------------
   68|    610|            key_name = keytypebuf;
   69|    610|        structure = "PrivateKeyInfo";
   70|    610|        PKCS8_PRIV_KEY_INFO_free(p8info);
   71|  12.1k|    } else {
   72|  12.1k|        structure = "type-specific";
   73|  12.1k|    }
   74|  12.7k|    *pp = p;
   75|       |
   76|  12.7k|    if (a != NULL && (bak_a = *a) != NULL)
  ------------------
  |  Branch (76:9): [True: 0, False: 12.7k]
  |  Branch (76:22): [True: 0, False: 0]
  ------------------
   77|      0|        ppkey = a;
   78|  12.7k|    dctx = OSSL_DECODER_CTX_new_for_pkey(ppkey, "DER", structure, key_name,
   79|  12.7k|                                         EVP_PKEY_KEYPAIR, libctx, propq);
  ------------------
  |  |  113|  12.7k|    ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  111|  12.7k|    ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|  12.7k|    ( OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  647|  12.7k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  642|  12.7k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  648|  12.7k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  643|  12.7k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|  12.7k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  640|  12.7k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  ------------------
   80|  12.7k|    if (a != NULL)
  ------------------
  |  Branch (80:9): [True: 0, False: 12.7k]
  ------------------
   81|      0|        *a = bak_a;
   82|  12.7k|    if (dctx == NULL)
  ------------------
  |  Branch (82:9): [True: 0, False: 12.7k]
  ------------------
   83|      0|        goto err;
   84|       |
   85|  12.7k|    ret = OSSL_DECODER_from_data(dctx, pp, &len);
   86|  12.7k|    OSSL_DECODER_CTX_free(dctx);
   87|  12.7k|    if (ret
  ------------------
  |  Branch (87:9): [True: 1.40k, False: 11.3k]
  ------------------
   88|  12.7k|        && *ppkey != NULL
  ------------------
  |  Branch (88:12): [True: 1.40k, False: 0]
  ------------------
   89|  12.7k|        && evp_keymgmt_util_has(*ppkey, OSSL_KEYMGMT_SELECT_PRIVATE_KEY)) {
  ------------------
  |  |  640|  1.40k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (89:12): [True: 1.40k, False: 0]
  ------------------
   90|  1.40k|        if (a != NULL)
  ------------------
  |  Branch (90:13): [True: 0, False: 1.40k]
  ------------------
   91|      0|            *a = *ppkey;
   92|  1.40k|        return *ppkey;
   93|  1.40k|    }
   94|       |
   95|  11.3k| err:
   96|  11.3k|    if (ppkey != a)
  ------------------
  |  Branch (96:9): [True: 11.3k, False: 0]
  ------------------
   97|  11.3k|        EVP_PKEY_free(*ppkey);
   98|  11.3k|    return NULL;
   99|  12.7k|}
d2i_pr.c:d2i_AutoPrivateKey_legacy:
  191|  11.3k|{
  192|  11.3k|    STACK_OF(ASN1_TYPE) *inkey;
  ------------------
  |  |   31|  11.3k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  193|  11.3k|    const unsigned char *p;
  194|  11.3k|    int keytype;
  195|       |
  196|  11.3k|    p = *pp;
  197|       |    /*
  198|       |     * Dirty trick: read in the ASN1 data into a STACK_OF(ASN1_TYPE): by
  199|       |     * analyzing it we can determine the passed structure: this assumes the
  200|       |     * input is surrounded by an ASN1 SEQUENCE.
  201|       |     */
  202|  11.3k|    inkey = d2i_ASN1_SEQUENCE_ANY(NULL, &p, length);
  203|  11.3k|    p = *pp;
  204|       |    /*
  205|       |     * Since we only need to discern "traditional format" RSA and DSA keys we
  206|       |     * can just count the elements.
  207|       |     */
  208|  11.3k|    if (sk_ASN1_TYPE_num(inkey) == 6) {
  ------------------
  |  |  556|  11.3k|#define sk_ASN1_TYPE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_TYPE_sk_type(sk))
  ------------------
  |  Branch (208:9): [True: 262, False: 11.0k]
  ------------------
  209|    262|        keytype = EVP_PKEY_DSA;
  ------------------
  |  |   66|    262|# define EVP_PKEY_DSA    NID_dsa
  |  |  ------------------
  |  |  |  |  136|    262|#define NID_dsa         116
  |  |  ------------------
  ------------------
  210|  11.0k|    } else if (sk_ASN1_TYPE_num(inkey) == 4) {
  ------------------
  |  |  556|  11.0k|#define sk_ASN1_TYPE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_TYPE_sk_type(sk))
  ------------------
  |  Branch (210:16): [True: 467, False: 10.6k]
  ------------------
  211|    467|        keytype = EVP_PKEY_EC;
  ------------------
  |  |   73|    467|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|    467|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  212|  10.6k|    } else if (sk_ASN1_TYPE_num(inkey) == 3) { /* This seems to be PKCS8, not
  ------------------
  |  |  556|  10.6k|#define sk_ASN1_TYPE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_TYPE_sk_type(sk))
  ------------------
  |  Branch (212:16): [True: 1.48k, False: 9.13k]
  ------------------
  213|       |                                              * traditional format */
  214|  1.48k|        PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
  215|  1.48k|        EVP_PKEY *ret;
  216|       |
  217|  1.48k|        sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free);
  ------------------
  |  |  570|  1.48k|#define sk_ASN1_TYPE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_freefunc_type(freefunc))
  ------------------
  218|  1.48k|        if (p8 == NULL) {
  ------------------
  |  Branch (218:13): [True: 1.36k, False: 123]
  ------------------
  219|  1.36k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE);
  ------------------
  |  |  401|  1.36k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.36k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.36k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.36k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.36k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.36k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.36k|     ERR_set_error)
  |  |  ------------------
  ------------------
  220|  1.36k|            return NULL;
  221|  1.36k|        }
  222|    123|        ret = evp_pkcs82pkey_legacy(p8, libctx, propq);
  223|    123|        PKCS8_PRIV_KEY_INFO_free(p8);
  224|    123|        if (ret == NULL)
  ------------------
  |  Branch (224:13): [True: 115, False: 8]
  ------------------
  225|    115|            return NULL;
  226|      8|        *pp = p;
  227|      8|        if (a != NULL) {
  ------------------
  |  Branch (227:13): [True: 0, False: 8]
  ------------------
  228|      0|            *a = ret;
  229|      0|        }
  230|      8|        return ret;
  231|  9.13k|    } else {
  232|  9.13k|        keytype = EVP_PKEY_RSA;
  ------------------
  |  |   63|  9.13k|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|  9.13k|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  233|  9.13k|    }
  234|  9.86k|    sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free);
  ------------------
  |  |  570|  9.86k|#define sk_ASN1_TYPE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_freefunc_type(freefunc))
  ------------------
  235|  9.86k|    return ossl_d2i_PrivateKey_legacy(keytype, a, pp, length, libctx, propq);
  236|  11.3k|}

i2a_ASN1_INTEGER:
   17|  1.04k|{
   18|  1.04k|    int i, n = 0;
   19|  1.04k|    char buf[2];
   20|       |
   21|  1.04k|    if (a == NULL)
  ------------------
  |  Branch (21:9): [True: 0, False: 1.04k]
  ------------------
   22|      0|        return 0;
   23|       |
   24|  1.04k|    if (a->type & V_ASN1_NEG) {
  ------------------
  |  |   97|  1.04k|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (24:9): [True: 485, False: 563]
  ------------------
   25|    485|        if (BIO_write(bp, "-", 1) != 1)
  ------------------
  |  Branch (25:13): [True: 0, False: 485]
  ------------------
   26|      0|            goto err;
   27|    485|        n = 1;
   28|    485|    }
   29|       |
   30|  1.04k|    if (a->length == 0) {
  ------------------
  |  Branch (30:9): [True: 0, False: 1.04k]
  ------------------
   31|      0|        if (BIO_write(bp, "00", 2) != 2)
  ------------------
  |  Branch (31:13): [True: 0, False: 0]
  ------------------
   32|      0|            goto err;
   33|      0|        n += 2;
   34|  1.04k|    } else {
   35|  5.21k|        for (i = 0; i < a->length; i++) {
  ------------------
  |  Branch (35:21): [True: 4.16k, False: 1.04k]
  ------------------
   36|  4.16k|            if ((i != 0) && (i % 35 == 0)) {
  ------------------
  |  Branch (36:17): [True: 3.11k, False: 1.04k]
  |  Branch (36:29): [True: 72, False: 3.04k]
  ------------------
   37|     72|                if (BIO_write(bp, "\\\n", 2) != 2)
  ------------------
  |  Branch (37:21): [True: 0, False: 72]
  ------------------
   38|      0|                    goto err;
   39|     72|                n += 2;
   40|     72|            }
   41|  4.16k|            ossl_to_hex(buf, a->data[i]);
   42|  4.16k|            if (BIO_write(bp, buf, 2) != 2)
  ------------------
  |  Branch (42:17): [True: 0, False: 4.16k]
  ------------------
   43|      0|                goto err;
   44|  4.16k|            n += 2;
   45|  4.16k|        }
   46|  1.04k|    }
   47|  1.04k|    return n;
   48|      0| err:
   49|      0|    return -1;
   50|  1.04k|}

i2a_ASN1_STRING:
   17|    146|{
   18|    146|    int i, n = 0;
   19|    146|    char buf[2];
   20|       |
   21|    146|    if (a == NULL)
  ------------------
  |  Branch (21:9): [True: 0, False: 146]
  ------------------
   22|      0|        return 0;
   23|       |
   24|    146|    if (a->length == 0) {
  ------------------
  |  Branch (24:9): [True: 40, False: 106]
  ------------------
   25|     40|        if (BIO_write(bp, "0", 1) != 1)
  ------------------
  |  Branch (25:13): [True: 0, False: 40]
  ------------------
   26|      0|            goto err;
   27|     40|        n = 1;
   28|    106|    } else {
   29|  20.3k|        for (i = 0; i < a->length; i++) {
  ------------------
  |  Branch (29:21): [True: 20.2k, False: 106]
  ------------------
   30|  20.2k|            if ((i != 0) && (i % 35 == 0)) {
  ------------------
  |  Branch (30:17): [True: 20.1k, False: 106]
  |  Branch (30:29): [True: 565, False: 19.6k]
  ------------------
   31|    565|                if (BIO_write(bp, "\\\n", 2) != 2)
  ------------------
  |  Branch (31:21): [True: 0, False: 565]
  ------------------
   32|      0|                    goto err;
   33|    565|                n += 2;
   34|    565|            }
   35|  20.2k|            ossl_to_hex(buf, a->data[i]);
   36|  20.2k|            if (BIO_write(bp, buf, 2) != 2)
  ------------------
  |  Branch (36:17): [True: 0, False: 20.2k]
  ------------------
   37|      0|                goto err;
   38|  20.2k|            n += 2;
   39|  20.2k|        }
   40|    106|    }
   41|    146|    return n;
   42|      0| err:
   43|      0|    return -1;
   44|    146|}

i2d_PrivateKey:
  128|  1.78k|{
  129|  1.78k|    return i2d_PrivateKey_impl(a, pp, 1);
  130|  1.78k|}
i2d_evp.c:i2d_provided:
   36|  1.40k|{
   37|  1.40k|    int ret;
   38|       |
   39|  1.40k|    for (ret = -1;
   40|  3.05k|         ret == -1 && output_info->output_type != NULL;
  ------------------
  |  Branch (40:10): [True: 1.85k, False: 1.19k]
  |  Branch (40:23): [True: 1.64k, False: 212]
  ------------------
   41|  1.64k|         output_info++) {
   42|       |        /*
   43|       |         * The i2d_ calls don't take a boundary length for *pp.  However,
   44|       |         * OSSL_ENCODER_to_data() needs one, so we make one up.  Because
   45|       |         * OSSL_ENCODER_to_data() decrements this number by the amount of
   46|       |         * bytes written, we need to calculate the length written further
   47|       |         * down, when pp != NULL.
   48|       |         */
   49|  1.64k|        size_t len = INT_MAX;
   50|  1.64k|        int pp_was_NULL = (pp == NULL || *pp == NULL);
  ------------------
  |  Branch (50:28): [True: 0, False: 1.64k]
  |  Branch (50:42): [True: 1.64k, False: 0]
  ------------------
   51|  1.64k|        OSSL_ENCODER_CTX *ctx;
   52|       |
   53|  1.64k|        ctx = OSSL_ENCODER_CTX_new_for_pkey(a, selection,
   54|  1.64k|                                            output_info->output_type,
   55|  1.64k|                                            output_info->output_structure,
   56|  1.64k|                                            NULL);
   57|  1.64k|        if (ctx == NULL)
  ------------------
  |  Branch (57:13): [True: 0, False: 1.64k]
  ------------------
   58|      0|            return -1;
   59|  1.64k|        if (OSSL_ENCODER_to_data(ctx, pp, &len)) {
  ------------------
  |  Branch (59:13): [True: 1.19k, False: 447]
  ------------------
   60|  1.19k|            if (pp_was_NULL)
  ------------------
  |  Branch (60:17): [True: 1.19k, False: 0]
  ------------------
   61|  1.19k|                ret = (int)len;
   62|      0|            else
   63|      0|                ret = INT_MAX - (int)len;
   64|  1.19k|        }
   65|  1.64k|        OSSL_ENCODER_CTX_free(ctx);
   66|  1.64k|    }
   67|       |
   68|  1.40k|    if (ret == -1)
  ------------------
  |  Branch (68:9): [True: 212, False: 1.19k]
  ------------------
   69|  1.40k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_TYPE);
  ------------------
  |  |  401|    212|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    212|    (ERR_new(),                                                 \
  |  |  |  |  404|    212|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    212|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    212|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    212|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    212|     ERR_set_error)
  |  |  ------------------
  ------------------
   70|  1.40k|    return ret;
   71|  1.40k|}
i2d_evp.c:i2d_PrivateKey_impl:
   96|  1.78k|{
   97|  1.78k|    if (evp_pkey_is_provided(a)) {
  ------------------
  |  |  649|  1.78k|    ((pk)->keymgmt != NULL)
  |  |  ------------------
  |  |  |  Branch (649:5): [True: 1.40k, False: 379]
  |  |  ------------------
  ------------------
   98|  1.40k|        static const struct type_and_structure_st trad_output_info[] = {
   99|  1.40k|            { "DER", "type-specific" },
  100|  1.40k|            { "DER", "PrivateKeyInfo" },
  101|  1.40k|            { NULL, }
  102|  1.40k|        };
  103|  1.40k|        const struct type_and_structure_st *oi = trad_output_info;
  104|       |
  105|  1.40k|        if (!traditional)
  ------------------
  |  Branch (105:13): [True: 0, False: 1.40k]
  ------------------
  106|      0|            ++oi;
  107|  1.40k|        return i2d_provided(a, EVP_PKEY_KEYPAIR, oi, pp);
  ------------------
  |  |  113|  1.40k|    ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  111|  1.40k|    ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|  1.40k|    ( OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  647|  1.40k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  642|  1.40k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  648|  1.40k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  643|  1.40k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|  1.40k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  640|  1.40k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  ------------------
  108|  1.40k|    }
  109|       |
  110|    379|    if (traditional && a->ameth != NULL && a->ameth->old_priv_encode != NULL)
  ------------------
  |  Branch (110:9): [True: 379, False: 0]
  |  Branch (110:24): [True: 379, False: 0]
  |  Branch (110:44): [True: 375, False: 4]
  ------------------
  111|    375|        return a->ameth->old_priv_encode(a, pp);
  112|       |
  113|      4|    if (a->ameth != NULL && a->ameth->priv_encode != NULL) {
  ------------------
  |  Branch (113:9): [True: 4, False: 0]
  |  Branch (113:29): [True: 4, False: 0]
  ------------------
  114|      4|        PKCS8_PRIV_KEY_INFO *p8 = EVP_PKEY2PKCS8(a);
  115|      4|        int ret = 0;
  116|       |
  117|      4|        if (p8 != NULL) {
  ------------------
  |  Branch (117:13): [True: 4, False: 0]
  ------------------
  118|      4|            ret = i2d_PKCS8_PRIV_KEY_INFO(p8, pp);
  119|      4|            PKCS8_PRIV_KEY_INFO_free(p8);
  120|      4|        }
  121|      4|        return ret;
  122|      4|    }
  123|      4|    ERR_raise(ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  124|      0|    return -1;
  125|      4|}

nsseq.c:nsseq_cb:
   18|  50.8k|{
   19|  50.8k|    if (operation == ASN1_OP_NEW_POST) {
  ------------------
  |  |  743|  50.8k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (19:9): [True: 10.1k, False: 40.7k]
  ------------------
   20|  10.1k|        NETSCAPE_CERT_SEQUENCE *nsseq;
   21|  10.1k|        nsseq = (NETSCAPE_CERT_SEQUENCE *)*pval;
   22|  10.1k|        nsseq->type = OBJ_nid2obj(NID_netscape_cert_sequence);
  ------------------
  |  | 2962|  10.1k|#define NID_netscape_cert_sequence              79
  ------------------
   23|  10.1k|    }
   24|  50.8k|    return 1;
   25|  50.8k|}

PKCS8_pkey_set0:
   56|     27|{
   57|     27|    if (version >= 0) {
  ------------------
  |  Branch (57:9): [True: 27, False: 0]
  ------------------
   58|       |        /* We only support PKCS#8 v1 (0) and v2 (1). */
   59|     27|        if (version > 1)
  ------------------
  |  Branch (59:13): [True: 0, False: 27]
  ------------------
   60|      0|            return 0;
   61|     27|        if (!ASN1_INTEGER_set(priv->version, version))
  ------------------
  |  Branch (61:13): [True: 0, False: 27]
  ------------------
   62|      0|            return 0;
   63|     27|    }
   64|     27|    if (!X509_ALGOR_set0(priv->pkeyalg, aobj, ptype, pval))
  ------------------
  |  Branch (64:9): [True: 0, False: 27]
  ------------------
   65|      0|        return 0;
   66|     27|    if (penc)
  ------------------
  |  Branch (66:9): [True: 27, False: 0]
  ------------------
   67|     27|        ASN1_STRING_set0(priv->pkey, penc, penclen);
   68|     27|    return 1;
   69|     27|}
PKCS8_pkey_get0:
   74|  2.85k|{
   75|  2.85k|    if (ppkalg)
  ------------------
  |  Branch (75:9): [True: 737, False: 2.11k]
  ------------------
   76|    737|        *ppkalg = p8->pkeyalg->algorithm;
   77|  2.85k|    if (pk) {
  ------------------
  |  Branch (77:9): [True: 1.20k, False: 1.64k]
  ------------------
   78|  1.20k|        *pk = ASN1_STRING_get0_data(p8->pkey);
   79|  1.20k|        *ppklen = ASN1_STRING_length(p8->pkey);
   80|  1.20k|    }
   81|  2.85k|    if (pa)
  ------------------
  |  Branch (81:9): [True: 2.11k, False: 737]
  ------------------
   82|  2.11k|        *pa = p8->pkeyalg;
   83|  2.85k|    return 1;
   84|  2.85k|}
p8_pkey.c:pkey_cb:
   19|  1.10M|{
   20|  1.10M|    PKCS8_PRIV_KEY_INFO *key;
   21|  1.10M|    int version;
   22|       |
   23|  1.10M|    switch (operation) {
  ------------------
  |  Branch (23:13): [True: 882k, False: 224k]
  ------------------
   24|   219k|    case ASN1_OP_FREE_PRE:
  ------------------
  |  |  744|   219k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (24:5): [True: 219k, False: 887k]
  ------------------
   25|       |        /* The structure is still valid during ASN1_OP_FREE_PRE */
   26|   219k|        key = (PKCS8_PRIV_KEY_INFO *)*pval;
   27|   219k|        if (key->pkey)
  ------------------
  |  Branch (27:13): [True: 219k, False: 0]
  ------------------
   28|   219k|            OPENSSL_cleanse(key->pkey->data, key->pkey->length);
   29|   219k|        break;
   30|  4.82k|    case ASN1_OP_D2I_POST:
  ------------------
  |  |  747|  4.82k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (30:5): [True: 4.82k, False: 1.10M]
  ------------------
   31|       |        /* Insist on a valid version now that the structure is decoded */
   32|  4.82k|        key = (PKCS8_PRIV_KEY_INFO *)*pval;
   33|  4.82k|        version = ASN1_INTEGER_get(key->version);
   34|  4.82k|        if (version < 0 || version > 1)
  ------------------
  |  Branch (34:13): [True: 1.19k, False: 3.62k]
  |  Branch (34:28): [True: 791, False: 2.83k]
  ------------------
   35|  1.98k|            return 0;
   36|  2.83k|        if (version == 0 && key->kpub != NULL)
  ------------------
  |  Branch (36:13): [True: 2.48k, False: 349]
  |  Branch (36:29): [True: 64, False: 2.42k]
  ------------------
   37|     64|            return 0;
   38|  2.76k|        break;
   39|  1.10M|    }
   40|  1.10M|    return 1;
   41|  1.10M|}

ASN1_buf_print:
   22|  3.56k|{
   23|  3.56k|    size_t i;
   24|       |
   25|   819k|    for (i = 0; i < buflen; i++) {
  ------------------
  |  Branch (25:17): [True: 816k, False: 3.56k]
  ------------------
   26|   816k|        if ((i % ASN1_BUF_PRINT_WIDTH) == 0) {
  ------------------
  |  |   17|   816k|#define ASN1_BUF_PRINT_WIDTH    15
  ------------------
  |  Branch (26:13): [True: 55.9k, False: 760k]
  ------------------
   27|  55.9k|            if (i > 0 && BIO_puts(bp, "\n") <= 0)
  ------------------
  |  Branch (27:17): [True: 52.3k, False: 3.56k]
  |  Branch (27:26): [True: 0, False: 52.3k]
  ------------------
   28|      0|                return 0;
   29|  55.9k|            if (!BIO_indent(bp, indent, ASN1_PRINT_MAX_INDENT))
  ------------------
  |  |   19|  55.9k|#define ASN1_PRINT_MAX_INDENT 128
  ------------------
  |  Branch (29:17): [True: 0, False: 55.9k]
  ------------------
   30|      0|                return 0;
   31|  55.9k|        }
   32|       |        /*
   33|       |         * Use colon separators for each octet for compatibility as
   34|       |         * this function is used to print out key components.
   35|       |         */
   36|   816k|        if (BIO_printf(bp, "%02x%s", buf[i],
  ------------------
  |  Branch (36:13): [True: 0, False: 816k]
  ------------------
   37|   816k|                       (i == buflen - 1) ? "" : ":") <= 0)
  ------------------
  |  Branch (37:24): [True: 3.56k, False: 812k]
  ------------------
   38|      0|                return 0;
   39|   816k|    }
   40|  3.56k|    if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (40:9): [True: 0, False: 3.56k]
  ------------------
   41|      0|        return 0;
   42|  3.56k|    return 1;
   43|  3.56k|}
ASN1_bn_print:
   47|  57.8k|{
   48|  57.8k|    int n, rv = 0;
   49|  57.8k|    const char *neg;
   50|  57.8k|    unsigned char *buf = NULL, *tmp = NULL;
   51|  57.8k|    int buflen;
   52|       |
   53|  57.8k|    if (num == NULL)
  ------------------
  |  Branch (53:9): [True: 0, False: 57.8k]
  ------------------
   54|      0|        return 1;
   55|  57.8k|    neg = BN_is_negative(num) ? "-" : "";
  ------------------
  |  Branch (55:11): [True: 0, False: 57.8k]
  ------------------
   56|  57.8k|    if (!BIO_indent(bp, indent, ASN1_PRINT_MAX_INDENT))
  ------------------
  |  |   19|  57.8k|#define ASN1_PRINT_MAX_INDENT 128
  ------------------
  |  Branch (56:9): [True: 0, False: 57.8k]
  ------------------
   57|      0|        return 0;
   58|  57.8k|    if (BN_is_zero(num)) {
  ------------------
  |  Branch (58:9): [True: 25.4k, False: 32.4k]
  ------------------
   59|  25.4k|        if (BIO_printf(bp, "%s 0\n", number) <= 0)
  ------------------
  |  Branch (59:13): [True: 0, False: 25.4k]
  ------------------
   60|      0|            return 0;
   61|  25.4k|        return 1;
   62|  25.4k|    }
   63|       |
   64|  32.4k|    if (BN_num_bytes(num) <= BN_BYTES) {
  ------------------
  |  |  189|  32.4k|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
                  if (BN_num_bytes(num) <= BN_BYTES) {
  ------------------
  |  |   38|  32.4k|#  define BN_BYTES        8
  ------------------
  |  Branch (64:9): [True: 30.0k, False: 2.38k]
  ------------------
   65|  30.0k|        if (BIO_printf(bp, "%s %s%lu (%s0x%lx)\n", number, neg,
  ------------------
  |  Branch (65:13): [True: 0, False: 30.0k]
  ------------------
   66|  30.0k|                       (unsigned long)bn_get_words(num)[0], neg,
   67|  30.0k|                       (unsigned long)bn_get_words(num)[0]) <= 0)
   68|      0|            return 0;
   69|  30.0k|        return 1;
   70|  30.0k|    }
   71|       |
   72|  2.38k|    buflen = BN_num_bytes(num) + 1;
  ------------------
  |  |  189|  2.38k|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
   73|  2.38k|    buf = tmp = OPENSSL_malloc(buflen);
  ------------------
  |  |  102|  2.38k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.38k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.38k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   74|  2.38k|    if (buf == NULL)
  ------------------
  |  Branch (74:9): [True: 0, False: 2.38k]
  ------------------
   75|      0|        goto err;
   76|  2.38k|    buf[0] = 0;
   77|  2.38k|    if (BIO_printf(bp, "%s%s\n", number,
  ------------------
  |  Branch (77:9): [True: 0, False: 2.38k]
  ------------------
   78|  2.38k|                   (neg[0] == '-') ? " (Negative)" : "") <= 0)
  ------------------
  |  Branch (78:20): [True: 0, False: 2.38k]
  ------------------
   79|      0|        goto err;
   80|  2.38k|    n = BN_bn2bin(num, buf + 1);
   81|       |
   82|  2.38k|    if (buf[1] & 0x80)
  ------------------
  |  Branch (82:9): [True: 1.23k, False: 1.15k]
  ------------------
   83|  1.23k|        n++;
   84|  1.15k|    else
   85|  1.15k|        tmp++;
   86|       |
   87|  2.38k|    if (ASN1_buf_print(bp, tmp, n, indent + 4) == 0)
  ------------------
  |  Branch (87:9): [True: 0, False: 2.38k]
  ------------------
   88|      0|        goto err;
   89|  2.38k|    rv = 1;
   90|  2.38k|    err:
   91|  2.38k|    OPENSSL_clear_free(buf, buflen);
  ------------------
  |  |  113|  2.38k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.38k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.38k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|  2.38k|    return rv;
   93|  2.38k|}

ASN1_tag2bit:
   88|   699k|{
   89|   699k|    if ((tag < 0) || (tag > 30))
  ------------------
  |  Branch (89:9): [True: 0, False: 699k]
  |  Branch (89:22): [True: 532, False: 698k]
  ------------------
   90|    532|        return 0;
   91|   698k|    return tag2bit[tag];
   92|   699k|}
ASN1_item_ex_d2i:
  128|   192k|{
  129|   192k|    return asn1_item_ex_d2i_intern(pval, in, len, it, tag, aclass, opt, ctx,
  130|   192k|                                   NULL, NULL);
  131|   192k|}
ASN1_item_d2i_ex:
  137|  2.95M|{
  138|  2.95M|    ASN1_TLC c;
  139|  2.95M|    ASN1_VALUE *ptmpval = NULL;
  140|       |
  141|  2.95M|    if (pval == NULL)
  ------------------
  |  Branch (141:9): [True: 2.89M, False: 60.2k]
  ------------------
  142|  2.89M|        pval = &ptmpval;
  143|  2.95M|    asn1_tlc_clear_nc(&c);
  ------------------
  |  |   98|  2.95M|#define asn1_tlc_clear_nc(c)    do {(c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (98:62): [Folded - Ignored]
  |  |  ------------------
  ------------------
  144|  2.95M|    if (asn1_item_ex_d2i_intern(pval, in, len, it, -1, 0, 0, &c, libctx,
  ------------------
  |  Branch (144:9): [True: 485k, False: 2.47M]
  ------------------
  145|  2.95M|                                propq) > 0)
  146|   485k|        return *pval;
  147|  2.47M|    return NULL;
  148|  2.95M|}
ASN1_item_d2i:
  153|  2.91M|{
  154|  2.91M|    return ASN1_item_d2i_ex(pval, in, len, it, NULL, NULL);
  155|  2.91M|}
tasn_dec.c:asn1_item_ex_d2i_intern:
  111|  3.14M|{
  112|  3.14M|    int rv;
  113|       |
  114|  3.14M|    if (pval == NULL || it == NULL) {
  ------------------
  |  Branch (114:9): [True: 0, False: 3.14M]
  |  Branch (114:25): [True: 0, False: 3.14M]
  ------------------
  115|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  116|      0|        return 0;
  117|      0|    }
  118|  3.14M|    rv = asn1_item_embed_d2i(pval, in, len, it, tag, aclass, opt, ctx, 0,
  119|  3.14M|                             libctx, propq);
  120|  3.14M|    if (rv <= 0)
  ------------------
  |  Branch (120:9): [True: 2.53M, False: 608k]
  ------------------
  121|  2.53M|        ASN1_item_ex_free(pval, it);
  122|  3.14M|    return rv;
  123|  3.14M|}
tasn_dec.c:asn1_item_embed_d2i:
  167|  12.6M|{
  168|  12.6M|    const ASN1_TEMPLATE *tt, *errtt = NULL;
  169|  12.6M|    const ASN1_EXTERN_FUNCS *ef;
  170|  12.6M|    const ASN1_AUX *aux;
  171|  12.6M|    ASN1_aux_cb *asn1_cb;
  172|  12.6M|    const unsigned char *p = NULL, *q;
  173|  12.6M|    unsigned char oclass;
  174|  12.6M|    char seq_eoc, seq_nolen, cst, isopt;
  175|  12.6M|    long tmplen;
  176|  12.6M|    int i;
  177|  12.6M|    int otag;
  178|  12.6M|    int ret = 0;
  179|  12.6M|    ASN1_VALUE **pchptr;
  180|       |
  181|  12.6M|    if (pval == NULL || it == NULL) {
  ------------------
  |  Branch (181:9): [True: 0, False: 12.6M]
  |  Branch (181:25): [True: 0, False: 12.6M]
  ------------------
  182|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  183|      0|        return 0;
  184|      0|    }
  185|  12.6M|    if (len <= 0) {
  ------------------
  |  Branch (185:9): [True: 927, False: 12.6M]
  ------------------
  186|    927|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|    927|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    927|    (ERR_new(),                                                 \
  |  |  |  |  404|    927|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    927|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    927|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    927|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    927|     ERR_set_error)
  |  |  ------------------
  ------------------
  187|    927|        return 0;
  188|    927|    }
  189|  12.6M|    aux = it->funcs;
  190|  12.6M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (190:9): [True: 1.77M, False: 10.8M]
  |  Branch (190:16): [True: 1.53M, False: 242k]
  ------------------
  191|  1.53M|        asn1_cb = aux->asn1_cb;
  192|  11.1M|    else
  193|  11.1M|        asn1_cb = 0;
  194|       |
  195|  12.6M|    if (++depth > ASN1_MAX_CONSTRUCTED_NEST) {
  ------------------
  |  |   26|  12.6M|#define ASN1_MAX_CONSTRUCTED_NEST 30
  ------------------
  |  Branch (195:9): [True: 1, False: 12.6M]
  ------------------
  196|      1|        ERR_raise(ERR_LIB_ASN1, ASN1_R_NESTED_TOO_DEEP);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
  197|      1|        goto err;
  198|      1|    }
  199|       |
  200|  12.6M|    switch (it->itype) {
  201|  8.16M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  8.16M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (201:5): [True: 8.16M, False: 4.51M]
  ------------------
  202|  8.16M|        if (it->templates) {
  ------------------
  |  Branch (202:13): [True: 2.25M, False: 5.90M]
  ------------------
  203|       |            /*
  204|       |             * tagging or OPTIONAL is currently illegal on an item template
  205|       |             * because the flags can't get passed down. In practice this
  206|       |             * isn't a problem: we include the relevant flags from the item
  207|       |             * template in the template itself.
  208|       |             */
  209|  2.25M|            if ((tag != -1) || opt) {
  ------------------
  |  Branch (209:17): [True: 0, False: 2.25M]
  |  Branch (209:32): [True: 0, False: 2.25M]
  ------------------
  210|      0|                ERR_raise(ERR_LIB_ASN1,
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  211|      0|                          ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE);
  212|      0|                goto err;
  213|      0|            }
  214|  2.25M|            return asn1_template_ex_d2i(pval, in, len, it->templates, opt, ctx,
  215|  2.25M|                                        depth, libctx, propq);
  216|  2.25M|        }
  217|  5.90M|        return asn1_d2i_ex_primitive(pval, in, len, it,
  218|  5.90M|                                     tag, aclass, opt, ctx);
  219|       |
  220|   481k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|   481k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (220:5): [True: 481k, False: 12.1M]
  ------------------
  221|       |        /*
  222|       |         * It never makes sense for multi-strings to have implicit tagging, so
  223|       |         * if tag != -1, then this looks like an error in the template.
  224|       |         */
  225|   481k|        if (tag != -1) {
  ------------------
  |  Branch (225:13): [True: 0, False: 481k]
  ------------------
  226|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  227|      0|            goto err;
  228|      0|        }
  229|       |
  230|   481k|        p = *in;
  231|       |        /* Just read in tag and class */
  232|   481k|        ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL,
  233|   481k|                              &p, len, -1, 0, 1, ctx);
  234|   481k|        if (!ret) {
  ------------------
  |  Branch (234:13): [True: 1.58k, False: 479k]
  ------------------
  235|  1.58k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  1.58k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.58k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.58k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.58k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.58k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.58k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.58k|     ERR_set_error)
  |  |  ------------------
  ------------------
  236|  1.58k|            goto err;
  237|  1.58k|        }
  238|       |
  239|       |        /* Must be UNIVERSAL class */
  240|   479k|        if (oclass != V_ASN1_UNIVERSAL) {
  ------------------
  |  |   47|   479k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (240:13): [True: 7.11k, False: 472k]
  ------------------
  241|       |            /* If OPTIONAL, assume this is OK */
  242|  7.11k|            if (opt)
  ------------------
  |  Branch (242:17): [True: 881, False: 6.23k]
  ------------------
  243|    881|                return -1;
  244|  7.11k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL);
  ------------------
  |  |  401|  6.23k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  6.23k|    (ERR_new(),                                                 \
  |  |  |  |  404|  6.23k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  6.23k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  6.23k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.23k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  6.23k|     ERR_set_error)
  |  |  ------------------
  ------------------
  245|  6.23k|            goto err;
  246|  7.11k|        }
  247|       |
  248|       |        /* Check tag matches bit map */
  249|   472k|        if (!(ASN1_tag2bit(otag) & it->utype)) {
  ------------------
  |  Branch (249:13): [True: 69.8k, False: 403k]
  ------------------
  250|       |            /* If OPTIONAL, assume this is OK */
  251|  69.8k|            if (opt)
  ------------------
  |  Branch (251:17): [True: 271, False: 69.5k]
  ------------------
  252|    271|                return -1;
  253|  69.8k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG);
  ------------------
  |  |  401|  69.5k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  69.5k|    (ERR_new(),                                                 \
  |  |  |  |  404|  69.5k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  69.5k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  69.5k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  69.5k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  69.5k|     ERR_set_error)
  |  |  ------------------
  ------------------
  254|  69.5k|            goto err;
  255|  69.8k|        }
  256|   403k|        return asn1_d2i_ex_primitive(pval, in, len, it, otag, 0, 0, ctx);
  257|       |
  258|   192k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|   192k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (258:5): [True: 192k, False: 12.4M]
  ------------------
  259|       |        /* Use new style d2i */
  260|   192k|        ef = it->funcs;
  261|   192k|        if (ef->asn1_ex_d2i_ex != NULL)
  ------------------
  |  Branch (261:13): [True: 76.5k, False: 116k]
  ------------------
  262|  76.5k|            return ef->asn1_ex_d2i_ex(pval, in, len, it, tag, aclass, opt, ctx,
  263|  76.5k|                                      libctx, propq);
  264|   116k|        return ef->asn1_ex_d2i(pval, in, len, it, tag, aclass, opt, ctx);
  265|       |
  266|   430k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|   430k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (266:5): [True: 430k, False: 12.2M]
  ------------------
  267|       |        /*
  268|       |         * It never makes sense for CHOICE types to have implicit tagging, so
  269|       |         * if tag != -1, then this looks like an error in the template.
  270|       |         */
  271|   430k|        if (tag != -1) {
  ------------------
  |  Branch (271:13): [True: 0, False: 430k]
  ------------------
  272|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  273|      0|            goto err;
  274|      0|        }
  275|       |
  276|   430k|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
  ------------------
  |  |  746|  29.4k|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (276:13): [True: 29.4k, False: 401k]
  |  Branch (276:24): [True: 0, False: 29.4k]
  ------------------
  277|      0|            goto auxerr;
  278|   430k|        if (*pval) {
  ------------------
  |  Branch (278:13): [True: 31.1k, False: 399k]
  ------------------
  279|       |            /* Free up and zero CHOICE value if initialised */
  280|  31.1k|            i = ossl_asn1_get_choice_selector(pval, it);
  281|  31.1k|            if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (281:17): [True: 0, False: 31.1k]
  |  Branch (281:29): [True: 0, False: 0]
  ------------------
  282|      0|                tt = it->templates + i;
  283|      0|                pchptr = ossl_asn1_get_field_ptr(pval, tt);
  284|      0|                ossl_asn1_template_free(pchptr, tt);
  285|      0|                ossl_asn1_set_choice_selector(pval, -1, it);
  286|      0|            }
  287|   399k|        } else if (!ossl_asn1_item_ex_new_intern(pval, it, libctx, propq)) {
  ------------------
  |  Branch (287:20): [True: 0, False: 399k]
  ------------------
  288|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  289|      0|            goto err;
  290|      0|        }
  291|       |        /* CHOICE type, try each possibility in turn */
  292|   430k|        p = *in;
  293|  1.56M|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (293:41): [True: 1.45M, False: 110k]
  ------------------
  294|  1.45M|            pchptr = ossl_asn1_get_field_ptr(pval, tt);
  295|       |            /*
  296|       |             * We mark field as OPTIONAL so its absence can be recognised.
  297|       |             */
  298|  1.45M|            ret = asn1_template_ex_d2i(pchptr, &p, len, tt, 1, ctx, depth,
  299|  1.45M|                                       libctx, propq);
  300|       |            /* If field not present, try the next one */
  301|  1.45M|            if (ret == -1)
  ------------------
  |  Branch (301:17): [True: 1.13M, False: 320k]
  ------------------
  302|  1.13M|                continue;
  303|       |            /* If positive return, read OK, break loop */
  304|   320k|            if (ret > 0)
  ------------------
  |  Branch (304:17): [True: 228k, False: 91.5k]
  ------------------
  305|   228k|                break;
  306|       |            /*
  307|       |             * Must be an ASN1 parsing error.
  308|       |             * Free up any partial choice value
  309|       |             */
  310|  91.5k|            ossl_asn1_template_free(pchptr, tt);
  311|  91.5k|            errtt = tt;
  312|  91.5k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  91.5k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  91.5k|    (ERR_new(),                                                 \
  |  |  |  |  404|  91.5k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  91.5k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  91.5k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  91.5k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  91.5k|     ERR_set_error)
  |  |  ------------------
  ------------------
  313|  91.5k|            goto err;
  314|   320k|        }
  315|       |
  316|       |        /* Did we fall off the end without reading anything? */
  317|   339k|        if (i == it->tcount) {
  ------------------
  |  Branch (317:13): [True: 110k, False: 228k]
  ------------------
  318|       |            /* If OPTIONAL, this is OK */
  319|   110k|            if (opt) {
  ------------------
  |  Branch (319:17): [True: 27, False: 110k]
  ------------------
  320|       |                /* Free and zero it */
  321|     27|                ASN1_item_ex_free(pval, it);
  322|     27|                return -1;
  323|     27|            }
  324|   110k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE);
  ------------------
  |  |  401|   110k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|   110k|    (ERR_new(),                                                 \
  |  |  |  |  404|   110k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|   110k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|   110k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|   110k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|   110k|     ERR_set_error)
  |  |  ------------------
  ------------------
  325|   110k|            goto err;
  326|   110k|        }
  327|       |
  328|   228k|        ossl_asn1_set_choice_selector(pval, i, it);
  329|       |
  330|   228k|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
  ------------------
  |  |  747|  14.8k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (330:13): [True: 14.8k, False: 213k]
  |  Branch (330:24): [True: 0, False: 14.8k]
  ------------------
  331|      0|            goto auxerr;
  332|   228k|        *in = p;
  333|   228k|        return 1;
  334|       |
  335|   130k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|   130k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (335:5): [True: 130k, False: 12.5M]
  ------------------
  336|  3.40M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  3.40M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (336:5): [True: 3.27M, False: 9.39M]
  ------------------
  337|  3.40M|        p = *in;
  338|  3.40M|        tmplen = len;
  339|       |
  340|       |        /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */
  341|  3.40M|        if (tag == -1) {
  ------------------
  |  Branch (341:13): [True: 3.25M, False: 154k]
  ------------------
  342|  3.25M|            tag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|  3.25M|# define V_ASN1_SEQUENCE                 16
  ------------------
  343|  3.25M|            aclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  3.25M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  344|  3.25M|        }
  345|       |        /* Get SEQUENCE length and update len, p */
  346|  3.40M|        ret = asn1_check_tlen(&len, NULL, NULL, &seq_eoc, &cst,
  347|  3.40M|                              &p, len, tag, aclass, opt, ctx);
  348|  3.40M|        if (!ret) {
  ------------------
  |  Branch (348:13): [True: 646k, False: 2.75M]
  ------------------
  349|   646k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|   646k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|   646k|    (ERR_new(),                                                 \
  |  |  |  |  404|   646k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|   646k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|   646k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|   646k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|   646k|     ERR_set_error)
  |  |  ------------------
  ------------------
  350|   646k|            goto err;
  351|  2.75M|        } else if (ret == -1)
  ------------------
  |  Branch (351:20): [True: 334k, False: 2.42M]
  ------------------
  352|   334k|            return -1;
  353|  2.42M|        if (aux && (aux->flags & ASN1_AFLG_BROKEN)) {
  ------------------
  |  |  736|   575k|# define ASN1_AFLG_BROKEN        4
  ------------------
  |  Branch (353:13): [True: 575k, False: 1.84M]
  |  Branch (353:20): [True: 0, False: 575k]
  ------------------
  354|      0|            len = tmplen - (p - *in);
  355|      0|            seq_nolen = 1;
  356|      0|        }
  357|       |        /* If indefinite we don't do a length check */
  358|  2.42M|        else
  359|  2.42M|            seq_nolen = seq_eoc;
  360|  2.42M|        if (!cst) {
  ------------------
  |  Branch (360:13): [True: 26.4k, False: 2.39M]
  ------------------
  361|  26.4k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED);
  ------------------
  |  |  401|  26.4k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  26.4k|    (ERR_new(),                                                 \
  |  |  |  |  404|  26.4k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  26.4k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  26.4k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  26.4k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  26.4k|     ERR_set_error)
  |  |  ------------------
  ------------------
  362|  26.4k|            goto err;
  363|  26.4k|        }
  364|       |
  365|  2.39M|        if (*pval == NULL
  ------------------
  |  Branch (365:13): [True: 1.96M, False: 431k]
  ------------------
  366|  2.39M|                && !ossl_asn1_item_ex_new_intern(pval, it, libctx, propq)) {
  ------------------
  |  Branch (366:20): [True: 0, False: 1.96M]
  ------------------
  367|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  368|      0|            goto err;
  369|      0|        }
  370|       |
  371|  2.39M|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
  ------------------
  |  |  746|   526k|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (371:13): [True: 526k, False: 1.87M]
  |  Branch (371:24): [True: 0, False: 526k]
  ------------------
  372|      0|            goto auxerr;
  373|       |
  374|       |        /* Free up and zero any ADB found */
  375|  10.2M|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (375:41): [True: 7.86M, False: 2.39M]
  ------------------
  376|  7.86M|            if (tt->flags & ASN1_TFLG_ADB_MASK) {
  ------------------
  |  |  583|  7.86M|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
  |  Branch (376:17): [True: 76.0k, False: 7.79M]
  ------------------
  377|  76.0k|                const ASN1_TEMPLATE *seqtt;
  378|  76.0k|                ASN1_VALUE **pseqval;
  379|  76.0k|                seqtt = ossl_asn1_do_adb(*pval, tt, 0);
  380|  76.0k|                if (seqtt == NULL)
  ------------------
  |  Branch (380:21): [True: 54.3k, False: 21.6k]
  ------------------
  381|  54.3k|                    continue;
  382|  21.6k|                pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  383|  21.6k|                ossl_asn1_template_free(pseqval, seqtt);
  384|  21.6k|            }
  385|  7.86M|        }
  386|       |
  387|       |        /* Get each field entry */
  388|  5.37M|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (388:41): [True: 4.59M, False: 775k]
  ------------------
  389|  4.59M|            const ASN1_TEMPLATE *seqtt;
  390|  4.59M|            ASN1_VALUE **pseqval;
  391|  4.59M|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  392|  4.59M|            if (seqtt == NULL)
  ------------------
  |  Branch (392:17): [True: 0, False: 4.59M]
  ------------------
  393|      0|                goto err;
  394|  4.59M|            pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  395|       |            /* Have we ran out of data? */
  396|  4.59M|            if (!len)
  ------------------
  |  Branch (396:17): [True: 111k, False: 4.48M]
  ------------------
  397|   111k|                break;
  398|  4.48M|            q = p;
  399|  4.48M|            if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (399:17): [True: 104k, False: 4.37M]
  ------------------
  400|   104k|                if (!seq_eoc) {
  ------------------
  |  Branch (400:21): [True: 1.34k, False: 102k]
  ------------------
  401|  1.34k|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  401|  1.34k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.34k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.34k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.34k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.34k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.34k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.34k|     ERR_set_error)
  |  |  ------------------
  ------------------
  402|  1.34k|                    goto err;
  403|  1.34k|                }
  404|   102k|                len -= p - q;
  405|   102k|                seq_eoc = 0;
  406|   102k|                break;
  407|   104k|            }
  408|       |            /*
  409|       |             * This determines the OPTIONAL flag value. The field cannot be
  410|       |             * omitted if it is the last of a SEQUENCE and there is still
  411|       |             * data to be read. This isn't strictly necessary but it
  412|       |             * increases efficiency in some cases.
  413|       |             */
  414|  4.37M|            if (i == (it->tcount - 1))
  ------------------
  |  Branch (414:17): [True: 988k, False: 3.39M]
  ------------------
  415|   988k|                isopt = 0;
  416|  3.39M|            else
  417|  3.39M|                isopt = (char)(seqtt->flags & ASN1_TFLG_OPTIONAL);
  ------------------
  |  |  523|  3.39M|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  418|       |            /*
  419|       |             * attempt to read in field, allowing each to be OPTIONAL
  420|       |             */
  421|       |
  422|  4.37M|            ret = asn1_template_ex_d2i(pseqval, &p, len, seqtt, isopt, ctx,
  423|  4.37M|                                       depth, libctx, propq);
  424|  4.37M|            if (!ret) {
  ------------------
  |  Branch (424:17): [True: 1.40M, False: 2.97M]
  ------------------
  425|  1.40M|                errtt = seqtt;
  426|  1.40M|                goto err;
  427|  2.97M|            } else if (ret == -1) {
  ------------------
  |  Branch (427:24): [True: 500k, False: 2.47M]
  ------------------
  428|       |                /*
  429|       |                 * OPTIONAL component absent. Free and zero the field.
  430|       |                 */
  431|   500k|                ossl_asn1_template_free(pseqval, seqtt);
  432|   500k|                continue;
  433|   500k|            }
  434|       |            /* Update length */
  435|  2.47M|            len -= p - q;
  436|  2.47M|        }
  437|       |
  438|       |        /* Check for EOC if expecting one */
  439|   990k|        if (seq_eoc && !asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (439:13): [True: 375k, False: 614k]
  |  Branch (439:24): [True: 14.4k, False: 360k]
  ------------------
  440|  14.4k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|  14.4k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  14.4k|    (ERR_new(),                                                 \
  |  |  |  |  404|  14.4k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  14.4k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  14.4k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  14.4k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  14.4k|     ERR_set_error)
  |  |  ------------------
  ------------------
  441|  14.4k|            goto err;
  442|  14.4k|        }
  443|       |        /* Check all data read */
  444|   975k|        if (!seq_nolen && len) {
  ------------------
  |  Branch (444:13): [True: 511k, False: 463k]
  |  Branch (444:27): [True: 4.18k, False: 507k]
  ------------------
  445|  4.18k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH);
  ------------------
  |  |  401|  4.18k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  4.18k|    (ERR_new(),                                                 \
  |  |  |  |  404|  4.18k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  4.18k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  4.18k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  4.18k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  4.18k|     ERR_set_error)
  |  |  ------------------
  ------------------
  446|  4.18k|            goto err;
  447|  4.18k|        }
  448|       |
  449|       |        /*
  450|       |         * If we get here we've got no more data in the SEQUENCE, however we
  451|       |         * may not have read all fields so check all remaining are OPTIONAL
  452|       |         * and clear any that are.
  453|       |         */
  454|  1.27M|        for (; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (454:16): [True: 331k, False: 939k]
  ------------------
  455|   331k|            const ASN1_TEMPLATE *seqtt;
  456|   331k|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  457|   331k|            if (seqtt == NULL)
  ------------------
  |  Branch (457:17): [True: 0, False: 331k]
  ------------------
  458|      0|                goto err;
  459|   331k|            if (seqtt->flags & ASN1_TFLG_OPTIONAL) {
  ------------------
  |  |  523|   331k|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (459:17): [True: 300k, False: 31.4k]
  ------------------
  460|   300k|                ASN1_VALUE **pseqval;
  461|   300k|                pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  462|   300k|                ossl_asn1_template_free(pseqval, seqtt);
  463|   300k|            } else {
  464|  31.4k|                errtt = seqtt;
  465|  31.4k|                ERR_raise(ERR_LIB_ASN1, ASN1_R_FIELD_MISSING);
  ------------------
  |  |  401|  31.4k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  31.4k|    (ERR_new(),                                                 \
  |  |  |  |  404|  31.4k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  31.4k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  31.4k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  31.4k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  31.4k|     ERR_set_error)
  |  |  ------------------
  ------------------
  466|  31.4k|                goto err;
  467|  31.4k|            }
  468|   331k|        }
  469|       |        /* Save encoding */
  470|   939k|        if (!ossl_asn1_enc_save(pval, *in, p - *in, it))
  ------------------
  |  Branch (470:13): [True: 0, False: 939k]
  ------------------
  471|      0|            goto auxerr;
  472|   939k|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
  ------------------
  |  |  747|  61.5k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (472:13): [True: 61.5k, False: 878k]
  |  Branch (472:24): [True: 2.13k, False: 59.4k]
  ------------------
  473|  2.13k|            goto auxerr;
  474|   937k|        *in = p;
  475|   937k|        return 1;
  476|       |
  477|      0|    default:
  ------------------
  |  Branch (477:5): [True: 0, False: 12.6M]
  ------------------
  478|      0|        return 0;
  479|  12.6M|    }
  480|  2.13k| auxerr:
  481|  2.13k|    ERR_raise(ERR_LIB_ASN1, ASN1_R_AUX_ERROR);
  ------------------
  |  |  401|  2.13k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.13k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.13k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  2.13k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  2.13k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.13k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.13k|     ERR_set_error)
  |  |  ------------------
  ------------------
  482|  2.41M| err:
  483|  2.41M|    if (errtt)
  ------------------
  |  Branch (483:9): [True: 1.53M, False: 883k]
  ------------------
  484|  1.53M|        ERR_add_error_data(4, "Field=", errtt->field_name,
  485|  1.53M|                           ", Type=", it->sname);
  486|   883k|    else
  487|   883k|        ERR_add_error_data(2, "Type=", it->sname);
  488|  2.41M|    return 0;
  489|  2.13k|}
tasn_dec.c:asn1_template_ex_d2i:
  501|  8.09M|{
  502|  8.09M|    int flags, aclass;
  503|  8.09M|    int ret;
  504|  8.09M|    long len;
  505|  8.09M|    const unsigned char *p, *q;
  506|  8.09M|    char exp_eoc;
  507|  8.09M|    if (!val)
  ------------------
  |  Branch (507:9): [True: 0, False: 8.09M]
  ------------------
  508|      0|        return 0;
  509|  8.09M|    flags = tt->flags;
  510|  8.09M|    aclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  8.09M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  511|       |
  512|  8.09M|    p = *in;
  513|       |
  514|       |    /* Check if EXPLICIT tag expected */
  515|  8.09M|    if (flags & ASN1_TFLG_EXPTAG) {
  ------------------
  |  |  550|  8.09M|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (515:9): [True: 379k, False: 7.71M]
  ------------------
  516|   379k|        char cst;
  517|       |        /*
  518|       |         * Need to work out amount of data available to the inner content and
  519|       |         * where it starts: so read in EXPLICIT header to get the info.
  520|       |         */
  521|   379k|        ret = asn1_check_tlen(&len, NULL, NULL, &exp_eoc, &cst,
  522|   379k|                              &p, inlen, tt->tag, aclass, opt, ctx);
  523|   379k|        q = p;
  524|   379k|        if (!ret) {
  ------------------
  |  Branch (524:13): [True: 53.2k, False: 326k]
  ------------------
  525|  53.2k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  53.2k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  53.2k|    (ERR_new(),                                                 \
  |  |  |  |  404|  53.2k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  53.2k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  53.2k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  53.2k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  53.2k|     ERR_set_error)
  |  |  ------------------
  ------------------
  526|  53.2k|            return 0;
  527|   326k|        } else if (ret == -1)
  ------------------
  |  Branch (527:20): [True: 290k, False: 35.4k]
  ------------------
  528|   290k|            return -1;
  529|  35.4k|        if (!cst) {
  ------------------
  |  Branch (529:13): [True: 332, False: 35.1k]
  ------------------
  530|    332|            ERR_raise(ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED);
  ------------------
  |  |  401|    332|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    332|    (ERR_new(),                                                 \
  |  |  |  |  404|    332|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    332|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    332|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    332|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    332|     ERR_set_error)
  |  |  ------------------
  ------------------
  531|    332|            return 0;
  532|    332|        }
  533|       |        /* We've found the field so it can't be OPTIONAL now */
  534|  35.1k|        ret = asn1_template_noexp_d2i(val, &p, len, tt, 0, ctx, depth, libctx,
  535|  35.1k|                                      propq);
  536|  35.1k|        if (!ret) {
  ------------------
  |  Branch (536:13): [True: 10.9k, False: 24.2k]
  ------------------
  537|  10.9k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  10.9k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  10.9k|    (ERR_new(),                                                 \
  |  |  |  |  404|  10.9k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  10.9k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  10.9k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  10.9k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  10.9k|     ERR_set_error)
  |  |  ------------------
  ------------------
  538|  10.9k|            return 0;
  539|  10.9k|        }
  540|       |        /* We read the field in OK so update length */
  541|  24.2k|        len -= p - q;
  542|  24.2k|        if (exp_eoc) {
  ------------------
  |  Branch (542:13): [True: 12.1k, False: 12.0k]
  ------------------
  543|       |            /* If NDEF we must have an EOC here */
  544|  12.1k|            if (!asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (544:17): [True: 453, False: 11.6k]
  ------------------
  545|    453|                ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|    453|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    453|    (ERR_new(),                                                 \
  |  |  |  |  404|    453|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    453|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    453|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    453|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    453|     ERR_set_error)
  |  |  ------------------
  ------------------
  546|    453|                goto err;
  547|    453|            }
  548|  12.1k|        } else {
  549|       |            /*
  550|       |             * Otherwise we must hit the EXPLICIT tag end or its an error
  551|       |             */
  552|  12.0k|            if (len) {
  ------------------
  |  Branch (552:17): [True: 14, False: 12.0k]
  ------------------
  553|     14|                ERR_raise(ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH);
  ------------------
  |  |  401|     14|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     14|    (ERR_new(),                                                 \
  |  |  |  |  404|     14|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     14|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     14|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     14|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     14|     ERR_set_error)
  |  |  ------------------
  ------------------
  554|     14|                goto err;
  555|     14|            }
  556|  12.0k|        }
  557|  24.2k|    } else
  558|  7.71M|        return asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx, depth,
  559|  7.71M|                                       libctx, propq);
  560|       |
  561|  23.7k|    *in = p;
  562|  23.7k|    return 1;
  563|       |
  564|    467| err:
  565|    467|    return 0;
  566|  8.09M|}
tasn_dec.c:asn1_template_noexp_d2i:
  573|  7.74M|{
  574|  7.74M|    int flags, aclass;
  575|  7.74M|    int ret;
  576|  7.74M|    ASN1_VALUE *tval;
  577|  7.74M|    const unsigned char *p, *q;
  578|  7.74M|    if (!val)
  ------------------
  |  Branch (578:9): [True: 0, False: 7.74M]
  ------------------
  579|      0|        return 0;
  580|  7.74M|    flags = tt->flags;
  581|  7.74M|    aclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  7.74M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  582|       |
  583|  7.74M|    p = *in;
  584|       |
  585|       |    /*
  586|       |     * If field is embedded then val needs fixing so it is a pointer to
  587|       |     * a pointer to a field.
  588|       |     */
  589|  7.74M|    if (tt->flags & ASN1_TFLG_EMBED) {
  ------------------
  |  |  597|  7.74M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  |  Branch (589:9): [True: 589k, False: 7.15M]
  ------------------
  590|   589k|        tval = (ASN1_VALUE *)val;
  591|   589k|        val = &tval;
  592|   589k|    }
  593|       |
  594|  7.74M|    if (flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  7.74M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (594:9): [True: 2.51M, False: 5.23M]
  ------------------
  595|       |        /* SET OF, SEQUENCE OF */
  596|  2.51M|        int sktag, skaclass;
  597|  2.51M|        char sk_eoc;
  598|       |        /* First work out expected inner tag value */
  599|  2.51M|        if (flags & ASN1_TFLG_IMPTAG) {
  ------------------
  |  |  547|  2.51M|# define ASN1_TFLG_IMPTAG        (0x1 << 3)
  ------------------
  |  Branch (599:13): [True: 120k, False: 2.39M]
  ------------------
  600|   120k|            sktag = tt->tag;
  601|   120k|            skaclass = aclass;
  602|  2.39M|        } else {
  603|  2.39M|            skaclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  2.39M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  604|  2.39M|            if (flags & ASN1_TFLG_SET_OF)
  ------------------
  |  |  526|  2.39M|# define ASN1_TFLG_SET_OF        (0x1 << 1)
  ------------------
  |  Branch (604:17): [True: 1.95M, False: 435k]
  ------------------
  605|  1.95M|                sktag = V_ASN1_SET;
  ------------------
  |  |   75|  1.95M|# define V_ASN1_SET                      17
  ------------------
  606|   435k|            else
  607|   435k|                sktag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|   435k|# define V_ASN1_SEQUENCE                 16
  ------------------
  608|  2.39M|        }
  609|       |        /* Get the tag */
  610|  2.51M|        ret = asn1_check_tlen(&len, NULL, NULL, &sk_eoc, NULL,
  611|  2.51M|                              &p, len, sktag, skaclass, opt, ctx);
  612|  2.51M|        if (!ret) {
  ------------------
  |  Branch (612:13): [True: 205k, False: 2.30M]
  ------------------
  613|   205k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|   205k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|   205k|    (ERR_new(),                                                 \
  |  |  |  |  404|   205k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|   205k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|   205k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|   205k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|   205k|     ERR_set_error)
  |  |  ------------------
  ------------------
  614|   205k|            return 0;
  615|  2.30M|        } else if (ret == -1)
  ------------------
  |  Branch (615:20): [True: 77.5k, False: 2.22M]
  ------------------
  616|  77.5k|            return -1;
  617|  2.22M|        if (*val == NULL)
  ------------------
  |  Branch (617:13): [True: 2.21M, False: 14.5k]
  ------------------
  618|  2.21M|            *val = (ASN1_VALUE *)sk_ASN1_VALUE_new_null();
  ------------------
  |  |  901|  2.21M|#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_null())
  ------------------
  619|  14.5k|        else {
  620|       |            /*
  621|       |             * We've got a valid STACK: free up any items present
  622|       |             */
  623|  14.5k|            STACK_OF(ASN1_VALUE) *sktmp = (STACK_OF(ASN1_VALUE) *)*val;
  ------------------
  |  |   31|  14.5k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  624|  14.5k|            ASN1_VALUE *vtmp;
  625|  14.5k|            while (sk_ASN1_VALUE_num(sktmp) > 0) {
  ------------------
  |  |  898|  14.5k|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (625:20): [True: 0, False: 14.5k]
  ------------------
  626|      0|                vtmp = sk_ASN1_VALUE_pop(sktmp);
  ------------------
  |  |  910|      0|#define sk_ASN1_VALUE_pop(sk) ((ASN1_VALUE *)OPENSSL_sk_pop(ossl_check_ASN1_VALUE_sk_type(sk)))
  ------------------
  627|      0|                ASN1_item_ex_free(&vtmp, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  422|      0|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  628|      0|            }
  629|  14.5k|        }
  630|       |
  631|  2.22M|        if (*val == NULL) {
  ------------------
  |  Branch (631:13): [True: 0, False: 2.22M]
  ------------------
  632|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  633|      0|            goto err;
  634|      0|        }
  635|       |
  636|       |        /* Read as many items as we can */
  637|  6.33M|        while (len > 0) {
  ------------------
  |  Branch (637:16): [True: 4.43M, False: 1.90M]
  ------------------
  638|  4.43M|            ASN1_VALUE *skfield;
  639|  4.43M|            q = p;
  640|       |            /* See if EOC found */
  641|  4.43M|            if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (641:17): [True: 142k, False: 4.29M]
  ------------------
  642|   142k|                if (!sk_eoc) {
  ------------------
  |  Branch (642:21): [True: 224, False: 142k]
  ------------------
  643|    224|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  401|    224|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    224|    (ERR_new(),                                                 \
  |  |  |  |  404|    224|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    224|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    224|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    224|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    224|     ERR_set_error)
  |  |  ------------------
  ------------------
  644|    224|                    goto err;
  645|    224|                }
  646|   142k|                len -= p - q;
  647|   142k|                sk_eoc = 0;
  648|   142k|                break;
  649|   142k|            }
  650|  4.29M|            skfield = NULL;
  651|  4.29M|            if (asn1_item_embed_d2i(&skfield, &p, len,
  ------------------
  |  Branch (651:17): [True: 183k, False: 4.10M]
  ------------------
  652|  4.29M|                                     ASN1_ITEM_ptr(tt->item), -1, 0, 0, ctx,
  ------------------
  |  |  422|  4.29M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  653|  4.29M|                                     depth, libctx, propq) <= 0) {
  654|   183k|                ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|   183k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|   183k|    (ERR_new(),                                                 \
  |  |  |  |  404|   183k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|   183k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|   183k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|   183k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|   183k|     ERR_set_error)
  |  |  ------------------
  ------------------
  655|       |                /* |skfield| may be partially allocated despite failure. */
  656|   183k|                ASN1_item_free(skfield, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  422|   183k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  657|   183k|                goto err;
  658|   183k|            }
  659|  4.10M|            len -= p - q;
  660|  4.10M|            if (!sk_ASN1_VALUE_push((STACK_OF(ASN1_VALUE) *)*val, skfield)) {
  ------------------
  |  |  908|  4.10M|#define sk_ASN1_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
  ------------------
  |  Branch (660:17): [True: 0, False: 4.10M]
  ------------------
  661|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  662|      0|                ASN1_item_free(skfield, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  422|      0|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  663|      0|                goto err;
  664|      0|            }
  665|  4.10M|        }
  666|  2.04M|        if (sk_eoc) {
  ------------------
  |  Branch (666:13): [True: 1.22k, False: 2.04M]
  ------------------
  667|  1.22k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|  1.22k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.22k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.22k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.22k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.22k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.22k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.22k|     ERR_set_error)
  |  |  ------------------
  ------------------
  668|  1.22k|            goto err;
  669|  1.22k|        }
  670|  5.23M|    } else if (flags & ASN1_TFLG_IMPTAG) {
  ------------------
  |  |  547|  5.23M|# define ASN1_TFLG_IMPTAG        (0x1 << 3)
  ------------------
  |  Branch (670:16): [True: 1.05M, False: 4.17M]
  ------------------
  671|       |        /* IMPLICIT tagging */
  672|  1.05M|        ret = asn1_item_embed_d2i(val, &p, len,
  673|  1.05M|                                  ASN1_ITEM_ptr(tt->item), tt->tag, aclass, opt,
  ------------------
  |  |  422|  1.05M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  674|  1.05M|                                  ctx, depth, libctx, propq);
  675|  1.05M|        if (!ret) {
  ------------------
  |  Branch (675:13): [True: 55.6k, False: 1.00M]
  ------------------
  676|  55.6k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  55.6k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  55.6k|    (ERR_new(),                                                 \
  |  |  |  |  404|  55.6k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  55.6k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  55.6k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  55.6k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  55.6k|     ERR_set_error)
  |  |  ------------------
  ------------------
  677|  55.6k|            goto err;
  678|  1.00M|        } else if (ret == -1)
  ------------------
  |  Branch (678:20): [True: 824k, False: 178k]
  ------------------
  679|   824k|            return -1;
  680|  4.17M|    } else {
  681|       |        /* Nothing special */
  682|  4.17M|        ret = asn1_item_embed_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  422|  4.17M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  683|  4.17M|                                  -1, 0, opt, ctx, depth, libctx, propq);
  684|  4.17M|        if (!ret) {
  ------------------
  |  Branch (684:13): [True: 1.26M, False: 2.91M]
  ------------------
  685|  1.26M|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  1.26M|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.26M|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.26M|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.26M|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.26M|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.26M|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.26M|     ERR_set_error)
  |  |  ------------------
  ------------------
  686|  1.26M|            goto err;
  687|  2.91M|        } else if (ret == -1)
  ------------------
  |  Branch (687:20): [True: 445k, False: 2.46M]
  ------------------
  688|   445k|            return -1;
  689|  4.17M|    }
  690|       |
  691|  4.68M|    *in = p;
  692|  4.68M|    return 1;
  693|       |
  694|  1.50M| err:
  695|  1.50M|    return 0;
  696|  7.74M|}
tasn_dec.c:asn1_d2i_ex_primitive:
  702|  6.31M|{
  703|  6.31M|    int ret = 0, utype;
  704|  6.31M|    long plen;
  705|  6.31M|    char cst, inf, free_cont = 0;
  706|  6.31M|    const unsigned char *p;
  707|  6.31M|    BUF_MEM buf = { 0, NULL, 0, 0 };
  708|  6.31M|    const unsigned char *cont = NULL;
  709|  6.31M|    long len;
  710|       |
  711|  6.31M|    if (pval == NULL) {
  ------------------
  |  Branch (711:9): [True: 0, False: 6.31M]
  ------------------
  712|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  713|      0|        return 0;               /* Should never happen */
  714|      0|    }
  715|       |
  716|  6.31M|    if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|  6.31M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (716:9): [True: 403k, False: 5.90M]
  ------------------
  717|   403k|        utype = tag;
  718|   403k|        tag = -1;
  719|   403k|    } else
  720|  5.90M|        utype = it->utype;
  721|       |
  722|  6.31M|    if (utype == V_ASN1_ANY) {
  ------------------
  |  |   58|  6.31M|# define V_ASN1_ANY                      -4 /* used in ASN1 template code */
  ------------------
  |  Branch (722:9): [True: 1.60M, False: 4.70M]
  ------------------
  723|       |        /* If type is ANY need to figure out type from tag */
  724|  1.60M|        unsigned char oclass;
  725|  1.60M|        if (tag >= 0) {
  ------------------
  |  Branch (725:13): [True: 0, False: 1.60M]
  ------------------
  726|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_TAGGED_ANY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  727|      0|            return 0;
  728|      0|        }
  729|  1.60M|        if (opt) {
  ------------------
  |  Branch (729:13): [True: 0, False: 1.60M]
  ------------------
  730|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONAL_ANY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  731|      0|            return 0;
  732|      0|        }
  733|  1.60M|        p = *in;
  734|  1.60M|        ret = asn1_check_tlen(NULL, &utype, &oclass, NULL, NULL,
  735|  1.60M|                              &p, inlen, -1, 0, 0, ctx);
  736|  1.60M|        if (!ret) {
  ------------------
  |  Branch (736:13): [True: 1.09k, False: 1.60M]
  ------------------
  737|  1.09k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  1.09k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.09k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.09k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.09k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.09k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.09k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.09k|     ERR_set_error)
  |  |  ------------------
  ------------------
  738|  1.09k|            return 0;
  739|  1.09k|        }
  740|  1.60M|        if (oclass != V_ASN1_UNIVERSAL)
  ------------------
  |  |   47|  1.60M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (740:13): [True: 36.9k, False: 1.56M]
  ------------------
  741|  36.9k|            utype = V_ASN1_OTHER;
  ------------------
  |  |   57|  36.9k|# define V_ASN1_OTHER                    -3 /* used in ASN1_TYPE */
  ------------------
  742|  1.60M|    }
  743|  6.31M|    if (tag == -1) {
  ------------------
  |  Branch (743:9): [True: 5.40M, False: 903k]
  ------------------
  744|  5.40M|        tag = utype;
  745|  5.40M|        aclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  5.40M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  746|  5.40M|    }
  747|  6.31M|    p = *in;
  748|       |    /* Check header */
  749|  6.31M|    ret = asn1_check_tlen(&plen, NULL, NULL, &inf, &cst,
  750|  6.31M|                          &p, inlen, tag, aclass, opt, ctx);
  751|  6.31M|    if (!ret) {
  ------------------
  |  Branch (751:9): [True: 1.17M, False: 5.13M]
  ------------------
  752|  1.17M|        ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  1.17M|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.17M|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.17M|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.17M|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.17M|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.17M|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.17M|     ERR_set_error)
  |  |  ------------------
  ------------------
  753|  1.17M|        return 0;
  754|  5.13M|    } else if (ret == -1)
  ------------------
  |  Branch (754:16): [True: 934k, False: 4.20M]
  ------------------
  755|   934k|        return -1;
  756|  4.20M|    ret = 0;
  757|       |    /* SEQUENCE, SET and "OTHER" are left in encoded form */
  758|  4.20M|    if ((utype == V_ASN1_SEQUENCE)
  ------------------
  |  |   74|  4.20M|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (758:9): [True: 253k, False: 3.95M]
  ------------------
  759|  4.20M|        || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) {
  ------------------
  |  |   75|  3.95M|# define V_ASN1_SET                      17
  ------------------
                      || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) {
  ------------------
  |  |   57|  2.60M|# define V_ASN1_OTHER                    -3 /* used in ASN1_TYPE */
  ------------------
  |  Branch (759:12): [True: 1.34M, False: 2.60M]
  |  Branch (759:37): [True: 36.9k, False: 2.56M]
  ------------------
  760|       |        /*
  761|       |         * Clear context cache for type OTHER because the auto clear when we
  762|       |         * have a exact match won't work
  763|       |         */
  764|  1.63M|        if (utype == V_ASN1_OTHER) {
  ------------------
  |  |   57|  1.63M|# define V_ASN1_OTHER                    -3 /* used in ASN1_TYPE */
  ------------------
  |  Branch (764:13): [True: 36.9k, False: 1.60M]
  ------------------
  765|  36.9k|            asn1_tlc_clear(ctx);
  ------------------
  |  |   96|  36.9k|#define asn1_tlc_clear(c)       do { if ((c) != NULL) (c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (96:42): [True: 36.9k, False: 0]
  |  |  |  Branch (96:80): [Folded - Ignored]
  |  |  ------------------
  ------------------
  766|  36.9k|        }
  767|       |        /* SEQUENCE and SET must be constructed */
  768|  1.60M|        else if (!cst) {
  ------------------
  |  Branch (768:18): [True: 900, False: 1.59M]
  ------------------
  769|    900|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED);
  ------------------
  |  |  401|    900|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    900|    (ERR_new(),                                                 \
  |  |  |  |  404|    900|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    900|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    900|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    900|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    900|     ERR_set_error)
  |  |  ------------------
  ------------------
  770|    900|            return 0;
  771|    900|        }
  772|       |
  773|  1.63M|        cont = *in;
  774|       |        /* If indefinite length constructed find the real end */
  775|  1.63M|        if (inf) {
  ------------------
  |  Branch (775:13): [True: 102k, False: 1.53M]
  ------------------
  776|   102k|            if (!asn1_find_end(&p, plen, inf))
  ------------------
  |  Branch (776:17): [True: 14.0k, False: 88.1k]
  ------------------
  777|  14.0k|                goto err;
  778|  88.1k|            len = p - cont;
  779|  1.53M|        } else {
  780|  1.53M|            len = p - cont + plen;
  781|  1.53M|            p += plen;
  782|  1.53M|        }
  783|  2.56M|    } else if (cst) {
  ------------------
  |  Branch (783:16): [True: 131k, False: 2.43M]
  ------------------
  784|   131k|        if (utype == V_ASN1_NULL || utype == V_ASN1_BOOLEAN
  ------------------
  |  |   67|   262k|# define V_ASN1_NULL                     5
  ------------------
                      if (utype == V_ASN1_NULL || utype == V_ASN1_BOOLEAN
  ------------------
  |  |   63|   262k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (784:13): [True: 116, False: 131k]
  |  Branch (784:37): [True: 294, False: 130k]
  ------------------
  785|   131k|            || utype == V_ASN1_OBJECT || utype == V_ASN1_INTEGER
  ------------------
  |  |   68|   261k|# define V_ASN1_OBJECT                   6
  ------------------
                          || utype == V_ASN1_OBJECT || utype == V_ASN1_INTEGER
  ------------------
  |  |   64|   261k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (785:16): [True: 173, False: 130k]
  |  Branch (785:42): [True: 712, False: 129k]
  ------------------
  786|   131k|            || utype == V_ASN1_ENUMERATED) {
  ------------------
  |  |   72|   129k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (786:16): [True: 218, False: 129k]
  ------------------
  787|  1.51k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE);
  ------------------
  |  |  401|  1.51k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.51k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.51k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.51k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.51k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.51k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.51k|     ERR_set_error)
  |  |  ------------------
  ------------------
  788|  1.51k|            return 0;
  789|  1.51k|        }
  790|       |
  791|       |        /* Free any returned 'buf' content */
  792|   129k|        free_cont = 1;
  793|       |        /*
  794|       |         * Should really check the internal tags are correct but some things
  795|       |         * may get this wrong. The relevant specs say that constructed string
  796|       |         * types should be OCTET STRINGs internally irrespective of the type.
  797|       |         * So instead just check for UNIVERSAL class and ignore the tag.
  798|       |         */
  799|   129k|        if (!asn1_collect(&buf, &p, plen, inf, -1, V_ASN1_UNIVERSAL, 0)) {
  ------------------
  |  |   47|   129k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (799:13): [True: 1.65k, False: 128k]
  ------------------
  800|  1.65k|            goto err;
  801|  1.65k|        }
  802|   128k|        len = buf.length;
  803|       |        /* Append a final null to string */
  804|   128k|        if (!BUF_MEM_grow_clean(&buf, len + 1)) {
  ------------------
  |  Branch (804:13): [True: 0, False: 128k]
  ------------------
  805|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  806|      0|            goto err;
  807|      0|        }
  808|   128k|        buf.data[len] = 0;
  809|   128k|        cont = (const unsigned char *)buf.data;
  810|  2.43M|    } else {
  811|  2.43M|        cont = p;
  812|  2.43M|        len = plen;
  813|  2.43M|        p += plen;
  814|  2.43M|    }
  815|       |
  816|       |    /* We now have content length and type: translate into a structure */
  817|       |    /* asn1_ex_c2i may reuse allocated buffer, and so sets free_cont to 0 */
  818|  4.18M|    if (!asn1_ex_c2i(pval, cont, len, utype, &free_cont, it))
  ------------------
  |  Branch (818:9): [True: 103k, False: 4.08M]
  ------------------
  819|   103k|        goto err;
  820|       |
  821|  4.08M|    *in = p;
  822|  4.08M|    ret = 1;
  823|  4.20M| err:
  824|  4.20M|    if (free_cont)
  ------------------
  |  Branch (824:9): [True: 5.52k, False: 4.19M]
  ------------------
  825|  5.52k|        OPENSSL_free(buf.data);
  ------------------
  |  |  115|  5.52k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  5.52k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  5.52k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  826|  4.20M|    return ret;
  827|  4.08M|}
tasn_dec.c:asn1_find_end:
  980|   102k|{
  981|   102k|    uint32_t expected_eoc;
  982|   102k|    long plen;
  983|   102k|    const unsigned char *p = *in, *q;
  984|       |    /* If not indefinite length constructed just add length */
  985|   102k|    if (inf == 0) {
  ------------------
  |  Branch (985:9): [True: 0, False: 102k]
  ------------------
  986|      0|        *in += len;
  987|      0|        return 1;
  988|      0|    }
  989|   102k|    expected_eoc = 1;
  990|       |    /*
  991|       |     * Indefinite length constructed form. Find the end when enough EOCs are
  992|       |     * found. If more indefinite length constructed headers are encountered
  993|       |     * increment the expected eoc count otherwise just skip to the end of the
  994|       |     * data.
  995|       |     */
  996|  37.5M|    while (len > 0) {
  ------------------
  |  Branch (996:12): [True: 37.4M, False: 6.01k]
  ------------------
  997|  37.4M|        if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (997:13): [True: 6.53M, False: 30.9M]
  ------------------
  998|  6.53M|            expected_eoc--;
  999|  6.53M|            if (expected_eoc == 0)
  ------------------
  |  Branch (999:17): [True: 88.1k, False: 6.44M]
  ------------------
 1000|  88.1k|                break;
 1001|  6.44M|            len -= 2;
 1002|  6.44M|            continue;
 1003|  6.53M|        }
 1004|  30.9M|        q = p;
 1005|       |        /* Just read in a header: only care about the length */
 1006|  30.9M|        if (!asn1_check_tlen(&plen, NULL, NULL, &inf, NULL, &p, len,
  ------------------
  |  Branch (1006:13): [True: 8.04k, False: 30.9M]
  ------------------
 1007|  30.9M|                             -1, 0, 0, NULL)) {
 1008|  8.04k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  8.04k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  8.04k|    (ERR_new(),                                                 \
  |  |  |  |  404|  8.04k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  8.04k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  8.04k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  8.04k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  8.04k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1009|  8.04k|            return 0;
 1010|  8.04k|        }
 1011|  30.9M|        if (inf) {
  ------------------
  |  Branch (1011:13): [True: 8.49M, False: 22.4M]
  ------------------
 1012|  8.49M|            if (expected_eoc == UINT32_MAX) {
  ------------------
  |  Branch (1012:17): [True: 0, False: 8.49M]
  ------------------
 1013|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1014|      0|                return 0;
 1015|      0|            }
 1016|  8.49M|            expected_eoc++;
 1017|  22.4M|        } else {
 1018|  22.4M|            p += plen;
 1019|  22.4M|        }
 1020|  30.9M|        len -= p - q;
 1021|  30.9M|    }
 1022|  94.1k|    if (expected_eoc) {
  ------------------
  |  Branch (1022:9): [True: 6.01k, False: 88.1k]
  ------------------
 1023|  6.01k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|  6.01k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  6.01k|    (ERR_new(),                                                 \
  |  |  |  |  404|  6.01k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  6.01k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  6.01k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.01k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  6.01k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1024|  6.01k|        return 0;
 1025|  6.01k|    }
 1026|  88.1k|    *in = p;
 1027|  88.1k|    return 1;
 1028|  94.1k|}
tasn_dec.c:asn1_collect:
 1048|   152k|{
 1049|   152k|    const unsigned char *p, *q;
 1050|   152k|    long plen;
 1051|   152k|    char cst, ininf;
 1052|   152k|    p = *in;
 1053|   152k|    inf &= 1;
 1054|       |    /*
 1055|       |     * If no buffer and not indefinite length constructed just pass over the
 1056|       |     * encoded data
 1057|       |     */
 1058|   152k|    if (!buf && !inf) {
  ------------------
  |  Branch (1058:9): [True: 0, False: 152k]
  |  Branch (1058:17): [True: 0, False: 0]
  ------------------
 1059|      0|        *in += len;
 1060|      0|        return 1;
 1061|      0|    }
 1062|   302k|    while (len > 0) {
  ------------------
  |  Branch (1062:12): [True: 171k, False: 130k]
  ------------------
 1063|   171k|        q = p;
 1064|       |        /* Check for EOC */
 1065|   171k|        if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (1065:13): [True: 19.0k, False: 152k]
  ------------------
 1066|       |            /*
 1067|       |             * EOC is illegal outside indefinite length constructed form
 1068|       |             */
 1069|  19.0k|            if (!inf) {
  ------------------
  |  Branch (1069:17): [True: 149, False: 18.9k]
  ------------------
 1070|    149|                ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  401|    149|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    149|    (ERR_new(),                                                 \
  |  |  |  |  404|    149|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    149|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    149|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    149|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    149|     ERR_set_error)
  |  |  ------------------
  ------------------
 1071|    149|                return 0;
 1072|    149|            }
 1073|  18.9k|            inf = 0;
 1074|  18.9k|            break;
 1075|  19.0k|        }
 1076|       |
 1077|   152k|        if (!asn1_check_tlen(&plen, NULL, NULL, &ininf, &cst, &p,
  ------------------
  |  Branch (1077:13): [True: 863, False: 151k]
  ------------------
 1078|   152k|                             len, tag, aclass, 0, NULL)) {
 1079|    863|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|    863|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    863|    (ERR_new(),                                                 \
  |  |  |  |  404|    863|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    863|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    863|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    863|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    863|     ERR_set_error)
  |  |  ------------------
  ------------------
 1080|    863|            return 0;
 1081|    863|        }
 1082|       |
 1083|       |        /* If indefinite length constructed update max length */
 1084|   151k|        if (cst) {
  ------------------
  |  Branch (1084:13): [True: 22.8k, False: 129k]
  ------------------
 1085|  22.8k|            if (depth >= ASN1_MAX_STRING_NEST) {
  ------------------
  |  | 1043|  22.8k|# define ASN1_MAX_STRING_NEST 5
  ------------------
  |  Branch (1085:17): [True: 104, False: 22.7k]
  ------------------
 1086|    104|                ERR_raise(ERR_LIB_ASN1, ASN1_R_NESTED_ASN1_STRING);
  ------------------
  |  |  401|    104|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    104|    (ERR_new(),                                                 \
  |  |  |  |  404|    104|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    104|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    104|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    104|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    104|     ERR_set_error)
  |  |  ------------------
  ------------------
 1087|    104|                return 0;
 1088|    104|            }
 1089|  22.7k|            if (!asn1_collect(buf, &p, plen, ininf, tag, aclass, depth + 1))
  ------------------
  |  Branch (1089:17): [True: 1.80k, False: 20.9k]
  ------------------
 1090|  1.80k|                return 0;
 1091|   129k|        } else if (plen && !collect_data(buf, &p, plen))
  ------------------
  |  Branch (1091:20): [True: 118k, False: 10.8k]
  |  Branch (1091:28): [True: 0, False: 118k]
  ------------------
 1092|      0|            return 0;
 1093|   150k|        len -= p - q;
 1094|   150k|    }
 1095|   149k|    if (inf) {
  ------------------
  |  Branch (1095:9): [True: 535, False: 149k]
  ------------------
 1096|    535|        ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|    535|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    535|    (ERR_new(),                                                 \
  |  |  |  |  404|    535|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    535|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    535|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    535|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    535|     ERR_set_error)
  |  |  ------------------
  ------------------
 1097|    535|        return 0;
 1098|    535|    }
 1099|   149k|    *in = p;
 1100|   149k|    return 1;
 1101|   149k|}
tasn_dec.c:collect_data:
 1104|   118k|{
 1105|   118k|    int len;
 1106|   118k|    if (buf) {
  ------------------
  |  Branch (1106:9): [True: 118k, False: 0]
  ------------------
 1107|   118k|        len = buf->length;
 1108|   118k|        if (!BUF_MEM_grow_clean(buf, len + plen)) {
  ------------------
  |  Branch (1108:13): [True: 0, False: 118k]
  ------------------
 1109|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1110|      0|            return 0;
 1111|      0|        }
 1112|   118k|        memcpy(buf->data + len, *p, plen);
 1113|   118k|    }
 1114|   118k|    *p += plen;
 1115|   118k|    return 1;
 1116|   118k|}
tasn_dec.c:asn1_ex_c2i:
  833|  4.18M|{
  834|  4.18M|    ASN1_VALUE **opval = NULL;
  835|  4.18M|    ASN1_STRING *stmp;
  836|  4.18M|    ASN1_TYPE *typ = NULL;
  837|  4.18M|    int ret = 0;
  838|  4.18M|    const ASN1_PRIMITIVE_FUNCS *pf;
  839|  4.18M|    ASN1_INTEGER **tint;
  840|  4.18M|    pf = it->funcs;
  841|       |
  842|  4.18M|    if (pf && pf->prim_c2i)
  ------------------
  |  Branch (842:9): [True: 371k, False: 3.81M]
  |  Branch (842:15): [True: 371k, False: 0]
  ------------------
  843|   371k|        return pf->prim_c2i(pval, cont, len, utype, free_cont, it);
  844|       |    /* If ANY type clear type and set pointer to internal value */
  845|  3.81M|    if (it->utype == V_ASN1_ANY) {
  ------------------
  |  |   58|  3.81M|# define V_ASN1_ANY                      -4 /* used in ASN1 template code */
  ------------------
  |  Branch (845:9): [True: 1.59M, False: 2.22M]
  ------------------
  846|  1.59M|        if (*pval == NULL) {
  ------------------
  |  Branch (846:13): [True: 1.58M, False: 10.5k]
  ------------------
  847|  1.58M|            typ = ASN1_TYPE_new();
  848|  1.58M|            if (typ == NULL)
  ------------------
  |  Branch (848:17): [True: 0, False: 1.58M]
  ------------------
  849|      0|                goto err;
  850|  1.58M|            *pval = (ASN1_VALUE *)typ;
  851|  1.58M|        } else
  852|  10.5k|            typ = (ASN1_TYPE *)*pval;
  853|       |
  854|  1.59M|        if (utype != typ->type)
  ------------------
  |  Branch (854:13): [True: 1.59M, False: 0]
  ------------------
  855|  1.59M|            ASN1_TYPE_set(typ, utype, NULL);
  856|  1.59M|        opval = pval;
  857|  1.59M|        pval = &typ->value.asn1_value;
  858|  1.59M|    }
  859|  3.81M|    switch (utype) {
  860|   734k|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|   734k|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (860:5): [True: 734k, False: 3.08M]
  ------------------
  861|   734k|        if (!ossl_c2i_ASN1_OBJECT((ASN1_OBJECT **)pval, &cont, len))
  ------------------
  |  Branch (861:13): [True: 746, False: 733k]
  ------------------
  862|    746|            goto err;
  863|   733k|        break;
  864|       |
  865|   733k|    case V_ASN1_NULL:
  ------------------
  |  |   67|  5.17k|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (865:5): [True: 5.17k, False: 3.81M]
  ------------------
  866|  5.17k|        if (len) {
  ------------------
  |  Branch (866:13): [True: 79, False: 5.09k]
  ------------------
  867|     79|            ERR_raise(ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH);
  ------------------
  |  |  401|     79|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     79|    (ERR_new(),                                                 \
  |  |  |  |  404|     79|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     79|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     79|     ERR_set_error)
  |  |  ------------------
  ------------------
  868|     79|            goto err;
  869|     79|        }
  870|  5.09k|        *pval = (ASN1_VALUE *)1;
  871|  5.09k|        break;
  872|       |
  873|  8.37k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|  8.37k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (873:5): [True: 8.37k, False: 3.80M]
  ------------------
  874|  8.37k|        if (len != 1) {
  ------------------
  |  Branch (874:13): [True: 291, False: 8.08k]
  ------------------
  875|    291|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH);
  ------------------
  |  |  401|    291|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    291|    (ERR_new(),                                                 \
  |  |  |  |  404|    291|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    291|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    291|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    291|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    291|     ERR_set_error)
  |  |  ------------------
  ------------------
  876|    291|            goto err;
  877|  8.08k|        } else {
  878|  8.08k|            ASN1_BOOLEAN *tbool;
  879|  8.08k|            tbool = (ASN1_BOOLEAN *)pval;
  880|  8.08k|            *tbool = *cont;
  881|  8.08k|        }
  882|  8.08k|        break;
  883|       |
  884|   139k|    case V_ASN1_BIT_STRING:
  ------------------
  |  |   65|   139k|# define V_ASN1_BIT_STRING               3
  ------------------
  |  Branch (884:5): [True: 139k, False: 3.67M]
  ------------------
  885|   139k|        if (!ossl_c2i_ASN1_BIT_STRING((ASN1_BIT_STRING **)pval, &cont, len))
  ------------------
  |  Branch (885:13): [True: 573, False: 139k]
  ------------------
  886|    573|            goto err;
  887|   139k|        break;
  888|       |
  889|   573k|    case V_ASN1_INTEGER:
  ------------------
  |  |   64|   573k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (889:5): [True: 573k, False: 3.24M]
  ------------------
  890|   593k|    case V_ASN1_ENUMERATED:
  ------------------
  |  |   72|   593k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (890:5): [True: 19.9k, False: 3.79M]
  ------------------
  891|   593k|        tint = (ASN1_INTEGER **)pval;
  892|   593k|        if (!ossl_c2i_ASN1_INTEGER(tint, &cont, len))
  ------------------
  |  Branch (892:13): [True: 91.2k, False: 501k]
  ------------------
  893|  91.2k|            goto err;
  894|       |        /* Fixup type to match the expected form */
  895|   501k|        (*tint)->type = utype | ((*tint)->type & V_ASN1_NEG);
  ------------------
  |  |   97|   501k|# define V_ASN1_NEG                      0x100
  ------------------
  896|   501k|        break;
  897|       |
  898|   313k|    case V_ASN1_OCTET_STRING:
  ------------------
  |  |   66|   313k|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (898:5): [True: 313k, False: 3.50M]
  ------------------
  899|   316k|    case V_ASN1_NUMERICSTRING:
  ------------------
  |  |   76|   316k|# define V_ASN1_NUMERICSTRING            18
  ------------------
  |  Branch (899:5): [True: 3.04k, False: 3.81M]
  ------------------
  900|   346k|    case V_ASN1_PRINTABLESTRING:
  ------------------
  |  |   77|   346k|# define V_ASN1_PRINTABLESTRING          19
  ------------------
  |  Branch (900:5): [True: 30.7k, False: 3.78M]
  ------------------
  901|   358k|    case V_ASN1_T61STRING:
  ------------------
  |  |   78|   358k|# define V_ASN1_T61STRING                20
  ------------------
  |  Branch (901:5): [True: 11.5k, False: 3.80M]
  ------------------
  902|   358k|    case V_ASN1_VIDEOTEXSTRING:
  ------------------
  |  |   80|   358k|# define V_ASN1_VIDEOTEXSTRING           21
  ------------------
  |  Branch (902:5): [True: 21, False: 3.81M]
  ------------------
  903|   408k|    case V_ASN1_IA5STRING:
  ------------------
  |  |   81|   408k|# define V_ASN1_IA5STRING                22
  ------------------
  |  Branch (903:5): [True: 50.4k, False: 3.76M]
  ------------------
  904|   507k|    case V_ASN1_UTCTIME:
  ------------------
  |  |   82|   507k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (904:5): [True: 98.4k, False: 3.71M]
  ------------------
  905|   527k|    case V_ASN1_GENERALIZEDTIME:
  ------------------
  |  |   83|   527k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (905:5): [True: 20.1k, False: 3.79M]
  ------------------
  906|   527k|    case V_ASN1_GRAPHICSTRING:
  ------------------
  |  |   84|   527k|# define V_ASN1_GRAPHICSTRING            25
  ------------------
  |  Branch (906:5): [True: 324, False: 3.81M]
  ------------------
  907|   528k|    case V_ASN1_VISIBLESTRING:
  ------------------
  |  |   86|   528k|# define V_ASN1_VISIBLESTRING            26 /* alias */
  ------------------
  |  Branch (907:5): [True: 817, False: 3.81M]
  ------------------
  908|   528k|    case V_ASN1_GENERALSTRING:
  ------------------
  |  |   87|   528k|# define V_ASN1_GENERALSTRING            27
  ------------------
  |  Branch (908:5): [True: 38, False: 3.81M]
  ------------------
  909|   539k|    case V_ASN1_UNIVERSALSTRING:
  ------------------
  |  |   88|   539k|# define V_ASN1_UNIVERSALSTRING          28
  ------------------
  |  Branch (909:5): [True: 10.8k, False: 3.80M]
  ------------------
  910|   556k|    case V_ASN1_BMPSTRING:
  ------------------
  |  |   89|   556k|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (910:5): [True: 16.4k, False: 3.80M]
  ------------------
  911|   569k|    case V_ASN1_UTF8STRING:
  ------------------
  |  |   73|   569k|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (911:5): [True: 13.1k, False: 3.80M]
  ------------------
  912|   601k|    case V_ASN1_OTHER:
  ------------------
  |  |   57|   601k|# define V_ASN1_OTHER                    -3 /* used in ASN1_TYPE */
  ------------------
  |  Branch (912:5): [True: 32.7k, False: 3.78M]
  ------------------
  913|  1.94M|    case V_ASN1_SET:
  ------------------
  |  |   75|  1.94M|# define V_ASN1_SET                      17
  ------------------
  |  Branch (913:5): [True: 1.34M, False: 2.47M]
  ------------------
  914|  2.19M|    case V_ASN1_SEQUENCE:
  ------------------
  |  |   74|  2.19M|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (914:5): [True: 243k, False: 3.57M]
  ------------------
  915|  2.33M|    default:
  ------------------
  |  Branch (915:5): [True: 144k, False: 3.67M]
  ------------------
  916|  2.33M|        if (utype == V_ASN1_BMPSTRING && (len & 1)) {
  ------------------
  |  |   89|  4.67M|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (916:13): [True: 16.4k, False: 2.31M]
  |  Branch (916:42): [True: 60, False: 16.4k]
  ------------------
  917|     60|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH);
  ------------------
  |  |  401|     60|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     60|    (ERR_new(),                                                 \
  |  |  |  |  404|     60|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     60|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     60|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     60|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     60|     ERR_set_error)
  |  |  ------------------
  ------------------
  918|     60|            goto err;
  919|     60|        }
  920|  2.33M|        if (utype == V_ASN1_UNIVERSALSTRING && (len & 3)) {
  ------------------
  |  |   88|  4.67M|# define V_ASN1_UNIVERSALSTRING          28
  ------------------
  |  Branch (920:13): [True: 10.8k, False: 2.32M]
  |  Branch (920:48): [True: 62, False: 10.7k]
  ------------------
  921|     62|            ERR_raise(ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH);
  ------------------
  |  |  401|     62|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     62|    (ERR_new(),                                                 \
  |  |  |  |  404|     62|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     62|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     62|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     62|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     62|     ERR_set_error)
  |  |  ------------------
  ------------------
  922|     62|            goto err;
  923|     62|        }
  924|  2.33M|        if (utype == V_ASN1_GENERALIZEDTIME && (len < 15)) {
  ------------------
  |  |   83|  4.67M|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (924:13): [True: 20.1k, False: 2.31M]
  |  Branch (924:48): [True: 672, False: 19.4k]
  ------------------
  925|    672|            ERR_raise(ERR_LIB_ASN1, ASN1_R_GENERALIZEDTIME_IS_TOO_SHORT);
  ------------------
  |  |  401|    672|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    672|    (ERR_new(),                                                 \
  |  |  |  |  404|    672|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    672|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    672|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    672|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    672|     ERR_set_error)
  |  |  ------------------
  ------------------
  926|    672|            goto err;
  927|    672|        }
  928|  2.33M|        if (utype == V_ASN1_UTCTIME && (len < 13)) {
  ------------------
  |  |   82|  4.66M|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (928:13): [True: 98.4k, False: 2.23M]
  |  Branch (928:40): [True: 115, False: 98.3k]
  ------------------
  929|    115|            ERR_raise(ERR_LIB_ASN1, ASN1_R_UTCTIME_IS_TOO_SHORT);
  ------------------
  |  |  401|    115|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    115|    (ERR_new(),                                                 \
  |  |  |  |  404|    115|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    115|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    115|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    115|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    115|     ERR_set_error)
  |  |  ------------------
  ------------------
  930|    115|            goto err;
  931|    115|        }
  932|       |        /* All based on ASN1_STRING and handled the same */
  933|  2.33M|        if (*pval == NULL) {
  ------------------
  |  Branch (933:13): [True: 1.84M, False: 493k]
  ------------------
  934|  1.84M|            stmp = ASN1_STRING_type_new(utype);
  935|  1.84M|            if (stmp == NULL) {
  ------------------
  |  Branch (935:17): [True: 0, False: 1.84M]
  ------------------
  936|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  937|      0|                goto err;
  938|      0|            }
  939|  1.84M|            *pval = (ASN1_VALUE *)stmp;
  940|  1.84M|        } else {
  941|   493k|            stmp = (ASN1_STRING *)*pval;
  942|   493k|            stmp->type = utype;
  943|   493k|        }
  944|       |        /* If we've already allocated a buffer use it */
  945|  2.33M|        if (*free_cont) {
  ------------------
  |  Branch (945:13): [True: 124k, False: 2.21M]
  ------------------
  946|   124k|            ASN1_STRING_set0(stmp, (unsigned char *)cont /* UGLY CAST! */, len);
  947|   124k|            *free_cont = 0;
  948|  2.21M|        } else {
  949|  2.21M|            if (!ASN1_STRING_set(stmp, cont, len)) {
  ------------------
  |  Branch (949:17): [True: 0, False: 2.21M]
  ------------------
  950|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  951|      0|                ASN1_STRING_free(stmp);
  952|      0|                *pval = NULL;
  953|      0|                goto err;
  954|      0|            }
  955|  2.21M|        }
  956|  2.33M|        break;
  957|  3.81M|    }
  958|       |    /* If ASN1_ANY and NULL type fix up value */
  959|  3.72M|    if (typ && (utype == V_ASN1_NULL))
  ------------------
  |  |   67|  1.59M|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (959:9): [True: 1.59M, False: 2.13M]
  |  Branch (959:16): [True: 5.00k, False: 1.58M]
  ------------------
  960|  5.00k|        typ->value.ptr = NULL;
  961|       |
  962|  3.72M|    ret = 1;
  963|  3.81M| err:
  964|  3.81M|    if (!ret) {
  ------------------
  |  Branch (964:9): [True: 93.8k, False: 3.72M]
  ------------------
  965|  93.8k|        ASN1_TYPE_free(typ);
  966|  93.8k|        if (opval)
  ------------------
  |  Branch (966:13): [True: 3.43k, False: 90.3k]
  ------------------
  967|  3.43k|            *opval = NULL;
  968|  93.8k|    }
  969|  3.81M|    return ret;
  970|  3.72M|}
tasn_dec.c:asn1_check_tlen:
 1145|  45.8M|{
 1146|  45.8M|    int i;
 1147|  45.8M|    int ptag, pclass;
 1148|  45.8M|    long plen;
 1149|  45.8M|    const unsigned char *p, *q;
 1150|  45.8M|    p = *in;
 1151|  45.8M|    q = p;
 1152|       |
 1153|  45.8M|    if (len <= 0) {
  ------------------
  |  Branch (1153:9): [True: 16, False: 45.8M]
  ------------------
 1154|     16|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|     16|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     16|    (ERR_new(),                                                 \
  |  |  |  |  404|     16|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     16|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     16|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     16|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     16|     ERR_set_error)
  |  |  ------------------
  ------------------
 1155|     16|        goto err;
 1156|     16|    }
 1157|  45.8M|    if (ctx != NULL && ctx->valid) {
  ------------------
  |  Branch (1157:9): [True: 14.6M, False: 31.1M]
  |  Branch (1157:24): [True: 3.53M, False: 11.1M]
  ------------------
 1158|  3.53M|        i = ctx->ret;
 1159|  3.53M|        plen = ctx->plen;
 1160|  3.53M|        pclass = ctx->pclass;
 1161|  3.53M|        ptag = ctx->ptag;
 1162|  3.53M|        p += ctx->hdrlen;
 1163|  42.2M|    } else {
 1164|  42.2M|        i = ASN1_get_object(&p, &plen, &ptag, &pclass, len);
 1165|  42.2M|        if (ctx != NULL) {
  ------------------
  |  Branch (1165:13): [True: 11.1M, False: 31.1M]
  ------------------
 1166|  11.1M|            ctx->ret = i;
 1167|  11.1M|            ctx->plen = plen;
 1168|  11.1M|            ctx->pclass = pclass;
 1169|  11.1M|            ctx->ptag = ptag;
 1170|  11.1M|            ctx->hdrlen = p - q;
 1171|  11.1M|            ctx->valid = 1;
 1172|       |            /*
 1173|       |             * If definite length, and no error, length + header can't exceed
 1174|       |             * total amount of data available.
 1175|       |             */
 1176|  11.1M|            if ((i & 0x81) == 0 && (plen + ctx->hdrlen) > len) {
  ------------------
  |  Branch (1176:17): [True: 8.53M, False: 2.62M]
  |  Branch (1176:36): [True: 0, False: 8.53M]
  ------------------
 1177|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1178|      0|                goto err;
 1179|      0|            }
 1180|  11.1M|        }
 1181|  42.2M|    }
 1182|       |
 1183|  45.8M|    if ((i & 0x80) != 0) {
  ------------------
  |  Branch (1183:9): [True: 85.2k, False: 45.7M]
  ------------------
 1184|  85.2k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER);
  ------------------
  |  |  401|  85.2k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  85.2k|    (ERR_new(),                                                 \
  |  |  |  |  404|  85.2k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  85.2k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  85.2k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  85.2k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  85.2k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1185|  85.2k|        goto err;
 1186|  85.2k|    }
 1187|  45.7M|    if (exptag >= 0) {
  ------------------
  |  Branch (1187:9): [True: 12.4M, False: 33.2M]
  ------------------
 1188|  12.4M|        if (exptag != ptag || expclass != pclass) {
  ------------------
  |  Branch (1188:13): [True: 3.57M, False: 8.92M]
  |  Branch (1188:31): [True: 62.8k, False: 8.85M]
  ------------------
 1189|       |            /*
 1190|       |             * If type is OPTIONAL, not an error: indicate missing type.
 1191|       |             */
 1192|  3.63M|            if (opt != 0)
  ------------------
  |  Branch (1192:17): [True: 1.63M, False: 2.00M]
  ------------------
 1193|  1.63M|                return -1;
 1194|  3.63M|            ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_TAG);
  ------------------
  |  |  401|  2.00M|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.00M|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.00M|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  2.00M|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  2.00M|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.00M|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.00M|     ERR_set_error)
  |  |  ------------------
  ------------------
 1195|  2.00M|            goto err;
 1196|  3.63M|        }
 1197|       |        /*
 1198|       |         * We have a tag and class match: assume we are going to do something
 1199|       |         * with it
 1200|       |         */
 1201|  8.85M|        asn1_tlc_clear(ctx);
  ------------------
  |  |   96|  8.85M|#define asn1_tlc_clear(c)       do { if ((c) != NULL) (c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (96:42): [True: 8.85M, False: 0]
  |  |  |  Branch (96:80): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1202|  8.85M|    }
 1203|       |
 1204|  42.0M|    if ((i & 1) != 0)
  ------------------
  |  Branch (1204:9): [True: 10.5M, False: 31.5M]
  ------------------
 1205|  10.5M|        plen = len - (p - q);
 1206|       |
 1207|  42.0M|    if (inf != NULL)
  ------------------
  |  Branch (1207:9): [True: 39.9M, False: 2.08M]
  ------------------
 1208|  39.9M|        *inf = i & 1;
 1209|       |
 1210|  42.0M|    if (cst != NULL)
  ------------------
  |  Branch (1210:9): [True: 6.81M, False: 35.2M]
  ------------------
 1211|  6.81M|        *cst = i & V_ASN1_CONSTRUCTED;
  ------------------
  |  |   52|  6.81M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
 1212|       |
 1213|  42.0M|    if (olen != NULL)
  ------------------
  |  Branch (1213:9): [True: 39.9M, False: 2.08M]
  ------------------
 1214|  39.9M|        *olen = plen;
 1215|       |
 1216|  42.0M|    if (oclass != NULL)
  ------------------
  |  Branch (1216:9): [True: 2.08M, False: 39.9M]
  ------------------
 1217|  2.08M|        *oclass = pclass;
 1218|       |
 1219|  42.0M|    if (otag != NULL)
  ------------------
  |  Branch (1219:9): [True: 2.08M, False: 39.9M]
  ------------------
 1220|  2.08M|        *otag = ptag;
 1221|       |
 1222|  42.0M|    *in = p;
 1223|  42.0M|    return 1;
 1224|       |
 1225|  2.08M| err:
 1226|  2.08M|    asn1_tlc_clear(ctx);
  ------------------
  |  |   96|  2.08M|#define asn1_tlc_clear(c)       do { if ((c) != NULL) (c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (96:42): [True: 2.07M, False: 8.90k]
  |  |  |  Branch (96:80): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1227|  2.08M|    return 0;
 1228|  45.7M|}
tasn_dec.c:asn1_check_eoc:
 1121|  46.9M|{
 1122|  46.9M|    const unsigned char *p;
 1123|       |
 1124|  46.9M|    if (len < 2)
  ------------------
  |  Branch (1124:9): [True: 8.12k, False: 46.9M]
  ------------------
 1125|  8.12k|        return 0;
 1126|  46.9M|    p = *in;
 1127|  46.9M|    if (p[0] == '\0' && p[1] == '\0') {
  ------------------
  |  Branch (1127:9): [True: 7.20M, False: 39.7M]
  |  Branch (1127:25): [True: 7.17M, False: 32.2k]
  ------------------
 1128|  7.17M|        *in += 2;
 1129|  7.17M|        return 1;
 1130|  7.17M|    }
 1131|  39.7M|    return 0;
 1132|  46.9M|}

ASN1_item_i2d:
   44|  67.0k|{
   45|  67.0k|    return asn1_item_flags_i2d(val, out, it, 0);
   46|  67.0k|}
ASN1_item_ex_i2d:
   83|  8.52M|{
   84|  8.52M|    const ASN1_TEMPLATE *tt = NULL;
   85|  8.52M|    int i, seqcontlen, seqlen, ndef = 1;
   86|  8.52M|    const ASN1_EXTERN_FUNCS *ef;
   87|  8.52M|    const ASN1_AUX *aux = it->funcs;
   88|  8.52M|    ASN1_aux_const_cb *asn1_cb = NULL;
   89|       |
   90|  8.52M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE) && *pval == NULL)
  ------------------
  |  |   80|  8.52M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (90:9): [True: 3.01M, False: 5.51M]
  |  Branch (90:48): [True: 29.3k, False: 2.98M]
  ------------------
   91|  29.3k|        return 0;
   92|       |
   93|  8.49M|    if (aux != NULL) {
  ------------------
  |  Branch (93:9): [True: 763k, False: 7.73M]
  ------------------
   94|   763k|        asn1_cb = ((aux->flags & ASN1_AFLG_CONST_CB) != 0) ? aux->asn1_const_cb
  ------------------
  |  |  738|   763k|# define ASN1_AFLG_CONST_CB      8
  ------------------
  |  Branch (94:19): [True: 0, False: 763k]
  ------------------
   95|   763k|            : (ASN1_aux_const_cb *)aux->asn1_cb; /* backward compatibility */
   96|   763k|    }
   97|       |
   98|  8.49M|    switch (it->itype) {
   99|       |
  100|  5.51M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  5.51M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (100:5): [True: 5.51M, False: 2.98M]
  ------------------
  101|  5.51M|        if (it->templates)
  ------------------
  |  Branch (101:13): [True: 179k, False: 5.33M]
  ------------------
  102|   179k|            return asn1_template_ex_i2d(pval, out, it->templates,
  103|   179k|                                        tag, aclass);
  104|  5.33M|        return asn1_i2d_ex_primitive(pval, out, it, tag, aclass);
  105|       |
  106|  1.09M|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|  1.09M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (106:5): [True: 1.09M, False: 7.40M]
  ------------------
  107|       |        /*
  108|       |         * It never makes sense for multi-strings to have implicit tagging, so
  109|       |         * if tag != -1, then this looks like an error in the template.
  110|       |         */
  111|  1.09M|        if (tag != -1) {
  ------------------
  |  Branch (111:13): [True: 0, False: 1.09M]
  ------------------
  112|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  113|      0|            return -1;
  114|      0|        }
  115|  1.09M|        return asn1_i2d_ex_primitive(pval, out, it, -1, aclass);
  116|       |
  117|   523k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|   523k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (117:5): [True: 523k, False: 7.97M]
  ------------------
  118|       |        /*
  119|       |         * It never makes sense for CHOICE types to have implicit tagging, so
  120|       |         * if tag != -1, then this looks like an error in the template.
  121|       |         */
  122|   523k|        if (tag != -1) {
  ------------------
  |  Branch (122:13): [True: 0, False: 523k]
  ------------------
  123|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  124|      0|            return -1;
  125|      0|        }
  126|   523k|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL))
  ------------------
  |  |  748|  18.7k|# define ASN1_OP_I2D_PRE         6
  ------------------
  |  Branch (126:13): [True: 18.7k, False: 504k]
  |  Branch (126:24): [True: 0, False: 18.7k]
  ------------------
  127|      0|            return 0;
  128|   523k|        i = ossl_asn1_get_choice_selector_const(pval, it);
  129|   523k|        if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (129:13): [True: 523k, False: 0]
  |  Branch (129:25): [True: 523k, False: 0]
  ------------------
  130|   523k|            const ASN1_VALUE **pchval;
  131|   523k|            const ASN1_TEMPLATE *chtt;
  132|   523k|            chtt = it->templates + i;
  133|   523k|            pchval = ossl_asn1_get_const_field_ptr(pval, chtt);
  134|   523k|            return asn1_template_ex_i2d(pchval, out, chtt, -1, aclass);
  135|   523k|        }
  136|       |        /* Fixme: error condition if selector out of range */
  137|      0|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it, NULL))
  ------------------
  |  |  749|      0|# define ASN1_OP_I2D_POST        7
  ------------------
  |  Branch (137:13): [True: 0, False: 0]
  |  Branch (137:24): [True: 0, False: 0]
  ------------------
  138|      0|            return 0;
  139|      0|        break;
  140|       |
  141|  15.5k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|  15.5k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (141:5): [True: 15.5k, False: 8.48M]
  ------------------
  142|       |        /* If new style i2d it does all the work */
  143|  15.5k|        ef = it->funcs;
  144|  15.5k|        return ef->asn1_ex_i2d(pval, out, it, tag, aclass);
  145|       |
  146|  10.6k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|  10.6k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (146:5): [True: 10.6k, False: 8.48M]
  ------------------
  147|       |        /* Use indefinite length constructed if requested */
  148|  10.6k|        if (aclass & ASN1_TFLG_NDEF)
  ------------------
  |  |  594|  10.6k|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
  |  Branch (148:13): [True: 0, False: 10.6k]
  ------------------
  149|      0|            ndef = 2;
  150|       |        /* fall through */
  151|       |
  152|  1.35M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  1.35M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (152:5): [True: 1.34M, False: 7.15M]
  ------------------
  153|  1.35M|        i = ossl_asn1_enc_restore(&seqcontlen, out, pval, it);
  154|       |        /* An error occurred */
  155|  1.35M|        if (i < 0)
  ------------------
  |  Branch (155:13): [True: 0, False: 1.35M]
  ------------------
  156|      0|            return 0;
  157|       |        /* We have a valid cached encoding... */
  158|  1.35M|        if (i > 0)
  ------------------
  |  Branch (158:13): [True: 22.6k, False: 1.33M]
  ------------------
  159|  22.6k|            return seqcontlen;
  160|       |        /* Otherwise carry on */
  161|  1.33M|        seqcontlen = 0;
  162|       |        /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */
  163|  1.33M|        if (tag == -1) {
  ------------------
  |  Branch (163:13): [True: 1.31M, False: 15.3k]
  ------------------
  164|  1.31M|            tag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|  1.31M|# define V_ASN1_SEQUENCE                 16
  ------------------
  165|       |            /* Retain any other flags in aclass */
  166|  1.31M|            aclass = (aclass & ~ASN1_TFLG_TAG_CLASS)
  ------------------
  |  |  575|  1.31M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  167|  1.31M|                | V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  1.31M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  168|  1.31M|        }
  169|  1.33M|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL))
  ------------------
  |  |  748|  36.1k|# define ASN1_OP_I2D_PRE         6
  ------------------
  |  Branch (169:13): [True: 36.1k, False: 1.29M]
  |  Branch (169:24): [True: 0, False: 36.1k]
  ------------------
  170|      0|            return 0;
  171|       |        /* First work out sequence content length */
  172|  4.48M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (172:41): [True: 3.15M, False: 1.33M]
  ------------------
  173|  3.15M|            const ASN1_TEMPLATE *seqtt;
  174|  3.15M|            const ASN1_VALUE **pseqval;
  175|  3.15M|            int tmplen;
  176|  3.15M|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  177|  3.15M|            if (!seqtt)
  ------------------
  |  Branch (177:17): [True: 0, False: 3.15M]
  ------------------
  178|      0|                return 0;
  179|  3.15M|            pseqval = ossl_asn1_get_const_field_ptr(pval, seqtt);
  180|  3.15M|            tmplen = asn1_template_ex_i2d(pseqval, NULL, seqtt, -1, aclass);
  181|  3.15M|            if (tmplen == -1 || (tmplen > INT_MAX - seqcontlen))
  ------------------
  |  Branch (181:17): [True: 0, False: 3.15M]
  |  Branch (181:33): [True: 0, False: 3.15M]
  ------------------
  182|      0|                return -1;
  183|  3.15M|            seqcontlen += tmplen;
  184|  3.15M|        }
  185|       |
  186|  1.33M|        seqlen = ASN1_object_size(ndef, seqcontlen, tag);
  187|  1.33M|        if (!out || seqlen == -1)
  ------------------
  |  Branch (187:13): [True: 931k, False: 398k]
  |  Branch (187:21): [True: 0, False: 398k]
  ------------------
  188|   931k|            return seqlen;
  189|       |        /* Output SEQUENCE header */
  190|   398k|        ASN1_put_object(out, ndef, seqcontlen, tag, aclass);
  191|  1.33M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (191:41): [True: 935k, False: 398k]
  ------------------
  192|   935k|            const ASN1_TEMPLATE *seqtt;
  193|   935k|            const ASN1_VALUE **pseqval;
  194|   935k|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  195|   935k|            if (!seqtt)
  ------------------
  |  Branch (195:17): [True: 0, False: 935k]
  ------------------
  196|      0|                return 0;
  197|   935k|            pseqval = ossl_asn1_get_const_field_ptr(pval, seqtt);
  198|       |            /* FIXME: check for errors in enhanced version */
  199|   935k|            asn1_template_ex_i2d(pseqval, out, seqtt, -1, aclass);
  200|   935k|        }
  201|   398k|        if (ndef == 2)
  ------------------
  |  Branch (201:13): [True: 0, False: 398k]
  ------------------
  202|      0|            ASN1_put_eoc(out);
  203|   398k|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it, NULL))
  ------------------
  |  |  749|  14.1k|# define ASN1_OP_I2D_POST        7
  ------------------
  |  Branch (203:13): [True: 14.1k, False: 384k]
  |  Branch (203:24): [True: 0, False: 14.1k]
  ------------------
  204|      0|            return 0;
  205|   398k|        return seqlen;
  206|       |
  207|      0|    default:
  ------------------
  |  Branch (207:5): [True: 0, False: 8.49M]
  ------------------
  208|      0|        return 0;
  209|       |
  210|  8.49M|    }
  211|      0|    return 0;
  212|  8.49M|}
tasn_enc.c:asn1_item_flags_i2d:
   57|  67.0k|{
   58|  67.0k|    if (out != NULL && *out == NULL) {
  ------------------
  |  Branch (58:9): [True: 64.9k, False: 2.13k]
  |  Branch (58:24): [True: 63.0k, False: 1.89k]
  ------------------
   59|  63.0k|        unsigned char *p, *buf;
   60|  63.0k|        int len;
   61|       |
   62|  63.0k|        len = ASN1_item_ex_i2d(&val, NULL, it, -1, flags);
   63|  63.0k|        if (len <= 0)
  ------------------
  |  Branch (63:13): [True: 20, False: 63.0k]
  ------------------
   64|     20|            return len;
   65|  63.0k|        if ((buf = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |  102|  63.0k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  63.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  63.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (65:13): [True: 0, False: 63.0k]
  ------------------
   66|      0|            return -1;
   67|  63.0k|        p = buf;
   68|  63.0k|        ASN1_item_ex_i2d(&val, &p, it, -1, flags);
   69|  63.0k|        *out = buf;
   70|  63.0k|        return len;
   71|  63.0k|    }
   72|       |
   73|  4.02k|    return ASN1_item_ex_i2d(&val, out, it, -1, flags);
   74|  67.0k|}
tasn_enc.c:asn1_template_ex_i2d:
  216|  4.79M|{
  217|  4.79M|    const int flags = tt->flags;
  218|  4.79M|    int i, ret, ttag, tclass, ndef, len;
  219|  4.79M|    const ASN1_VALUE *tval;
  220|       |
  221|       |    /*
  222|       |     * If field is embedded then val needs fixing so it is a pointer to
  223|       |     * a pointer to a field.
  224|       |     */
  225|  4.79M|    if (flags & ASN1_TFLG_EMBED) {
  ------------------
  |  |  597|  4.79M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  |  Branch (225:9): [True: 331k, False: 4.46M]
  ------------------
  226|   331k|        tval = (ASN1_VALUE *)pval;
  227|   331k|        pval = &tval;
  228|   331k|    }
  229|       |    /*
  230|       |     * Work out tag and class to use: tagging may come either from the
  231|       |     * template or the arguments, not both because this would create
  232|       |     * ambiguity. Additionally the iclass argument may contain some
  233|       |     * additional flags which should be noted and passed down to other
  234|       |     * levels.
  235|       |     */
  236|  4.79M|    if (flags & ASN1_TFLG_TAG_MASK) {
  ------------------
  |  |  552|  4.79M|# define ASN1_TFLG_TAG_MASK      (0x3 << 3)
  ------------------
  |  Branch (236:9): [True: 649k, False: 4.14M]
  ------------------
  237|       |        /* Error if argument and template tagging */
  238|   649k|        if (tag != -1)
  ------------------
  |  Branch (238:13): [True: 0, False: 649k]
  ------------------
  239|       |            /* FIXME: error code here */
  240|      0|            return -1;
  241|       |        /* Get tagging from template */
  242|   649k|        ttag = tt->tag;
  243|   649k|        tclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|   649k|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  244|  4.14M|    } else if (tag != -1) {
  ------------------
  |  Branch (244:16): [True: 0, False: 4.14M]
  ------------------
  245|       |        /* No template tagging, get from arguments */
  246|      0|        ttag = tag;
  247|      0|        tclass = iclass & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|      0|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  248|  4.14M|    } else {
  249|  4.14M|        ttag = -1;
  250|  4.14M|        tclass = 0;
  251|  4.14M|    }
  252|       |    /*
  253|       |     * Remove any class mask from iflag.
  254|       |     */
  255|  4.79M|    iclass &= ~ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  4.79M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  256|       |
  257|       |    /*
  258|       |     * At this point 'ttag' contains the outer tag to use, 'tclass' is the
  259|       |     * class and iclass is any flags passed to this function.
  260|       |     */
  261|       |
  262|       |    /* if template and arguments require ndef, use it */
  263|  4.79M|    if ((flags & ASN1_TFLG_NDEF) && (iclass & ASN1_TFLG_NDEF))
  ------------------
  |  |  594|  4.79M|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
                  if ((flags & ASN1_TFLG_NDEF) && (iclass & ASN1_TFLG_NDEF))
  ------------------
  |  |  594|  1.76k|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
  |  Branch (263:9): [True: 1.76k, False: 4.78M]
  |  Branch (263:37): [True: 0, False: 1.76k]
  ------------------
  264|      0|        ndef = 2;
  265|  4.79M|    else
  266|  4.79M|        ndef = 1;
  267|       |
  268|  4.79M|    if (flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  4.79M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (268:9): [True: 257k, False: 4.53M]
  ------------------
  269|       |        /* SET OF, SEQUENCE OF */
  270|   257k|        STACK_OF(const_ASN1_VALUE) *sk = (STACK_OF(const_ASN1_VALUE) *)*pval;
  ------------------
  |  |   31|   257k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  271|   257k|        int isset, sktag, skaclass;
  272|   257k|        int skcontlen, sklen;
  273|   257k|        const ASN1_VALUE *skitem;
  274|       |
  275|   257k|        if (*pval == NULL)
  ------------------
  |  Branch (275:13): [True: 49.2k, False: 208k]
  ------------------
  276|  49.2k|            return 0;
  277|       |
  278|   208k|        if (flags & ASN1_TFLG_SET_OF) {
  ------------------
  |  |  526|   208k|# define ASN1_TFLG_SET_OF        (0x1 << 1)
  ------------------
  |  Branch (278:13): [True: 161k, False: 47.3k]
  ------------------
  279|   161k|            isset = 1;
  280|       |            /* 2 means we reorder */
  281|   161k|            if (flags & ASN1_TFLG_SEQUENCE_OF)
  ------------------
  |  |  529|   161k|# define ASN1_TFLG_SEQUENCE_OF   (0x2 << 1)
  ------------------
  |  Branch (281:17): [True: 252, False: 160k]
  ------------------
  282|    252|                isset = 2;
  283|   161k|        } else
  284|  47.3k|            isset = 0;
  285|       |
  286|       |        /*
  287|       |         * Work out inner tag value: if EXPLICIT or no tagging use underlying
  288|       |         * type.
  289|       |         */
  290|   208k|        if ((ttag != -1) && !(flags & ASN1_TFLG_EXPTAG)) {
  ------------------
  |  |  550|  16.5k|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (290:13): [True: 16.5k, False: 191k]
  |  Branch (290:29): [True: 8.07k, False: 8.44k]
  ------------------
  291|  8.07k|            sktag = ttag;
  292|  8.07k|            skaclass = tclass;
  293|   200k|        } else {
  294|   200k|            skaclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|   200k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  295|   200k|            if (isset)
  ------------------
  |  Branch (295:17): [True: 160k, False: 39.7k]
  ------------------
  296|   160k|                sktag = V_ASN1_SET;
  ------------------
  |  |   75|   160k|# define V_ASN1_SET                      17
  ------------------
  297|  39.7k|            else
  298|  39.7k|                sktag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|  39.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  299|   200k|        }
  300|       |
  301|       |        /* Determine total length of items */
  302|   208k|        skcontlen = 0;
  303|  2.83M|        for (i = 0; i < sk_const_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  Branch (303:21): [True: 2.62M, False: 208k]
  ------------------
  304|  2.62M|            skitem = sk_const_ASN1_VALUE_value(sk, i);
  305|  2.62M|            len = ASN1_item_ex_i2d(&skitem, NULL, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  422|  2.62M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  306|  2.62M|                                   -1, iclass);
  307|  2.62M|            if (len == -1 || (skcontlen > INT_MAX - len))
  ------------------
  |  Branch (307:17): [True: 0, False: 2.62M]
  |  Branch (307:30): [True: 0, False: 2.62M]
  ------------------
  308|      0|                return -1;
  309|  2.62M|            if (len == 0 && (tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  523|      0|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (309:17): [True: 0, False: 2.62M]
  |  Branch (309:29): [True: 0, False: 0]
  ------------------
  310|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  311|      0|                return -1;
  312|      0|            }
  313|  2.62M|            skcontlen += len;
  314|  2.62M|        }
  315|   208k|        sklen = ASN1_object_size(ndef, skcontlen, sktag);
  316|   208k|        if (sklen == -1)
  ------------------
  |  Branch (316:13): [True: 0, False: 208k]
  ------------------
  317|      0|            return -1;
  318|       |        /* If EXPLICIT need length of surrounding tag */
  319|   208k|        if (flags & ASN1_TFLG_EXPTAG)
  ------------------
  |  |  550|   208k|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (319:13): [True: 8.44k, False: 200k]
  ------------------
  320|  8.44k|            ret = ASN1_object_size(ndef, sklen, ttag);
  321|   200k|        else
  322|   200k|            ret = sklen;
  323|       |
  324|   208k|        if (!out || ret == -1)
  ------------------
  |  Branch (324:13): [True: 120k, False: 88.0k]
  |  Branch (324:21): [True: 0, False: 88.0k]
  ------------------
  325|   120k|            return ret;
  326|       |
  327|       |        /* Now encode this lot... */
  328|       |        /* EXPLICIT tag */
  329|  88.0k|        if (flags & ASN1_TFLG_EXPTAG)
  ------------------
  |  |  550|  88.0k|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (329:13): [True: 564, False: 87.5k]
  ------------------
  330|    564|            ASN1_put_object(out, ndef, sklen, ttag, tclass);
  331|       |        /* SET or SEQUENCE and IMPLICIT tag */
  332|  88.0k|        ASN1_put_object(out, ndef, skcontlen, sktag, skaclass);
  333|       |        /* And the stuff itself */
  334|  88.0k|        asn1_set_seq_out(sk, out, skcontlen, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  422|  88.0k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  335|  88.0k|                         isset, iclass);
  336|  88.0k|        if (ndef == 2) {
  ------------------
  |  Branch (336:13): [True: 0, False: 88.0k]
  ------------------
  337|      0|            ASN1_put_eoc(out);
  338|      0|            if (flags & ASN1_TFLG_EXPTAG)
  ------------------
  |  |  550|      0|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (338:17): [True: 0, False: 0]
  ------------------
  339|      0|                ASN1_put_eoc(out);
  340|      0|        }
  341|       |
  342|  88.0k|        return ret;
  343|   208k|    }
  344|       |
  345|  4.53M|    if (flags & ASN1_TFLG_EXPTAG) {
  ------------------
  |  |  550|  4.53M|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (345:9): [True: 76.5k, False: 4.45M]
  ------------------
  346|       |        /* EXPLICIT tagging */
  347|       |        /* Find length of tagged item */
  348|  76.5k|        i = ASN1_item_ex_i2d(pval, NULL, ASN1_ITEM_ptr(tt->item), -1, iclass);
  ------------------
  |  |  422|  76.5k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  349|  76.5k|        if (i == 0) {
  ------------------
  |  Branch (349:13): [True: 44.6k, False: 31.9k]
  ------------------
  350|  44.6k|            if ((tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  523|  44.6k|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (350:17): [True: 0, False: 44.6k]
  ------------------
  351|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  352|      0|                return -1;
  353|      0|            }
  354|  44.6k|            return 0;
  355|  44.6k|        }
  356|       |        /* Find length of EXPLICIT tag */
  357|  31.9k|        ret = ASN1_object_size(ndef, i, ttag);
  358|  31.9k|        if (out && ret != -1) {
  ------------------
  |  Branch (358:13): [True: 8.23k, False: 23.6k]
  |  Branch (358:20): [True: 8.23k, False: 0]
  ------------------
  359|       |            /* Output tag and item */
  360|  8.23k|            ASN1_put_object(out, ndef, i, ttag, tclass);
  361|  8.23k|            ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, iclass);
  ------------------
  |  |  422|  8.23k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  362|  8.23k|            if (ndef == 2)
  ------------------
  |  Branch (362:17): [True: 0, False: 8.23k]
  ------------------
  363|      0|                ASN1_put_eoc(out);
  364|  8.23k|        }
  365|  31.9k|        return ret;
  366|  76.5k|    }
  367|       |
  368|       |    /* Either normal or IMPLICIT tagging: combine class and flags */
  369|  4.45M|    len = ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  422|  4.45M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  370|  4.45M|                              ttag, tclass | iclass);
  371|  4.45M|    if (len == 0 && (tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  523|   324k|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (371:9): [True: 324k, False: 4.13M]
  |  Branch (371:21): [True: 0, False: 324k]
  ------------------
  372|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  373|      0|        return -1;
  374|      0|    }
  375|  4.45M|    return len;
  376|  4.45M|}
tasn_enc.c:asn1_set_seq_out:
  403|  88.0k|{
  404|  88.0k|    int i, ret = 0;
  405|  88.0k|    const ASN1_VALUE *skitem;
  406|  88.0k|    unsigned char *tmpdat = NULL, *p = NULL;
  407|  88.0k|    DER_ENC *derlst = NULL, *tder;
  408|       |
  409|  88.0k|    if (do_sort) {
  ------------------
  |  Branch (409:9): [True: 72.7k, False: 15.3k]
  ------------------
  410|       |        /* Don't need to sort less than 2 items */
  411|  72.7k|        if (sk_const_ASN1_VALUE_num(sk) < 2)
  ------------------
  |  Branch (411:13): [True: 70.2k, False: 2.52k]
  ------------------
  412|  70.2k|            do_sort = 0;
  413|  2.52k|        else {
  414|  2.52k|            derlst = OPENSSL_malloc(sk_const_ASN1_VALUE_num(sk)
  ------------------
  |  |  102|  2.52k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.52k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.52k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  415|  2.52k|                                    * sizeof(*derlst));
  416|  2.52k|            if (derlst == NULL)
  ------------------
  |  Branch (416:17): [True: 0, False: 2.52k]
  ------------------
  417|      0|                return 0;
  418|  2.52k|            tmpdat = OPENSSL_malloc(skcontlen);
  ------------------
  |  |  102|  2.52k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.52k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.52k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  419|  2.52k|            if (tmpdat == NULL)
  ------------------
  |  Branch (419:17): [True: 0, False: 2.52k]
  ------------------
  420|      0|                goto err;
  421|  2.52k|        }
  422|  72.7k|    }
  423|       |    /* If not sorting just output each item */
  424|  88.0k|    if (!do_sort) {
  ------------------
  |  Branch (424:9): [True: 85.5k, False: 2.52k]
  ------------------
  425|   904k|        for (i = 0; i < sk_const_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  Branch (425:21): [True: 818k, False: 85.5k]
  ------------------
  426|   818k|            skitem = sk_const_ASN1_VALUE_value(sk, i);
  427|   818k|            ASN1_item_ex_i2d(&skitem, out, item, -1, iclass);
  428|   818k|        }
  429|  85.5k|        return 1;
  430|  85.5k|    }
  431|  2.52k|    p = tmpdat;
  432|       |
  433|       |    /* Doing sort: build up a list of each member's DER encoding */
  434|   295k|    for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++) {
  ------------------
  |  Branch (434:32): [True: 292k, False: 2.52k]
  ------------------
  435|   292k|        skitem = sk_const_ASN1_VALUE_value(sk, i);
  436|   292k|        tder->data = p;
  437|   292k|        tder->length = ASN1_item_ex_i2d(&skitem, &p, item, -1, iclass);
  438|   292k|        tder->field = skitem;
  439|   292k|    }
  440|       |
  441|       |    /* Now sort them */
  442|  2.52k|    qsort(derlst, sk_const_ASN1_VALUE_num(sk), sizeof(*derlst), der_cmp);
  443|       |    /* Output sorted DER encoding */
  444|  2.52k|    p = *out;
  445|   295k|    for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++) {
  ------------------
  |  Branch (445:32): [True: 292k, False: 2.52k]
  ------------------
  446|   292k|        memcpy(p, tder->data, tder->length);
  447|   292k|        p += tder->length;
  448|   292k|    }
  449|  2.52k|    *out = p;
  450|       |    /* If do_sort is 2 then reorder the STACK */
  451|  2.52k|    if (do_sort == 2) {
  ------------------
  |  Branch (451:9): [True: 22, False: 2.49k]
  ------------------
  452|    389|        for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++)
  ------------------
  |  Branch (452:36): [True: 367, False: 22]
  ------------------
  453|    367|            (void)sk_const_ASN1_VALUE_set(sk, i, tder->field);
  454|     22|    }
  455|  2.52k|    ret = 1;
  456|  2.52k|err:
  457|  2.52k|    OPENSSL_free(derlst);
  ------------------
  |  |  115|  2.52k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.52k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.52k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  458|  2.52k|    OPENSSL_free(tmpdat);
  ------------------
  |  |  115|  2.52k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.52k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.52k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  459|  2.52k|    return ret;
  460|  2.52k|}
tasn_enc.c:der_cmp:
  387|  2.90M|{
  388|  2.90M|    const DER_ENC *d1 = a, *d2 = b;
  389|  2.90M|    int cmplen, i;
  390|  2.90M|    cmplen = (d1->length < d2->length) ? d1->length : d2->length;
  ------------------
  |  Branch (390:14): [True: 9.76k, False: 2.89M]
  ------------------
  391|  2.90M|    i = memcmp(d1->data, d2->data, cmplen);
  392|  2.90M|    if (i)
  ------------------
  |  Branch (392:9): [True: 1.21M, False: 1.68M]
  ------------------
  393|  1.21M|        return i;
  394|  1.68M|    return d1->length - d2->length;
  395|  2.90M|}
tasn_enc.c:asn1_i2d_ex_primitive:
  464|  6.42M|{
  465|  6.42M|    int len;
  466|  6.42M|    int utype;
  467|  6.42M|    int usetag;
  468|  6.42M|    int ndef = 0;
  469|       |
  470|  6.42M|    utype = it->utype;
  471|       |
  472|       |    /*
  473|       |     * Get length of content octets and maybe find out the underlying type.
  474|       |     */
  475|       |
  476|  6.42M|    len = asn1_ex_i2c(pval, NULL, &utype, it);
  477|       |
  478|       |    /*
  479|       |     * If SEQUENCE, SET or OTHER then header is included in pseudo content
  480|       |     * octets so don't include tag+length. We need to check here because the
  481|       |     * call to asn1_ex_i2c() could change utype.
  482|       |     */
  483|  6.42M|    if ((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) ||
  ------------------
  |  |   74|  6.42M|# define V_ASN1_SEQUENCE                 16
  ------------------
                  if ((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) ||
  ------------------
  |  |   75|  5.76M|# define V_ASN1_SET                      17
  ------------------
  |  Branch (483:9): [True: 661k, False: 5.76M]
  |  Branch (483:39): [True: 1.80M, False: 3.96M]
  ------------------
  484|  6.42M|        (utype == V_ASN1_OTHER))
  ------------------
  |  |   57|  3.96M|# define V_ASN1_OTHER                    -3 /* used in ASN1_TYPE */
  ------------------
  |  Branch (484:9): [True: 53.6k, False: 3.90M]
  ------------------
  485|  2.51M|        usetag = 0;
  486|  3.90M|    else
  487|  3.90M|        usetag = 1;
  488|       |
  489|       |    /* -1 means omit type */
  490|       |
  491|  6.42M|    if (len == -1)
  ------------------
  |  Branch (491:9): [True: 339k, False: 6.08M]
  ------------------
  492|   339k|        return 0;
  493|       |
  494|       |    /* -2 return is special meaning use ndef */
  495|  6.08M|    if (len == -2) {
  ------------------
  |  Branch (495:9): [True: 0, False: 6.08M]
  ------------------
  496|      0|        ndef = 2;
  497|      0|        len = 0;
  498|      0|    }
  499|       |
  500|       |    /* If not implicitly tagged get tag from underlying type */
  501|  6.08M|    if (tag == -1)
  ------------------
  |  Branch (501:9): [True: 5.60M, False: 478k]
  ------------------
  502|  5.60M|        tag = utype;
  503|       |
  504|       |    /* Output tag+length followed by content octets */
  505|  6.08M|    if (out) {
  ------------------
  |  Branch (505:9): [True: 1.58M, False: 4.50M]
  ------------------
  506|  1.58M|        if (usetag)
  ------------------
  |  Branch (506:13): [True: 827k, False: 757k]
  ------------------
  507|   827k|            ASN1_put_object(out, ndef, len, tag, aclass);
  508|  1.58M|        asn1_ex_i2c(pval, *out, &utype, it);
  509|  1.58M|        if (ndef)
  ------------------
  |  Branch (509:13): [True: 0, False: 1.58M]
  ------------------
  510|      0|            ASN1_put_eoc(out);
  511|  1.58M|        else
  512|  1.58M|            *out += len;
  513|  1.58M|    }
  514|       |
  515|  6.08M|    if (usetag)
  ------------------
  |  Branch (515:9): [True: 3.56M, False: 2.51M]
  ------------------
  516|  3.56M|        return ASN1_object_size(ndef, len, tag);
  517|  2.51M|    return len;
  518|  6.08M|}
tasn_enc.c:asn1_ex_i2c:
  524|  8.01M|{
  525|  8.01M|    ASN1_BOOLEAN *tbool = NULL;
  526|  8.01M|    ASN1_STRING *strtmp;
  527|  8.01M|    ASN1_OBJECT *otmp;
  528|  8.01M|    int utype;
  529|  8.01M|    const unsigned char *cont;
  530|  8.01M|    unsigned char c;
  531|  8.01M|    int len;
  532|  8.01M|    const ASN1_PRIMITIVE_FUNCS *pf;
  533|  8.01M|    pf = it->funcs;
  534|  8.01M|    if (pf && pf->prim_i2c)
  ------------------
  |  Branch (534:9): [True: 810k, False: 7.19M]
  |  Branch (534:15): [True: 810k, False: 0]
  ------------------
  535|   810k|        return pf->prim_i2c(pval, cout, putype, it);
  536|       |
  537|       |    /* Should type be omitted? */
  538|  7.19M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE)
  ------------------
  |  |   80|  7.19M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (538:9): [True: 1.36M, False: 5.83M]
  ------------------
  539|  7.19M|        || (it->utype != V_ASN1_BOOLEAN)) {
  ------------------
  |  |   63|  5.83M|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (539:12): [True: 5.61M, False: 222k]
  ------------------
  540|  6.97M|        if (*pval == NULL)
  ------------------
  |  Branch (540:13): [True: 114k, False: 6.86M]
  ------------------
  541|   114k|            return -1;
  542|  6.97M|    }
  543|       |
  544|  7.08M|    if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|  7.08M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (544:9): [True: 1.36M, False: 5.72M]
  ------------------
  545|       |        /* If MSTRING type set the underlying type */
  546|  1.36M|        strtmp = (ASN1_STRING *)*pval;
  547|  1.36M|        utype = strtmp->type;
  548|  1.36M|        *putype = utype;
  549|  5.72M|    } else if (it->utype == V_ASN1_ANY) {
  ------------------
  |  |   58|  5.72M|# define V_ASN1_ANY                      -4 /* used in ASN1 template code */
  ------------------
  |  Branch (549:16): [True: 2.71M, False: 3.00M]
  ------------------
  550|       |        /* If ANY set type and pointer to value */
  551|  2.71M|        ASN1_TYPE *typ;
  552|  2.71M|        typ = (ASN1_TYPE *)*pval;
  553|  2.71M|        utype = typ->type;
  554|  2.71M|        *putype = utype;
  555|  2.71M|        pval = (const ASN1_VALUE **)&typ->value.asn1_value; /* actually is const */
  556|  2.71M|    } else
  557|  3.00M|        utype = *putype;
  558|       |
  559|  7.08M|    switch (utype) {
  560|  1.78M|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|  1.78M|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (560:5): [True: 1.78M, False: 5.30M]
  ------------------
  561|  1.78M|        otmp = (ASN1_OBJECT *)*pval;
  562|  1.78M|        cont = otmp->data;
  563|  1.78M|        len = otmp->length;
  564|  1.78M|        if (cont == NULL || len == 0)
  ------------------
  |  Branch (564:13): [True: 0, False: 1.78M]
  |  Branch (564:29): [True: 0, False: 1.78M]
  ------------------
  565|      0|            return -1;
  566|  1.78M|        break;
  567|       |
  568|  1.78M|    case V_ASN1_UNDEF:
  ------------------
  |  |   60|      0|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (568:5): [True: 0, False: 7.08M]
  ------------------
  569|      0|        return -2;
  570|       |
  571|  14.1k|    case V_ASN1_NULL:
  ------------------
  |  |   67|  14.1k|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (571:5): [True: 14.1k, False: 7.07M]
  ------------------
  572|  14.1k|        cont = NULL;
  573|  14.1k|        len = 0;
  574|  14.1k|        break;
  575|       |
  576|   225k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|   225k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (576:5): [True: 225k, False: 6.85M]
  ------------------
  577|   225k|        tbool = (ASN1_BOOLEAN *)pval;
  578|   225k|        if (*tbool == -1)
  ------------------
  |  Branch (578:13): [True: 0, False: 225k]
  ------------------
  579|      0|            return -1;
  580|   225k|        if (it->utype != V_ASN1_ANY) {
  ------------------
  |  |   58|   225k|# define V_ASN1_ANY                      -4 /* used in ASN1 template code */
  ------------------
  |  Branch (580:13): [True: 222k, False: 2.72k]
  ------------------
  581|       |            /*
  582|       |             * Default handling if value == size field then omit
  583|       |             */
  584|   222k|            if (*tbool && (it->size > 0))
  ------------------
  |  Branch (584:17): [True: 5.09k, False: 217k]
  |  Branch (584:27): [True: 8, False: 5.08k]
  ------------------
  585|      8|                return -1;
  586|   222k|            if (!*tbool && !it->size)
  ------------------
  |  Branch (586:17): [True: 217k, False: 5.08k]
  |  Branch (586:28): [True: 217k, False: 0]
  ------------------
  587|   217k|                return -1;
  588|   222k|        }
  589|  7.81k|        c = (unsigned char)*tbool;
  590|  7.81k|        cont = &c;
  591|  7.81k|        len = 1;
  592|  7.81k|        break;
  593|       |
  594|   242k|    case V_ASN1_BIT_STRING:
  ------------------
  |  |   65|   242k|# define V_ASN1_BIT_STRING               3
  ------------------
  |  Branch (594:5): [True: 242k, False: 6.84M]
  ------------------
  595|   242k|        return ossl_i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval,
  596|   242k|                                        cout ? &cout : NULL);
  ------------------
  |  Branch (596:41): [True: 48.4k, False: 193k]
  ------------------
  597|       |
  598|  92.7k|    case V_ASN1_INTEGER:
  ------------------
  |  |   64|  92.7k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (598:5): [True: 92.7k, False: 6.99M]
  ------------------
  599|  97.5k|    case V_ASN1_ENUMERATED:
  ------------------
  |  |   72|  97.5k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (599:5): [True: 4.84k, False: 7.08M]
  ------------------
  600|       |        /*
  601|       |         * These are all have the same content format as ASN1_INTEGER
  602|       |         */
  603|  97.5k|        return ossl_i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : NULL);
  ------------------
  |  Branch (603:61): [True: 20.6k, False: 76.8k]
  ------------------
  604|       |
  605|   339k|    case V_ASN1_OCTET_STRING:
  ------------------
  |  |   66|   339k|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (605:5): [True: 339k, False: 6.74M]
  ------------------
  606|   358k|    case V_ASN1_NUMERICSTRING:
  ------------------
  |  |   76|   358k|# define V_ASN1_NUMERICSTRING            18
  ------------------
  |  Branch (606:5): [True: 19.1k, False: 7.06M]
  ------------------
  607|   367k|    case V_ASN1_PRINTABLESTRING:
  ------------------
  |  |   77|   367k|# define V_ASN1_PRINTABLESTRING          19
  ------------------
  |  Branch (607:5): [True: 8.33k, False: 7.07M]
  ------------------
  608|   374k|    case V_ASN1_T61STRING:
  ------------------
  |  |   78|   374k|# define V_ASN1_T61STRING                20
  ------------------
  |  Branch (608:5): [True: 7.46k, False: 7.07M]
  ------------------
  609|   374k|    case V_ASN1_VIDEOTEXSTRING:
  ------------------
  |  |   80|   374k|# define V_ASN1_VIDEOTEXSTRING           21
  ------------------
  |  Branch (609:5): [True: 44, False: 7.08M]
  ------------------
  610|   404k|    case V_ASN1_IA5STRING:
  ------------------
  |  |   81|   404k|# define V_ASN1_IA5STRING                22
  ------------------
  |  Branch (610:5): [True: 29.7k, False: 7.05M]
  ------------------
  611|   408k|    case V_ASN1_UTCTIME:
  ------------------
  |  |   82|   408k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (611:5): [True: 4.55k, False: 7.08M]
  ------------------
  612|   419k|    case V_ASN1_GENERALIZEDTIME:
  ------------------
  |  |   83|   419k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (612:5): [True: 10.4k, False: 7.07M]
  ------------------
  613|   419k|    case V_ASN1_GRAPHICSTRING:
  ------------------
  |  |   84|   419k|# define V_ASN1_GRAPHICSTRING            25
  ------------------
  |  Branch (613:5): [True: 7, False: 7.08M]
  ------------------
  614|   419k|    case V_ASN1_VISIBLESTRING:
  ------------------
  |  |   86|   419k|# define V_ASN1_VISIBLESTRING            26 /* alias */
  ------------------
  |  Branch (614:5): [True: 140, False: 7.08M]
  ------------------
  615|   419k|    case V_ASN1_GENERALSTRING:
  ------------------
  |  |   87|   419k|# define V_ASN1_GENERALSTRING            27
  ------------------
  |  Branch (615:5): [True: 318, False: 7.08M]
  ------------------
  616|   432k|    case V_ASN1_UNIVERSALSTRING:
  ------------------
  |  |   88|   432k|# define V_ASN1_UNIVERSALSTRING          28
  ------------------
  |  Branch (616:5): [True: 12.8k, False: 7.07M]
  ------------------
  617|   440k|    case V_ASN1_BMPSTRING:
  ------------------
  |  |   89|   440k|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (617:5): [True: 8.26k, False: 7.07M]
  ------------------
  618|  1.06M|    case V_ASN1_UTF8STRING:
  ------------------
  |  |   73|  1.06M|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (618:5): [True: 621k, False: 6.46M]
  ------------------
  619|  1.86M|    case V_ASN1_SEQUENCE:
  ------------------
  |  |   74|  1.86M|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (619:5): [True: 802k, False: 6.28M]
  ------------------
  620|  4.26M|    case V_ASN1_SET:
  ------------------
  |  |   75|  4.26M|# define V_ASN1_SET                      17
  ------------------
  |  Branch (620:5): [True: 2.40M, False: 4.68M]
  ------------------
  621|  4.72M|    default:
  ------------------
  |  Branch (621:5): [True: 455k, False: 6.62M]
  ------------------
  622|       |        /* All based on ASN1_STRING and handled the same */
  623|  4.72M|        strtmp = (ASN1_STRING *)*pval;
  624|       |        /* Special handling for NDEF */
  625|  4.72M|        if ((it->size == ASN1_TFLG_NDEF)
  ------------------
  |  |  594|  4.72M|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
  |  Branch (625:13): [True: 56, False: 4.72M]
  ------------------
  626|  4.72M|            && (strtmp->flags & ASN1_STRING_FLAG_NDEF)) {
  ------------------
  |  |  167|     56|# define ASN1_STRING_FLAG_NDEF 0x010
  ------------------
  |  Branch (626:16): [True: 0, False: 56]
  ------------------
  627|      0|            if (cout) {
  ------------------
  |  Branch (627:17): [True: 0, False: 0]
  ------------------
  628|      0|                strtmp->data = cout;
  629|      0|                strtmp->length = 0;
  630|      0|            }
  631|       |            /* Special return code */
  632|      0|            return -2;
  633|      0|        }
  634|  4.72M|        cont = strtmp->data;
  635|  4.72M|        len = strtmp->length;
  636|       |
  637|  4.72M|        break;
  638|       |
  639|  7.08M|    }
  640|  6.52M|    if (cout && len)
  ------------------
  |  Branch (640:9): [True: 1.37M, False: 5.15M]
  |  Branch (640:17): [True: 1.16M, False: 205k]
  ------------------
  641|  1.16M|        memcpy(cout, cont, len);
  642|  6.52M|    return len;
  643|  7.08M|}

ASN1_item_free:
   19|  2.49M|{
   20|  2.49M|    ossl_asn1_item_embed_free(&val, it, 0);
   21|  2.49M|}
ASN1_item_ex_free:
   24|  2.53M|{
   25|  2.53M|    ossl_asn1_item_embed_free(pval, it, 0);
   26|  2.53M|}
ossl_asn1_item_embed_free:
   29|  16.9M|{
   30|  16.9M|    const ASN1_TEMPLATE *tt = NULL, *seqtt;
   31|  16.9M|    const ASN1_EXTERN_FUNCS *ef;
   32|  16.9M|    const ASN1_AUX *aux = it->funcs;
   33|  16.9M|    ASN1_aux_cb *asn1_cb;
   34|  16.9M|    int i;
   35|       |
   36|  16.9M|    if (pval == NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 16.9M]
  ------------------
   37|      0|        return;
   38|  16.9M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE) && *pval == NULL)
  ------------------
  |  |   80|  16.9M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (38:9): [True: 6.58M, False: 10.3M]
  |  Branch (38:48): [True: 1.77M, False: 4.80M]
  ------------------
   39|  1.77M|        return;
   40|  15.1M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (40:9): [True: 1.33M, False: 13.8M]
  |  Branch (40:16): [True: 991k, False: 340k]
  ------------------
   41|   991k|        asn1_cb = aux->asn1_cb;
   42|  14.1M|    else
   43|  14.1M|        asn1_cb = 0;
   44|       |
   45|  15.1M|    switch (it->itype) {
  ------------------
  |  Branch (45:13): [True: 0, False: 15.1M]
  ------------------
   46|       |
   47|  10.3M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  10.3M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (47:5): [True: 10.3M, False: 4.80M]
  ------------------
   48|  10.3M|        if (it->templates)
  ------------------
  |  Branch (48:13): [True: 1.70M, False: 8.61M]
  ------------------
   49|  1.70M|            ossl_asn1_template_free(pval, it->templates);
   50|  8.61M|        else
   51|  8.61M|            ossl_asn1_primitive_free(pval, it, embed);
   52|  10.3M|        break;
   53|       |
   54|   752k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|   752k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (54:5): [True: 752k, False: 14.3M]
  ------------------
   55|   752k|        ossl_asn1_primitive_free(pval, it, embed);
   56|   752k|        break;
   57|       |
   58|   481k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|   481k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (58:5): [True: 481k, False: 14.6M]
  ------------------
   59|   481k|        if (asn1_cb) {
  ------------------
  |  Branch (59:13): [True: 29.4k, False: 451k]
  ------------------
   60|  29.4k|            i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL);
  ------------------
  |  |  744|  29.4k|# define ASN1_OP_FREE_PRE        2
  ------------------
   61|  29.4k|            if (i == 2)
  ------------------
  |  Branch (61:17): [True: 0, False: 29.4k]
  ------------------
   62|      0|                return;
   63|  29.4k|        }
   64|   481k|        i = ossl_asn1_get_choice_selector(pval, it);
   65|   481k|        if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (65:13): [True: 230k, False: 250k]
  |  Branch (65:25): [True: 230k, False: 0]
  ------------------
   66|   230k|            ASN1_VALUE **pchval;
   67|       |
   68|   230k|            tt = it->templates + i;
   69|   230k|            pchval = ossl_asn1_get_field_ptr(pval, tt);
   70|   230k|            ossl_asn1_template_free(pchval, tt);
   71|   230k|        }
   72|   481k|        if (asn1_cb)
  ------------------
  |  Branch (72:13): [True: 29.4k, False: 451k]
  ------------------
   73|  29.4k|            asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL);
  ------------------
  |  |  745|  29.4k|# define ASN1_OP_FREE_POST       3
  ------------------
   74|   481k|        if (embed == 0) {
  ------------------
  |  Branch (74:13): [True: 460k, False: 20.2k]
  ------------------
   75|   460k|            OPENSSL_free(*pval);
  ------------------
  |  |  115|   460k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   460k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   460k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|   460k|            *pval = NULL;
   77|   460k|        }
   78|   481k|        break;
   79|       |
   80|   292k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|   292k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (80:5): [True: 292k, False: 14.8M]
  ------------------
   81|   292k|        ef = it->funcs;
   82|   292k|        if (ef && ef->asn1_ex_free)
  ------------------
  |  Branch (82:13): [True: 292k, False: 0]
  |  Branch (82:19): [True: 292k, False: 0]
  ------------------
   83|   292k|            ef->asn1_ex_free(pval, it);
   84|   292k|        break;
   85|       |
   86|   153k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|   153k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (86:5): [True: 153k, False: 14.9M]
  ------------------
   87|  3.28M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  3.28M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (87:5): [True: 3.12M, False: 12.0M]
  ------------------
   88|  3.28M|        if (ossl_asn1_do_lock(pval, -1, it) != 0) {
  ------------------
  |  Branch (88:13): [True: 0, False: 3.28M]
  ------------------
   89|       |            /* if error or ref-counter > 0 */
   90|      0|            OPENSSL_assert(embed == 0);
  ------------------
  |  |  438|      0|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   91|      0|            *pval = NULL;
   92|      0|            return;
   93|      0|        }
   94|  3.28M|        if (asn1_cb) {
  ------------------
  |  Branch (94:13): [True: 568k, False: 2.71M]
  ------------------
   95|   568k|            i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL);
  ------------------
  |  |  744|   568k|# define ASN1_OP_FREE_PRE        2
  ------------------
   96|   568k|            if (i == 2)
  ------------------
  |  Branch (96:17): [True: 110k, False: 457k]
  ------------------
   97|   110k|                return;
   98|   568k|        }
   99|  3.17M|        ossl_asn1_enc_free(pval, it);
  100|       |        /*
  101|       |         * If we free up as normal we will invalidate any ANY DEFINED BY
  102|       |         * field and we won't be able to determine the type of the field it
  103|       |         * defines. So free up in reverse order.
  104|       |         */
  105|  3.17M|        tt = it->templates + it->tcount;
  106|  12.4M|        for (i = 0; i < it->tcount; i++) {
  ------------------
  |  Branch (106:21): [True: 9.25M, False: 3.17M]
  ------------------
  107|  9.25M|            ASN1_VALUE **pseqval;
  108|       |
  109|  9.25M|            tt--;
  110|  9.25M|            seqtt = ossl_asn1_do_adb(*pval, tt, 0);
  111|  9.25M|            if (!seqtt)
  ------------------
  |  Branch (111:17): [True: 72.1k, False: 9.18M]
  ------------------
  112|  72.1k|                continue;
  113|  9.18M|            pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  114|  9.18M|            ossl_asn1_template_free(pseqval, seqtt);
  115|  9.18M|        }
  116|  3.17M|        if (asn1_cb)
  ------------------
  |  Branch (116:13): [True: 457k, False: 2.71M]
  ------------------
  117|   457k|            asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL);
  ------------------
  |  |  745|   457k|# define ASN1_OP_FREE_POST       3
  ------------------
  118|  3.17M|        if (embed == 0) {
  ------------------
  |  Branch (118:13): [True: 2.84M, False: 330k]
  ------------------
  119|  2.84M|            OPENSSL_free(*pval);
  ------------------
  |  |  115|  2.84M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.84M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.84M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  120|  2.84M|            *pval = NULL;
  121|  2.84M|        }
  122|  3.17M|        break;
  123|  15.1M|    }
  124|  15.1M|}
ossl_asn1_template_free:
  127|  12.0M|{
  128|  12.0M|    int embed = tt->flags & ASN1_TFLG_EMBED;
  ------------------
  |  |  597|  12.0M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  129|  12.0M|    ASN1_VALUE *tval;
  130|  12.0M|    if (embed) {
  ------------------
  |  Branch (130:9): [True: 890k, False: 11.1M]
  ------------------
  131|   890k|        tval = (ASN1_VALUE *)pval;
  132|   890k|        pval = &tval;
  133|   890k|    }
  134|  12.0M|    if (tt->flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  12.0M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (134:9): [True: 2.76M, False: 9.27M]
  ------------------
  135|  2.76M|        STACK_OF(ASN1_VALUE) *sk = (STACK_OF(ASN1_VALUE) *)*pval;
  ------------------
  |  |   31|  2.76M|# define STACK_OF(type) struct stack_st_##type
  ------------------
  136|  2.76M|        int i;
  137|       |
  138|  5.36M|        for (i = 0; i < sk_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  |  898|  5.36M|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (138:21): [True: 2.60M, False: 2.76M]
  ------------------
  139|  2.60M|            ASN1_VALUE *vtmp = sk_ASN1_VALUE_value(sk, i);
  ------------------
  |  |  899|  2.60M|#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx)))
  ------------------
  140|       |
  141|  2.60M|            ossl_asn1_item_embed_free(&vtmp, ASN1_ITEM_ptr(tt->item), embed);
  ------------------
  |  |  422|  2.60M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  142|  2.60M|        }
  143|  2.76M|        sk_ASN1_VALUE_free(sk);
  ------------------
  |  |  904|  2.76M|#define sk_ASN1_VALUE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_VALUE_sk_type(sk))
  ------------------
  144|  2.76M|        *pval = NULL;
  145|  9.27M|    } else {
  146|  9.27M|        ossl_asn1_item_embed_free(pval, ASN1_ITEM_ptr(tt->item), embed);
  ------------------
  |  |  422|  9.27M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  147|  9.27M|    }
  148|  12.0M|}
ossl_asn1_primitive_free:
  151|  10.9M|{
  152|  10.9M|    int utype;
  153|       |
  154|       |    /* Special case: if 'it' is a primitive with a free_func, use that. */
  155|  10.9M|    if (it) {
  ------------------
  |  Branch (155:9): [True: 9.37M, False: 1.60M]
  ------------------
  156|  9.37M|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  157|       |
  158|  9.37M|        if (embed) {
  ------------------
  |  Branch (158:13): [True: 539k, False: 8.83M]
  ------------------
  159|   539k|            if (pf && pf->prim_clear) {
  ------------------
  |  Branch (159:17): [True: 199k, False: 339k]
  |  Branch (159:23): [True: 199k, False: 0]
  ------------------
  160|   199k|                pf->prim_clear(pval, it);
  161|   199k|                return;
  162|   199k|            }
  163|  8.83M|        } else if (pf && pf->prim_free) {
  ------------------
  |  Branch (163:20): [True: 193k, False: 8.63M]
  |  Branch (163:26): [True: 193k, False: 0]
  ------------------
  164|   193k|            pf->prim_free(pval, it);
  165|   193k|            return;
  166|   193k|        }
  167|  9.37M|    }
  168|       |
  169|       |    /* Special case: if 'it' is NULL, free contents of ASN1_TYPE */
  170|  10.5M|    if (!it) {
  ------------------
  |  Branch (170:9): [True: 1.60M, False: 8.97M]
  ------------------
  171|  1.60M|        ASN1_TYPE *typ = (ASN1_TYPE *)*pval;
  172|       |
  173|  1.60M|        utype = typ->type;
  174|  1.60M|        pval = &typ->value.asn1_value;
  175|  1.60M|        if (*pval == NULL)
  ------------------
  |  Branch (175:13): [True: 20.6k, False: 1.58M]
  ------------------
  176|  20.6k|            return;
  177|  8.97M|    } else if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|  8.97M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (177:16): [True: 752k, False: 8.22M]
  ------------------
  178|   752k|        utype = -1;
  179|   752k|        if (*pval == NULL)
  ------------------
  |  Branch (179:13): [True: 0, False: 752k]
  ------------------
  180|      0|            return;
  181|  8.22M|    } else {
  182|  8.22M|        utype = it->utype;
  183|  8.22M|        if ((utype != V_ASN1_BOOLEAN) && *pval == NULL)
  ------------------
  |  |   63|  8.22M|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (183:13): [True: 7.81M, False: 414k]
  |  Branch (183:42): [True: 2.63M, False: 5.17M]
  ------------------
  184|  2.63M|            return;
  185|  8.22M|    }
  186|       |
  187|  7.93M|    switch (utype) {
  188|  1.72M|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|  1.72M|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (188:5): [True: 1.72M, False: 6.20M]
  ------------------
  189|  1.72M|        ASN1_OBJECT_free((ASN1_OBJECT *)*pval);
  190|  1.72M|        break;
  191|       |
  192|   415k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|   415k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (192:5): [True: 415k, False: 7.51M]
  ------------------
  193|   415k|        if (it)
  ------------------
  |  Branch (193:13): [True: 414k, False: 736]
  ------------------
  194|   414k|            *(ASN1_BOOLEAN *)pval = it->size;
  195|    736|        else
  196|    736|            *(ASN1_BOOLEAN *)pval = -1;
  197|   415k|        return;
  198|       |
  199|     93|    case V_ASN1_NULL:
  ------------------
  |  |   67|     93|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (199:5): [True: 93, False: 7.93M]
  ------------------
  200|     93|        break;
  201|       |
  202|  1.60M|    case V_ASN1_ANY:
  ------------------
  |  |   58|  1.60M|# define V_ASN1_ANY                      -4 /* used in ASN1 template code */
  ------------------
  |  Branch (202:5): [True: 1.60M, False: 6.32M]
  ------------------
  203|  1.60M|        ossl_asn1_primitive_free(pval, NULL, 0);
  204|  1.60M|        OPENSSL_free(*pval);
  ------------------
  |  |  115|  1.60M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.60M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.60M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  205|  1.60M|        break;
  206|       |
  207|  4.18M|    default:
  ------------------
  |  Branch (207:5): [True: 4.18M, False: 3.74M]
  ------------------
  208|  4.18M|        ossl_asn1_string_embed_free((ASN1_STRING *)*pval, embed);
  209|  4.18M|        break;
  210|  7.93M|    }
  211|  7.51M|    *pval = NULL;
  212|  7.51M|}

ASN1_item_new:
   30|  1.94M|{
   31|  1.94M|    ASN1_VALUE *ret = NULL;
   32|  1.94M|    if (ASN1_item_ex_new(&ret, it) > 0)
  ------------------
  |  Branch (32:9): [True: 1.94M, False: 0]
  ------------------
   33|  1.94M|        return ret;
   34|      0|    return NULL;
   35|  1.94M|}
ossl_asn1_item_ex_new_intern:
   51|  2.36M|{
   52|  2.36M|    return asn1_item_embed_new(pval, it, 0, libctx, propq);
   53|  2.36M|}
ASN1_item_ex_new:
   56|  1.94M|{
   57|  1.94M|    return asn1_item_embed_new(pval, it, 0, NULL, NULL);
   58|  1.94M|}
tasn_new.c:asn1_item_embed_new:
   62|  10.0M|{
   63|  10.0M|    const ASN1_TEMPLATE *tt = NULL;
   64|  10.0M|    const ASN1_EXTERN_FUNCS *ef;
   65|  10.0M|    const ASN1_AUX *aux = it->funcs;
   66|  10.0M|    ASN1_aux_cb *asn1_cb;
   67|  10.0M|    ASN1_VALUE **pseqval;
   68|  10.0M|    int i;
   69|  10.0M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (69:9): [True: 1.25M, False: 8.82M]
  |  Branch (69:16): [True: 929k, False: 321k]
  ------------------
   70|   929k|        asn1_cb = aux->asn1_cb;
   71|  9.14M|    else
   72|  9.14M|        asn1_cb = 0;
   73|       |
   74|  10.0M|    switch (it->itype) {
  ------------------
  |  Branch (74:13): [True: 0, False: 10.0M]
  ------------------
   75|       |
   76|   273k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|   273k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (76:5): [True: 273k, False: 9.79M]
  ------------------
   77|   273k|        ef = it->funcs;
   78|   273k|        if (ef != NULL) {
  ------------------
  |  Branch (78:13): [True: 273k, False: 0]
  ------------------
   79|   273k|            if (ef->asn1_ex_new_ex != NULL) {
  ------------------
  |  Branch (79:17): [True: 87.7k, False: 186k]
  ------------------
   80|  87.7k|                if (!ef->asn1_ex_new_ex(pval, it, libctx, propq))
  ------------------
  |  Branch (80:21): [True: 0, False: 87.7k]
  ------------------
   81|      0|                    goto asn1err;
   82|   186k|            } else if (ef->asn1_ex_new != NULL) {
  ------------------
  |  Branch (82:24): [True: 186k, False: 0]
  ------------------
   83|   186k|                if (!ef->asn1_ex_new(pval, it))
  ------------------
  |  Branch (83:21): [True: 0, False: 186k]
  ------------------
   84|      0|                    goto asn1err;
   85|   186k|            }
   86|   273k|        }
   87|   273k|        break;
   88|       |
   89|  5.28M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  5.28M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (89:5): [True: 5.28M, False: 4.78M]
  ------------------
   90|  5.28M|        if (it->templates) {
  ------------------
  |  Branch (90:13): [True: 0, False: 5.28M]
  ------------------
   91|      0|            if (!asn1_template_new(pval, it->templates, libctx, propq))
  ------------------
  |  Branch (91:17): [True: 0, False: 0]
  ------------------
   92|      0|                goto asn1err;
   93|  5.28M|        } else if (!asn1_primitive_new(pval, it, embed))
  ------------------
  |  Branch (93:20): [True: 0, False: 5.28M]
  ------------------
   94|      0|            goto asn1err;
   95|  5.28M|        break;
   96|       |
   97|  5.28M|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|   741k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (97:5): [True: 741k, False: 9.33M]
  ------------------
   98|   741k|        if (!asn1_primitive_new(pval, it, embed))
  ------------------
  |  Branch (98:13): [True: 0, False: 741k]
  ------------------
   99|      0|            goto asn1err;
  100|   741k|        break;
  101|       |
  102|   741k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|   481k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (102:5): [True: 481k, False: 9.59M]
  ------------------
  103|   481k|        if (asn1_cb) {
  ------------------
  |  Branch (103:13): [True: 29.4k, False: 451k]
  ------------------
  104|  29.4k|            i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
  ------------------
  |  |  742|  29.4k|# define ASN1_OP_NEW_PRE         0
  ------------------
  105|  29.4k|            if (!i)
  ------------------
  |  Branch (105:17): [True: 0, False: 29.4k]
  ------------------
  106|      0|                goto auxerr;
  107|  29.4k|            if (i == 2) {
  ------------------
  |  Branch (107:17): [True: 0, False: 29.4k]
  ------------------
  108|      0|                return 1;
  109|      0|            }
  110|  29.4k|        }
  111|   481k|        if (embed) {
  ------------------
  |  Branch (111:13): [True: 20.2k, False: 460k]
  ------------------
  112|  20.2k|            memset(*pval, 0, it->size);
  113|   460k|        } else {
  114|   460k|            *pval = OPENSSL_zalloc(it->size);
  ------------------
  |  |  104|   460k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   460k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   460k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  115|   460k|            if (*pval == NULL)
  ------------------
  |  Branch (115:17): [True: 0, False: 460k]
  ------------------
  116|      0|                return 0;
  117|   460k|        }
  118|   481k|        ossl_asn1_set_choice_selector(pval, -1, it);
  119|   481k|        if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
  ------------------
  |  |  743|  29.4k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (119:13): [True: 29.4k, False: 451k]
  |  Branch (119:24): [True: 0, False: 29.4k]
  ------------------
  120|      0|            goto auxerr2;
  121|   481k|        break;
  122|       |
  123|   481k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|   153k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (123:5): [True: 153k, False: 9.91M]
  ------------------
  124|  3.29M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  3.29M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (124:5): [True: 3.13M, False: 6.93M]
  ------------------
  125|  3.29M|        if (asn1_cb) {
  ------------------
  |  Branch (125:13): [True: 570k, False: 2.72M]
  ------------------
  126|   570k|            i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
  ------------------
  |  |  742|   570k|# define ASN1_OP_NEW_PRE         0
  ------------------
  127|   570k|            if (!i)
  ------------------
  |  Branch (127:17): [True: 0, False: 570k]
  ------------------
  128|      0|                goto auxerr;
  129|   570k|            if (i == 2) {
  ------------------
  |  Branch (129:17): [True: 112k, False: 457k]
  ------------------
  130|   112k|                return 1;
  131|   112k|            }
  132|   570k|        }
  133|  3.17M|        if (embed) {
  ------------------
  |  Branch (133:13): [True: 330k, False: 2.84M]
  ------------------
  134|   330k|            memset(*pval, 0, it->size);
  135|  2.84M|        } else {
  136|  2.84M|            *pval = OPENSSL_zalloc(it->size);
  ------------------
  |  |  104|  2.84M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.84M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.84M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|  2.84M|            if (*pval == NULL)
  ------------------
  |  Branch (137:17): [True: 0, False: 2.84M]
  ------------------
  138|      0|                return 0;
  139|  2.84M|        }
  140|       |        /* 0 : init. lock */
  141|  3.17M|        if (ossl_asn1_do_lock(pval, 0, it) < 0) {
  ------------------
  |  Branch (141:13): [True: 0, False: 3.17M]
  ------------------
  142|      0|            if (!embed) {
  ------------------
  |  Branch (142:17): [True: 0, False: 0]
  ------------------
  143|      0|                OPENSSL_free(*pval);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  144|      0|                *pval = NULL;
  145|      0|            }
  146|      0|            goto asn1err;
  147|      0|        }
  148|  3.17M|        ossl_asn1_enc_init(pval, it);
  149|  12.5M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (149:41): [True: 9.33M, False: 3.17M]
  ------------------
  150|  9.33M|            pseqval = ossl_asn1_get_field_ptr(pval, tt);
  151|  9.33M|            if (!asn1_template_new(pseqval, tt, libctx, propq))
  ------------------
  |  Branch (151:17): [True: 0, False: 9.33M]
  ------------------
  152|      0|                goto asn1err2;
  153|  9.33M|        }
  154|  3.17M|        if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
  ------------------
  |  |  743|   457k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (154:13): [True: 457k, False: 2.72M]
  |  Branch (154:24): [True: 0, False: 457k]
  ------------------
  155|      0|            goto auxerr2;
  156|  3.17M|        break;
  157|  10.0M|    }
  158|  9.96M|    return 1;
  159|       |
  160|      0| asn1err2:
  161|      0|    ossl_asn1_item_embed_free(pval, it, embed);
  162|      0| asn1err:
  163|      0|    ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  164|      0|    return 0;
  165|       |
  166|      0| auxerr2:
  167|      0|    ossl_asn1_item_embed_free(pval, it, embed);
  168|      0| auxerr:
  169|      0|    ERR_raise(ERR_LIB_ASN1, ASN1_R_AUX_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  170|      0|    return 0;
  171|       |
  172|      0|}
tasn_new.c:asn1_template_new:
  209|  9.33M|{
  210|  9.33M|    const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item);
  ------------------
  |  |  422|  9.33M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  211|  9.33M|    int embed = tt->flags & ASN1_TFLG_EMBED;
  ------------------
  |  |  597|  9.33M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  212|  9.33M|    ASN1_VALUE *tval;
  213|  9.33M|    int ret;
  214|  9.33M|    if (embed) {
  ------------------
  |  Branch (214:9): [True: 886k, False: 8.44M]
  ------------------
  215|   886k|        tval = (ASN1_VALUE *)pval;
  216|   886k|        pval = &tval;
  217|   886k|    }
  218|  9.33M|    if (tt->flags & ASN1_TFLG_OPTIONAL) {
  ------------------
  |  |  523|  9.33M|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (218:9): [True: 3.25M, False: 6.07M]
  ------------------
  219|  3.25M|        asn1_template_clear(pval, tt);
  220|  3.25M|        return 1;
  221|  3.25M|    }
  222|       |    /* If ANY DEFINED BY nothing to do */
  223|       |
  224|  6.07M|    if (tt->flags & ASN1_TFLG_ADB_MASK) {
  ------------------
  |  |  583|  6.07M|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
  |  Branch (224:9): [True: 134k, False: 5.94M]
  ------------------
  225|   134k|        *pval = NULL;
  226|   134k|        return 1;
  227|   134k|    }
  228|       |    /* If SET OF or SEQUENCE OF, its a STACK */
  229|  5.94M|    if (tt->flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  5.94M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (229:9): [True: 178k, False: 5.76M]
  ------------------
  230|   178k|        STACK_OF(ASN1_VALUE) *skval;
  ------------------
  |  |   31|   178k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  231|   178k|        skval = sk_ASN1_VALUE_new_null();
  ------------------
  |  |  901|   178k|#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_null())
  ------------------
  232|   178k|        if (!skval) {
  ------------------
  |  Branch (232:13): [True: 0, False: 178k]
  ------------------
  233|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  234|      0|            ret = 0;
  235|      0|            goto done;
  236|      0|        }
  237|   178k|        *pval = (ASN1_VALUE *)skval;
  238|   178k|        ret = 1;
  239|   178k|        goto done;
  240|   178k|    }
  241|       |    /* Otherwise pass it back to the item routine */
  242|  5.76M|    ret = asn1_item_embed_new(pval, it, embed, libctx, propq);
  243|  5.94M| done:
  244|  5.94M|    return ret;
  245|  5.76M|}
tasn_new.c:asn1_template_clear:
  248|  3.25M|{
  249|       |    /* If ADB or STACK just NULL the field */
  250|  3.25M|    if (tt->flags & (ASN1_TFLG_ADB_MASK | ASN1_TFLG_SK_MASK))
  ------------------
  |  |  583|  3.25M|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
                  if (tt->flags & (ASN1_TFLG_ADB_MASK | ASN1_TFLG_SK_MASK))
  ------------------
  |  |  539|  3.25M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (250:9): [True: 739k, False: 2.51M]
  ------------------
  251|   739k|        *pval = NULL;
  252|  2.51M|    else
  253|  2.51M|        asn1_item_clear(pval, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  422|  2.51M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  254|  3.25M|}
tasn_new.c:asn1_item_clear:
  175|  2.51M|{
  176|  2.51M|    const ASN1_EXTERN_FUNCS *ef;
  177|       |
  178|  2.51M|    switch (it->itype) {
  ------------------
  |  Branch (178:13): [True: 0, False: 2.51M]
  ------------------
  179|       |
  180|      0|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|      0|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (180:5): [True: 0, False: 2.51M]
  ------------------
  181|      0|        ef = it->funcs;
  182|      0|        if (ef && ef->asn1_ex_clear)
  ------------------
  |  Branch (182:13): [True: 0, False: 0]
  |  Branch (182:19): [True: 0, False: 0]
  ------------------
  183|      0|            ef->asn1_ex_clear(pval, it);
  184|      0|        else
  185|      0|            *pval = NULL;
  186|      0|        break;
  187|       |
  188|  2.15M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  2.15M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (188:5): [True: 2.15M, False: 360k]
  ------------------
  189|  2.15M|        if (it->templates)
  ------------------
  |  Branch (189:13): [True: 0, False: 2.15M]
  ------------------
  190|      0|            asn1_template_clear(pval, it->templates);
  191|  2.15M|        else
  192|  2.15M|            asn1_primitive_clear(pval, it);
  193|  2.15M|        break;
  194|       |
  195|  47.7k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|  47.7k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (195:5): [True: 47.7k, False: 2.46M]
  ------------------
  196|  47.7k|        asn1_primitive_clear(pval, it);
  197|  47.7k|        break;
  198|       |
  199|   127k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|   127k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (199:5): [True: 127k, False: 2.38M]
  ------------------
  200|   302k|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|   302k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (200:5): [True: 174k, False: 2.33M]
  ------------------
  201|   312k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|   312k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (201:5): [True: 10.1k, False: 2.50M]
  ------------------
  202|   312k|        *pval = NULL;
  203|   312k|        break;
  204|  2.51M|    }
  205|  2.51M|}
tasn_new.c:asn1_primitive_clear:
  328|  2.19M|{
  329|  2.19M|    int utype;
  330|  2.19M|    if (it && it->funcs) {
  ------------------
  |  Branch (330:9): [True: 2.19M, False: 0]
  |  Branch (330:15): [True: 101k, False: 2.09M]
  ------------------
  331|   101k|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  332|   101k|        if (pf->prim_clear)
  ------------------
  |  Branch (332:13): [True: 90.9k, False: 10.1k]
  ------------------
  333|  90.9k|            pf->prim_clear(pval, it);
  334|  10.1k|        else
  335|  10.1k|            *pval = NULL;
  336|   101k|        return;
  337|   101k|    }
  338|  2.09M|    if (!it || (it->itype == ASN1_ITYPE_MSTRING))
  ------------------
  |  |   85|  2.09M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (338:9): [True: 0, False: 2.09M]
  |  Branch (338:16): [True: 47.7k, False: 2.05M]
  ------------------
  339|  47.7k|        utype = -1;
  340|  2.05M|    else
  341|  2.05M|        utype = it->utype;
  342|  2.09M|    if (utype == V_ASN1_BOOLEAN)
  ------------------
  |  |   63|  2.09M|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (342:9): [True: 216k, False: 1.88M]
  ------------------
  343|   216k|        *(ASN1_BOOLEAN *)pval = it->size;
  344|  1.88M|    else
  345|  1.88M|        *pval = NULL;
  346|  2.09M|}
tasn_new.c:asn1_primitive_new:
  263|  6.02M|{
  264|  6.02M|    ASN1_TYPE *typ;
  265|  6.02M|    ASN1_STRING *str;
  266|  6.02M|    int utype;
  267|       |
  268|  6.02M|    if (!it)
  ------------------
  |  Branch (268:9): [True: 0, False: 6.02M]
  ------------------
  269|      0|        return 0;
  270|       |
  271|  6.02M|    if (it->funcs) {
  ------------------
  |  Branch (271:9): [True: 329k, False: 5.69M]
  ------------------
  272|   329k|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  273|   329k|        if (embed) {
  ------------------
  |  Branch (273:13): [True: 104k, False: 224k]
  ------------------
  274|   104k|            if (pf->prim_clear) {
  ------------------
  |  Branch (274:17): [True: 104k, False: 0]
  ------------------
  275|   104k|                pf->prim_clear(pval, it);
  276|   104k|                return 1;
  277|   104k|            }
  278|   224k|        } else if (pf->prim_new) {
  ------------------
  |  Branch (278:20): [True: 224k, False: 0]
  ------------------
  279|   224k|            return pf->prim_new(pval, it);
  280|   224k|        }
  281|   329k|    }
  282|       |
  283|  5.69M|    if (it->itype == ASN1_ITYPE_MSTRING)
  ------------------
  |  |   85|  5.69M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (283:9): [True: 741k, False: 4.95M]
  ------------------
  284|   741k|        utype = -1;
  285|  4.95M|    else
  286|  4.95M|        utype = it->utype;
  287|  5.69M|    switch (utype) {
  288|  1.70M|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|  1.70M|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (288:5): [True: 1.70M, False: 3.99M]
  ------------------
  289|  1.70M|        *pval = (ASN1_VALUE *)OBJ_nid2obj(NID_undef);
  ------------------
  |  |   18|  1.70M|#define NID_undef                       0
  ------------------
  290|  1.70M|        return 1;
  291|       |
  292|      0|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|      0|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (292:5): [True: 0, False: 5.69M]
  ------------------
  293|      0|        *(ASN1_BOOLEAN *)pval = it->size;
  294|      0|        return 1;
  295|       |
  296|      0|    case V_ASN1_NULL:
  ------------------
  |  |   67|      0|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (296:5): [True: 0, False: 5.69M]
  ------------------
  297|      0|        *pval = (ASN1_VALUE *)1;
  298|      0|        return 1;
  299|       |
  300|  1.60M|    case V_ASN1_ANY:
  ------------------
  |  |   58|  1.60M|# define V_ASN1_ANY                      -4 /* used in ASN1 template code */
  ------------------
  |  Branch (300:5): [True: 1.60M, False: 4.09M]
  ------------------
  301|  1.60M|        if ((typ = OPENSSL_malloc(sizeof(*typ))) == NULL)
  ------------------
  |  |  102|  1.60M|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.60M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.60M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (301:13): [True: 0, False: 1.60M]
  ------------------
  302|      0|            return 0;
  303|  1.60M|        typ->value.ptr = NULL;
  304|  1.60M|        typ->type = -1;
  305|  1.60M|        *pval = (ASN1_VALUE *)typ;
  306|  1.60M|        break;
  307|       |
  308|  2.38M|    default:
  ------------------
  |  Branch (308:5): [True: 2.38M, False: 3.31M]
  ------------------
  309|  2.38M|        if (embed) {
  ------------------
  |  Branch (309:13): [True: 339k, False: 2.04M]
  ------------------
  310|   339k|            str = *(ASN1_STRING **)pval;
  311|   339k|            memset(str, 0, sizeof(*str));
  312|   339k|            str->type = utype;
  313|   339k|            str->flags = ASN1_STRING_FLAG_EMBED;
  ------------------
  |  |  182|   339k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  314|  2.04M|        } else {
  315|  2.04M|            str = ASN1_STRING_type_new(utype);
  316|  2.04M|            *pval = (ASN1_VALUE *)str;
  317|  2.04M|        }
  318|  2.38M|        if (it->itype == ASN1_ITYPE_MSTRING && str)
  ------------------
  |  |   85|  4.77M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (318:13): [True: 741k, False: 1.64M]
  |  Branch (318:48): [True: 741k, False: 0]
  ------------------
  319|   741k|            str->flags |= ASN1_STRING_FLAG_MSTRING;
  ------------------
  |  |  180|   741k|# define ASN1_STRING_FLAG_MSTRING 0x040
  ------------------
  320|  2.38M|        break;
  321|  5.69M|    }
  322|  3.99M|    if (*pval)
  ------------------
  |  Branch (322:9): [True: 3.99M, False: 0]
  ------------------
  323|  3.99M|        return 1;
  324|      0|    return 0;
  325|  3.99M|}

ASN1_PCTX_new:
   36|      2|{
   37|      2|    ASN1_PCTX *ret;
   38|       |
   39|      2|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      2|    if (ret == NULL)
  ------------------
  |  Branch (40:9): [True: 0, False: 2]
  ------------------
   41|      0|        return NULL;
   42|      2|    return ret;
   43|      2|}
ASN1_PCTX_set_flags:
   56|      2|{
   57|      2|    p->flags = flags;
   58|      2|}
ASN1_PCTX_set_str_flags:
   96|      2|{
   97|      2|    p->str_flags = flags;
   98|      2|}
ASN1_item_print:
  121|  49.0k|{
  122|  49.0k|    const char *sname;
  123|  49.0k|    if (pctx == NULL)
  ------------------
  |  Branch (123:9): [True: 0, False: 49.0k]
  ------------------
  124|      0|        pctx = &default_pctx;
  125|  49.0k|    if (pctx->flags & ASN1_PCTX_FLAGS_NO_STRUCT_NAME)
  ------------------
  |  | 1067|  49.0k|# define ASN1_PCTX_FLAGS_NO_STRUCT_NAME          0x100
  ------------------
  |  Branch (125:9): [True: 0, False: 49.0k]
  ------------------
  126|      0|        sname = NULL;
  127|  49.0k|    else
  128|  49.0k|        sname = it->sname;
  129|  49.0k|    return asn1_item_print_ctx(out, &ifld, indent, it, NULL, sname, 0, pctx);
  130|  49.0k|}
tasn_prn.c:asn1_item_print_ctx:
  136|   249k|{
  137|   249k|    const ASN1_TEMPLATE *tt;
  138|   249k|    const ASN1_EXTERN_FUNCS *ef;
  139|   249k|    const ASN1_VALUE **tmpfld;
  140|   249k|    const ASN1_AUX *aux = it->funcs;
  141|   249k|    ASN1_aux_const_cb *asn1_cb = NULL;
  142|   249k|    ASN1_PRINT_ARG parg;
  143|   249k|    int i;
  144|   249k|    if (aux != NULL) {
  ------------------
  |  Branch (144:9): [True: 39.5k, False: 209k]
  ------------------
  145|  39.5k|        parg.out = out;
  146|  39.5k|        parg.indent = indent;
  147|  39.5k|        parg.pctx = pctx;
  148|  39.5k|        asn1_cb = ((aux->flags & ASN1_AFLG_CONST_CB) != 0) ? aux->asn1_const_cb
  ------------------
  |  |  738|  39.5k|# define ASN1_AFLG_CONST_CB      8
  ------------------
  |  Branch (148:19): [True: 0, False: 39.5k]
  ------------------
  149|  39.5k|            : (ASN1_aux_const_cb *)aux->asn1_cb; /* backward compatibility */
  150|  39.5k|    }
  151|       |
  152|   249k|   if (((it->itype != ASN1_ITYPE_PRIMITIVE)
  ------------------
  |  |   80|   249k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (152:9): [True: 74.6k, False: 174k]
  ------------------
  153|   249k|       || (it->utype != V_ASN1_BOOLEAN)) && *fld == NULL) {
  ------------------
  |  |   63|   174k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (153:11): [True: 172k, False: 1.87k]
  |  Branch (153:45): [True: 18.3k, False: 229k]
  ------------------
  154|  18.3k|        if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_ABSENT) {
  ------------------
  |  | 1051|  18.3k|# define ASN1_PCTX_FLAGS_SHOW_ABSENT             0x001
  ------------------
  |  Branch (154:13): [True: 18.3k, False: 0]
  ------------------
  155|  18.3k|            if (!nohdr && !asn1_print_fsname(out, indent, fname, sname, pctx))
  ------------------
  |  Branch (155:17): [True: 18.3k, False: 0]
  |  Branch (155:27): [True: 0, False: 18.3k]
  ------------------
  156|      0|                return 0;
  157|  18.3k|            if (BIO_puts(out, "<ABSENT>\n") <= 0)
  ------------------
  |  Branch (157:17): [True: 0, False: 18.3k]
  ------------------
  158|      0|                return 0;
  159|  18.3k|        }
  160|  18.3k|        return 1;
  161|  18.3k|    }
  162|       |
  163|   230k|    switch (it->itype) {
  164|   159k|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|   159k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (164:5): [True: 159k, False: 71.0k]
  ------------------
  165|   159k|        if (it->templates) {
  ------------------
  |  Branch (165:13): [True: 10.7k, False: 149k]
  ------------------
  166|  10.7k|            if (!asn1_template_print_ctx(out, fld, indent,
  ------------------
  |  Branch (166:17): [True: 428, False: 10.3k]
  ------------------
  167|  10.7k|                                         it->templates, pctx))
  168|    428|                return 0;
  169|  10.3k|            break;
  170|  10.7k|        }
  171|       |        /* fall through */
  172|   158k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|   158k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (172:5): [True: 9.56k, False: 221k]
  ------------------
  173|   158k|        if (!asn1_primitive_print(out, fld, it, indent, fname, sname, pctx))
  ------------------
  |  Branch (173:13): [True: 2.96k, False: 155k]
  ------------------
  174|  2.96k|            return 0;
  175|   155k|        break;
  176|       |
  177|   155k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|  3.76k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (177:5): [True: 3.76k, False: 227k]
  ------------------
  178|  3.76k|        if (!nohdr && !asn1_print_fsname(out, indent, fname, sname, pctx))
  ------------------
  |  Branch (178:13): [True: 3.76k, False: 0]
  |  Branch (178:23): [True: 0, False: 3.76k]
  ------------------
  179|      0|            return 0;
  180|       |        /* Use new style print routine if possible */
  181|  3.76k|        ef = it->funcs;
  182|  3.76k|        if (ef && ef->asn1_ex_print) {
  ------------------
  |  Branch (182:13): [True: 3.76k, False: 0]
  |  Branch (182:19): [True: 3.76k, False: 0]
  ------------------
  183|  3.76k|            i = ef->asn1_ex_print(out, fld, indent, "", pctx);
  184|  3.76k|            if (!i)
  ------------------
  |  Branch (184:17): [True: 9, False: 3.75k]
  ------------------
  185|      9|                return 0;
  186|  3.75k|            if ((i == 2) && (BIO_puts(out, "\n") <= 0))
  ------------------
  |  Branch (186:17): [True: 2.79k, False: 958]
  |  Branch (186:29): [True: 0, False: 2.79k]
  ------------------
  187|      0|                return 0;
  188|  3.75k|            return 1;
  189|  3.75k|        } else if (sname &&
  ------------------
  |  Branch (189:20): [True: 0, False: 0]
  ------------------
  190|      0|                   BIO_printf(out, ":EXTERNAL TYPE %s\n", sname) <= 0)
  ------------------
  |  Branch (190:20): [True: 0, False: 0]
  ------------------
  191|      0|            return 0;
  192|      0|        break;
  193|       |
  194|  19.9k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|  19.9k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (194:5): [True: 19.9k, False: 211k]
  ------------------
  195|       |        /* CHOICE type, get selector */
  196|  19.9k|        i = ossl_asn1_get_choice_selector_const(fld, it);
  197|       |        /* This should never happen... */
  198|  19.9k|        if ((i < 0) || (i >= it->tcount)) {
  ------------------
  |  Branch (198:13): [True: 0, False: 19.9k]
  |  Branch (198:24): [True: 0, False: 19.9k]
  ------------------
  199|      0|            if (BIO_printf(out, "ERROR: selector [%d] invalid\n", i) <= 0)
  ------------------
  |  Branch (199:17): [True: 0, False: 0]
  ------------------
  200|      0|                return 0;
  201|      0|            return 1;
  202|      0|        }
  203|  19.9k|        tt = it->templates + i;
  204|  19.9k|        tmpfld = ossl_asn1_get_const_field_ptr(fld, tt);
  205|  19.9k|        if (!asn1_template_print_ctx(out, tmpfld, indent, tt, pctx))
  ------------------
  |  Branch (205:13): [True: 67, False: 19.8k]
  ------------------
  206|     67|            return 0;
  207|  19.8k|        break;
  208|       |
  209|  34.1k|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  34.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (209:5): [True: 34.1k, False: 196k]
  ------------------
  210|  37.7k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|  37.7k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (210:5): [True: 3.57k, False: 227k]
  ------------------
  211|  37.7k|        if (!nohdr && !asn1_print_fsname(out, indent, fname, sname, pctx))
  ------------------
  |  Branch (211:13): [True: 17.8k, False: 19.9k]
  |  Branch (211:23): [True: 0, False: 17.8k]
  ------------------
  212|      0|            return 0;
  213|  37.7k|        if (fname || sname) {
  ------------------
  |  Branch (213:13): [True: 9.75k, False: 28.0k]
  |  Branch (213:22): [True: 8.08k, False: 19.9k]
  ------------------
  214|  17.8k|            if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_SEQUENCE) {
  ------------------
  |  | 1053|  17.8k|# define ASN1_PCTX_FLAGS_SHOW_SEQUENCE           0x002
  ------------------
  |  Branch (214:17): [True: 17.8k, False: 0]
  ------------------
  215|  17.8k|                if (BIO_puts(out, " {\n") <= 0)
  ------------------
  |  Branch (215:21): [True: 0, False: 17.8k]
  ------------------
  216|      0|                    return 0;
  217|  17.8k|            } else {
  218|      0|                if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (218:21): [True: 0, False: 0]
  ------------------
  219|      0|                    return 0;
  220|      0|            }
  221|  17.8k|        }
  222|       |
  223|  37.7k|        if (asn1_cb) {
  ------------------
  |  Branch (223:13): [True: 5.98k, False: 31.7k]
  ------------------
  224|  5.98k|            i = asn1_cb(ASN1_OP_PRINT_PRE, fld, it, &parg);
  ------------------
  |  |  750|  5.98k|# define ASN1_OP_PRINT_PRE       8
  ------------------
  225|  5.98k|            if (i == 0)
  ------------------
  |  Branch (225:17): [True: 0, False: 5.98k]
  ------------------
  226|      0|                return 0;
  227|  5.98k|            if (i == 2)
  ------------------
  |  Branch (227:17): [True: 0, False: 5.98k]
  ------------------
  228|      0|                return 1;
  229|  5.98k|        }
  230|       |
  231|       |        /* Print each field entry */
  232|   140k|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (232:41): [True: 103k, False: 36.2k]
  ------------------
  233|   103k|            const ASN1_TEMPLATE *seqtt;
  234|   103k|            seqtt = ossl_asn1_do_adb(*fld, tt, 1);
  235|   103k|            if (!seqtt)
  ------------------
  |  Branch (235:17): [True: 0, False: 103k]
  ------------------
  236|      0|                return 0;
  237|   103k|            tmpfld = ossl_asn1_get_const_field_ptr(fld, seqtt);
  238|   103k|            if (!asn1_template_print_ctx(out, tmpfld,
  ------------------
  |  Branch (238:17): [True: 1.51k, False: 102k]
  ------------------
  239|   103k|                                         indent + 2, seqtt, pctx))
  240|  1.51k|                return 0;
  241|   103k|        }
  242|  36.2k|        if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_SEQUENCE) {
  ------------------
  |  | 1053|  36.2k|# define ASN1_PCTX_FLAGS_SHOW_SEQUENCE           0x002
  ------------------
  |  Branch (242:13): [True: 36.2k, False: 0]
  ------------------
  243|  36.2k|            if (BIO_printf(out, "%*s}\n", indent, "") < 0)
  ------------------
  |  Branch (243:17): [True: 0, False: 36.2k]
  ------------------
  244|      0|                return 0;
  245|  36.2k|        }
  246|       |
  247|  36.2k|        if (asn1_cb) {
  ------------------
  |  Branch (247:13): [True: 5.38k, False: 30.8k]
  ------------------
  248|  5.38k|            i = asn1_cb(ASN1_OP_PRINT_POST, fld, it, &parg);
  ------------------
  |  |  751|  5.38k|# define ASN1_OP_PRINT_POST      9
  ------------------
  249|  5.38k|            if (i == 0)
  ------------------
  |  Branch (249:17): [True: 0, False: 5.38k]
  ------------------
  250|      0|                return 0;
  251|  5.38k|        }
  252|  36.2k|        break;
  253|       |
  254|  36.2k|    default:
  ------------------
  |  Branch (254:5): [True: 0, False: 230k]
  ------------------
  255|      0|        BIO_printf(out, "Unprocessed type %d\n", it->itype);
  256|      0|        return 0;
  257|   230k|    }
  258|       |
  259|   222k|    return 1;
  260|   230k|}
tasn_prn.c:asn1_print_fsname:
  332|   198k|{
  333|   198k|    static const char spaces[] = "                    ";
  334|   198k|    static const int nspaces = sizeof(spaces) - 1;
  335|       |
  336|   199k|    while (indent > nspaces) {
  ------------------
  |  Branch (336:12): [True: 1.11k, False: 198k]
  ------------------
  337|  1.11k|        if (BIO_write(out, spaces, nspaces) != nspaces)
  ------------------
  |  Branch (337:13): [True: 0, False: 1.11k]
  ------------------
  338|      0|            return 0;
  339|  1.11k|        indent -= nspaces;
  340|  1.11k|    }
  341|   198k|    if (BIO_write(out, spaces, indent) != indent)
  ------------------
  |  Branch (341:9): [True: 0, False: 198k]
  ------------------
  342|      0|        return 0;
  343|   198k|    if (pctx->flags & ASN1_PCTX_FLAGS_NO_STRUCT_NAME)
  ------------------
  |  | 1067|   198k|# define ASN1_PCTX_FLAGS_NO_STRUCT_NAME          0x100
  ------------------
  |  Branch (343:9): [True: 0, False: 198k]
  ------------------
  344|      0|        sname = NULL;
  345|   198k|    if (pctx->flags & ASN1_PCTX_FLAGS_NO_FIELD_NAME)
  ------------------
  |  | 1063|   198k|# define ASN1_PCTX_FLAGS_NO_FIELD_NAME           0x040
  ------------------
  |  Branch (345:9): [True: 0, False: 198k]
  ------------------
  346|      0|        fname = NULL;
  347|   198k|    if (!sname && !fname)
  ------------------
  |  Branch (347:9): [True: 51.1k, False: 147k]
  |  Branch (347:19): [True: 51.1k, False: 0]
  ------------------
  348|  51.1k|        return 1;
  349|   147k|    if (fname) {
  ------------------
  |  Branch (349:9): [True: 108k, False: 39.1k]
  ------------------
  350|   108k|        if (BIO_puts(out, fname) <= 0)
  ------------------
  |  Branch (350:13): [True: 0, False: 108k]
  ------------------
  351|      0|            return 0;
  352|   108k|    }
  353|   147k|    if (sname) {
  ------------------
  |  Branch (353:9): [True: 147k, False: 0]
  ------------------
  354|   147k|        if (fname) {
  ------------------
  |  Branch (354:13): [True: 108k, False: 39.1k]
  ------------------
  355|   108k|            if (BIO_printf(out, " (%s)", sname) <= 0)
  ------------------
  |  Branch (355:17): [True: 0, False: 108k]
  ------------------
  356|      0|                return 0;
  357|   108k|        } else {
  358|  39.1k|            if (BIO_puts(out, sname) <= 0)
  ------------------
  |  Branch (358:17): [True: 0, False: 39.1k]
  ------------------
  359|      0|                return 0;
  360|  39.1k|        }
  361|   147k|    }
  362|   147k|    if (BIO_write(out, ": ", 2) != 2)
  ------------------
  |  Branch (362:9): [True: 0, False: 147k]
  ------------------
  363|      0|        return 0;
  364|   147k|    return 1;
  365|   147k|}
tasn_prn.c:asn1_template_print_ctx:
  264|   134k|{
  265|   134k|    int i, flags;
  266|   134k|    const char *sname, *fname;
  267|   134k|    const ASN1_VALUE *tfld;
  268|   134k|    flags = tt->flags;
  269|   134k|    if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME)
  ------------------
  |  | 1065|   134k|# define ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME  0x080
  ------------------
  |  Branch (269:9): [True: 134k, False: 0]
  ------------------
  270|   134k|        sname = ASN1_ITEM_ptr(tt->item)->sname;
  ------------------
  |  |  422|   134k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  271|      0|    else
  272|      0|        sname = NULL;
  273|   134k|    if (pctx->flags & ASN1_PCTX_FLAGS_NO_FIELD_NAME)
  ------------------
  |  | 1063|   134k|# define ASN1_PCTX_FLAGS_NO_FIELD_NAME           0x040
  ------------------
  |  Branch (273:9): [True: 0, False: 134k]
  ------------------
  274|      0|        fname = NULL;
  275|   134k|    else
  276|   134k|        fname = tt->field_name;
  277|       |
  278|       |    /*
  279|       |     * If field is embedded then fld needs fixing so it is a pointer to
  280|       |     * a pointer to a field.
  281|       |     */
  282|   134k|    if (flags & ASN1_TFLG_EMBED) {
  ------------------
  |  |  597|   134k|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  |  Branch (282:9): [True: 6.78k, False: 127k]
  ------------------
  283|  6.78k|        tfld = (const ASN1_VALUE *)fld;
  284|  6.78k|        fld = &tfld;
  285|  6.78k|    }
  286|       |
  287|   134k|    if (flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|   134k|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (287:9): [True: 24.3k, False: 110k]
  ------------------
  288|  24.3k|        char *tname;
  289|  24.3k|        const ASN1_VALUE *skitem;
  290|  24.3k|        STACK_OF(const_ASN1_VALUE) *stack;
  ------------------
  |  |   31|  24.3k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  291|       |
  292|       |        /* SET OF, SEQUENCE OF */
  293|  24.3k|        if (fname) {
  ------------------
  |  Branch (293:13): [True: 24.3k, False: 0]
  ------------------
  294|  24.3k|            if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_SSOF) {
  ------------------
  |  | 1055|  24.3k|# define ASN1_PCTX_FLAGS_SHOW_SSOF               0x004
  ------------------
  |  Branch (294:17): [True: 24.3k, False: 0]
  ------------------
  295|  24.3k|                if (flags & ASN1_TFLG_SET_OF)
  ------------------
  |  |  526|  24.3k|# define ASN1_TFLG_SET_OF        (0x1 << 1)
  ------------------
  |  Branch (295:21): [True: 4.07k, False: 20.2k]
  ------------------
  296|  4.07k|                    tname = "SET";
  297|  20.2k|                else
  298|  20.2k|                    tname = "SEQUENCE";
  299|  24.3k|                if (BIO_printf(out, "%*s%s OF %s {\n",
  ------------------
  |  Branch (299:21): [True: 0, False: 24.3k]
  ------------------
  300|  24.3k|                               indent, "", tname, tt->field_name) <= 0)
  301|      0|                    return 0;
  302|  24.3k|            } else if (BIO_printf(out, "%*s%s:\n", indent, "", fname) <= 0)
  ------------------
  |  Branch (302:24): [True: 0, False: 0]
  ------------------
  303|      0|                return 0;
  304|  24.3k|        }
  305|  24.3k|        stack = (STACK_OF(const_ASN1_VALUE) *)*fld;
  306|   113k|        for (i = 0; i < sk_const_ASN1_VALUE_num(stack); i++) {
  ------------------
  |  Branch (306:21): [True: 90.0k, False: 23.6k]
  ------------------
  307|  90.0k|            if ((i > 0) && (BIO_puts(out, "\n") <= 0))
  ------------------
  |  Branch (307:17): [True: 79.9k, False: 10.1k]
  |  Branch (307:28): [True: 0, False: 79.9k]
  ------------------
  308|      0|                return 0;
  309|       |
  310|  90.0k|            skitem = sk_const_ASN1_VALUE_value(stack, i);
  311|  90.0k|            if (!asn1_item_print_ctx(out, &skitem, indent + 2,
  ------------------
  |  Branch (311:17): [True: 706, False: 89.3k]
  ------------------
  312|  90.0k|                                     ASN1_ITEM_ptr(tt->item), NULL, NULL, 1,
  ------------------
  |  |  422|  90.0k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  313|  90.0k|                                     pctx))
  314|    706|                return 0;
  315|  90.0k|        }
  316|  23.6k|        if (i == 0 && BIO_printf(out, "%*s<%s>\n", indent + 2, "",
  ------------------
  |  Branch (316:13): [True: 14.1k, False: 9.44k]
  |  Branch (316:23): [True: 0, False: 14.1k]
  ------------------
  317|  14.1k|                                 stack == NULL ? "ABSENT" : "EMPTY") <= 0)
  ------------------
  |  Branch (317:34): [True: 9.48k, False: 4.68k]
  ------------------
  318|      0|            return 0;
  319|  23.6k|        if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_SEQUENCE) {
  ------------------
  |  | 1053|  23.6k|# define ASN1_PCTX_FLAGS_SHOW_SEQUENCE           0x002
  ------------------
  |  Branch (319:13): [True: 23.6k, False: 0]
  ------------------
  320|  23.6k|            if (BIO_printf(out, "%*s}\n", indent, "") <= 0)
  ------------------
  |  Branch (320:17): [True: 0, False: 23.6k]
  ------------------
  321|      0|                return 0;
  322|  23.6k|        }
  323|  23.6k|        return 1;
  324|  23.6k|    }
  325|   110k|    return asn1_item_print_ctx(out, fld, indent, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  422|   110k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  326|   110k|                               fname, sname, 0, pctx);
  327|   134k|}
tasn_prn.c:asn1_primitive_print:
  435|   158k|{
  436|   158k|    long utype;
  437|   158k|    ASN1_STRING *str;
  438|   158k|    int ret = 1, needlf = 1;
  439|   158k|    const char *pname;
  440|   158k|    const ASN1_PRIMITIVE_FUNCS *pf;
  441|   158k|    pf = it->funcs;
  442|   158k|    if (!asn1_print_fsname(out, indent, fname, sname, pctx))
  ------------------
  |  Branch (442:9): [True: 0, False: 158k]
  ------------------
  443|      0|        return 0;
  444|   158k|    if (pf && pf->prim_print)
  ------------------
  |  Branch (444:9): [True: 25.2k, False: 133k]
  |  Branch (444:15): [True: 25.2k, False: 0]
  ------------------
  445|  25.2k|        return pf->prim_print(out, fld, it, indent, pctx);
  446|   133k|    if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|   133k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (446:9): [True: 9.56k, False: 123k]
  ------------------
  447|  9.56k|        str = (ASN1_STRING *)*fld;
  448|  9.56k|        utype = str->type & ~V_ASN1_NEG;
  ------------------
  |  |   97|  9.56k|# define V_ASN1_NEG                      0x100
  ------------------
  449|   123k|    } else {
  450|   123k|        utype = it->utype;
  451|   123k|        if (utype == V_ASN1_BOOLEAN)
  ------------------
  |  |   63|   123k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (451:13): [True: 1.87k, False: 122k]
  ------------------
  452|  1.87k|            str = NULL;
  453|   122k|        else
  454|   122k|            str = (ASN1_STRING *)*fld;
  455|   123k|    }
  456|   133k|    if (utype == V_ASN1_ANY) {
  ------------------
  |  |   58|   133k|# define V_ASN1_ANY                      -4 /* used in ASN1 template code */
  ------------------
  |  Branch (456:9): [True: 66.8k, False: 66.6k]
  ------------------
  457|  66.8k|        const ASN1_TYPE *atype = (const ASN1_TYPE *)*fld;
  458|  66.8k|        utype = atype->type;
  459|  66.8k|        fld = (const ASN1_VALUE **)&atype->value.asn1_value; /* actually is const */
  460|  66.8k|        str = (ASN1_STRING *)*fld;
  461|  66.8k|        if (pctx->flags & ASN1_PCTX_FLAGS_NO_ANY_TYPE)
  ------------------
  |  | 1059|  66.8k|# define ASN1_PCTX_FLAGS_NO_ANY_TYPE             0x010
  ------------------
  |  Branch (461:13): [True: 0, False: 66.8k]
  ------------------
  462|      0|            pname = NULL;
  463|  66.8k|        else
  464|  66.8k|            pname = ASN1_tag2str(utype);
  465|  66.8k|    } else {
  466|  66.6k|        if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_TYPE)
  ------------------
  |  | 1057|  66.6k|# define ASN1_PCTX_FLAGS_SHOW_TYPE               0x008
  ------------------
  |  Branch (466:13): [True: 66.6k, False: 0]
  ------------------
  467|  66.6k|            pname = ASN1_tag2str(utype);
  468|      0|        else
  469|      0|            pname = NULL;
  470|  66.6k|    }
  471|       |
  472|   133k|    if (utype == V_ASN1_NULL) {
  ------------------
  |  |   67|   133k|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (472:9): [True: 1.21k, False: 132k]
  ------------------
  473|  1.21k|        if (BIO_puts(out, "NULL\n") <= 0)
  ------------------
  |  Branch (473:13): [True: 0, False: 1.21k]
  ------------------
  474|      0|            return 0;
  475|  1.21k|        return 1;
  476|  1.21k|    }
  477|       |
  478|   132k|    if (pname) {
  ------------------
  |  Branch (478:9): [True: 132k, False: 0]
  ------------------
  479|   132k|        if (BIO_puts(out, pname) <= 0)
  ------------------
  |  Branch (479:13): [True: 0, False: 132k]
  ------------------
  480|      0|            return 0;
  481|   132k|        if (BIO_puts(out, ":") <= 0)
  ------------------
  |  Branch (481:13): [True: 0, False: 132k]
  ------------------
  482|      0|            return 0;
  483|   132k|    }
  484|       |
  485|   132k|    switch (utype) {
  486|  2.25k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|  2.25k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (486:5): [True: 2.25k, False: 130k]
  ------------------
  487|  2.25k|        {
  488|  2.25k|            int boolval = *(int *)fld;
  489|  2.25k|            if (boolval == -1)
  ------------------
  |  Branch (489:17): [True: 0, False: 2.25k]
  ------------------
  490|      0|                boolval = it->size;
  491|  2.25k|            ret = asn1_print_boolean(out, boolval);
  492|  2.25k|        }
  493|  2.25k|        break;
  494|       |
  495|  16.1k|    case V_ASN1_INTEGER:
  ------------------
  |  |   64|  16.1k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (495:5): [True: 16.1k, False: 116k]
  ------------------
  496|  16.1k|    case V_ASN1_ENUMERATED:
  ------------------
  |  |   72|  16.1k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (496:5): [True: 60, False: 132k]
  ------------------
  497|  16.1k|        ret = asn1_print_integer(out, str);
  498|  16.1k|        break;
  499|       |
  500|  1.92k|    case V_ASN1_UTCTIME:
  ------------------
  |  |   82|  1.92k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (500:5): [True: 1.92k, False: 130k]
  ------------------
  501|  1.92k|        ret = ASN1_UTCTIME_print(out, str);
  502|  1.92k|        break;
  503|       |
  504|  2.01k|    case V_ASN1_GENERALIZEDTIME:
  ------------------
  |  |   83|  2.01k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (504:5): [True: 2.01k, False: 130k]
  ------------------
  505|  2.01k|        ret = ASN1_GENERALIZEDTIME_print(out, str);
  506|  2.01k|        break;
  507|       |
  508|  23.5k|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|  23.5k|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (508:5): [True: 23.5k, False: 108k]
  ------------------
  509|  23.5k|        ret = asn1_print_oid(out, (const ASN1_OBJECT *)*fld);
  510|  23.5k|        break;
  511|       |
  512|  9.06k|    case V_ASN1_OCTET_STRING:
  ------------------
  |  |   66|  9.06k|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (512:5): [True: 9.06k, False: 123k]
  ------------------
  513|  13.7k|    case V_ASN1_BIT_STRING:
  ------------------
  |  |   65|  13.7k|# define V_ASN1_BIT_STRING               3
  ------------------
  |  Branch (513:5): [True: 4.70k, False: 127k]
  ------------------
  514|  13.7k|        ret = asn1_print_obstring(out, str, indent);
  515|  13.7k|        needlf = 0;
  516|  13.7k|        break;
  517|       |
  518|  50.3k|    case V_ASN1_SEQUENCE:
  ------------------
  |  |   74|  50.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (518:5): [True: 50.3k, False: 81.9k]
  ------------------
  519|  54.6k|    case V_ASN1_SET:
  ------------------
  |  |   75|  54.6k|# define V_ASN1_SET                      17
  ------------------
  |  Branch (519:5): [True: 4.34k, False: 127k]
  ------------------
  520|  68.1k|    case V_ASN1_OTHER:
  ------------------
  |  |   57|  68.1k|# define V_ASN1_OTHER                    -3 /* used in ASN1_TYPE */
  ------------------
  |  Branch (520:5): [True: 13.4k, False: 118k]
  ------------------
  521|  68.1k|        if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (521:13): [True: 0, False: 68.1k]
  ------------------
  522|      0|            return 0;
  523|  68.1k|        if (ASN1_parse_dump(out, str->data, str->length, indent, 0) <= 0)
  ------------------
  |  Branch (523:13): [True: 2.18k, False: 65.9k]
  ------------------
  524|  2.18k|            ret = 0;
  525|  68.1k|        needlf = 0;
  526|  68.1k|        break;
  527|       |
  528|  4.48k|    default:
  ------------------
  |  Branch (528:5): [True: 4.48k, False: 127k]
  ------------------
  529|  4.48k|        ret = ASN1_STRING_print_ex(out, str, pctx->str_flags);
  530|       |
  531|   132k|    }
  532|   132k|    if (!ret)
  ------------------
  |  Branch (532:9): [True: 2.96k, False: 129k]
  ------------------
  533|  2.96k|        return 0;
  534|   129k|    if (needlf && BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (534:9): [True: 49.5k, False: 79.7k]
  |  Branch (534:19): [True: 0, False: 49.5k]
  ------------------
  535|      0|        return 0;
  536|   129k|    return 1;
  537|   129k|}
tasn_prn.c:asn1_print_boolean:
  368|  2.25k|{
  369|  2.25k|    const char *str;
  370|  2.25k|    switch (boolval) {
  371|      0|    case -1:
  ------------------
  |  Branch (371:5): [True: 0, False: 2.25k]
  ------------------
  372|      0|        str = "BOOL ABSENT";
  373|      0|        break;
  374|       |
  375|  1.54k|    case 0:
  ------------------
  |  Branch (375:5): [True: 1.54k, False: 706]
  ------------------
  376|  1.54k|        str = "FALSE";
  377|  1.54k|        break;
  378|       |
  379|    706|    default:
  ------------------
  |  Branch (379:5): [True: 706, False: 1.54k]
  ------------------
  380|    706|        str = "TRUE";
  381|    706|        break;
  382|       |
  383|  2.25k|    }
  384|       |
  385|  2.25k|    if (BIO_puts(out, str) <= 0)
  ------------------
  |  Branch (385:9): [True: 0, False: 2.25k]
  ------------------
  386|      0|        return 0;
  387|  2.25k|    return 1;
  388|       |
  389|  2.25k|}
tasn_prn.c:asn1_print_integer:
  392|  16.1k|{
  393|  16.1k|    char *s;
  394|  16.1k|    int ret = 1;
  395|  16.1k|    s = i2s_ASN1_INTEGER(NULL, str);
  396|  16.1k|    if (s == NULL)
  ------------------
  |  Branch (396:9): [True: 60, False: 16.1k]
  ------------------
  397|     60|        return 0;
  398|  16.1k|    if (BIO_puts(out, s) <= 0)
  ------------------
  |  Branch (398:9): [True: 0, False: 16.1k]
  ------------------
  399|      0|        ret = 0;
  400|  16.1k|    OPENSSL_free(s);
  ------------------
  |  |  115|  16.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  16.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  16.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  401|  16.1k|    return ret;
  402|  16.1k|}
tasn_prn.c:asn1_print_oid:
  405|  23.5k|{
  406|  23.5k|    char objbuf[80];
  407|  23.5k|    const char *ln;
  408|  23.5k|    ln = OBJ_nid2ln(OBJ_obj2nid(oid));
  409|  23.5k|    if (!ln)
  ------------------
  |  Branch (409:9): [True: 0, False: 23.5k]
  ------------------
  410|      0|        ln = "";
  411|  23.5k|    OBJ_obj2txt(objbuf, sizeof(objbuf), oid, 1);
  412|  23.5k|    if (BIO_printf(out, "%s (%s)", ln, objbuf) <= 0)
  ------------------
  |  Branch (412:9): [True: 0, False: 23.5k]
  ------------------
  413|      0|        return 0;
  414|  23.5k|    return 1;
  415|  23.5k|}
tasn_prn.c:asn1_print_obstring:
  418|  13.7k|{
  419|  13.7k|    if (str->type == V_ASN1_BIT_STRING) {
  ------------------
  |  |   65|  13.7k|# define V_ASN1_BIT_STRING               3
  ------------------
  |  Branch (419:9): [True: 4.70k, False: 9.06k]
  ------------------
  420|  4.70k|        if (BIO_printf(out, " (%ld unused bits)\n", str->flags & 0x7) <= 0)
  ------------------
  |  Branch (420:13): [True: 0, False: 4.70k]
  ------------------
  421|      0|            return 0;
  422|  9.06k|    } else if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (422:16): [True: 0, False: 9.06k]
  ------------------
  423|      0|        return 0;
  424|  13.7k|    if ((str->length > 0)
  ------------------
  |  Branch (424:9): [True: 7.71k, False: 6.04k]
  ------------------
  425|  13.7k|        && BIO_dump_indent(out, (const char *)str->data, str->length,
  ------------------
  |  Branch (425:12): [True: 0, False: 7.71k]
  ------------------
  426|  7.71k|                           indent + 2) <= 0)
  427|      0|        return 0;
  428|  13.7k|    return 1;
  429|  13.7k|}

ASN1_OCTET_STRING_new:
   19|    146|sname *sname##_new(void) \
   20|    146|{ \
   21|    146|    return ASN1_STRING_type_new(V_##sname); \
   22|    146|} \
ASN1_OCTET_STRING_free:
   23|   885k|void sname##_free(sname *x) \
   24|   885k|{ \
   25|   885k|    ASN1_STRING_free(x); \
   26|   885k|}
ASN1_INTEGER_new:
   19|   228k|sname *sname##_new(void) \
   20|   228k|{ \
   21|   228k|    return ASN1_STRING_type_new(V_##sname); \
   22|   228k|} \
ASN1_INTEGER_free:
   23|   799k|void sname##_free(sname *x) \
   24|   799k|{ \
   25|   799k|    ASN1_STRING_free(x); \
   26|   799k|}
ASN1_ENUMERATED_free:
   23|   560k|void sname##_free(sname *x) \
   24|   560k|{ \
   25|   560k|    ASN1_STRING_free(x); \
   26|   560k|}
ASN1_BIT_STRING_new:
   19|   160k|sname *sname##_new(void) \
   20|   160k|{ \
   21|   160k|    return ASN1_STRING_type_new(V_##sname); \
   22|   160k|} \
ASN1_BIT_STRING_free:
   23|   101k|void sname##_free(sname *x) \
   24|   101k|{ \
   25|   101k|    ASN1_STRING_free(x); \
   26|   101k|}

ossl_asn1_get_choice_selector:
   30|   512k|{
   31|   512k|    int *sel = offset2ptr(*pval, it->utype);
  ------------------
  |  |   23|   512k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   32|       |
   33|   512k|    return *sel;
   34|   512k|}
ossl_asn1_get_choice_selector_const:
   38|   543k|{
   39|   543k|    int *sel = offset2ptr(*pval, it->utype);
  ------------------
  |  |   23|   543k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   40|       |
   41|   543k|    return *sel;
   42|   543k|}
ossl_asn1_set_choice_selector:
   50|   709k|{
   51|   709k|    int *sel, ret;
   52|       |
   53|   709k|    sel = offset2ptr(*pval, it->utype);
  ------------------
  |  |   23|   709k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   54|   709k|    ret = *sel;
   55|   709k|    *sel = value;
   56|   709k|    return ret;
   57|   709k|}
ossl_asn1_do_lock:
   69|  6.46M|{
   70|  6.46M|    const ASN1_AUX *aux;
   71|  6.46M|    CRYPTO_RWLOCK **lock;
   72|  6.46M|    CRYPTO_REF_COUNT *refcnt;
   73|  6.46M|    int ret = -1;
   74|       |
   75|  6.46M|    if ((it->itype != ASN1_ITYPE_SEQUENCE)
  ------------------
  |  |   81|  6.46M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (75:9): [True: 306k, False: 6.15M]
  ------------------
   76|  6.46M|        && (it->itype != ASN1_ITYPE_NDEF_SEQUENCE))
  ------------------
  |  |   86|   306k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (76:12): [True: 0, False: 306k]
  ------------------
   77|      0|        return 0;
   78|  6.46M|    aux = it->funcs;
   79|  6.46M|    if (aux == NULL || (aux->flags & ASN1_AFLG_REFCOUNT) == 0)
  ------------------
  |  |  732|  1.12M|# define ASN1_AFLG_REFCOUNT      1
  ------------------
  |  Branch (79:9): [True: 5.33M, False: 1.12M]
  |  Branch (79:24): [True: 992k, False: 128k]
  ------------------
   80|  6.33M|        return 0;
   81|   128k|    lock = offset2ptr(*pval, aux->ref_lock);
  ------------------
  |  |   23|   128k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   82|   128k|    refcnt = offset2ptr(*pval, aux->ref_offset);
  ------------------
  |  |   23|   128k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   83|       |
   84|   128k|    switch (op) {
  ------------------
  |  Branch (84:13): [True: 0, False: 128k]
  ------------------
   85|  64.0k|    case 0:
  ------------------
  |  Branch (85:5): [True: 64.0k, False: 64.0k]
  ------------------
   86|  64.0k|        if (!CRYPTO_NEW_REF(refcnt, 1))
  ------------------
  |  Branch (86:13): [True: 0, False: 64.0k]
  ------------------
   87|      0|            return -1;
   88|  64.0k|        *lock = CRYPTO_THREAD_lock_new();
   89|  64.0k|        if (*lock == NULL) {
  ------------------
  |  Branch (89:13): [True: 0, False: 64.0k]
  ------------------
   90|      0|            CRYPTO_FREE_REF(refcnt);
   91|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   92|      0|            return -1;
   93|      0|        }
   94|  64.0k|        ret = 1;
   95|  64.0k|        break;
   96|      0|    case 1:
  ------------------
  |  Branch (96:5): [True: 0, False: 128k]
  ------------------
   97|      0|        if (!CRYPTO_UP_REF(refcnt, &ret))
  ------------------
  |  Branch (97:13): [True: 0, False: 0]
  ------------------
   98|      0|            return -1;
   99|      0|        break;
  100|  64.0k|    case -1:
  ------------------
  |  Branch (100:5): [True: 64.0k, False: 64.0k]
  ------------------
  101|  64.0k|        if (!CRYPTO_DOWN_REF(refcnt, &ret))
  ------------------
  |  Branch (101:13): [True: 0, False: 64.0k]
  ------------------
  102|      0|            return -1;  /* failed */
  103|  64.0k|        REF_PRINT_EX(it->sname, ret, (void *)it);
  ------------------
  |  |  299|  64.0k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  ------------------
  |  |  |  |  295|  64.0k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  64.0k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  104|  64.0k|        REF_ASSERT_ISNT(ret < 0);
  ------------------
  |  |  293|  64.0k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 64.0k]
  |  |  ------------------
  ------------------
  105|  64.0k|        if (ret == 0) {
  ------------------
  |  Branch (105:13): [True: 64.0k, False: 0]
  ------------------
  106|  64.0k|            CRYPTO_THREAD_lock_free(*lock);
  107|  64.0k|            *lock = NULL;
  108|  64.0k|            CRYPTO_FREE_REF(refcnt);
  109|  64.0k|        }
  110|  64.0k|        break;
  111|   128k|    }
  112|       |
  113|   128k|    return ret;
  114|   128k|}
ossl_asn1_enc_init:
  142|  3.17M|{
  143|  3.17M|    ASN1_ENCODING *enc = asn1_get_enc_ptr(pval, it);
  144|       |
  145|  3.17M|    if (enc != NULL) {
  ------------------
  |  Branch (145:9): [True: 94.3k, False: 3.08M]
  ------------------
  146|  94.3k|        enc->enc = NULL;
  147|  94.3k|        enc->len = 0;
  148|  94.3k|        enc->modified = 1;
  149|  94.3k|    }
  150|  3.17M|}
ossl_asn1_enc_free:
  153|  3.17M|{
  154|  3.17M|    ASN1_ENCODING *enc = asn1_get_enc_ptr(pval, it);
  155|       |
  156|  3.17M|    if (enc != NULL) {
  ------------------
  |  Branch (156:9): [True: 94.3k, False: 3.07M]
  ------------------
  157|  94.3k|        OPENSSL_free(enc->enc);
  ------------------
  |  |  115|  94.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  94.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  94.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  158|  94.3k|        enc->enc = NULL;
  159|  94.3k|        enc->len = 0;
  160|  94.3k|        enc->modified = 1;
  161|  94.3k|    }
  162|  3.17M|}
ossl_asn1_enc_save:
  166|   939k|{
  167|   939k|    ASN1_ENCODING *enc = asn1_get_enc_ptr(pval, it);
  168|       |
  169|   939k|    if (enc == NULL)
  ------------------
  |  Branch (169:9): [True: 906k, False: 33.2k]
  ------------------
  170|   906k|        return 1;
  171|       |
  172|  33.2k|    OPENSSL_free(enc->enc);
  ------------------
  |  |  115|  33.2k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  33.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  33.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  173|  33.2k|    if (inlen <= 0)
  ------------------
  |  Branch (173:9): [True: 0, False: 33.2k]
  ------------------
  174|      0|        return 0;
  175|  33.2k|    if ((enc->enc = OPENSSL_malloc(inlen)) == NULL)
  ------------------
  |  |  102|  33.2k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  33.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  33.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (175:9): [True: 0, False: 33.2k]
  ------------------
  176|      0|        return 0;
  177|  33.2k|    memcpy(enc->enc, in, inlen);
  178|  33.2k|    enc->len = inlen;
  179|  33.2k|    enc->modified = 0;
  180|       |
  181|  33.2k|    return 1;
  182|  33.2k|}
ossl_asn1_enc_restore:
  186|  1.35M|{
  187|  1.35M|    const ASN1_ENCODING *enc = asn1_get_const_enc_ptr(pval, it);
  188|       |
  189|  1.35M|    if (enc == NULL || enc->modified)
  ------------------
  |  Branch (189:9): [True: 1.33M, False: 22.6k]
  |  Branch (189:24): [True: 0, False: 22.6k]
  ------------------
  190|  1.33M|        return 0;
  191|  22.6k|    if (out) {
  ------------------
  |  Branch (191:9): [True: 7.15k, False: 15.5k]
  ------------------
  192|  7.15k|        memcpy(*out, enc->enc, enc->len);
  193|  7.15k|        *out += enc->len;
  194|  7.15k|    }
  195|  22.6k|    if (len != NULL)
  ------------------
  |  Branch (195:9): [True: 22.6k, False: 0]
  ------------------
  196|  22.6k|        *len = enc->len;
  197|  22.6k|    return 1;
  198|  1.35M|}
ossl_asn1_get_field_ptr:
  202|  25.1M|{
  203|  25.1M|    ASN1_VALUE **pvaltmp = offset2ptr(*pval, tt->offset);
  ------------------
  |  |   23|  25.1M|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  204|       |
  205|       |    /*
  206|       |     * NOTE for BOOLEAN types the field is just a plain int so we can't
  207|       |     * return int **, so settle for (int *).
  208|       |     */
  209|  25.1M|    return pvaltmp;
  210|  25.1M|}
ossl_asn1_get_const_field_ptr:
  215|  4.73M|{
  216|  4.73M|    return offset2ptr(*pval, tt->offset);
  ------------------
  |  |   23|  4.73M|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  217|  4.73M|}
ossl_asn1_do_adb:
  227|  18.4M|{
  228|  18.4M|    const ASN1_ADB *adb;
  229|  18.4M|    const ASN1_ADB_TABLE *atbl;
  230|  18.4M|    long selector;
  231|  18.4M|    const ASN1_VALUE **sfld;
  232|  18.4M|    int i;
  233|       |
  234|  18.4M|    if ((tt->flags & ASN1_TFLG_ADB_MASK) == 0)
  ------------------
  |  |  583|  18.4M|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
  |  Branch (234:9): [True: 18.1M, False: 279k]
  ------------------
  235|  18.1M|        return tt;
  236|       |
  237|       |    /* Else ANY DEFINED BY ... get the table */
  238|   279k|    adb = ASN1_ADB_ptr(tt->item);
  ------------------
  |  |   89|   279k|# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
  ------------------
  239|       |
  240|       |    /* Get the selector field */
  241|   279k|    sfld = offset2ptr(val, adb->offset);
  ------------------
  |  |   23|   279k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  242|       |
  243|       |    /* Check if NULL */
  244|   279k|    if (*sfld == NULL) {
  ------------------
  |  Branch (244:9): [True: 126k, False: 153k]
  ------------------
  245|   126k|        if (adb->null_tt == NULL)
  ------------------
  |  Branch (245:13): [True: 126k, False: 0]
  ------------------
  246|   126k|            goto err;
  247|      0|        return adb->null_tt;
  248|   126k|    }
  249|       |
  250|       |    /*
  251|       |     * Convert type to a long: NB: don't check for NID_undef here because it
  252|       |     * might be a legitimate value in the table
  253|       |     */
  254|   153k|    if ((tt->flags & ASN1_TFLG_ADB_OID) != 0)
  ------------------
  |  |  585|   153k|# define ASN1_TFLG_ADB_OID       (0x1<<8)
  ------------------
  |  Branch (254:9): [True: 153k, False: 0]
  ------------------
  255|   153k|        selector = OBJ_obj2nid((ASN1_OBJECT *)*sfld);
  256|      0|    else
  257|      0|        selector = ASN1_INTEGER_get((ASN1_INTEGER *)*sfld);
  258|       |
  259|       |    /* Let application callback translate value */
  260|   153k|    if (adb->adb_cb != NULL && adb->adb_cb(&selector) == 0) {
  ------------------
  |  Branch (260:9): [True: 0, False: 153k]
  |  Branch (260:32): [True: 0, False: 0]
  ------------------
  261|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  262|      0|        return NULL;
  263|      0|    }
  264|       |
  265|       |    /*
  266|       |     * Try to find matching entry in table Maybe should check application
  267|       |     * types first to allow application override? Might also be useful to
  268|       |     * have a flag which indicates table is sorted and we can do a binary
  269|       |     * search. For now stick to a linear search.
  270|       |     */
  271|       |
  272|   906k|    for (atbl = adb->tbl, i = 0; i < adb->tblcount; i++, atbl++)
  ------------------
  |  Branch (272:34): [True: 775k, False: 130k]
  ------------------
  273|   775k|        if (atbl->value == selector)
  ------------------
  |  Branch (273:13): [True: 22.7k, False: 753k]
  ------------------
  274|  22.7k|            return &atbl->tt;
  275|       |
  276|       |    /* FIXME: need to search application table too */
  277|       |
  278|       |    /* No match, return default type */
  279|   130k|    if (!adb->default_tt)
  ------------------
  |  Branch (279:9): [True: 0, False: 130k]
  ------------------
  280|      0|        goto err;
  281|   130k|    return adb->default_tt;
  282|       |
  283|   126k| err:
  284|       |    /* FIXME: should log the value or OID of unsupported type */
  285|   126k|    if (nullerr)
  ------------------
  |  Branch (285:9): [True: 0, False: 126k]
  ------------------
  286|   126k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  287|   126k|    return NULL;
  288|   130k|}
tasn_utl.c:asn1_get_enc_ptr:
  117|  7.28M|{
  118|  7.28M|    const ASN1_AUX *aux;
  119|       |
  120|  7.28M|    if (pval == NULL || *pval == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 7.28M]
  |  Branch (120:25): [True: 0, False: 7.28M]
  ------------------
  121|      0|        return NULL;
  122|  7.28M|    aux = it->funcs;
  123|  7.28M|    if (aux == NULL || (aux->flags & ASN1_AFLG_ENCODING) == 0)
  ------------------
  |  |  734|  1.09M|# define ASN1_AFLG_ENCODING      2
  ------------------
  |  Branch (123:9): [True: 6.19M, False: 1.09M]
  |  Branch (123:24): [True: 875k, False: 221k]
  ------------------
  124|  7.06M|        return NULL;
  125|   221k|    return offset2ptr(*pval, aux->enc_offset);
  ------------------
  |  |   23|   221k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  126|  7.28M|}
tasn_utl.c:asn1_get_const_enc_ptr:
  130|  1.35M|{
  131|  1.35M|    const ASN1_AUX *aux;
  132|       |
  133|  1.35M|    if (pval == NULL || *pval == NULL)
  ------------------
  |  Branch (133:9): [True: 0, False: 1.35M]
  |  Branch (133:25): [True: 0, False: 1.35M]
  ------------------
  134|      0|        return NULL;
  135|  1.35M|    aux = it->funcs;
  136|  1.35M|    if (aux == NULL || (aux->flags & ASN1_AFLG_ENCODING) == 0)
  ------------------
  |  |  734|  58.8k|# define ASN1_AFLG_ENCODING      2
  ------------------
  |  Branch (136:9): [True: 1.29M, False: 58.8k]
  |  Branch (136:24): [True: 36.1k, False: 22.6k]
  ------------------
  137|  1.33M|        return NULL;
  138|  22.6k|    return offset2ptr(*pval, aux->enc_offset);
  ------------------
  |  |   23|  22.6k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  139|  1.35M|}

X509_ALGOR_set0:
   32|     27|{
   33|     27|    if (alg == NULL)
  ------------------
  |  Branch (33:9): [True: 0, False: 27]
  ------------------
   34|      0|        return 0;
   35|       |
   36|     27|    if (ptype != V_ASN1_UNDEF && alg->parameter == NULL
  ------------------
  |  |   60|     54|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (36:9): [True: 22, False: 5]
  |  Branch (36:34): [True: 22, False: 0]
  ------------------
   37|     27|            && (alg->parameter = ASN1_TYPE_new()) == NULL)
  ------------------
  |  Branch (37:16): [True: 0, False: 22]
  ------------------
   38|      0|        return 0;
   39|       |
   40|     27|    ASN1_OBJECT_free(alg->algorithm);
   41|     27|    alg->algorithm = aobj;
   42|       |
   43|     27|    if (ptype == V_ASN1_EOC)
  ------------------
  |  |   62|     27|# define V_ASN1_EOC                      0
  ------------------
  |  Branch (43:9): [True: 0, False: 27]
  ------------------
   44|      0|        return 1;
   45|     27|    if (ptype == V_ASN1_UNDEF) {
  ------------------
  |  |   60|     27|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (45:9): [True: 5, False: 22]
  ------------------
   46|      5|        ASN1_TYPE_free(alg->parameter);
   47|      5|        alg->parameter = NULL;
   48|      5|    } else
   49|     22|        ASN1_TYPE_set(alg->parameter, ptype, pval);
   50|     27|    return 1;
   51|     27|}
X509_ALGOR_get0:
   74|  75.6k|{
   75|  75.6k|    if (paobj)
  ------------------
  |  Branch (75:9): [True: 25.7k, False: 49.9k]
  ------------------
   76|  25.7k|        *paobj = algor->algorithm;
   77|  75.6k|    if (pptype) {
  ------------------
  |  Branch (77:9): [True: 50.0k, False: 25.6k]
  ------------------
   78|  50.0k|        if (algor->parameter == NULL) {
  ------------------
  |  Branch (78:13): [True: 343, False: 49.6k]
  ------------------
   79|    343|            *pptype = V_ASN1_UNDEF;
  ------------------
  |  |   60|    343|# define V_ASN1_UNDEF                    -1
  ------------------
   80|    343|            return;
   81|    343|        } else
   82|  49.6k|            *pptype = algor->parameter->type;
   83|  49.6k|        if (ppval)
  ------------------
  |  Branch (83:13): [True: 49.4k, False: 205]
  ------------------
   84|  49.4k|            *ppval = algor->parameter->value.ptr;
   85|  49.6k|    }
   86|  75.6k|}
ossl_x509_algor_get_md:
  158|     16|{
  159|     16|    const EVP_MD *md;
  160|       |
  161|     16|    if (alg == NULL)
  ------------------
  |  Branch (161:9): [True: 16, False: 0]
  ------------------
  162|     16|        return EVP_sha1();
  163|      0|    md = EVP_get_digestbyobj(alg->algorithm);
  ------------------
  |  |  553|      0|# define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a))
  |  |  ------------------
  |  |  |  |  552|      0|# define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a))
  |  |  ------------------
  ------------------
  164|      0|    if (md == NULL)
  ------------------
  |  Branch (164:9): [True: 0, False: 0]
  ------------------
  165|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_UNKNOWN_DIGEST);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  166|      0|    return md;
  167|     16|}

BIGNUM_it:
   57|   271k|ASN1_ITEM_start(BIGNUM)
  ------------------
  |  |   95|   271k|        { \
  |  |   96|   271k|                static const ASN1_ITEM local_it = {
  ------------------
   58|   271k|        ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &bignum_pf, 0, "BIGNUM"
  ------------------
  |  |   80|   271k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                      ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &bignum_pf, 0, "BIGNUM"
  ------------------
  |  |   64|   271k|# define V_ASN1_INTEGER                  2
  ------------------
   59|   271k|ASN1_ITEM_end(BIGNUM)
  ------------------
  |  |  102|   271k|                }; \
  |  |  103|   271k|        return &local_it; \
  |  |  104|   271k|        }
  ------------------
CBIGNUM_it:
   61|  1.05M|ASN1_ITEM_start(CBIGNUM)
  ------------------
  |  |   95|  1.05M|        { \
  |  |   96|  1.05M|                static const ASN1_ITEM local_it = {
  ------------------
   62|  1.05M|        ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &cbignum_pf, BN_SENSITIVE, "CBIGNUM"
  ------------------
  |  |   80|  1.05M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                      ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &cbignum_pf, BN_SENSITIVE, "CBIGNUM"
  ------------------
  |  |   64|  1.05M|# define V_ASN1_INTEGER                  2
  ------------------
                      ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &cbignum_pf, BN_SENSITIVE, "CBIGNUM"
  ------------------
  |  |   22|  1.05M|#define BN_SENSITIVE    1
  ------------------
   63|  1.05M|ASN1_ITEM_end(CBIGNUM)
  ------------------
  |  |  102|  1.05M|                }; \
  |  |  103|  1.05M|        return &local_it; \
  |  |  104|  1.05M|        }
  ------------------
x_bignum.c:bn_new:
   66|  91.6k|{
   67|  91.6k|    *pval = (ASN1_VALUE *)BN_new();
   68|  91.6k|    if (*pval != NULL)
  ------------------
  |  Branch (68:9): [True: 91.6k, False: 0]
  ------------------
   69|  91.6k|        return 1;
   70|      0|    else
   71|      0|        return 0;
   72|  91.6k|}
x_bignum.c:bn_free:
   84|  66.1k|{
   85|  66.1k|    if (*pval == NULL)
  ------------------
  |  Branch (85:9): [True: 33.8k, False: 32.2k]
  ------------------
   86|  33.8k|        return;
   87|  32.2k|    if (it->size & BN_SENSITIVE)
  ------------------
  |  |   22|  32.2k|#define BN_SENSITIVE    1
  ------------------
  |  Branch (87:9): [True: 880, False: 31.4k]
  ------------------
   88|    880|        BN_clear_free((BIGNUM *)*pval);
   89|  31.4k|    else
   90|  31.4k|        BN_free((BIGNUM *)*pval);
   91|  32.2k|    *pval = NULL;
   92|  32.2k|}
x_bignum.c:bn_c2i:
  117|   277k|{
  118|   277k|    BIGNUM *bn;
  119|       |
  120|   277k|    if (*pval == NULL && !bn_new(pval, it))
  ------------------
  |  Branch (120:9): [True: 61.1k, False: 215k]
  |  Branch (120:26): [True: 0, False: 61.1k]
  ------------------
  121|      0|        return 0;
  122|   277k|    bn = (BIGNUM *)*pval;
  123|   277k|    if (!BN_bin2bn(cont, len, bn)) {
  ------------------
  |  Branch (123:9): [True: 0, False: 277k]
  ------------------
  124|      0|        bn_free(pval, it);
  125|      0|        return 0;
  126|      0|    }
  127|   277k|    return 1;
  128|   277k|}
x_bignum.c:bn_i2c:
   96|   748k|{
   97|   748k|    BIGNUM *bn;
   98|   748k|    int pad;
   99|   748k|    if (*pval == NULL)
  ------------------
  |  Branch (99:9): [True: 174, False: 748k]
  ------------------
  100|    174|        return -1;
  101|   748k|    bn = (BIGNUM *)*pval;
  102|       |    /* If MSB set in an octet we need a padding byte */
  103|   748k|    if (BN_num_bits(bn) & 0x7)
  ------------------
  |  Branch (103:9): [True: 179k, False: 568k]
  ------------------
  104|   179k|        pad = 0;
  105|   568k|    else
  106|   568k|        pad = 1;
  107|   748k|    if (cont) {
  ------------------
  |  Branch (107:9): [True: 129k, False: 618k]
  ------------------
  108|   129k|        if (pad)
  ------------------
  |  Branch (108:13): [True: 96.7k, False: 32.4k]
  ------------------
  109|  96.7k|            *cont++ = 0;
  110|   129k|        BN_bn2bin(bn, cont);
  111|   129k|    }
  112|   748k|    return pad + BN_num_bytes(bn);
  ------------------
  |  |  189|   748k|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  113|   748k|}
x_bignum.c:bn_print:
  151|  20.3k|{
  152|  20.3k|    if (!BN_print(out, *(BIGNUM **)pval))
  ------------------
  |  Branch (152:9): [True: 0, False: 20.3k]
  ------------------
  153|      0|        return 0;
  154|  20.3k|    if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (154:9): [True: 0, False: 20.3k]
  ------------------
  155|      0|        return 0;
  156|  20.3k|    return 1;
  157|  20.3k|}
x_bignum.c:bn_secure_new:
   75|   208k|{
   76|   208k|    *pval = (ASN1_VALUE *)BN_secure_new();
   77|   208k|    if (*pval != NULL)
  ------------------
  |  Branch (77:9): [True: 208k, False: 0]
  ------------------
   78|   208k|        return 1;
   79|      0|    else
   80|      0|        return 0;
   81|   208k|}
x_bignum.c:bn_secure_c2i:
  132|   208k|{
  133|   208k|    int ret;
  134|   208k|    BIGNUM *bn;
  135|       |
  136|   208k|    if (*pval == NULL && !bn_secure_new(pval, it))
  ------------------
  |  Branch (136:9): [True: 14.2k, False: 194k]
  |  Branch (136:26): [True: 0, False: 14.2k]
  ------------------
  137|      0|        return 0;
  138|       |
  139|   208k|    ret = bn_c2i(pval, cont, len, utype, free_cont, it);
  140|   208k|    if (!ret)
  ------------------
  |  Branch (140:9): [True: 0, False: 208k]
  ------------------
  141|      0|        return 0;
  142|       |
  143|       |    /* Set constant-time flag for all secure BIGNUMS */
  144|   208k|    bn = (BIGNUM *)*pval;
  145|   208k|    BN_set_flags(bn, BN_FLG_CONSTTIME);
  ------------------
  |  |   67|   208k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  146|   208k|    return ret;
  147|   208k|}

INT32_it:
  250|   377k|ASN1_ITEM_start(INT32)
  ------------------
  |  |   95|   377k|        { \
  |  |   96|   377k|                static const ASN1_ITEM local_it = {
  ------------------
  251|   377k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   80|   377k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   64|   377k|# define V_ASN1_INTEGER                  2
  ------------------
  252|   377k|    INTxx_FLAG_SIGNED, "INT32"
  ------------------
  |  |   27|   377k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  253|   377k|ASN1_ITEM_end(INT32)
  ------------------
  |  |  102|   377k|                }; \
  |  |  103|   377k|        return &local_it; \
  |  |  104|   377k|        }
  ------------------
UINT32_it:
  255|  76.7k|ASN1_ITEM_start(UINT32)
  ------------------
  |  |   95|  76.7k|        { \
  |  |   96|  76.7k|                static const ASN1_ITEM local_it = {
  ------------------
  256|  76.7k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf, 0, "UINT32"
  ------------------
  |  |   80|  76.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf, 0, "UINT32"
  ------------------
  |  |   64|  76.7k|# define V_ASN1_INTEGER                  2
  ------------------
  257|  76.7k|ASN1_ITEM_end(UINT32)
  ------------------
  |  |  102|  76.7k|                }; \
  |  |  103|  76.7k|        return &local_it; \
  |  |  104|  76.7k|        }
  ------------------
INT64_it:
  259|  12.7k|ASN1_ITEM_start(INT64)
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  260|  12.7k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf,
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf,
  ------------------
  |  |   64|  12.7k|# define V_ASN1_INTEGER                  2
  ------------------
  261|  12.7k|    INTxx_FLAG_SIGNED, "INT64"
  ------------------
  |  |   27|  12.7k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  262|  12.7k|ASN1_ITEM_end(INT64)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
UINT64_it:
  264|  12.7k|ASN1_ITEM_start(UINT64)
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  265|  12.7k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf, 0, "UINT64"
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf, 0, "UINT64"
  ------------------
  |  |   64|  12.7k|# define V_ASN1_INTEGER                  2
  ------------------
  266|  12.7k|ASN1_ITEM_end(UINT64)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
ZINT32_it:
  268|  48.1k|ASN1_ITEM_start(ZINT32)
  ------------------
  |  |   95|  48.1k|        { \
  |  |   96|  48.1k|                static const ASN1_ITEM local_it = {
  ------------------
  269|  48.1k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   80|  48.1k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   64|  48.1k|# define V_ASN1_INTEGER                  2
  ------------------
  270|  48.1k|    INTxx_FLAG_ZERO_DEFAULT|INTxx_FLAG_SIGNED, "ZINT32"
  ------------------
  |  |   26|  48.1k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
                  INTxx_FLAG_ZERO_DEFAULT|INTxx_FLAG_SIGNED, "ZINT32"
  ------------------
  |  |   27|  48.1k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  271|  48.1k|ASN1_ITEM_end(ZINT32)
  ------------------
  |  |  102|  48.1k|                }; \
  |  |  103|  48.1k|        return &local_it; \
  |  |  104|  48.1k|        }
  ------------------
ZUINT32_it:
  273|   108k|ASN1_ITEM_start(ZUINT32)
  ------------------
  |  |   95|   108k|        { \
  |  |   96|   108k|                static const ASN1_ITEM local_it = {
  ------------------
  274|   108k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   80|   108k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   64|   108k|# define V_ASN1_INTEGER                  2
  ------------------
  275|   108k|    INTxx_FLAG_ZERO_DEFAULT, "ZUINT32"
  ------------------
  |  |   26|   108k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
  276|   108k|ASN1_ITEM_end(ZUINT32)
  ------------------
  |  |  102|   108k|                }; \
  |  |  103|   108k|        return &local_it; \
  |  |  104|   108k|        }
  ------------------
ZINT64_it:
  278|  77.7k|ASN1_ITEM_start(ZINT64)
  ------------------
  |  |   95|  77.7k|        { \
  |  |   96|  77.7k|                static const ASN1_ITEM local_it = {
  ------------------
  279|  77.7k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf,
  ------------------
  |  |   80|  77.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf,
  ------------------
  |  |   64|  77.7k|# define V_ASN1_INTEGER                  2
  ------------------
  280|  77.7k|    INTxx_FLAG_ZERO_DEFAULT|INTxx_FLAG_SIGNED, "ZINT64"
  ------------------
  |  |   26|  77.7k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
                  INTxx_FLAG_ZERO_DEFAULT|INTxx_FLAG_SIGNED, "ZINT64"
  ------------------
  |  |   27|  77.7k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  281|  77.7k|ASN1_ITEM_end(ZINT64)
  ------------------
  |  |  102|  77.7k|                }; \
  |  |  103|  77.7k|        return &local_it; \
  |  |  104|  77.7k|        }
  ------------------
ZUINT64_it:
  283|  76.9k|ASN1_ITEM_start(ZUINT64)
  ------------------
  |  |   95|  76.9k|        { \
  |  |   96|  76.9k|                static const ASN1_ITEM local_it = {
  ------------------
  284|  76.9k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf,
  ------------------
  |  |   80|  76.9k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf,
  ------------------
  |  |   64|  76.9k|# define V_ASN1_INTEGER                  2
  ------------------
  285|  76.9k|    INTxx_FLAG_ZERO_DEFAULT, "ZUINT64"
  ------------------
  |  |   26|  76.9k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
  286|  76.9k|ASN1_ITEM_end(ZUINT64)
  ------------------
  |  |  102|  76.9k|                }; \
  |  |  103|  76.9k|        return &local_it; \
  |  |  104|  76.9k|        }
  ------------------
x_int64.c:uint32_free:
  130|  51.0k|{
  131|  51.0k|    OPENSSL_free(*pval);
  ------------------
  |  |  115|  51.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  51.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  51.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  132|  51.0k|    *pval = NULL;
  133|  51.0k|}
x_int64.c:uint32_clear:
  136|   313k|{
  137|   313k|    **(uint32_t **)pval = 0;
  138|   313k|}
x_int64.c:uint32_c2i:
  173|  90.3k|{
  174|  90.3k|    uint64_t utmp = 0;
  175|  90.3k|    uint32_t utmp2 = 0;
  176|  90.3k|    char *cp;
  177|  90.3k|    int neg = 0;
  178|       |
  179|  90.3k|    if (*pval == NULL && !uint64_new(pval, it))
  ------------------
  |  Branch (179:9): [True: 2.18k, False: 88.1k]
  |  Branch (179:26): [True: 0, False: 2.18k]
  ------------------
  180|      0|        return 0;
  181|       |
  182|  90.3k|    cp = (char *)*pval;
  183|       |
  184|       |    /*
  185|       |     * Strictly speaking, zero length is malformed.  However, long_c2i
  186|       |     * (x_long.c) encodes 0 as a zero length INTEGER (wrongly, of course),
  187|       |     * so for the sake of backward compatibility, we still decode zero
  188|       |     * length INTEGERs as the number zero.
  189|       |     */
  190|  90.3k|    if (len == 0)
  ------------------
  |  Branch (190:9): [True: 10.6k, False: 79.6k]
  ------------------
  191|  10.6k|        goto long_compat;
  192|       |
  193|  79.6k|    if (!ossl_c2i_uint64_int(&utmp, &neg, &cont, len))
  ------------------
  |  Branch (193:9): [True: 2.15k, False: 77.5k]
  ------------------
  194|  2.15k|        return 0;
  195|  77.5k|    if ((it->size & INTxx_FLAG_SIGNED) == 0 && neg) {
  ------------------
  |  |   27|  77.5k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (195:9): [True: 5.25k, False: 72.2k]
  |  Branch (195:48): [True: 1.16k, False: 4.09k]
  ------------------
  196|  1.16k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE);
  ------------------
  |  |  401|  1.16k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.16k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.16k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.16k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.16k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.16k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.16k|     ERR_set_error)
  |  |  ------------------
  ------------------
  197|  1.16k|        return 0;
  198|  1.16k|    }
  199|  76.3k|    if (neg) {
  ------------------
  |  Branch (199:9): [True: 16.1k, False: 60.2k]
  ------------------
  200|  16.1k|        if (utmp > ABS_INT32_MIN) {
  ------------------
  |  |  169|  16.1k|#define ABS_INT32_MIN ((uint32_t)INT32_MAX + 1)
  ------------------
  |  Branch (200:13): [True: 2.65k, False: 13.4k]
  ------------------
  201|  2.65k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|  2.65k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.65k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.65k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  2.65k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  2.65k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.65k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.65k|     ERR_set_error)
  |  |  ------------------
  ------------------
  202|  2.65k|            return 0;
  203|  2.65k|        }
  204|  13.4k|        utmp = 0 - utmp;
  205|  60.2k|    } else {
  206|  60.2k|        if (((it->size & INTxx_FLAG_SIGNED) != 0 && utmp > INT32_MAX)
  ------------------
  |  |   27|  60.2k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (206:14): [True: 56.1k, False: 4.09k]
  |  Branch (206:53): [True: 2.15k, False: 53.9k]
  ------------------
  207|  60.2k|            || ((it->size & INTxx_FLAG_SIGNED) == 0 && utmp > UINT32_MAX)) {
  ------------------
  |  |   27|  58.0k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (207:17): [True: 4.09k, False: 53.9k]
  |  Branch (207:56): [True: 392, False: 3.70k]
  ------------------
  208|  2.54k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|  2.54k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.54k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.54k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  2.54k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  2.54k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.54k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.54k|     ERR_set_error)
  |  |  ------------------
  ------------------
  209|  2.54k|            return 0;
  210|  2.54k|        }
  211|  60.2k|    }
  212|       |
  213|  81.8k| long_compat:
  214|  81.8k|    utmp2 = (uint32_t)utmp;
  215|  81.8k|    memcpy(cp, &utmp2, sizeof(utmp2));
  216|  81.8k|    return 1;
  217|  76.3k|}
x_int64.c:uint64_new:
   30|  4.37k|{
   31|  4.37k|    if ((*pval = (ASN1_VALUE *)OPENSSL_zalloc(sizeof(uint64_t))) == NULL)
  ------------------
  |  |  104|  4.37k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.37k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.37k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (31:9): [True: 0, False: 4.37k]
  ------------------
   32|      0|        return 0;
   33|  4.37k|    return 1;
   34|  4.37k|}
x_int64.c:uint32_i2c:
  142|  49.7k|{
  143|  49.7k|    uint32_t utmp;
  144|  49.7k|    int neg = 0;
  145|       |    /* this exists to bypass broken gcc optimization */
  146|  49.7k|    char *cp = (char *)*pval;
  147|       |
  148|       |    /* use memcpy, because we may not be uint32_t aligned */
  149|  49.7k|    memcpy(&utmp, cp, sizeof(utmp));
  150|       |
  151|  49.7k|    if ((it->size & INTxx_FLAG_ZERO_DEFAULT) == INTxx_FLAG_ZERO_DEFAULT
  ------------------
  |  |   26|  49.7k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
                  if ((it->size & INTxx_FLAG_ZERO_DEFAULT) == INTxx_FLAG_ZERO_DEFAULT
  ------------------
  |  |   26|  99.5k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
  |  Branch (151:9): [True: 6.35k, False: 43.4k]
  ------------------
  152|  49.7k|        && utmp == 0)
  ------------------
  |  Branch (152:12): [True: 5.09k, False: 1.25k]
  ------------------
  153|  5.09k|        return -1;
  154|  44.6k|    if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED
  ------------------
  |  |   27|  44.6k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
                  if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED
  ------------------
  |  |   27|  89.3k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (154:9): [True: 40.3k, False: 4.32k]
  ------------------
  155|  44.6k|        && (int32_t)utmp < 0) {
  ------------------
  |  Branch (155:12): [True: 9.05k, False: 31.2k]
  ------------------
  156|       |        /* ossl_i2c_uint64_int() assumes positive values */
  157|  9.05k|        utmp = 0 - utmp;
  158|  9.05k|        neg = 1;
  159|  9.05k|    }
  160|       |
  161|  44.6k|    return ossl_i2c_uint64_int(cont, (uint64_t)utmp, neg);
  162|  49.7k|}
x_int64.c:uint32_print:
  221|  3.13k|{
  222|  3.13k|    if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED)
  ------------------
  |  |   27|  3.13k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
                  if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED)
  ------------------
  |  |   27|  3.13k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (222:9): [True: 2.93k, False: 204]
  ------------------
  223|  2.93k|        return BIO_printf(out, "%d\n", (int)**(int32_t **)pval);
  224|    204|    return BIO_printf(out, "%u\n", (unsigned int)**(uint32_t **)pval);
  225|  3.13k|}
x_int64.c:uint64_free:
   37|  51.0k|{
   38|  51.0k|    OPENSSL_free(*pval);
  ------------------
  |  |  115|  51.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  51.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  51.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|  51.0k|    *pval = NULL;
   40|  51.0k|}
x_int64.c:uint64_clear:
   43|  82.4k|{
   44|  82.4k|    **(uint64_t **)pval = 0;
   45|  82.4k|}
x_int64.c:uint64_c2i:
   73|  2.56k|{
   74|  2.56k|    uint64_t utmp = 0;
   75|  2.56k|    char *cp;
   76|  2.56k|    int neg = 0;
   77|       |
   78|  2.56k|    if (*pval == NULL && !uint64_new(pval, it))
  ------------------
  |  Branch (78:9): [True: 2.18k, False: 374]
  |  Branch (78:26): [True: 0, False: 2.18k]
  ------------------
   79|      0|        return 0;
   80|       |
   81|  2.56k|    cp = (char *)*pval;
   82|       |
   83|       |    /*
   84|       |     * Strictly speaking, zero length is malformed.  However, long_c2i
   85|       |     * (x_long.c) encodes 0 as a zero length INTEGER (wrongly, of course),
   86|       |     * so for the sake of backward compatibility, we still decode zero
   87|       |     * length INTEGERs as the number zero.
   88|       |     */
   89|  2.56k|    if (len == 0)
  ------------------
  |  Branch (89:9): [True: 5, False: 2.55k]
  ------------------
   90|      5|        goto long_compat;
   91|       |
   92|  2.55k|    if (!ossl_c2i_uint64_int(&utmp, &neg, &cont, len))
  ------------------
  |  Branch (92:9): [True: 545, False: 2.01k]
  ------------------
   93|    545|        return 0;
   94|  2.01k|    if ((it->size & INTxx_FLAG_SIGNED) == 0 && neg) {
  ------------------
  |  |   27|  2.01k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (94:9): [True: 943, False: 1.06k]
  |  Branch (94:48): [True: 347, False: 596]
  ------------------
   95|    347|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE);
  ------------------
  |  |  401|    347|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    347|    (ERR_new(),                                                 \
  |  |  |  |  404|    347|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    347|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    347|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    347|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    347|     ERR_set_error)
  |  |  ------------------
  ------------------
   96|    347|        return 0;
   97|    347|    }
   98|  1.66k|    if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED
  ------------------
  |  |   27|  1.66k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
                  if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED
  ------------------
  |  |   27|  3.33k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (98:9): [True: 1.06k, False: 596]
  ------------------
   99|  1.66k|            && !neg && utmp > INT64_MAX) {
  ------------------
  |  Branch (99:16): [True: 538, False: 531]
  |  Branch (99:24): [True: 123, False: 415]
  ------------------
  100|    123|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|    123|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    123|    (ERR_new(),                                                 \
  |  |  |  |  404|    123|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    123|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    123|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    123|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    123|     ERR_set_error)
  |  |  ------------------
  ------------------
  101|    123|        return 0;
  102|    123|    }
  103|  1.54k|    if (neg)
  ------------------
  |  Branch (103:9): [True: 531, False: 1.01k]
  ------------------
  104|       |        /* ossl_c2i_uint64_int() returns positive values */
  105|    531|        utmp = 0 - utmp;
  106|       |
  107|  1.54k| long_compat:
  108|  1.54k|    memcpy(cp, &utmp, sizeof(utmp));
  109|  1.54k|    return 1;
  110|  1.54k|}
x_int64.c:uint64_i2c:
   49|  10.3k|{
   50|  10.3k|    uint64_t utmp;
   51|  10.3k|    int neg = 0;
   52|       |    /* this exists to bypass broken gcc optimization */
   53|  10.3k|    char *cp = (char *)*pval;
   54|       |
   55|       |    /* use memcpy, because we may not be uint64_t aligned */
   56|  10.3k|    memcpy(&utmp, cp, sizeof(utmp));
   57|       |
   58|  10.3k|    if ((it->size & INTxx_FLAG_ZERO_DEFAULT) == INTxx_FLAG_ZERO_DEFAULT
  ------------------
  |  |   26|  10.3k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
                  if ((it->size & INTxx_FLAG_ZERO_DEFAULT) == INTxx_FLAG_ZERO_DEFAULT
  ------------------
  |  |   26|  20.7k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
  |  Branch (58:9): [True: 8.61k, False: 1.76k]
  ------------------
   59|  10.3k|        && utmp == 0)
  ------------------
  |  Branch (59:12): [True: 2.13k, False: 6.47k]
  ------------------
   60|  2.13k|        return -1;
   61|  8.24k|    if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED
  ------------------
  |  |   27|  8.24k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
                  if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED
  ------------------
  |  |   27|  16.4k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (61:9): [True: 6.21k, False: 2.02k]
  ------------------
   62|  8.24k|        && (int64_t)utmp < 0) {
  ------------------
  |  Branch (62:12): [True: 840, False: 5.37k]
  ------------------
   63|       |        /* ossl_i2c_uint64_int() assumes positive values */
   64|    840|        utmp = 0 - utmp;
   65|    840|        neg = 1;
   66|    840|    }
   67|       |
   68|  8.24k|    return ossl_i2c_uint64_int(cont, utmp, neg);
   69|  10.3k|}
x_int64.c:uint64_print:
  114|  1.17k|{
  115|  1.17k|    if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED)
  ------------------
  |  |   27|  1.17k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
                  if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED)
  ------------------
  |  |   27|  1.17k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (115:9): [True: 700, False: 476]
  ------------------
  116|    700|        return BIO_printf(out, "%jd\n", **(int64_t **)pval);
  117|    476|    return BIO_printf(out, "%ju\n", **(uint64_t **)pval);
  118|  1.17k|}

LONG_it:
   41|  12.7k|ASN1_ITEM_start(LONG)
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
   42|  12.7k|        ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &long_pf, ASN1_LONG_UNDEF, "LONG"
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                      ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &long_pf, ASN1_LONG_UNDEF, "LONG"
  ------------------
  |  |   64|  12.7k|# define V_ASN1_INTEGER                  2
  ------------------
                      ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &long_pf, ASN1_LONG_UNDEF, "LONG"
  ------------------
  |  |  211|  12.7k|# define ASN1_LONG_UNDEF 0x7fffffffL
  ------------------
   43|  12.7k|ASN1_ITEM_end(LONG)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
ZLONG_it:
   45|  12.7k|ASN1_ITEM_start(ZLONG)
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
   46|  12.7k|        ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &long_pf, 0, "ZLONG"
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                      ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &long_pf, 0, "ZLONG"
  ------------------
  |  |   64|  12.7k|# define V_ASN1_INTEGER                  2
  ------------------
   47|  12.7k|ASN1_ITEM_end(ZLONG)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
x_long.c:long_free:
   56|  25.5k|{
   57|  25.5k|    memcpy(pval, &it->size, COPY_SIZE(*pval, it->size));
  ------------------
  |  |   14|  25.5k|#define COPY_SIZE(a, b) (sizeof(a) < sizeof(b) ? sizeof(a) : sizeof(b))
  |  |  ------------------
  |  |  |  Branch (14:26): [Folded - Ignored]
  |  |  ------------------
  ------------------
   58|  25.5k|}
x_long.c:long_c2i:
  130|  1.09k|{
  131|  1.09k|    int i;
  132|  1.09k|    long ltmp;
  133|  1.09k|    unsigned long utmp = 0, sign = 0x100;
  134|       |
  135|  1.09k|    if (len > 1) {
  ------------------
  |  Branch (135:9): [True: 1.03k, False: 56]
  ------------------
  136|       |        /*
  137|       |         * Check possible pad byte.  Worst case, we're skipping past actual
  138|       |         * content, but since that's only with 0x00 and 0xff and we set neg
  139|       |         * accordingly, the result will be correct in the end anyway.
  140|       |         */
  141|  1.03k|        switch (cont[0]) {
  ------------------
  |  Branch (141:17): [True: 560, False: 478]
  ------------------
  142|    276|        case 0xff:
  ------------------
  |  Branch (142:9): [True: 276, False: 762]
  ------------------
  143|    276|            cont++;
  144|    276|            len--;
  145|    276|            sign = 0xff;
  146|    276|            break;
  147|    202|        case 0:
  ------------------
  |  Branch (147:9): [True: 202, False: 836]
  ------------------
  148|    202|            cont++;
  149|    202|            len--;
  150|    202|            sign = 0;
  151|    202|            break;
  152|  1.03k|        }
  153|  1.03k|    }
  154|  1.09k|    if (len > (int)sizeof(long)) {
  ------------------
  |  Branch (154:9): [True: 98, False: 996]
  ------------------
  155|     98|        ERR_raise(ERR_LIB_ASN1, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
  ------------------
  |  |  401|     98|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     98|    (ERR_new(),                                                 \
  |  |  |  |  404|     98|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     98|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     98|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     98|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     98|     ERR_set_error)
  |  |  ------------------
  ------------------
  156|     98|        return 0;
  157|     98|    }
  158|       |
  159|    996|    if (sign == 0x100) {
  ------------------
  |  Branch (159:9): [True: 536, False: 460]
  ------------------
  160|       |        /* Is it negative? */
  161|    536|        if (len && (cont[0] & 0x80))
  ------------------
  |  Branch (161:13): [True: 534, False: 2]
  |  Branch (161:20): [True: 248, False: 286]
  ------------------
  162|    248|            sign = 0xff;
  163|    288|        else
  164|    288|            sign = 0;
  165|    536|    } else if (((sign ^ cont[0]) & 0x80) == 0) { /* same sign bit? */
  ------------------
  |  Branch (165:16): [True: 174, False: 286]
  ------------------
  166|    174|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING);
  ------------------
  |  |  401|    174|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    174|    (ERR_new(),                                                 \
  |  |  |  |  404|    174|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    174|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    174|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    174|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    174|     ERR_set_error)
  |  |  ------------------
  ------------------
  167|    174|        return 0;
  168|    174|    }
  169|    822|    utmp = 0;
  170|  5.16k|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (170:17): [True: 4.33k, False: 822]
  ------------------
  171|  4.33k|        utmp <<= 8;
  172|  4.33k|        utmp |= cont[i] ^ sign;
  173|  4.33k|    }
  174|    822|    ltmp = (long)utmp;
  175|    822|    if (ltmp < 0) {
  ------------------
  |  Branch (175:9): [True: 188, False: 634]
  ------------------
  176|    188|        ERR_raise(ERR_LIB_ASN1, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
  ------------------
  |  |  401|    188|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    188|    (ERR_new(),                                                 \
  |  |  |  |  404|    188|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    188|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    188|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    188|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    188|     ERR_set_error)
  |  |  ------------------
  ------------------
  177|    188|        return 0;
  178|    188|    }
  179|    634|    if (sign)
  ------------------
  |  Branch (179:9): [True: 280, False: 354]
  ------------------
  180|    280|        ltmp = -ltmp - 1;
  181|    634|    if (ltmp == it->size) {
  ------------------
  |  Branch (181:9): [True: 4, False: 630]
  ------------------
  182|      4|        ERR_raise(ERR_LIB_ASN1, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
  ------------------
  |  |  401|      4|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      4|    (ERR_new(),                                                 \
  |  |  |  |  404|      4|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      4|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      4|     ERR_set_error)
  |  |  ------------------
  ------------------
  183|      4|        return 0;
  184|      4|    }
  185|    630|    memcpy(pval, &ltmp, COPY_SIZE(*pval, ltmp));
  ------------------
  |  |   14|    630|#define COPY_SIZE(a, b) (sizeof(a) < sizeof(b) ? sizeof(a) : sizeof(b))
  |  |  ------------------
  |  |  |  Branch (14:26): [Folded - Ignored]
  |  |  ------------------
  ------------------
  186|    630|    return 1;
  187|    634|}
x_long.c:long_i2c:
   87|  1.88k|{
   88|  1.88k|    long ltmp;
   89|  1.88k|    unsigned long utmp, sign;
   90|  1.88k|    int clen, pad, i;
   91|       |
   92|  1.88k|    memcpy(&ltmp, pval, COPY_SIZE(*pval, ltmp));
  ------------------
  |  |   14|  1.88k|#define COPY_SIZE(a, b) (sizeof(a) < sizeof(b) ? sizeof(a) : sizeof(b))
  |  |  ------------------
  |  |  |  Branch (14:26): [Folded - Ignored]
  |  |  ------------------
  ------------------
   93|  1.88k|    if (ltmp == it->size)
  ------------------
  |  Branch (93:9): [True: 0, False: 1.88k]
  ------------------
   94|      0|        return -1;
   95|       |    /*
   96|       |     * Convert the long to positive: we subtract one if negative so we can
   97|       |     * cleanly handle the padding if only the MSB of the leading octet is
   98|       |     * set.
   99|       |     */
  100|  1.88k|    if (ltmp < 0) {
  ------------------
  |  Branch (100:9): [True: 840, False: 1.04k]
  ------------------
  101|    840|        sign = 0xff;
  102|    840|        utmp = 0 - (unsigned long)ltmp - 1;
  103|  1.04k|    } else {
  104|  1.04k|        sign = 0;
  105|  1.04k|        utmp = ltmp;
  106|  1.04k|    }
  107|  1.88k|    clen = num_bits_ulong(utmp);
  108|       |    /* If MSB of leading octet set we need to pad */
  109|  1.88k|    if (!(clen & 0x7))
  ------------------
  |  Branch (109:9): [True: 300, False: 1.58k]
  ------------------
  110|    300|        pad = 1;
  111|  1.58k|    else
  112|  1.58k|        pad = 0;
  113|       |
  114|       |    /* Convert number of bits to number of octets */
  115|  1.88k|    clen = (clen + 7) >> 3;
  116|       |
  117|  1.88k|    if (cont != NULL) {
  ------------------
  |  Branch (117:9): [True: 627, False: 1.25k]
  ------------------
  118|    627|        if (pad)
  ------------------
  |  Branch (118:13): [True: 100, False: 527]
  ------------------
  119|    100|            *cont++ = (unsigned char)sign;
  120|  3.45k|        for (i = clen - 1; i >= 0; i--) {
  ------------------
  |  Branch (120:28): [True: 2.82k, False: 627]
  ------------------
  121|  2.82k|            cont[i] = (unsigned char)(utmp ^ sign);
  122|  2.82k|            utmp >>= 8;
  123|  2.82k|        }
  124|    627|    }
  125|  1.88k|    return clen + pad;
  126|  1.88k|}
x_long.c:num_bits_ulong:
   67|  1.88k|{
   68|  1.88k|    size_t i;
   69|  1.88k|    unsigned long ret = 0;
   70|       |
   71|       |    /*
   72|       |     * It is argued that *on average* constant counter loop performs
   73|       |     * not worse [if not better] than one with conditional break or
   74|       |     * mask-n-table-lookup-style, because of branch misprediction
   75|       |     * penalties.
   76|       |     */
   77|   122k|    for (i = 0; i < sizeof(value) * 8; i++) {
  ------------------
  |  Branch (77:17): [True: 120k, False: 1.88k]
  ------------------
   78|   120k|        ret += (value != 0);
   79|   120k|        value >>= 1;
   80|   120k|    }
   81|       |
   82|  1.88k|    return (int)ret;
   83|  1.88k|}
x_long.c:long_print:
  191|    627|{
  192|    627|    long l;
  193|       |
  194|    627|    memcpy(&l, pval, COPY_SIZE(*pval, l));
  ------------------
  |  |   14|    627|#define COPY_SIZE(a, b) (sizeof(a) < sizeof(b) ? sizeof(a) : sizeof(b))
  |  |  ------------------
  |  |  |  Branch (14:26): [Folded - Ignored]
  |  |  ------------------
  ------------------
  195|    627|    return BIO_printf(out, "%ld\n", l);
  196|    627|}

ossl_encode_der_length:
   40|  24.4k|{
   41|  24.4k|    if (cont_len > 0xffff)
  ------------------
  |  Branch (41:9): [True: 5, False: 24.4k]
  ------------------
   42|      5|        return 0; /* Too large for supported length encodings */
   43|       |
   44|  24.4k|    if (cont_len > 0xff) {
  ------------------
  |  Branch (44:9): [True: 75, False: 24.3k]
  ------------------
   45|     75|        if (!WPACKET_put_bytes_u8(pkt, 0x82)
  ------------------
  |  |  878|    150|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (45:13): [True: 0, False: 75]
  ------------------
   46|     75|                || !WPACKET_put_bytes_u16(pkt, cont_len))
  ------------------
  |  |  880|     75|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (46:20): [True: 0, False: 75]
  ------------------
   47|      0|            return 0;
   48|  24.3k|    } else {
   49|  24.3k|        if (cont_len > 0x7f
  ------------------
  |  Branch (49:13): [True: 89, False: 24.2k]
  ------------------
   50|  24.3k|                && !WPACKET_put_bytes_u8(pkt, 0x81))
  ------------------
  |  |  878|     89|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (50:20): [True: 0, False: 89]
  ------------------
   51|      0|            return 0;
   52|  24.3k|        if (!WPACKET_put_bytes_u8(pkt, cont_len))
  ------------------
  |  |  878|  24.3k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (52:13): [True: 0, False: 24.3k]
  ------------------
   53|      0|            return 0;
   54|  24.3k|    }
   55|       |
   56|  24.4k|    return 1;
   57|  24.4k|}
ossl_encode_der_integer:
   67|  16.3k|{
   68|  16.3k|    unsigned char *bnbytes;
   69|  16.3k|    size_t cont_len;
   70|       |
   71|  16.3k|    if (BN_is_negative(n))
  ------------------
  |  Branch (71:9): [True: 0, False: 16.3k]
  ------------------
   72|      0|        return 0;
   73|       |
   74|       |    /*
   75|       |     * Calculate the ASN.1 INTEGER DER content length for n.
   76|       |     * This is the number of whole bytes required to represent n (i.e. rounded
   77|       |     * down), plus one.
   78|       |     * If n is zero then the content is a single zero byte (length = 1).
   79|       |     * If the number of bits of n is a multiple of 8 then an extra zero padding
   80|       |     * byte is included to ensure that the value is still treated as positive
   81|       |     * in the INTEGER two's complement representation.
   82|       |     */
   83|  16.3k|    cont_len = BN_num_bits(n) / 8 + 1;
   84|       |
   85|  16.3k|    if (!WPACKET_start_sub_packet(pkt)
  ------------------
  |  Branch (85:9): [True: 0, False: 16.3k]
  ------------------
   86|  16.3k|            || !WPACKET_put_bytes_u8(pkt, ID_INTEGER)
  ------------------
  |  |  878|  32.6k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (86:16): [True: 0, False: 16.3k]
  ------------------
   87|  16.3k|            || !ossl_encode_der_length(pkt, cont_len)
  ------------------
  |  Branch (87:16): [True: 0, False: 16.3k]
  ------------------
   88|  16.3k|            || !WPACKET_allocate_bytes(pkt, cont_len, &bnbytes)
  ------------------
  |  Branch (88:16): [True: 0, False: 16.3k]
  ------------------
   89|  16.3k|            || !WPACKET_close(pkt))
  ------------------
  |  Branch (89:16): [True: 0, False: 16.3k]
  ------------------
   90|      0|        return 0;
   91|       |
   92|  16.3k|    if (bnbytes != NULL
  ------------------
  |  Branch (92:9): [True: 140, False: 16.1k]
  ------------------
   93|  16.3k|            && BN_bn2binpad(n, bnbytes, (int)cont_len) != (int)cont_len)
  ------------------
  |  Branch (93:16): [True: 0, False: 140]
  ------------------
   94|      0|        return 0;
   95|       |
   96|  16.3k|    return 1;
   97|  16.3k|}
ossl_encode_der_dsa_sig:
  107|  8.09k|{
  108|  8.09k|    WPACKET tmppkt, *dummypkt;
  109|  8.09k|    size_t cont_len;
  110|  8.09k|    int isnull = WPACKET_is_null_buf(pkt);
  111|       |
  112|  8.09k|    if (!WPACKET_start_sub_packet(pkt))
  ------------------
  |  Branch (112:9): [True: 0, False: 8.09k]
  ------------------
  113|      0|        return 0;
  114|       |
  115|  8.09k|    if (!isnull) {
  ------------------
  |  Branch (115:9): [True: 70, False: 8.02k]
  ------------------
  116|     70|        if (!WPACKET_init_null(&tmppkt, 0))
  ------------------
  |  Branch (116:13): [True: 0, False: 70]
  ------------------
  117|      0|            return 0;
  118|     70|        dummypkt = &tmppkt;
  119|  8.02k|    } else {
  120|       |        /* If the input packet has a NULL buffer, we don't need a dummy packet */
  121|  8.02k|        dummypkt = pkt;
  122|  8.02k|    }
  123|       |
  124|       |    /* Calculate the content length */
  125|  8.09k|    if (!ossl_encode_der_integer(dummypkt, r)
  ------------------
  |  Branch (125:9): [True: 0, False: 8.09k]
  ------------------
  126|  8.09k|            || !ossl_encode_der_integer(dummypkt, s)
  ------------------
  |  Branch (126:16): [True: 0, False: 8.09k]
  ------------------
  127|  8.09k|            || !WPACKET_get_length(dummypkt, &cont_len)
  ------------------
  |  Branch (127:16): [True: 0, False: 8.09k]
  ------------------
  128|  8.09k|            || (!isnull && !WPACKET_finish(dummypkt))) {
  ------------------
  |  Branch (128:17): [True: 70, False: 8.02k]
  |  Branch (128:28): [True: 0, False: 70]
  ------------------
  129|      0|        if (!isnull)
  ------------------
  |  Branch (129:13): [True: 0, False: 0]
  ------------------
  130|      0|            WPACKET_cleanup(dummypkt);
  131|      0|        return 0;
  132|      0|    }
  133|       |
  134|       |    /* Add the tag and length bytes */
  135|  8.09k|    if (!WPACKET_put_bytes_u8(pkt, ID_SEQUENCE)
  ------------------
  |  |  878|  16.1k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (135:9): [True: 0, False: 8.09k]
  ------------------
  136|  8.09k|            || !ossl_encode_der_length(pkt, cont_len)
  ------------------
  |  Branch (136:16): [True: 5, False: 8.08k]
  ------------------
  137|       |               /*
  138|       |                * Really encode the integers. We already wrote to the main pkt
  139|       |                * if it had a NULL buffer, so don't do it again
  140|       |                */
  141|  8.09k|            || (!isnull && !ossl_encode_der_integer(pkt, r))
  ------------------
  |  Branch (141:17): [True: 70, False: 8.01k]
  |  Branch (141:28): [True: 0, False: 70]
  ------------------
  142|  8.09k|            || (!isnull && !ossl_encode_der_integer(pkt, s))
  ------------------
  |  Branch (142:17): [True: 70, False: 8.01k]
  |  Branch (142:28): [True: 0, False: 70]
  ------------------
  143|  8.09k|            || !WPACKET_close(pkt))
  ------------------
  |  Branch (143:16): [True: 0, False: 8.08k]
  ------------------
  144|      5|        return 0;
  145|       |
  146|  8.08k|    return 1;
  147|  8.09k|}
ossl_decode_der_length:
  156|  24.9k|{
  157|  24.9k|    unsigned int byte;
  158|       |
  159|  24.9k|    if (!PACKET_get_1(pkt, &byte))
  ------------------
  |  Branch (159:9): [True: 8, False: 24.9k]
  ------------------
  160|      8|        return 0;
  161|       |
  162|  24.9k|    if (byte < 0x80)
  ------------------
  |  Branch (162:9): [True: 9.65k, False: 15.3k]
  ------------------
  163|  9.65k|        return PACKET_get_sub_packet(pkt, subpkt, (size_t)byte);
  164|  15.3k|    if (byte == 0x81)
  ------------------
  |  Branch (164:9): [True: 202, False: 15.1k]
  ------------------
  165|    202|        return PACKET_get_length_prefixed_1(pkt, subpkt);
  166|  15.1k|    if (byte == 0x82)
  ------------------
  |  Branch (166:9): [True: 990, False: 14.1k]
  ------------------
  167|    990|        return PACKET_get_length_prefixed_2(pkt, subpkt);
  168|       |
  169|       |    /* Too large, invalid, or not DER. */
  170|  14.1k|    return 0;
  171|  15.1k|}
ossl_decode_der_integer:
  188|  8.93k|{
  189|  8.93k|    PACKET contpkt, tmppkt;
  190|  8.93k|    unsigned int tag, tmp;
  191|       |
  192|       |    /* Check we have an integer and get the content bytes */
  193|  8.93k|    if (!PACKET_get_1(pkt, &tag)
  ------------------
  |  Branch (193:9): [True: 296, False: 8.63k]
  ------------------
  194|  8.93k|            || tag != ID_INTEGER
  ------------------
  |  |   30|  17.5k|#define ID_INTEGER 0x02
  ------------------
  |  Branch (194:16): [True: 4.10k, False: 4.53k]
  ------------------
  195|  8.93k|            || !ossl_decode_der_length(pkt, &contpkt))
  ------------------
  |  Branch (195:16): [True: 84, False: 4.44k]
  ------------------
  196|  4.48k|        return 0;
  197|       |
  198|       |    /* Peek ahead at the first bytes to check for proper encoding */
  199|  4.44k|    tmppkt = contpkt;
  200|       |    /* The INTEGER must be positive */
  201|  4.44k|    if (!PACKET_get_1(&tmppkt, &tmp)
  ------------------
  |  Branch (201:9): [True: 534, False: 3.91k]
  ------------------
  202|  4.44k|            || (tmp & 0x80) != 0)
  ------------------
  |  Branch (202:16): [True: 588, False: 3.32k]
  ------------------
  203|  1.12k|        return 0;
  204|       |    /* If there a zero padding byte the next byte must have the msb set */
  205|  3.32k|    if (PACKET_remaining(&tmppkt) > 0 && tmp == 0) {
  ------------------
  |  Branch (205:9): [True: 928, False: 2.39k]
  |  Branch (205:42): [True: 210, False: 718]
  ------------------
  206|    210|        if (!PACKET_get_1(&tmppkt, &tmp)
  ------------------
  |  Branch (206:13): [True: 0, False: 210]
  ------------------
  207|    210|                || (tmp & 0x80) == 0)
  ------------------
  |  Branch (207:20): [True: 20, False: 190]
  ------------------
  208|     20|            return 0;
  209|    210|    }
  210|       |
  211|  3.30k|    if (BN_bin2bn(PACKET_data(&contpkt),
  ------------------
  |  Branch (211:9): [True: 0, False: 3.30k]
  ------------------
  212|  3.30k|                  (int)PACKET_remaining(&contpkt), n) == NULL)
  213|      0|        return 0;
  214|       |
  215|  3.30k|    return 1;
  216|  3.30k|}
ossl_decode_der_dsa_sig:
  235|  25.5k|{
  236|  25.5k|    size_t consumed;
  237|  25.5k|    PACKET pkt, contpkt;
  238|  25.5k|    unsigned int tag;
  239|       |
  240|  25.5k|    if (!PACKET_buf_init(&pkt, *ppin, len)
  ------------------
  |  Branch (240:9): [True: 0, False: 25.5k]
  ------------------
  241|  25.5k|            || !PACKET_get_1(&pkt, &tag)
  ------------------
  |  Branch (241:16): [True: 0, False: 25.5k]
  ------------------
  242|  25.5k|            || tag != ID_SEQUENCE
  ------------------
  |  |   29|  51.0k|#define ID_SEQUENCE 0x30
  ------------------
  |  Branch (242:16): [True: 5.06k, False: 20.4k]
  ------------------
  243|  25.5k|            || !ossl_decode_der_length(&pkt, &contpkt)
  ------------------
  |  Branch (243:16): [True: 14.2k, False: 6.21k]
  ------------------
  244|  25.5k|            || !ossl_decode_der_integer(&contpkt, r)
  ------------------
  |  Branch (244:16): [True: 3.50k, False: 2.71k]
  ------------------
  245|  25.5k|            || !ossl_decode_der_integer(&contpkt, s)
  ------------------
  |  Branch (245:16): [True: 2.12k, False: 590]
  ------------------
  246|  25.5k|            || PACKET_remaining(&contpkt) != 0)
  ------------------
  |  Branch (246:16): [True: 520, False: 70]
  ------------------
  247|  25.4k|        return 0;
  248|       |
  249|     70|    consumed = PACKET_data(&pkt) - *ppin;
  250|     70|    *ppin += consumed;
  251|     70|    return consumed;
  252|  25.5k|}

ossl_err_load_ASYNC_strings:
   31|      2|{
   32|      2|#ifndef OPENSSL_NO_ERR
   33|      2|    if (ERR_reason_error_string(ASYNC_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (33:9): [True: 2, False: 0]
  ------------------
   34|      2|        ERR_load_strings_const(ASYNC_str_reasons);
   35|      2|#endif
   36|      2|    return 1;
   37|      2|}

BIO_f_prefix:
   41|  1.70M|{
   42|  1.70M|    return &prefix_meth;
   43|  1.70M|}
bf_prefix.c:prefix_write:
   83|  1.70M|{
   84|  1.70M|    PREFIX_CTX *ctx = BIO_get_data(b);
   85|       |
   86|  1.70M|    if (ctx == NULL)
  ------------------
  |  Branch (86:9): [True: 0, False: 1.70M]
  ------------------
   87|      0|        return 0;
   88|       |
   89|       |    /*
   90|       |     * If no prefix is set or if it's empty, and no indentation amount is set,
   91|       |     * we've got nothing to do here
   92|       |     */
   93|  1.70M|    if ((ctx->prefix == NULL || *ctx->prefix == '\0')
  ------------------
  |  Branch (93:10): [True: 0, False: 1.70M]
  |  Branch (93:33): [True: 0, False: 1.70M]
  ------------------
   94|  1.70M|        && ctx->indent == 0) {
  ------------------
  |  Branch (94:12): [True: 0, False: 0]
  ------------------
   95|       |        /*
   96|       |         * We do note if what comes next will be a new line, though, so we're
   97|       |         * prepared to handle prefix and indentation the next time around.
   98|       |         */
   99|      0|        if (outl > 0)
  ------------------
  |  Branch (99:13): [True: 0, False: 0]
  ------------------
  100|      0|            ctx->linestart = (out[outl-1] == '\n');
  101|      0|        return BIO_write_ex(BIO_next(b), out, outl, numwritten);
  102|      0|    }
  103|       |
  104|  1.70M|    *numwritten = 0;
  105|       |
  106|  3.41M|    while (outl > 0) {
  ------------------
  |  Branch (106:12): [True: 1.70M, False: 1.70M]
  ------------------
  107|  1.70M|        size_t i;
  108|  1.70M|        char c;
  109|       |
  110|       |        /*
  111|       |         * If we know that we're at the start of the line, output prefix and
  112|       |         * indentation.
  113|       |         */
  114|  1.70M|        if (ctx->linestart) {
  ------------------
  |  Branch (114:13): [True: 1.70M, False: 0]
  ------------------
  115|  1.70M|            size_t dontcare;
  116|       |
  117|  1.70M|            if (ctx->prefix != NULL
  ------------------
  |  Branch (117:17): [True: 1.70M, False: 0]
  ------------------
  118|  1.70M|                && !BIO_write_ex(BIO_next(b), ctx->prefix, strlen(ctx->prefix),
  ------------------
  |  Branch (118:20): [True: 0, False: 1.70M]
  ------------------
  119|  1.70M|                                 &dontcare))
  120|      0|                return 0;
  121|  1.70M|            BIO_printf(BIO_next(b), "%*s", ctx->indent, "");
  122|  1.70M|            ctx->linestart = 0;
  123|  1.70M|        }
  124|       |
  125|       |        /* Now, go look for the next LF, or the end of the string */
  126|  32.4M|        for (i = 0, c = '\0'; i < outl && (c = out[i]) != '\n'; i++)
  ------------------
  |  Branch (126:31): [True: 30.7M, False: 1.70M]
  |  Branch (126:43): [True: 30.7M, False: 0]
  ------------------
  127|  30.7M|            continue;
  128|  1.70M|        if (c == '\n')
  ------------------
  |  Branch (128:13): [True: 0, False: 1.70M]
  ------------------
  129|      0|            i++;
  130|       |
  131|       |        /* Output what we found so far */
  132|  3.41M|        while (i > 0) {
  ------------------
  |  Branch (132:16): [True: 1.70M, False: 1.70M]
  ------------------
  133|  1.70M|            size_t num = 0;
  134|       |
  135|  1.70M|            if (!BIO_write_ex(BIO_next(b), out, i, &num))
  ------------------
  |  Branch (135:17): [True: 0, False: 1.70M]
  ------------------
  136|      0|                return 0;
  137|  1.70M|            out += num;
  138|  1.70M|            outl -= num;
  139|  1.70M|            *numwritten += num;
  140|  1.70M|            i -= num;
  141|  1.70M|        }
  142|       |
  143|       |        /* If we found a LF, what follows is a new line, so take note */
  144|  1.70M|        if (c == '\n')
  ------------------
  |  Branch (144:13): [True: 0, False: 1.70M]
  ------------------
  145|      0|            ctx->linestart = 1;
  146|  1.70M|    }
  147|       |
  148|  1.70M|    return 1;
  149|  1.70M|}
bf_prefix.c:prefix_ctrl:
  152|  10.2M|{
  153|  10.2M|    long ret = 0;
  154|  10.2M|    PREFIX_CTX *ctx;
  155|       |
  156|  10.2M|    if (b == NULL || (ctx = BIO_get_data(b)) == NULL)
  ------------------
  |  Branch (156:9): [True: 0, False: 10.2M]
  |  Branch (156:22): [True: 0, False: 10.2M]
  ------------------
  157|      0|        return -1;
  158|       |
  159|  10.2M|    switch (cmd) {
  160|  1.70M|    case BIO_CTRL_SET_PREFIX:
  ------------------
  |  |  175|  1.70M|# define BIO_CTRL_SET_PREFIX                    79
  ------------------
  |  Branch (160:5): [True: 1.70M, False: 8.54M]
  ------------------
  161|  1.70M|        OPENSSL_free(ctx->prefix);
  ------------------
  |  |  115|  1.70M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.70M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.70M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  162|  1.70M|        if (ptr == NULL) {
  ------------------
  |  Branch (162:13): [True: 0, False: 1.70M]
  ------------------
  163|      0|            ctx->prefix = NULL;
  164|      0|            ret = 1;
  165|  1.70M|        } else {
  166|  1.70M|            ctx->prefix = OPENSSL_strdup((const char *)ptr);
  ------------------
  |  |  119|  1.70M|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.70M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.70M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  167|  1.70M|            ret = ctx->prefix != NULL;
  168|  1.70M|        }
  169|  1.70M|        break;
  170|  3.41M|    case BIO_CTRL_SET_INDENT:
  ------------------
  |  |  176|  3.41M|# define BIO_CTRL_SET_INDENT                    80
  ------------------
  |  Branch (170:5): [True: 3.41M, False: 6.83M]
  ------------------
  171|  3.41M|        if (num >= 0) {
  ------------------
  |  Branch (171:13): [True: 3.41M, False: 0]
  ------------------
  172|  3.41M|            ctx->indent = (unsigned int)num;
  173|  3.41M|            ret = 1;
  174|  3.41M|        }
  175|  3.41M|        break;
  176|  1.70M|    case BIO_CTRL_GET_INDENT:
  ------------------
  |  |  177|  1.70M|# define BIO_CTRL_GET_INDENT                    81
  ------------------
  |  Branch (176:5): [True: 1.70M, False: 8.54M]
  ------------------
  177|  1.70M|        ret = (long)ctx->indent;
  178|  1.70M|        break;
  179|  3.41M|    default:
  ------------------
  |  Branch (179:5): [True: 3.41M, False: 6.83M]
  ------------------
  180|       |        /* Commands that we intercept before passing them along */
  181|  3.41M|        switch (cmd) {
  ------------------
  |  Branch (181:17): [True: 3.41M, False: 0]
  ------------------
  182|      0|        case BIO_C_FILE_SEEK:
  ------------------
  |  |  459|      0|# define BIO_C_FILE_SEEK                         128
  ------------------
  |  Branch (182:9): [True: 0, False: 3.41M]
  ------------------
  183|      0|        case BIO_CTRL_RESET:
  ------------------
  |  |   88|      0|# define BIO_CTRL_RESET          1/* opt - rewind/zero etc */
  ------------------
  |  Branch (183:9): [True: 0, False: 3.41M]
  ------------------
  184|      0|            ctx->linestart = 1;
  185|      0|            break;
  186|  3.41M|        }
  187|  3.41M|        if (BIO_next(b) != NULL)
  ------------------
  |  Branch (187:13): [True: 3.41M, False: 0]
  ------------------
  188|  3.41M|            ret = BIO_ctrl(BIO_next(b), cmd, num, ptr);
  189|  3.41M|        break;
  190|  10.2M|    }
  191|  10.2M|    return ret;
  192|  10.2M|}
bf_prefix.c:prefix_create:
   53|  1.70M|{
   54|  1.70M|    PREFIX_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|  1.70M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.70M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.70M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   55|       |
   56|  1.70M|    if (ctx == NULL)
  ------------------
  |  Branch (56:9): [True: 0, False: 1.70M]
  ------------------
   57|      0|        return 0;
   58|       |
   59|  1.70M|    ctx->prefix = NULL;
   60|  1.70M|    ctx->indent = 0;
   61|  1.70M|    ctx->linestart = 1;
   62|  1.70M|    BIO_set_data(b, ctx);
   63|  1.70M|    BIO_set_init(b, 1);
   64|  1.70M|    return 1;
   65|  1.70M|}
bf_prefix.c:prefix_destroy:
   68|  1.70M|{
   69|  1.70M|    PREFIX_CTX *ctx = BIO_get_data(b);
   70|       |
   71|  1.70M|    OPENSSL_free(ctx->prefix);
  ------------------
  |  |  115|  1.70M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.70M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.70M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   72|  1.70M|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  1.70M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.70M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.70M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|  1.70M|    return 1;
   74|  1.70M|}

BIO_dump_cb:
   24|     89|{
   25|     89|    return BIO_dump_indent_cb(cb, u, s, len, 0);
   26|     89|}
BIO_dump_indent_cb:
   30|  9.08k|{
   31|  9.08k|    const unsigned char *s = v;
   32|  9.08k|    int res, ret = 0;
   33|  9.08k|    char buf[288 + 1];
   34|  9.08k|    int i, j, rows, n;
   35|  9.08k|    unsigned char ch;
   36|  9.08k|    int dump_width;
   37|       |
   38|  9.08k|    if (indent < 0)
  ------------------
  |  Branch (38:9): [True: 0, False: 9.08k]
  ------------------
   39|      0|        indent = 0;
   40|  9.08k|    else if (indent > 64)
  ------------------
  |  Branch (40:14): [True: 21, False: 9.06k]
  ------------------
   41|     21|        indent = 64;
   42|       |
   43|  9.08k|    dump_width = DUMP_WIDTH_LESS_INDENT(indent);
  ------------------
  |  |   18|  9.08k|#define DUMP_WIDTH_LESS_INDENT(i) (DUMP_WIDTH - ((i - (i > 6 ? 6 : i) + 3) / 4))
  |  |  ------------------
  |  |  |  |   17|  9.08k|#define DUMP_WIDTH      16
  |  |  ------------------
  |  |  |  Branch (18:56): [True: 7.58k, False: 1.49k]
  |  |  ------------------
  ------------------
   44|  9.08k|    rows = len / dump_width;
   45|  9.08k|    if ((rows * dump_width) < len)
  ------------------
  |  Branch (45:9): [True: 7.48k, False: 1.59k]
  ------------------
   46|  7.48k|        rows++;
   47|   101k|    for (i = 0; i < rows; i++) {
  ------------------
  |  Branch (47:17): [True: 92.4k, False: 9.08k]
  ------------------
   48|  92.4k|        n = BIO_snprintf(buf, sizeof(buf), "%*s%04x - ", indent, "",
   49|  92.4k|                         i * dump_width);
   50|  92.4k|        if (n < 0)
  ------------------
  |  Branch (50:13): [True: 0, False: 92.4k]
  ------------------
   51|      0|            return -1;
   52|  1.54M|        for (j = 0; j < dump_width; j++) {
  ------------------
  |  Branch (52:21): [True: 1.45M, False: 92.4k]
  ------------------
   53|  1.45M|            if (SPACE(buf, n, 3)) {
  ------------------
  |  |   20|  1.45M|#define SPACE(buf, pos, n)   (sizeof(buf) - (pos) > (n))
  |  |  ------------------
  |  |  |  Branch (20:30): [True: 1.45M, False: 0]
  |  |  ------------------
  ------------------
   54|  1.45M|                if (((i * dump_width) + j) >= len) {
  ------------------
  |  Branch (54:21): [True: 72.1k, False: 1.38M]
  ------------------
   55|  72.1k|                    strcpy(buf + n, "   ");
   56|  1.38M|                } else {
   57|  1.38M|                    ch = *(s + i * dump_width + j) & 0xff;
   58|  1.38M|                    BIO_snprintf(buf + n, 4, "%02x%c", ch,
   59|  1.38M|                                 j == 7 ? '-' : ' ');
  ------------------
  |  Branch (59:34): [True: 86.7k, False: 1.29M]
  ------------------
   60|  1.38M|                }
   61|  1.45M|                n += 3;
   62|  1.45M|            }
   63|  1.45M|        }
   64|  92.4k|        if (SPACE(buf, n, 2)) {
  ------------------
  |  |   20|  92.4k|#define SPACE(buf, pos, n)   (sizeof(buf) - (pos) > (n))
  |  |  ------------------
  |  |  |  Branch (20:30): [True: 92.4k, False: 0]
  |  |  ------------------
  ------------------
   65|  92.4k|            strcpy(buf + n, "  ");
   66|  92.4k|            n += 2;
   67|  92.4k|        }
   68|  1.47M|        for (j = 0; j < dump_width; j++) {
  ------------------
  |  Branch (68:21): [True: 1.39M, False: 85.0k]
  ------------------
   69|  1.39M|            if (((i * dump_width) + j) >= len)
  ------------------
  |  Branch (69:17): [True: 7.48k, False: 1.38M]
  ------------------
   70|  7.48k|                break;
   71|  1.38M|            if (SPACE(buf, n, 1)) {
  ------------------
  |  |   20|  1.38M|#define SPACE(buf, pos, n)   (sizeof(buf) - (pos) > (n))
  |  |  ------------------
  |  |  |  Branch (20:30): [True: 1.38M, False: 0]
  |  |  ------------------
  ------------------
   72|  1.38M|                ch = *(s + i * dump_width + j) & 0xff;
   73|  1.38M|#ifndef CHARSET_EBCDIC
   74|  1.38M|                buf[n++] = ((ch >= ' ') && (ch <= '~')) ? ch : '.';
  ------------------
  |  Branch (74:29): [True: 1.01M, False: 366k]
  |  Branch (74:44): [True: 116k, False: 901k]
  ------------------
   75|       |#else
   76|       |                buf[n++] = ((ch >= os_toascii[' ']) && (ch <= os_toascii['~']))
   77|       |                           ? os_toebcdic[ch]
   78|       |                           : '.';
   79|       |#endif
   80|  1.38M|                buf[n] = '\0';
   81|  1.38M|            }
   82|  1.38M|        }
   83|  92.4k|        if (SPACE(buf, n, 1)) {
  ------------------
  |  |   20|  92.4k|#define SPACE(buf, pos, n)   (sizeof(buf) - (pos) > (n))
  |  |  ------------------
  |  |  |  Branch (20:30): [True: 92.4k, False: 0]
  |  |  ------------------
  ------------------
   84|  92.4k|            buf[n++] = '\n';
   85|  92.4k|            buf[n] = '\0';
   86|  92.4k|        }
   87|       |        /*
   88|       |         * if this is the last call then update the ddt_dump thing so that we
   89|       |         * will move the selection point in the debug window
   90|       |         */
   91|  92.4k|        res = cb((void *)buf, n, u);
   92|  92.4k|        if (res < 0)
  ------------------
  |  Branch (92:13): [True: 0, False: 92.4k]
  ------------------
   93|      0|            return res;
   94|  92.4k|        ret += res;
   95|  92.4k|    }
   96|  9.08k|    return ret;
   97|  9.08k|}
BIO_dump:
  122|     89|{
  123|     89|    return BIO_dump_cb(write_bio, bp, s, len);
  124|     89|}
BIO_dump_indent:
  127|  8.99k|{
  128|  8.99k|    return BIO_dump_indent_cb(write_bio, bp, s, len, indent);
  129|  8.99k|}
bio_dump.c:write_bio:
  117|  92.4k|{
  118|  92.4k|    return BIO_write((BIO *)bp, (const char *)data, len);
  119|  92.4k|}

ossl_err_load_BIO_strings:
   93|      2|{
   94|      2|#ifndef OPENSSL_NO_ERR
   95|      2|    if (ERR_reason_error_string(BIO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (95:9): [True: 2, False: 0]
  ------------------
   96|      2|        ERR_load_strings_const(BIO_str_reasons);
   97|      2|#endif
   98|      2|    return 1;
   99|      2|}

BIO_new_ex:
   82|  2.29M|{
   83|  2.29M|    BIO *bio = OPENSSL_zalloc(sizeof(*bio));
  ------------------
  |  |  104|  2.29M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.29M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.29M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   84|       |
   85|  2.29M|    if (bio == NULL)
  ------------------
  |  Branch (85:9): [True: 0, False: 2.29M]
  ------------------
   86|      0|        return NULL;
   87|       |
   88|  2.29M|    bio->libctx = libctx;
   89|  2.29M|    bio->method = method;
   90|  2.29M|    bio->shutdown = 1;
   91|       |
   92|  2.29M|    if (!CRYPTO_NEW_REF(&bio->references, 1))
  ------------------
  |  Branch (92:9): [True: 0, False: 2.29M]
  ------------------
   93|      0|        goto err;
   94|       |
   95|  2.29M|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data))
  ------------------
  |  |  241|  2.29M|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  |  Branch (95:9): [True: 0, False: 2.29M]
  ------------------
   96|      0|        goto err;
   97|       |
   98|  2.29M|    if (method->create != NULL && !method->create(bio)) {
  ------------------
  |  Branch (98:9): [True: 2.24M, False: 53.8k]
  |  Branch (98:35): [True: 0, False: 2.24M]
  ------------------
   99|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  100|      0|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data);
  ------------------
  |  |  241|      0|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  101|      0|        goto err;
  102|      0|    }
  103|  2.29M|    if (method->create == NULL)
  ------------------
  |  Branch (103:9): [True: 53.8k, False: 2.24M]
  ------------------
  104|  53.8k|        bio->init = 1;
  105|       |
  106|  2.29M|    return bio;
  107|       |
  108|      0|err:
  109|      0|    CRYPTO_FREE_REF(&bio->references);
  110|      0|    OPENSSL_free(bio);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  111|      0|    return NULL;
  112|  2.29M|}
BIO_new:
  115|  2.29M|{
  116|  2.29M|    return BIO_new_ex(NULL, method);
  117|  2.29M|}
BIO_free:
  120|  2.41M|{
  121|  2.41M|    int ret;
  122|       |
  123|  2.41M|    if (a == NULL)
  ------------------
  |  Branch (123:9): [True: 52.0k, False: 2.36M]
  ------------------
  124|  52.0k|        return 0;
  125|       |
  126|  2.36M|    if (CRYPTO_DOWN_REF(&a->references, &ret) <= 0)
  ------------------
  |  Branch (126:9): [True: 0, False: 2.36M]
  ------------------
  127|      0|        return 0;
  128|       |
  129|  2.36M|    REF_PRINT_COUNT("BIO", ret, a);
  ------------------
  |  |  301|  2.36M|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  2.36M|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  2.36M|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  2.36M|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  130|  2.36M|    if (ret > 0)
  ------------------
  |  Branch (130:9): [True: 66.3k, False: 2.29M]
  ------------------
  131|  66.3k|        return 1;
  132|  2.29M|    REF_ASSERT_ISNT(ret < 0);
  ------------------
  |  |  293|  2.29M|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 2.29M]
  |  |  ------------------
  ------------------
  133|       |
  134|  2.29M|    if (HAS_CALLBACK(a)) {
  ------------------
  |  |   26|  2.29M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 2.29M]
  |  |  |  Branch (26:52): [True: 0, False: 2.29M]
  |  |  ------------------
  ------------------
  135|      0|        ret = (int)bio_call_callback(a, BIO_CB_FREE, NULL, 0, 0, 0L, 1L, NULL);
  ------------------
  |  |  289|      0|# define BIO_CB_FREE        0x01
  ------------------
  136|      0|        if (ret <= 0)
  ------------------
  |  Branch (136:13): [True: 0, False: 0]
  ------------------
  137|      0|            return 0;
  138|      0|    }
  139|       |
  140|  2.29M|    if ((a->method != NULL) && (a->method->destroy != NULL))
  ------------------
  |  Branch (140:9): [True: 2.29M, False: 0]
  |  Branch (140:32): [True: 2.24M, False: 53.8k]
  ------------------
  141|  2.24M|        a->method->destroy(a);
  142|       |
  143|  2.29M|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
  ------------------
  |  |  241|  2.29M|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  144|       |
  145|  2.29M|    CRYPTO_FREE_REF(&a->references);
  146|       |
  147|  2.29M|    OPENSSL_free(a);
  ------------------
  |  |  115|  2.29M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.29M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.29M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  148|       |
  149|  2.29M|    return 1;
  150|  2.29M|}
BIO_set_data:
  153|  2.17M|{
  154|  2.17M|    a->ptr = ptr;
  155|  2.17M|}
BIO_get_data:
  158|   208M|{
  159|   208M|    return a->ptr;
  160|   208M|}
BIO_set_init:
  163|  2.64M|{
  164|  2.64M|    a->init = init;
  165|  2.64M|}
BIO_up_ref:
  188|  66.3k|{
  189|  66.3k|    int i;
  190|       |
  191|  66.3k|    if (CRYPTO_UP_REF(&a->references, &i) <= 0)
  ------------------
  |  Branch (191:9): [True: 0, False: 66.3k]
  ------------------
  192|      0|        return 0;
  193|       |
  194|  66.3k|    REF_PRINT_COUNT("BIO", i, a);
  ------------------
  |  |  301|  66.3k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  66.3k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  66.3k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  66.3k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|  66.3k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|  66.3k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 66.3k]
  |  |  ------------------
  ------------------
  196|  66.3k|    return i > 1;
  197|  66.3k|}
BIO_clear_flags:
  200|   193M|{
  201|   193M|    b->flags &= ~flags;
  202|   193M|}
BIO_read:
  304|   193M|{
  305|   193M|    size_t readbytes;
  306|   193M|    int ret;
  307|       |
  308|   193M|    if (dlen < 0)
  ------------------
  |  Branch (308:9): [True: 0, False: 193M]
  ------------------
  309|      0|        return 0;
  310|       |
  311|   193M|    ret = bio_read_intern(b, data, (size_t)dlen, &readbytes);
  312|       |
  313|   193M|    if (ret > 0) {
  ------------------
  |  Branch (313:9): [True: 192M, False: 582k]
  ------------------
  314|       |        /* *readbytes should always be <= dlen */
  315|   192M|        ret = (int)readbytes;
  316|   192M|    }
  317|       |
  318|   193M|    return ret;
  319|   193M|}
BIO_read_ex:
  322|   193M|{
  323|   193M|    return bio_read_intern(b, data, dlen, readbytes) > 0;
  324|   193M|}
BIO_write:
  371|  13.1M|{
  372|  13.1M|    size_t written;
  373|  13.1M|    int ret;
  374|       |
  375|  13.1M|    if (dlen <= 0)
  ------------------
  |  Branch (375:9): [True: 79.2k, False: 13.0M]
  ------------------
  376|  79.2k|        return 0;
  377|       |
  378|  13.0M|    ret = bio_write_intern(b, data, (size_t)dlen, &written);
  379|       |
  380|  13.0M|    if (ret > 0) {
  ------------------
  |  Branch (380:9): [True: 13.0M, False: 0]
  ------------------
  381|       |        /* written should always be <= dlen */
  382|  13.0M|        ret = (int)written;
  383|  13.0M|    }
  384|       |
  385|  13.0M|    return ret;
  386|  13.1M|}
BIO_write_ex:
  389|  4.04M|{
  390|  4.04M|    return bio_write_intern(b, data, dlen, written) > 0
  ------------------
  |  Branch (390:12): [True: 4.04M, False: 0]
  ------------------
  391|  4.04M|        || (b != NULL && dlen == 0); /* order is important for *written */
  ------------------
  |  Branch (391:13): [True: 0, False: 0]
  |  Branch (391:26): [True: 0, False: 0]
  ------------------
  392|  4.04M|}
BIO_puts:
  499|  1.17M|{
  500|  1.17M|    int ret;
  501|  1.17M|    size_t written = 0;
  502|       |
  503|  1.17M|    if (b == NULL) {
  ------------------
  |  Branch (503:9): [True: 0, False: 1.17M]
  ------------------
  504|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  505|      0|        return -1;
  506|      0|    }
  507|  1.17M|    if (b->method == NULL || b->method->bputs == NULL) {
  ------------------
  |  Branch (507:9): [True: 0, False: 1.17M]
  |  Branch (507:30): [True: 0, False: 1.17M]
  ------------------
  508|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  509|      0|        return -2;
  510|      0|    }
  511|       |
  512|  1.17M|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|  1.17M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 1.17M]
  |  |  |  Branch (26:52): [True: 0, False: 1.17M]
  |  |  ------------------
  ------------------
  513|      0|        ret = (int)bio_call_callback(b, BIO_CB_PUTS, buf, 0, 0, 0L, 1L, NULL);
  ------------------
  |  |  292|      0|# define BIO_CB_PUTS        0x04
  ------------------
  514|      0|        if (ret <= 0)
  ------------------
  |  Branch (514:13): [True: 0, False: 0]
  ------------------
  515|      0|            return ret;
  516|      0|    }
  517|       |
  518|  1.17M|    if (!b->init) {
  ------------------
  |  Branch (518:9): [True: 0, False: 1.17M]
  ------------------
  519|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  520|      0|        return -1;
  521|      0|    }
  522|       |
  523|  1.17M|    ret = b->method->bputs(b, buf);
  524|       |
  525|  1.17M|    if (ret > 0) {
  ------------------
  |  Branch (525:9): [True: 1.17M, False: 194]
  ------------------
  526|  1.17M|        b->num_write += (uint64_t)ret;
  527|  1.17M|        written = ret;
  528|  1.17M|        ret = 1;
  529|  1.17M|    }
  530|       |
  531|  1.17M|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  1.17M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 1.17M]
  |  |  |  Branch (26:52): [True: 0, False: 1.17M]
  |  |  ------------------
  ------------------
  532|      0|        ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
  ------------------
  |  |  292|      0|# define BIO_CB_PUTS        0x04
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
  ------------------
  |  |  302|      0|# define BIO_CB_RETURN   0x80
  ------------------
  533|      0|                                     0L, ret, &written);
  534|       |
  535|  1.17M|    if (ret > 0) {
  ------------------
  |  Branch (535:9): [True: 1.17M, False: 194]
  ------------------
  536|  1.17M|        if (written > INT_MAX) {
  ------------------
  |  Branch (536:13): [True: 0, False: 1.17M]
  ------------------
  537|      0|            ERR_raise(ERR_LIB_BIO, BIO_R_LENGTH_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  538|      0|            ret = -1;
  539|  1.17M|        } else {
  540|  1.17M|            ret = (int)written;
  541|  1.17M|        }
  542|  1.17M|    }
  543|       |
  544|  1.17M|    return ret;
  545|  1.17M|}
BIO_indent:
  631|   170k|{
  632|   170k|    if (indent < 0)
  ------------------
  |  Branch (632:9): [True: 0, False: 170k]
  ------------------
  633|      0|        indent = 0;
  634|   170k|    if (indent > max)
  ------------------
  |  Branch (634:9): [True: 0, False: 170k]
  ------------------
  635|      0|        indent = max;
  636|   396k|    while (indent--)
  ------------------
  |  Branch (636:12): [True: 226k, False: 170k]
  ------------------
  637|   226k|        if (BIO_puts(b, " ") != 1)
  ------------------
  |  Branch (637:13): [True: 0, False: 226k]
  ------------------
  638|      0|            return 0;
  639|   170k|    return 1;
  640|   170k|}
BIO_ctrl:
  661|  16.4M|{
  662|  16.4M|    long ret;
  663|       |
  664|  16.4M|    if (b == NULL)
  ------------------
  |  Branch (664:9): [True: 0, False: 16.4M]
  ------------------
  665|      0|        return -1;
  666|  16.4M|    if (b->method == NULL || b->method->ctrl == NULL) {
  ------------------
  |  Branch (666:9): [True: 0, False: 16.4M]
  |  Branch (666:30): [True: 0, False: 16.4M]
  ------------------
  667|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  668|      0|        return -2;
  669|      0|    }
  670|       |
  671|  16.4M|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|  16.4M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 16.4M]
  |  |  |  Branch (26:52): [True: 0, False: 16.4M]
  |  |  ------------------
  ------------------
  672|      0|        ret = bio_call_callback(b, BIO_CB_CTRL, parg, 0, cmd, larg, 1L, NULL);
  ------------------
  |  |  294|      0|# define BIO_CB_CTRL        0x06
  ------------------
  673|      0|        if (ret <= 0)
  ------------------
  |  Branch (673:13): [True: 0, False: 0]
  ------------------
  674|      0|            return ret;
  675|      0|    }
  676|       |
  677|  16.4M|    ret = b->method->ctrl(b, cmd, larg, parg);
  678|       |
  679|  16.4M|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  16.4M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 16.4M]
  |  |  |  Branch (26:52): [True: 0, False: 16.4M]
  |  |  ------------------
  ------------------
  680|      0|        ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  294|      0|# define BIO_CB_CTRL        0x06
  ------------------
                      ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  302|      0|# define BIO_CB_RETURN   0x80
  ------------------
  681|      0|                                larg, ret, NULL);
  682|       |
  683|  16.4M|    return ret;
  684|  16.4M|}
BIO_push:
  747|  1.70M|{
  748|  1.70M|    BIO *lb;
  749|       |
  750|  1.70M|    if (b == NULL)
  ------------------
  |  Branch (750:9): [True: 0, False: 1.70M]
  ------------------
  751|      0|        return bio;
  752|  1.70M|    lb = b;
  753|  1.70M|    while (lb->next_bio != NULL)
  ------------------
  |  Branch (753:12): [True: 0, False: 1.70M]
  ------------------
  754|      0|        lb = lb->next_bio;
  755|  1.70M|    lb->next_bio = bio;
  756|  1.70M|    if (bio != NULL)
  ------------------
  |  Branch (756:9): [True: 1.70M, False: 0]
  ------------------
  757|  1.70M|        bio->prev_bio = lb;
  758|       |    /* called to do internal processing */
  759|  1.70M|    BIO_ctrl(b, BIO_CTRL_PUSH, 0, lb);
  ------------------
  |  |   93|  1.70M|# define BIO_CTRL_PUSH           6/* opt - internal, used to signify change */
  ------------------
  760|  1.70M|    return b;
  761|  1.70M|}
BIO_pop:
  765|  1.70M|{
  766|  1.70M|    BIO *ret;
  767|       |
  768|  1.70M|    if (b == NULL)
  ------------------
  |  Branch (768:9): [True: 0, False: 1.70M]
  ------------------
  769|      0|        return NULL;
  770|  1.70M|    ret = b->next_bio;
  771|       |
  772|  1.70M|    BIO_ctrl(b, BIO_CTRL_POP, 0, b);
  ------------------
  |  |   94|  1.70M|# define BIO_CTRL_POP            7/* opt - internal, used to signify change */
  ------------------
  773|       |
  774|  1.70M|    if (b->prev_bio != NULL)
  ------------------
  |  Branch (774:9): [True: 0, False: 1.70M]
  ------------------
  775|      0|        b->prev_bio->next_bio = b->next_bio;
  776|  1.70M|    if (b->next_bio != NULL)
  ------------------
  |  Branch (776:9): [True: 1.70M, False: 0]
  ------------------
  777|  1.70M|        b->next_bio->prev_bio = b->prev_bio;
  778|       |
  779|  1.70M|    b->next_bio = NULL;
  780|  1.70M|    b->prev_bio = NULL;
  781|  1.70M|    return ret;
  782|  1.70M|}
BIO_next:
  838|  11.9M|{
  839|  11.9M|    if (b == NULL)
  ------------------
  |  Branch (839:9): [True: 0, False: 11.9M]
  ------------------
  840|      0|        return NULL;
  841|  11.9M|    return b->next_bio;
  842|  11.9M|}
bio_cleanup:
  947|      2|{
  948|      2|#ifndef OPENSSL_NO_SOCK
  949|      2|    bio_sock_cleanup_int();
  950|      2|    CRYPTO_THREAD_lock_free(bio_lookup_lock);
  951|      2|    bio_lookup_lock = NULL;
  952|      2|#endif
  953|      2|    CRYPTO_FREE_REF(&bio_type_count);
  954|      2|}
bio_lib.c:bio_read_intern:
  263|   386M|{
  264|   386M|    int ret;
  265|       |
  266|   386M|    if (b == NULL) {
  ------------------
  |  Branch (266:9): [True: 0, False: 386M]
  ------------------
  267|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  268|      0|        return -1;
  269|      0|    }
  270|   386M|    if (b->method == NULL || b->method->bread == NULL) {
  ------------------
  |  Branch (270:9): [True: 0, False: 386M]
  |  Branch (270:30): [True: 0, False: 386M]
  ------------------
  271|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        return -2;
  273|      0|    }
  274|       |
  275|   386M|    if (HAS_CALLBACK(b) &&
  ------------------
  |  |   26|   773M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 386M]
  |  |  |  Branch (26:52): [True: 0, False: 386M]
  |  |  ------------------
  ------------------
  276|   386M|        ((ret = (int)bio_call_callback(b, BIO_CB_READ, data, dlen, 0, 0L, 1L,
  ------------------
  |  |  290|      0|# define BIO_CB_READ        0x02
  ------------------
  |  Branch (276:9): [True: 0, False: 0]
  ------------------
  277|      0|                                       NULL)) <= 0))
  278|      0|        return ret;
  279|       |
  280|   386M|    if (!b->init) {
  ------------------
  |  Branch (280:9): [True: 0, False: 386M]
  ------------------
  281|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  282|      0|        return -1;
  283|      0|    }
  284|       |
  285|   386M|    ret = b->method->bread(b, data, dlen, readbytes);
  286|       |
  287|   386M|    if (ret > 0)
  ------------------
  |  Branch (287:9): [True: 385M, False: 1.16M]
  ------------------
  288|   385M|        b->num_read += (uint64_t)*readbytes;
  289|       |
  290|   386M|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|   386M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 386M]
  |  |  |  Branch (26:52): [True: 0, False: 386M]
  |  |  ------------------
  ------------------
  291|      0|        ret = (int)bio_call_callback(b, BIO_CB_READ | BIO_CB_RETURN, data,
  ------------------
  |  |  290|      0|# define BIO_CB_READ        0x02
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_READ | BIO_CB_RETURN, data,
  ------------------
  |  |  302|      0|# define BIO_CB_RETURN   0x80
  ------------------
  292|      0|                                     dlen, 0, 0L, ret, readbytes);
  293|       |
  294|       |    /* Shouldn't happen */
  295|   386M|    if (ret > 0 && *readbytes > dlen) {
  ------------------
  |  Branch (295:9): [True: 385M, False: 1.16M]
  |  Branch (295:20): [True: 0, False: 385M]
  ------------------
  296|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  297|      0|        return -1;
  298|      0|    }
  299|       |
  300|   386M|    return ret;
  301|   386M|}
bio_lib.c:bio_write_intern:
  328|  17.0M|{
  329|  17.0M|    size_t local_written;
  330|  17.0M|    int ret;
  331|       |
  332|  17.0M|    if (written != NULL)
  ------------------
  |  Branch (332:9): [True: 17.0M, False: 0]
  ------------------
  333|  17.0M|        *written = 0;
  334|       |    /*
  335|       |     * b == NULL is not an error but just means that zero bytes are written.
  336|       |     * Do not raise an error here.
  337|       |     */
  338|  17.0M|    if (b == NULL)
  ------------------
  |  Branch (338:9): [True: 0, False: 17.0M]
  ------------------
  339|      0|        return 0;
  340|       |
  341|  17.0M|    if (b->method == NULL || b->method->bwrite == NULL) {
  ------------------
  |  Branch (341:9): [True: 0, False: 17.0M]
  |  Branch (341:30): [True: 0, False: 17.0M]
  ------------------
  342|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  343|      0|        return -2;
  344|      0|    }
  345|       |
  346|  17.0M|    if (HAS_CALLBACK(b) &&
  ------------------
  |  |   26|  34.1M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 17.0M]
  |  |  |  Branch (26:52): [True: 0, False: 17.0M]
  |  |  ------------------
  ------------------
  347|  17.0M|        ((ret = (int)bio_call_callback(b, BIO_CB_WRITE, data, dlen, 0, 0L, 1L,
  ------------------
  |  |  291|      0|# define BIO_CB_WRITE       0x03
  ------------------
  |  Branch (347:9): [True: 0, False: 0]
  ------------------
  348|      0|                                       NULL)) <= 0))
  349|      0|        return ret;
  350|       |
  351|  17.0M|    if (!b->init) {
  ------------------
  |  Branch (351:9): [True: 0, False: 17.0M]
  ------------------
  352|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  353|      0|        return -1;
  354|      0|    }
  355|       |
  356|  17.0M|    ret = b->method->bwrite(b, data, dlen, &local_written);
  357|       |
  358|  17.0M|    if (ret > 0)
  ------------------
  |  Branch (358:9): [True: 17.0M, False: 0]
  ------------------
  359|  17.0M|        b->num_write += (uint64_t)local_written;
  360|       |
  361|  17.0M|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  17.0M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 17.0M]
  |  |  |  Branch (26:52): [True: 0, False: 17.0M]
  |  |  ------------------
  ------------------
  362|      0|        ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data,
  ------------------
  |  |  291|      0|# define BIO_CB_WRITE       0x03
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data,
  ------------------
  |  |  302|      0|# define BIO_CB_RETURN   0x80
  ------------------
  363|      0|                                     dlen, 0, 0L, ret, &local_written);
  364|       |
  365|  17.0M|    if (written != NULL)
  ------------------
  |  Branch (365:9): [True: 17.0M, False: 0]
  ------------------
  366|  17.0M|        *written = local_written;
  367|  17.0M|    return ret;
  368|  17.0M|}

BIO_meth_new:
   38|      1|{
   39|      1|    BIO_METHOD *biom = OPENSSL_zalloc(sizeof(BIO_METHOD));
  ------------------
  |  |  104|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|       |
   41|      1|    if (biom == NULL
  ------------------
  |  Branch (41:9): [True: 0, False: 1]
  ------------------
   42|      1|            || (biom->name = OPENSSL_strdup(name)) == NULL) {
  ------------------
  |  |  119|      1|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (42:16): [True: 0, False: 1]
  ------------------
   43|      0|        OPENSSL_free(biom);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|      0|        return NULL;
   45|      0|    }
   46|      1|    biom->type = type;
   47|      1|    return biom;
   48|      1|}
BIO_meth_free:
   51|      1|{
   52|      1|    if (biom != NULL) {
  ------------------
  |  Branch (52:9): [True: 1, False: 0]
  ------------------
   53|      1|        OPENSSL_free(biom->name);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   54|      1|        OPENSSL_free(biom);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   55|      1|    }
   56|      1|}
bwrite_conv:
   73|  14.7M|{
   74|  14.7M|    int ret;
   75|       |
   76|  14.7M|    if (datal > INT_MAX)
  ------------------
  |  Branch (76:9): [True: 0, False: 14.7M]
  ------------------
   77|      0|        datal = INT_MAX;
   78|       |
   79|  14.7M|    ret = bio->method->bwrite_old(bio, data, (int)datal);
   80|       |
   81|  14.7M|    if (ret <= 0) {
  ------------------
  |  Branch (81:9): [True: 0, False: 14.7M]
  ------------------
   82|      0|        *written = 0;
   83|      0|        return ret;
   84|      0|    }
   85|       |
   86|  14.7M|    *written = (size_t)ret;
   87|       |
   88|  14.7M|    return 1;
   89|  14.7M|}
BIO_meth_set_write_ex:
  101|      1|{
  102|      1|    biom->bwrite_old = NULL;
  103|      1|    biom->bwrite = bwrite;
  104|      1|    return 1;
  105|      1|}
bread_conv:
  121|   193M|{
  122|   193M|    int ret;
  123|       |
  124|   193M|    if (datal > INT_MAX)
  ------------------
  |  Branch (124:9): [True: 0, False: 193M]
  ------------------
  125|      0|        datal = INT_MAX;
  126|       |
  127|   193M|    ret = bio->method->bread_old(bio, data, (int)datal);
  128|       |
  129|   193M|    if (ret <= 0) {
  ------------------
  |  Branch (129:9): [True: 582k, False: 192M]
  ------------------
  130|   582k|        *readbytes = 0;
  131|   582k|        return ret;
  132|   582k|    }
  133|       |
  134|   192M|    *readbytes = (size_t)ret;
  135|       |
  136|   192M|    return 1;
  137|   193M|}
BIO_meth_set_read_ex:
  149|      1|{
  150|      1|    biom->bread_old = NULL;
  151|      1|    biom->bread = bread;
  152|      1|    return 1;
  153|      1|}
BIO_meth_set_puts:
  164|      1|{
  165|      1|    biom->bputs = bputs;
  166|      1|    return 1;
  167|      1|}
BIO_meth_set_gets:
  178|      1|{
  179|      1|    biom->bgets = bgets;
  180|      1|    return 1;
  181|      1|}
BIO_meth_set_ctrl:
  192|      1|{
  193|      1|    biom->ctrl = ctrl;
  194|      1|    return 1;
  195|      1|}
BIO_meth_set_create:
  205|      1|{
  206|      1|    biom->create = create;
  207|      1|    return 1;
  208|      1|}
BIO_meth_set_destroy:
  218|      1|{
  219|      1|    biom->destroy = destroy;
  220|      1|    return 1;
  221|      1|}

BIO_printf:
  886|  8.99M|{
  887|  8.99M|    va_list args;
  888|  8.99M|    int ret;
  889|       |
  890|  8.99M|    va_start(args, format);
  891|       |
  892|  8.99M|    ret = BIO_vprintf(bio, format, args);
  893|       |
  894|  8.99M|    va_end(args);
  895|  8.99M|    return ret;
  896|  8.99M|}
BIO_vprintf:
  899|  8.99M|{
  900|  8.99M|    int ret;
  901|  8.99M|    size_t retlen;
  902|  8.99M|    char hugebuf[1024 * 2];     /* Was previously 10k, which is unreasonable
  903|       |                                 * in small-stack environments, like threads
  904|       |                                 * or DOS programs. */
  905|  8.99M|    char *hugebufp = hugebuf;
  906|  8.99M|    size_t hugebufsize = sizeof(hugebuf);
  907|  8.99M|    char *dynbuf = NULL;
  908|  8.99M|    int ignored;
  909|       |
  910|  8.99M|    dynbuf = NULL;
  911|  8.99M|    if (!_dopr(&hugebufp, &dynbuf, &hugebufsize, &retlen, &ignored, format,
  ------------------
  |  Branch (911:9): [True: 0, False: 8.99M]
  ------------------
  912|  8.99M|                args)) {
  913|      0|        OPENSSL_free(dynbuf);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  914|      0|        return -1;
  915|      0|    }
  916|  8.99M|    if (dynbuf) {
  ------------------
  |  Branch (916:9): [True: 47, False: 8.99M]
  ------------------
  917|     47|        ret = BIO_write(bio, dynbuf, (int)retlen);
  918|     47|        OPENSSL_free(dynbuf);
  ------------------
  |  |  115|     47|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     47|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     47|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  919|  8.99M|    } else {
  920|  8.99M|        ret = BIO_write(bio, hugebuf, (int)retlen);
  921|  8.99M|    }
  922|  8.99M|    return ret;
  923|  8.99M|}
BIO_snprintf:
  932|  3.83M|{
  933|  3.83M|    va_list args;
  934|  3.83M|    int ret;
  935|       |
  936|  3.83M|    va_start(args, format);
  937|       |
  938|  3.83M|    ret = BIO_vsnprintf(buf, n, format, args);
  939|       |
  940|  3.83M|    va_end(args);
  941|  3.83M|    return ret;
  942|  3.83M|}
BIO_vsnprintf:
  945|  3.86M|{
  946|  3.86M|    size_t retlen;
  947|  3.86M|    int truncated;
  948|       |
  949|  3.86M|    if (!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
  ------------------
  |  Branch (949:9): [True: 0, False: 3.86M]
  ------------------
  950|      0|        return -1;
  951|       |
  952|  3.86M|    if (truncated)
  ------------------
  |  Branch (952:9): [True: 0, False: 3.86M]
  ------------------
  953|       |        /*
  954|       |         * In case of truncation, return -1 like traditional snprintf.
  955|       |         * (Current drafts for ISO/IEC 9899 say snprintf should return the
  956|       |         * number of characters that would have been written, had the buffer
  957|       |         * been large enough.)
  958|       |         */
  959|      0|        return -1;
  960|  3.86M|    return (retlen <= INT_MAX) ? (int)retlen : -1;
  ------------------
  |  Branch (960:12): [True: 3.86M, False: 0]
  ------------------
  961|  3.86M|}
bio_print.c:_dopr:
   91|  12.8M|{
   92|  12.8M|    char ch;
   93|  12.8M|    int64_t value;
   94|  12.8M|#ifndef OPENSSL_SYS_UEFI
   95|  12.8M|    LDOUBLE fvalue;
  ------------------
  |  |   28|  12.8M|# define LDOUBLE double
  ------------------
   96|  12.8M|#endif
   97|  12.8M|    char *strvalue;
   98|  12.8M|    int min;
   99|  12.8M|    int max;
  100|  12.8M|    int state;
  101|  12.8M|    int flags;
  102|  12.8M|    int cflags;
  103|  12.8M|    size_t currlen;
  104|       |
  105|  12.8M|    state = DP_S_DEFAULT;
  ------------------
  |  |   45|  12.8M|#define DP_S_DEFAULT    0
  ------------------
  106|  12.8M|    flags = currlen = cflags = min = 0;
  107|  12.8M|    max = -1;
  108|  12.8M|    ch = *format++;
  109|       |
  110|   214M|    while (state != DP_S_DONE) {
  ------------------
  |  |   52|   214M|#define DP_S_DONE       7
  ------------------
  |  Branch (110:12): [True: 201M, False: 12.8M]
  ------------------
  111|   201M|        if (ch == '\0' || (buffer == NULL && currlen >= *maxlen))
  ------------------
  |  Branch (111:13): [True: 12.8M, False: 189M]
  |  Branch (111:28): [True: 105M, False: 83.3M]
  |  Branch (111:46): [True: 0, False: 105M]
  ------------------
  112|  12.8M|            state = DP_S_DONE;
  ------------------
  |  |   52|  12.8M|#define DP_S_DONE       7
  ------------------
  113|       |
  114|   201M|        switch (state) {
  115|  49.1M|        case DP_S_DEFAULT:
  ------------------
  |  |   45|  49.1M|#define DP_S_DEFAULT    0
  ------------------
  |  Branch (115:9): [True: 49.1M, False: 152M]
  ------------------
  116|  49.1M|            if (ch == '%')
  ------------------
  |  Branch (116:17): [True: 23.2M, False: 25.9M]
  ------------------
  117|  23.2M|                state = DP_S_FLAGS;
  ------------------
  |  |   46|  23.2M|#define DP_S_FLAGS      1
  ------------------
  118|  25.9M|            else
  119|  25.9M|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
  ------------------
  |  Branch (119:21): [True: 0, False: 25.9M]
  ------------------
  120|      0|                    return 0;
  121|  49.1M|            ch = *format++;
  122|  49.1M|            break;
  123|  32.7M|        case DP_S_FLAGS:
  ------------------
  |  |   46|  32.7M|#define DP_S_FLAGS      1
  ------------------
  |  Branch (123:9): [True: 32.7M, False: 169M]
  ------------------
  124|  32.7M|            switch (ch) {
  125|  3.41M|            case '-':
  ------------------
  |  Branch (125:13): [True: 3.41M, False: 29.2M]
  ------------------
  126|  3.41M|                flags |= DP_F_MINUS;
  ------------------
  |  |   56|  3.41M|#define DP_F_MINUS      (1 << 0)
  ------------------
  127|  3.41M|                ch = *format++;
  128|  3.41M|                break;
  129|      1|            case '+':
  ------------------
  |  Branch (129:13): [True: 1, False: 32.7M]
  ------------------
  130|      1|                flags |= DP_F_PLUS;
  ------------------
  |  |   58|      1|#define DP_F_PLUS       (1 << 1)
  ------------------
  131|      1|                ch = *format++;
  132|      1|                break;
  133|      0|            case ' ':
  ------------------
  |  Branch (133:13): [True: 0, False: 32.7M]
  ------------------
  134|      0|                flags |= DP_F_SPACE;
  ------------------
  |  |   60|      0|#define DP_F_SPACE      (1 << 2)
  ------------------
  135|      0|                ch = *format++;
  136|      0|                break;
  137|      0|            case '#':
  ------------------
  |  Branch (137:13): [True: 0, False: 32.7M]
  ------------------
  138|      0|                flags |= DP_F_NUM;
  ------------------
  |  |   62|      0|#define DP_F_NUM        (1 << 3)
  ------------------
  139|      0|                ch = *format++;
  140|      0|                break;
  141|  6.08M|            case '0':
  ------------------
  |  Branch (141:13): [True: 6.08M, False: 26.6M]
  ------------------
  142|  6.08M|                flags |= DP_F_ZERO;
  ------------------
  |  |   64|  6.08M|#define DP_F_ZERO       (1 << 4)
  ------------------
  143|  6.08M|                ch = *format++;
  144|  6.08M|                break;
  145|  23.2M|            default:
  ------------------
  |  Branch (145:13): [True: 23.2M, False: 9.50M]
  ------------------
  146|  23.2M|                state = DP_S_MIN;
  ------------------
  |  |   47|  23.2M|#define DP_S_MIN        2
  ------------------
  147|  23.2M|                break;
  148|  32.7M|            }
  149|  32.7M|            break;
  150|  37.6M|        case DP_S_MIN:
  ------------------
  |  |   47|  37.6M|#define DP_S_MIN        2
  ------------------
  |  Branch (150:9): [True: 37.6M, False: 164M]
  ------------------
  151|  37.6M|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (151:17): [True: 14.3M, False: 23.2M]
  ------------------
  152|  14.3M|                min = 10 * min + char_to_int(ch);
  ------------------
  |  |   83|  14.3M|#define char_to_int(p) (p - '0')
  ------------------
  153|  14.3M|                ch = *format++;
  154|  23.2M|            } else if (ch == '*') {
  ------------------
  |  Branch (154:24): [True: 1.93M, False: 21.2M]
  ------------------
  155|  1.93M|                min = va_arg(args, int);
  156|  1.93M|                ch = *format++;
  157|  1.93M|                state = DP_S_DOT;
  ------------------
  |  |   48|  1.93M|#define DP_S_DOT        3
  ------------------
  158|  1.93M|            } else
  159|  21.2M|                state = DP_S_DOT;
  ------------------
  |  |   48|  21.2M|#define DP_S_DOT        3
  ------------------
  160|  37.6M|            break;
  161|  23.2M|        case DP_S_DOT:
  ------------------
  |  |   48|  23.2M|#define DP_S_DOT        3
  ------------------
  |  Branch (161:9): [True: 23.2M, False: 178M]
  ------------------
  162|  23.2M|            if (ch == '.') {
  ------------------
  |  Branch (162:17): [True: 1.09k, False: 23.2M]
  ------------------
  163|  1.09k|                state = DP_S_MAX;
  ------------------
  |  |   49|  1.09k|#define DP_S_MAX        4
  ------------------
  164|  1.09k|                ch = *format++;
  165|  1.09k|            } else
  166|  23.2M|                state = DP_S_MOD;
  ------------------
  |  |   50|  23.2M|#define DP_S_MOD        5
  ------------------
  167|  23.2M|            break;
  168|  1.09k|        case DP_S_MAX:
  ------------------
  |  |   49|  1.09k|#define DP_S_MAX        4
  ------------------
  |  Branch (168:9): [True: 1.09k, False: 201M]
  ------------------
  169|  1.09k|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (169:17): [True: 0, False: 1.09k]
  ------------------
  170|      0|                if (max < 0)
  ------------------
  |  Branch (170:21): [True: 0, False: 0]
  ------------------
  171|      0|                    max = 0;
  172|      0|                max = 10 * max + char_to_int(ch);
  ------------------
  |  |   83|      0|#define char_to_int(p) (p - '0')
  ------------------
  173|      0|                ch = *format++;
  174|  1.09k|            } else if (ch == '*') {
  ------------------
  |  Branch (174:24): [True: 1.09k, False: 0]
  ------------------
  175|  1.09k|                max = va_arg(args, int);
  176|  1.09k|                ch = *format++;
  177|  1.09k|                state = DP_S_MOD;
  ------------------
  |  |   50|  1.09k|#define DP_S_MOD        5
  ------------------
  178|  1.09k|            } else
  179|      0|                state = DP_S_MOD;
  ------------------
  |  |   50|      0|#define DP_S_MOD        5
  ------------------
  180|  1.09k|            break;
  181|  23.2M|        case DP_S_MOD:
  ------------------
  |  |   50|  23.2M|#define DP_S_MOD        5
  ------------------
  |  Branch (181:9): [True: 23.2M, False: 178M]
  ------------------
  182|  23.2M|            switch (ch) {
  183|      0|            case 'h':
  ------------------
  |  Branch (183:13): [True: 0, False: 23.2M]
  ------------------
  184|      0|                cflags = DP_C_SHORT;
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  185|      0|                ch = *format++;
  186|      0|                break;
  187|  5.27M|            case 'l':
  ------------------
  |  Branch (187:13): [True: 5.27M, False: 17.9M]
  ------------------
  188|  5.27M|                if (*format == 'l') {
  ------------------
  |  Branch (188:21): [True: 816, False: 5.26M]
  ------------------
  189|    816|                    cflags = DP_C_LLONG;
  ------------------
  |  |   74|    816|#define DP_C_LLONG      4
  ------------------
  190|    816|                    format++;
  191|    816|                } else
  192|  5.26M|                    cflags = DP_C_LONG;
  ------------------
  |  |   72|  5.26M|#define DP_C_LONG       2
  ------------------
  193|  5.27M|                ch = *format++;
  194|  5.27M|                break;
  195|      0|            case 'q':
  ------------------
  |  Branch (195:13): [True: 0, False: 23.2M]
  ------------------
  196|  1.17k|            case 'j':
  ------------------
  |  Branch (196:13): [True: 1.17k, False: 23.2M]
  ------------------
  197|  1.17k|                cflags = DP_C_LLONG;
  ------------------
  |  |   74|  1.17k|#define DP_C_LLONG      4
  ------------------
  198|  1.17k|                ch = *format++;
  199|  1.17k|                break;
  200|      0|            case 'L':
  ------------------
  |  Branch (200:13): [True: 0, False: 23.2M]
  ------------------
  201|      0|                cflags = DP_C_LDOUBLE;
  ------------------
  |  |   73|      0|#define DP_C_LDOUBLE    3
  ------------------
  202|      0|                ch = *format++;
  203|      0|                break;
  204|      0|            case 'z':
  ------------------
  |  Branch (204:13): [True: 0, False: 23.2M]
  ------------------
  205|      0|                cflags = DP_C_SIZE;
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  206|      0|                ch = *format++;
  207|      0|                break;
  208|  17.9M|            default:
  ------------------
  |  Branch (208:13): [True: 17.9M, False: 5.27M]
  ------------------
  209|  17.9M|                break;
  210|  23.2M|            }
  211|  23.2M|            state = DP_S_CONV;
  ------------------
  |  |   51|  23.2M|#define DP_S_CONV       6
  ------------------
  212|  23.2M|            break;
  213|  23.2M|        case DP_S_CONV:
  ------------------
  |  |   51|  23.2M|#define DP_S_CONV       6
  ------------------
  |  Branch (213:9): [True: 23.2M, False: 178M]
  ------------------
  214|  23.2M|            switch (ch) {
  215|  6.86M|            case 'd':
  ------------------
  |  Branch (215:13): [True: 6.86M, False: 16.3M]
  ------------------
  216|  6.86M|            case 'i':
  ------------------
  |  Branch (216:13): [True: 0, False: 23.2M]
  ------------------
  217|  6.86M|                switch (cflags) {
  218|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (218:17): [True: 0, False: 6.86M]
  ------------------
  219|      0|                    value = (short int)va_arg(args, int);
  220|      0|                    break;
  221|  4.86M|                case DP_C_LONG:
  ------------------
  |  |   72|  4.86M|#define DP_C_LONG       2
  ------------------
  |  Branch (221:17): [True: 4.86M, False: 1.99M]
  ------------------
  222|  4.86M|                    value = va_arg(args, long int);
  223|  4.86M|                    break;
  224|  1.51k|                case DP_C_LLONG:
  ------------------
  |  |   74|  1.51k|#define DP_C_LLONG      4
  ------------------
  |  Branch (224:17): [True: 1.51k, False: 6.86M]
  ------------------
  225|  1.51k|                    value = va_arg(args, int64_t);
  226|  1.51k|                    break;
  227|      0|                case DP_C_SIZE:
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  |  Branch (227:17): [True: 0, False: 6.86M]
  ------------------
  228|      0|                    value = va_arg(args, ossl_ssize_t);
  229|      0|                    break;
  230|  1.99M|                default:
  ------------------
  |  Branch (230:17): [True: 1.99M, False: 4.86M]
  ------------------
  231|  1.99M|                    value = va_arg(args, int);
  232|  1.99M|                    break;
  233|  6.86M|                }
  234|  6.86M|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, 10, min,
  ------------------
  |  Branch (234:21): [True: 0, False: 6.86M]
  ------------------
  235|  6.86M|                            max, flags))
  236|      0|                    return 0;
  237|  6.86M|                break;
  238|  6.86M|            case 'X':
  ------------------
  |  Branch (238:13): [True: 3.72M, False: 19.4M]
  ------------------
  239|  3.72M|                flags |= DP_F_UP;
  ------------------
  |  |   66|  3.72M|#define DP_F_UP         (1 << 5)
  ------------------
  240|       |                /* FALLTHROUGH */
  241|  6.09M|            case 'x':
  ------------------
  |  Branch (241:13): [True: 2.37M, False: 20.8M]
  ------------------
  242|  6.09M|            case 'o':
  ------------------
  |  Branch (242:13): [True: 0, False: 23.2M]
  ------------------
  243|  6.48M|            case 'u':
  ------------------
  |  Branch (243:13): [True: 383k, False: 22.8M]
  ------------------
  244|  6.48M|                flags |= DP_F_UNSIGNED;
  ------------------
  |  |   68|  6.48M|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  245|  6.48M|                switch (cflags) {
  246|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (246:17): [True: 0, False: 6.48M]
  ------------------
  247|      0|                    value = (unsigned short int)va_arg(args, unsigned int);
  248|      0|                    break;
  249|   403k|                case DP_C_LONG:
  ------------------
  |  |   72|   403k|#define DP_C_LONG       2
  ------------------
  |  Branch (249:17): [True: 403k, False: 6.07M]
  ------------------
  250|   403k|                    value = va_arg(args, unsigned long int);
  251|   403k|                    break;
  252|    476|                case DP_C_LLONG:
  ------------------
  |  |   74|    476|#define DP_C_LLONG      4
  ------------------
  |  Branch (252:17): [True: 476, False: 6.48M]
  ------------------
  253|    476|                    value = va_arg(args, uint64_t);
  254|    476|                    break;
  255|      0|                case DP_C_SIZE:
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  |  Branch (255:17): [True: 0, False: 6.48M]
  ------------------
  256|      0|                    value = va_arg(args, size_t);
  257|      0|                    break;
  258|  6.07M|                default:
  ------------------
  |  Branch (258:17): [True: 6.07M, False: 404k]
  ------------------
  259|  6.07M|                    value = va_arg(args, unsigned int);
  260|  6.07M|                    break;
  261|  6.48M|                }
  262|  6.48M|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value,
  ------------------
  |  Branch (262:21): [True: 0, False: 6.48M]
  ------------------
  263|  6.48M|                            ch == 'o' ? 8 : (ch == 'u' ? 10 : 16),
  ------------------
  |  Branch (263:29): [True: 0, False: 6.48M]
  |  Branch (263:46): [True: 383k, False: 6.09M]
  ------------------
  264|  6.48M|                            min, max, flags))
  265|      0|                    return 0;
  266|  6.48M|                break;
  267|  6.48M|#ifndef OPENSSL_SYS_UEFI
  268|  6.48M|            case 'f':
  ------------------
  |  Branch (268:13): [True: 0, False: 23.2M]
  ------------------
  269|      0|                if (cflags == DP_C_LDOUBLE)
  ------------------
  |  |   73|      0|#define DP_C_LDOUBLE    3
  ------------------
  |  Branch (269:21): [True: 0, False: 0]
  ------------------
  270|      0|                    fvalue = va_arg(args, LDOUBLE);
  271|      0|                else
  272|      0|                    fvalue = va_arg(args, double);
  273|      0|                if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
  ------------------
  |  Branch (273:21): [True: 0, False: 0]
  ------------------
  274|      0|                           flags, F_FORMAT))
  ------------------
  |  |   78|      0|#define F_FORMAT        0
  ------------------
  275|      0|                    return 0;
  276|      0|                break;
  277|      0|            case 'E':
  ------------------
  |  Branch (277:13): [True: 0, False: 23.2M]
  ------------------
  278|      0|                flags |= DP_F_UP;
  ------------------
  |  |   66|      0|#define DP_F_UP         (1 << 5)
  ------------------
  279|       |                /* fall through */
  280|      0|            case 'e':
  ------------------
  |  Branch (280:13): [True: 0, False: 23.2M]
  ------------------
  281|      0|                if (cflags == DP_C_LDOUBLE)
  ------------------
  |  |   73|      0|#define DP_C_LDOUBLE    3
  ------------------
  |  Branch (281:21): [True: 0, False: 0]
  ------------------
  282|      0|                    fvalue = va_arg(args, LDOUBLE);
  283|      0|                else
  284|      0|                    fvalue = va_arg(args, double);
  285|      0|                if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
  ------------------
  |  Branch (285:21): [True: 0, False: 0]
  ------------------
  286|      0|                           flags, E_FORMAT))
  ------------------
  |  |   79|      0|#define E_FORMAT        1
  ------------------
  287|      0|                    return 0;
  288|      0|                break;
  289|      0|            case 'G':
  ------------------
  |  Branch (289:13): [True: 0, False: 23.2M]
  ------------------
  290|      0|                flags |= DP_F_UP;
  ------------------
  |  |   66|      0|#define DP_F_UP         (1 << 5)
  ------------------
  291|       |                /* fall through */
  292|      0|            case 'g':
  ------------------
  |  Branch (292:13): [True: 0, False: 23.2M]
  ------------------
  293|      0|                if (cflags == DP_C_LDOUBLE)
  ------------------
  |  |   73|      0|#define DP_C_LDOUBLE    3
  ------------------
  |  Branch (293:21): [True: 0, False: 0]
  ------------------
  294|      0|                    fvalue = va_arg(args, LDOUBLE);
  295|      0|                else
  296|      0|                    fvalue = va_arg(args, double);
  297|      0|                if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
  ------------------
  |  Branch (297:21): [True: 0, False: 0]
  ------------------
  298|      0|                           flags, G_FORMAT))
  ------------------
  |  |   80|      0|#define G_FORMAT        2
  ------------------
  299|      0|                    return 0;
  300|      0|                break;
  301|       |#else
  302|       |            case 'f':
  303|       |            case 'E':
  304|       |            case 'e':
  305|       |            case 'G':
  306|       |            case 'g':
  307|       |                /* not implemented for UEFI */
  308|       |                ERR_raise(ERR_LIB_BIO, ERR_R_UNSUPPORTED);
  309|       |                return 0;
  310|       |#endif
  311|  2.43M|            case 'c':
  ------------------
  |  Branch (311:13): [True: 2.43M, False: 20.7M]
  ------------------
  312|  2.43M|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen,
  ------------------
  |  Branch (312:21): [True: 0, False: 2.43M]
  ------------------
  313|  2.43M|                                 va_arg(args, int)))
  314|      0|                    return 0;
  315|  2.43M|                break;
  316|  7.42M|            case 's':
  ------------------
  |  Branch (316:13): [True: 7.42M, False: 15.7M]
  ------------------
  317|  7.42M|                strvalue = va_arg(args, char *);
  318|  7.42M|                if (max < 0) {
  ------------------
  |  Branch (318:21): [True: 7.42M, False: 1.09k]
  ------------------
  319|  7.42M|                    if (buffer)
  ------------------
  |  Branch (319:25): [True: 5.44M, False: 1.97M]
  ------------------
  320|  5.44M|                        max = INT_MAX;
  321|  1.97M|                    else
  322|  1.97M|                        max = *maxlen;
  323|  7.42M|                }
  324|  7.42M|                if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
  ------------------
  |  Branch (324:21): [True: 0, False: 7.42M]
  ------------------
  325|  7.42M|                            flags, min, max))
  326|      0|                    return 0;
  327|  7.42M|                break;
  328|  7.42M|            case 'p':
  ------------------
  |  Branch (328:13): [True: 0, False: 23.2M]
  ------------------
  329|      0|                value = (size_t)va_arg(args, void *);
  330|      0|                if (!fmtint(sbuffer, buffer, &currlen, maxlen,
  ------------------
  |  Branch (330:21): [True: 0, False: 0]
  ------------------
  331|      0|                            value, 16, min, max, flags | DP_F_NUM))
  ------------------
  |  |   62|      0|#define DP_F_NUM        (1 << 3)
  ------------------
  332|      0|                    return 0;
  333|      0|                break;
  334|      0|            case 'n':
  ------------------
  |  Branch (334:13): [True: 0, False: 23.2M]
  ------------------
  335|      0|                {
  336|      0|                    int *num;
  337|      0|                    num = va_arg(args, int *);
  338|      0|                    *num = currlen;
  339|      0|                }
  340|      0|                break;
  341|      0|            case '%':
  ------------------
  |  Branch (341:13): [True: 0, False: 23.2M]
  ------------------
  342|      0|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
  ------------------
  |  Branch (342:21): [True: 0, False: 0]
  ------------------
  343|      0|                    return 0;
  344|      0|                break;
  345|      0|            case 'w':
  ------------------
  |  Branch (345:13): [True: 0, False: 23.2M]
  ------------------
  346|       |                /* not supported yet, treat as next char */
  347|      0|                format++;
  348|      0|                break;
  349|      0|            default:
  ------------------
  |  Branch (349:13): [True: 0, False: 23.2M]
  ------------------
  350|       |                /* unknown, skip */
  351|      0|                break;
  352|  23.2M|            }
  353|  23.2M|            ch = *format++;
  354|  23.2M|            state = DP_S_DEFAULT;
  ------------------
  |  |   45|  23.2M|#define DP_S_DEFAULT    0
  ------------------
  355|  23.2M|            flags = cflags = min = 0;
  356|  23.2M|            max = -1;
  357|  23.2M|            break;
  358|  12.8M|        case DP_S_DONE:
  ------------------
  |  |   52|  12.8M|#define DP_S_DONE       7
  ------------------
  |  Branch (358:9): [True: 12.8M, False: 189M]
  ------------------
  359|  12.8M|            break;
  360|      0|        default:
  ------------------
  |  Branch (360:9): [True: 0, False: 201M]
  ------------------
  361|      0|            break;
  362|   201M|        }
  363|   201M|    }
  364|       |    /*
  365|       |     * We have to truncate if there is no dynamic buffer and we have filled the
  366|       |     * static buffer.
  367|       |     */
  368|  12.8M|    if (buffer == NULL) {
  ------------------
  |  Branch (368:9): [True: 3.86M, False: 8.99M]
  ------------------
  369|  3.86M|        *truncated = (currlen > *maxlen - 1);
  370|  3.86M|        if (*truncated)
  ------------------
  |  Branch (370:13): [True: 0, False: 3.86M]
  ------------------
  371|      0|            currlen = *maxlen - 1;
  372|  3.86M|    }
  373|  12.8M|    if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'))
  ------------------
  |  Branch (373:9): [True: 0, False: 12.8M]
  ------------------
  374|      0|        return 0;
  375|  12.8M|    *retlen = currlen - 1;
  376|  12.8M|    return 1;
  377|  12.8M|}
bio_print.c:doapr_outch:
  840|   133M|{
  841|       |    /* If we haven't at least one buffer, someone has done a big booboo */
  842|   133M|    if (!ossl_assert(*sbuffer != NULL || buffer != NULL))
  ------------------
  |  |   52|   137M|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 129M, False: 4.15M]
  |  |  |  Branch (52:43): [True: 4.15M, False: 0]
  |  |  ------------------
  |  |   53|   133M|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (842:9): [True: 0, False: 133M]
  ------------------
  843|      0|        return 0;
  844|       |
  845|       |    /* |currlen| must always be <= |*maxlen| */
  846|   133M|    if (!ossl_assert(*currlen <= *maxlen))
  ------------------
  |  |   52|   133M|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   133M|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (846:9): [True: 0, False: 133M]
  ------------------
  847|      0|        return 0;
  848|       |
  849|   133M|    if (buffer && *currlen == *maxlen) {
  ------------------
  |  Branch (849:9): [True: 68.4M, False: 65.0M]
  |  Branch (849:19): [True: 4.09k, False: 68.4M]
  ------------------
  850|  4.09k|        if (*maxlen > INT_MAX - BUFFER_INC)
  ------------------
  |  |  835|  4.09k|#define BUFFER_INC  1024
  ------------------
  |  Branch (850:13): [True: 0, False: 4.09k]
  ------------------
  851|      0|            return 0;
  852|       |
  853|  4.09k|        *maxlen += BUFFER_INC;
  ------------------
  |  |  835|  4.09k|#define BUFFER_INC  1024
  ------------------
  854|  4.09k|        if (*buffer == NULL) {
  ------------------
  |  Branch (854:13): [True: 47, False: 4.04k]
  ------------------
  855|     47|            if ((*buffer = OPENSSL_malloc(*maxlen)) == NULL)
  ------------------
  |  |  102|     47|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     47|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     47|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (855:17): [True: 0, False: 47]
  ------------------
  856|      0|                return 0;
  857|     47|            if (*currlen > 0) {
  ------------------
  |  Branch (857:17): [True: 47, False: 0]
  ------------------
  858|     47|                if (!ossl_assert(*sbuffer != NULL))
  ------------------
  |  |   52|     47|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     47|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (858:21): [True: 0, False: 47]
  ------------------
  859|      0|                    return 0;
  860|     47|                memcpy(*buffer, *sbuffer, *currlen);
  861|     47|            }
  862|     47|            *sbuffer = NULL;
  863|  4.04k|        } else {
  864|  4.04k|            char *tmpbuf;
  865|       |
  866|  4.04k|            tmpbuf = OPENSSL_realloc(*buffer, *maxlen);
  ------------------
  |  |  109|  4.04k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.04k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.04k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  867|  4.04k|            if (tmpbuf == NULL)
  ------------------
  |  Branch (867:17): [True: 0, False: 4.04k]
  ------------------
  868|      0|                return 0;
  869|  4.04k|            *buffer = tmpbuf;
  870|  4.04k|        }
  871|  4.09k|    }
  872|       |
  873|   133M|    if (*currlen < *maxlen) {
  ------------------
  |  Branch (873:9): [True: 133M, False: 0]
  ------------------
  874|   133M|        if (*sbuffer)
  ------------------
  |  Branch (874:13): [True: 129M, False: 4.15M]
  ------------------
  875|   129M|            (*sbuffer)[(*currlen)++] = (char)c;
  876|  4.15M|        else
  877|  4.15M|            (*buffer)[(*currlen)++] = (char)c;
  878|   133M|    }
  879|       |
  880|   133M|    return 1;
  881|   133M|}
bio_print.c:fmtint:
  436|  13.3M|{
  437|  13.3M|    int signvalue = 0;
  438|  13.3M|    const char *prefix = "";
  439|  13.3M|    uint64_t uvalue;
  440|  13.3M|    char convert[DECIMAL_SIZE(value) + 3];
  441|  13.3M|    int place = 0;
  442|  13.3M|    int spadlen = 0;
  443|  13.3M|    int zpadlen = 0;
  444|  13.3M|    int caps = 0;
  445|       |
  446|  13.3M|    if (max < 0)
  ------------------
  |  Branch (446:9): [True: 13.3M, False: 0]
  ------------------
  447|  13.3M|        max = 0;
  448|  13.3M|    uvalue = value;
  449|  13.3M|    if (!(flags & DP_F_UNSIGNED)) {
  ------------------
  |  |   68|  13.3M|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  |  Branch (449:9): [True: 6.86M, False: 6.48M]
  ------------------
  450|  6.86M|        if (value < 0) {
  ------------------
  |  Branch (450:13): [True: 1.89k, False: 6.86M]
  ------------------
  451|  1.89k|            signvalue = '-';
  452|  1.89k|            uvalue = 0 - (uint64_t)value;
  453|  6.86M|        } else if (flags & DP_F_PLUS)
  ------------------
  |  |   58|  6.86M|#define DP_F_PLUS       (1 << 1)
  ------------------
  |  Branch (453:20): [True: 1, False: 6.86M]
  ------------------
  454|      1|            signvalue = '+';
  455|  6.86M|        else if (flags & DP_F_SPACE)
  ------------------
  |  |   60|  6.86M|#define DP_F_SPACE      (1 << 2)
  ------------------
  |  Branch (455:18): [True: 0, False: 6.86M]
  ------------------
  456|      0|            signvalue = ' ';
  457|  6.86M|    }
  458|  13.3M|    if (flags & DP_F_NUM) {
  ------------------
  |  |   62|  13.3M|#define DP_F_NUM        (1 << 3)
  ------------------
  |  Branch (458:9): [True: 0, False: 13.3M]
  ------------------
  459|      0|        if (base == 8)
  ------------------
  |  Branch (459:13): [True: 0, False: 0]
  ------------------
  460|      0|            prefix = "0";
  461|      0|        if (base == 16)
  ------------------
  |  Branch (461:13): [True: 0, False: 0]
  ------------------
  462|      0|            prefix = "0x";
  463|      0|    }
  464|  13.3M|    if (flags & DP_F_UP)
  ------------------
  |  |   66|  13.3M|#define DP_F_UP         (1 << 5)
  ------------------
  |  Branch (464:9): [True: 3.72M, False: 9.62M]
  ------------------
  465|  3.72M|        caps = 1;
  466|  21.3M|    do {
  467|  21.3M|        convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef")
  ------------------
  |  Branch (467:29): [True: 5.62M, False: 15.7M]
  ------------------
  468|  21.3M|            [uvalue % (unsigned)base];
  469|  21.3M|        uvalue = (uvalue / (unsigned)base);
  470|  21.3M|    } while (uvalue && (place < (int)sizeof(convert)));
  ------------------
  |  Branch (470:14): [True: 8.01M, False: 13.3M]
  |  Branch (470:24): [True: 8.01M, False: 0]
  ------------------
  471|  13.3M|    if (place == sizeof(convert))
  ------------------
  |  Branch (471:9): [True: 0, False: 13.3M]
  ------------------
  472|      0|        place--;
  473|  13.3M|    convert[place] = 0;
  474|       |
  475|  13.3M|    zpadlen = max - place;
  476|  13.3M|    spadlen =
  477|  13.3M|        min - OSSL_MAX(max, place) - (signvalue ? 1 : 0) - strlen(prefix);
  ------------------
  |  |   84|  13.3M|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 0, False: 13.3M]
  |  |  ------------------
  ------------------
  |  Branch (477:39): [True: 1.89k, False: 13.3M]
  ------------------
  478|  13.3M|    if (zpadlen < 0)
  ------------------
  |  Branch (478:9): [True: 13.3M, False: 0]
  ------------------
  479|  13.3M|        zpadlen = 0;
  480|  13.3M|    if (spadlen < 0)
  ------------------
  |  Branch (480:9): [True: 2.44M, False: 10.8M]
  ------------------
  481|  2.44M|        spadlen = 0;
  482|  13.3M|    if (flags & DP_F_ZERO) {
  ------------------
  |  |   64|  13.3M|#define DP_F_ZERO       (1 << 4)
  ------------------
  |  Branch (482:9): [True: 6.08M, False: 7.26M]
  ------------------
  483|  6.08M|        zpadlen = OSSL_MAX(zpadlen, spadlen);
  ------------------
  |  |   84|  6.08M|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 3.20M, False: 2.88M]
  |  |  ------------------
  ------------------
  484|  6.08M|        spadlen = 0;
  485|  6.08M|    }
  486|  13.3M|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|  13.3M|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (486:9): [True: 1.70M, False: 11.6M]
  ------------------
  487|  1.70M|        spadlen = -spadlen;
  488|       |
  489|       |    /* spaces */
  490|  20.8M|    while (spadlen > 0) {
  ------------------
  |  Branch (490:12): [True: 7.52M, False: 13.3M]
  ------------------
  491|  7.52M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (491:13): [True: 0, False: 7.52M]
  ------------------
  492|      0|            return 0;
  493|  7.52M|        --spadlen;
  494|  7.52M|    }
  495|       |
  496|       |    /* sign */
  497|  13.3M|    if (signvalue)
  ------------------
  |  Branch (497:9): [True: 1.89k, False: 13.3M]
  ------------------
  498|  1.89k|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
  ------------------
  |  Branch (498:13): [True: 0, False: 1.89k]
  ------------------
  499|      0|            return 0;
  500|       |
  501|       |    /* prefix */
  502|  13.3M|    while (*prefix) {
  ------------------
  |  Branch (502:12): [True: 0, False: 13.3M]
  ------------------
  503|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *prefix))
  ------------------
  |  Branch (503:13): [True: 0, False: 0]
  ------------------
  504|      0|            return 0;
  505|      0|        prefix++;
  506|      0|    }
  507|       |
  508|       |    /* zeros */
  509|  13.3M|    if (zpadlen > 0) {
  ------------------
  |  Branch (509:9): [True: 2.88M, False: 10.4M]
  ------------------
  510|  5.78M|        while (zpadlen > 0) {
  ------------------
  |  Branch (510:16): [True: 2.90M, False: 2.88M]
  ------------------
  511|  2.90M|            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
  ------------------
  |  Branch (511:17): [True: 0, False: 2.90M]
  ------------------
  512|      0|                return 0;
  513|  2.90M|            --zpadlen;
  514|  2.90M|        }
  515|  2.88M|    }
  516|       |    /* digits */
  517|  34.7M|    while (place > 0) {
  ------------------
  |  Branch (517:12): [True: 21.3M, False: 13.3M]
  ------------------
  518|  21.3M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place]))
  ------------------
  |  Branch (518:13): [True: 0, False: 21.3M]
  ------------------
  519|      0|            return 0;
  520|  21.3M|    }
  521|       |
  522|       |    /* left justified spaces */
  523|  15.0M|    while (spadlen < 0) {
  ------------------
  |  Branch (523:12): [True: 1.66M, False: 13.3M]
  ------------------
  524|  1.66M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (524:13): [True: 0, False: 1.66M]
  ------------------
  525|      0|            return 0;
  526|  1.66M|        ++spadlen;
  527|  1.66M|    }
  528|  13.3M|    return 1;
  529|  13.3M|}
bio_print.c:fmtstr:
  384|  7.42M|{
  385|  7.42M|    int padlen;
  386|  7.42M|    size_t strln;
  387|  7.42M|    int cnt = 0;
  388|       |
  389|  7.42M|    if (value == 0)
  ------------------
  |  Branch (389:9): [True: 47, False: 7.42M]
  ------------------
  390|     47|        value = "<NULL>";
  391|       |
  392|  7.42M|    strln = OPENSSL_strnlen(value, max < 0 ? SIZE_MAX : (size_t)max);
  ------------------
  |  Branch (392:36): [True: 0, False: 7.42M]
  ------------------
  393|       |
  394|  7.42M|    padlen = min - strln;
  395|  7.42M|    if (min < 0 || padlen < 0)
  ------------------
  |  Branch (395:9): [True: 0, False: 7.42M]
  |  Branch (395:20): [True: 3.52M, False: 3.89M]
  ------------------
  396|  3.52M|        padlen = 0;
  397|  7.42M|    if (max >= 0) {
  ------------------
  |  Branch (397:9): [True: 7.42M, False: 0]
  ------------------
  398|       |        /*
  399|       |         * Calculate the maximum output including padding.
  400|       |         * Make sure max doesn't overflow into negativity
  401|       |         */
  402|  7.42M|        if (max < INT_MAX - padlen)
  ------------------
  |  Branch (402:13): [True: 1.97M, False: 5.44M]
  ------------------
  403|  1.97M|            max += padlen;
  404|  5.44M|        else
  405|  5.44M|            max = INT_MAX;
  406|  7.42M|    }
  407|  7.42M|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|  7.42M|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (407:9): [True: 1.70M, False: 5.71M]
  ------------------
  408|  1.70M|        padlen = -padlen;
  409|       |
  410|  15.3M|    while ((padlen > 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (410:12): [True: 7.92M, False: 7.42M]
  |  Branch (410:29): [True: 0, False: 7.92M]
  |  Branch (410:40): [True: 7.92M, False: 0]
  ------------------
  411|  7.92M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (411:13): [True: 0, False: 7.92M]
  ------------------
  412|      0|            return 0;
  413|  7.92M|        --padlen;
  414|  7.92M|        ++cnt;
  415|  7.92M|    }
  416|  40.1M|    while (strln > 0 && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (416:12): [True: 32.7M, False: 7.42M]
  |  Branch (416:26): [True: 0, False: 32.7M]
  |  Branch (416:37): [True: 32.7M, False: 0]
  ------------------
  417|  32.7M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *value++))
  ------------------
  |  Branch (417:13): [True: 0, False: 32.7M]
  ------------------
  418|      0|            return 0;
  419|  32.7M|        --strln;
  420|  32.7M|        ++cnt;
  421|  32.7M|    }
  422|  25.5M|    while ((padlen < 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (422:12): [True: 18.1M, False: 7.42M]
  |  Branch (422:29): [True: 0, False: 18.1M]
  |  Branch (422:40): [True: 18.1M, False: 0]
  ------------------
  423|  18.1M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (423:13): [True: 0, False: 18.1M]
  ------------------
  424|      0|            return 0;
  425|  18.1M|        ++padlen;
  426|  18.1M|        ++cnt;
  427|  18.1M|    }
  428|  7.42M|    return 1;
  429|  7.42M|}

bio_sock_cleanup_int:
  203|      2|{
  204|       |# ifdef OPENSSL_SYS_WINDOWS
  205|       |    if (wsa_init_done) {
  206|       |        wsa_init_done = 0;
  207|       |        WSACleanup();
  208|       |    }
  209|       |# endif
  210|      2|}

ossl_bio_core_globals_free:
   26|      2|{
   27|      2|    OPENSSL_free(vbcg);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   28|      2|}
ossl_bio_core_globals_new:
   31|      4|{
   32|      4|    return OPENSSL_zalloc(sizeof(BIO_CORE_GLOBALS));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|      4|}

BIO_new_file:
   58|      2|{
   59|      2|    BIO  *ret;
   60|      2|    FILE *file = openssl_fopen(filename, mode);
   61|      2|    int fp_flags = BIO_CLOSE;
  ------------------
  |  |   83|      2|# define BIO_CLOSE               0x01
  ------------------
   62|       |
   63|      2|    if (strchr(mode, 'b') == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 2]
  ------------------
   64|      0|        fp_flags |= BIO_FP_TEXT;
  ------------------
  |  |  218|      0|# define BIO_FP_TEXT             0x10
  ------------------
   65|       |
   66|      2|    if (file == NULL) {
  ------------------
  |  Branch (66:9): [True: 2, False: 0]
  ------------------
   67|      2|        ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |  403|      2|    (ERR_new(),                                                 \
  |  |  404|      2|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      2|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      2|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   72|      2|# define ERR_LIB_SYS             2
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   30|      2|# define get_last_sys_error()    errno
  ------------------
   68|      2|                       "calling fopen(%s, %s)",
   69|      2|                       filename, mode);
   70|      2|        if (errno == ENOENT
  ------------------
  |  Branch (70:13): [True: 2, False: 0]
  ------------------
   71|      2|#ifdef ENXIO
   72|      2|            || errno == ENXIO
  ------------------
  |  Branch (72:16): [True: 0, False: 0]
  ------------------
   73|      2|#endif
   74|      2|            )
   75|      2|            ERR_raise(ERR_LIB_BIO, BIO_R_NO_SUCH_FILE);
  ------------------
  |  |  401|      2|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      2|    (ERR_new(),                                                 \
  |  |  |  |  404|      2|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      2|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      2|     ERR_set_error)
  |  |  ------------------
  ------------------
   76|      0|        else
   77|      2|            ERR_raise(ERR_LIB_BIO, ERR_R_SYS_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   78|      2|        return NULL;
   79|      2|    }
   80|      0|    if ((ret = BIO_new(BIO_s_file())) == NULL) {
  ------------------
  |  Branch (80:9): [True: 0, False: 0]
  ------------------
   81|      0|        fclose(file);
   82|      0|        return NULL;
   83|      0|    }
   84|       |
   85|       |    /* we did fopen -> we disengage UPLINK */
   86|      0|    BIO_clear_flags(ret, BIO_FLAGS_UPLINK_INTERNAL);
  ------------------
  |  |   18|      0|#  define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
   87|      0|    BIO_set_fp(ret, file, fp_flags);
  ------------------
  |  |  565|      0|# define BIO_set_fp(b,fp,c)      BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)(fp))
  |  |  ------------------
  |  |  |  |  437|      0|# define BIO_C_SET_FILE_PTR                      106
  |  |  ------------------
  ------------------
   88|      0|    return ret;
   89|      0|}

BIO_s_mem:
   73|  67.6k|{
   74|  67.6k|    return &mem_method;
   75|  67.6k|}
BIO_new_mem_buf:
   83|  66.0k|{
   84|  66.0k|    BIO *ret;
   85|  66.0k|    BUF_MEM *b;
   86|  66.0k|    BIO_BUF_MEM *bb;
   87|  66.0k|    size_t sz;
   88|       |
   89|  66.0k|    if (buf == NULL) {
  ------------------
  |  Branch (89:9): [True: 0, False: 66.0k]
  ------------------
   90|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   91|      0|        return NULL;
   92|      0|    }
   93|  66.0k|    sz = (len < 0) ? strlen(buf) : (size_t)len;
  ------------------
  |  Branch (93:10): [True: 0, False: 66.0k]
  ------------------
   94|  66.0k|    if ((ret = BIO_new(BIO_s_mem())) == NULL)
  ------------------
  |  Branch (94:9): [True: 0, False: 66.0k]
  ------------------
   95|      0|        return NULL;
   96|  66.0k|    bb = (BIO_BUF_MEM *)ret->ptr;
   97|  66.0k|    b = bb->buf;
   98|       |    /* Cast away const and trust in the MEM_RDONLY flag. */
   99|  66.0k|    b->data = (void *)buf;
  100|  66.0k|    b->length = sz;
  101|  66.0k|    b->max = sz;
  102|  66.0k|    *bb->readp = *bb->buf;
  103|  66.0k|    ret->flags |= BIO_FLAGS_MEM_RDONLY;
  ------------------
  |  |  237|  66.0k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  104|       |    /* Since this is static data retrying won't help */
  105|  66.0k|    ret->num = 0;
  106|  66.0k|    return ret;
  107|  66.0k|}
bss_mem.c:mem_write:
  215|  1.19k|{
  216|  1.19k|    int ret = -1;
  217|  1.19k|    int blen;
  218|  1.19k|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  219|       |
  220|  1.19k|    if (b->flags & BIO_FLAGS_MEM_RDONLY) {
  ------------------
  |  |  237|  1.19k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (220:9): [True: 0, False: 1.19k]
  ------------------
  221|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  222|      0|        goto end;
  223|      0|    }
  224|  1.19k|    BIO_clear_retry_flags(b);
  ------------------
  |  |  261|  1.19k|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  223|  1.19k|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  220|  1.19k|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  221|  1.19k|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|  1.19k|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  224|  1.19k|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  225|  1.19k|    if (inl == 0)
  ------------------
  |  Branch (225:9): [True: 0, False: 1.19k]
  ------------------
  226|      0|        return 0;
  227|  1.19k|    if (in == NULL) {
  ------------------
  |  Branch (227:9): [True: 0, False: 1.19k]
  ------------------
  228|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  229|      0|        goto end;
  230|      0|    }
  231|  1.19k|    blen = bbm->readp->length;
  232|  1.19k|    mem_buf_sync(b);
  233|  1.19k|    if (BUF_MEM_grow_clean(bbm->buf, blen + inl) == 0)
  ------------------
  |  Branch (233:9): [True: 0, False: 1.19k]
  ------------------
  234|      0|        goto end;
  235|  1.19k|    memcpy(bbm->buf->data + blen, in, inl);
  236|  1.19k|    *bbm->readp = *bbm->buf;
  237|  1.19k|    ret = inl;
  238|  1.19k| end:
  239|  1.19k|    return ret;
  240|  1.19k|}
bss_mem.c:mem_buf_sync:
  178|  2.39k|{
  179|  2.39k|    if (b != NULL && b->init != 0 && b->ptr != NULL) {
  ------------------
  |  Branch (179:9): [True: 2.39k, False: 0]
  |  Branch (179:22): [True: 2.39k, False: 0]
  |  Branch (179:38): [True: 2.39k, False: 0]
  ------------------
  180|  2.39k|        BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  181|       |
  182|  2.39k|        if (bbm->readp->data != bbm->buf->data) {
  ------------------
  |  Branch (182:13): [True: 0, False: 2.39k]
  ------------------
  183|      0|            memmove(bbm->buf->data, bbm->readp->data, bbm->readp->length);
  184|      0|            bbm->buf->length = bbm->readp->length;
  185|      0|            bbm->readp->data = bbm->buf->data;
  186|      0|        }
  187|  2.39k|    }
  188|  2.39k|    return 0;
  189|  2.39k|}
bss_mem.c:mem_read:
  192|   193M|{
  193|   193M|    int ret = -1;
  194|   193M|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  195|   193M|    BUF_MEM *bm = bbm->readp;
  196|       |
  197|   193M|    if (b->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  237|   193M|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (197:9): [True: 193M, False: 0]
  ------------------
  198|   193M|        bm = bbm->buf;
  199|   193M|    BIO_clear_retry_flags(b);
  ------------------
  |  |  261|   193M|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  223|   193M|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  220|   193M|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  221|   193M|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|   193M|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  224|   193M|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  200|   193M|    ret = (outl >= 0 && (size_t)outl > bm->length) ? (int)bm->length : outl;
  ------------------
  |  Branch (200:12): [True: 193M, False: 0]
  |  Branch (200:25): [True: 801k, False: 192M]
  ------------------
  201|   193M|    if ((out != NULL) && (ret > 0)) {
  ------------------
  |  Branch (201:9): [True: 193M, False: 0]
  |  Branch (201:26): [True: 192M, False: 582k]
  ------------------
  202|   192M|        memcpy(out, bm->data, ret);
  203|   192M|        bm->length -= ret;
  204|   192M|        bm->max -= ret;
  205|   192M|        bm->data += ret;
  206|   192M|    } else if (bm->length == 0) {
  ------------------
  |  Branch (206:16): [True: 582k, False: 0]
  ------------------
  207|   582k|        ret = b->num;
  208|   582k|        if (ret != 0)
  ------------------
  |  Branch (208:13): [True: 0, False: 582k]
  ------------------
  209|      0|            BIO_set_retry_read(b);
  ------------------
  |  |  255|      0|                BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  220|      0|# define BIO_FLAGS_READ          0x01
  |  |  ------------------
  |  |                               BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  224|      0|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  210|   582k|    }
  211|   193M|    return ret;
  212|   193M|}
bss_mem.c:mem_ctrl:
  243|  1.04M|{
  244|  1.04M|    long ret = 1;
  245|  1.04M|    char **pptr;
  246|  1.04M|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  247|  1.04M|    BUF_MEM *bm, *bo;            /* bio_mem, bio_other */
  248|  1.04M|    long off, remain;
  249|       |
  250|  1.04M|    if (b->flags & BIO_FLAGS_MEM_RDONLY) {
  ------------------
  |  |  237|  1.04M|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (250:9): [True: 1.04M, False: 1.19k]
  ------------------
  251|  1.04M|        bm = bbm->buf;
  252|  1.04M|        bo = bbm->readp;
  253|  1.04M|    } else {
  254|  1.19k|        bm = bbm->readp;
  255|  1.19k|        bo = bbm->buf;
  256|  1.19k|    }
  257|  1.04M|    off = (bm->data == bo->data) ? 0 : bm->data - bo->data;
  ------------------
  |  Branch (257:11): [True: 630k, False: 411k]
  ------------------
  258|  1.04M|    remain = bm->length;
  259|       |
  260|  1.04M|    switch (cmd) {
  261|      0|    case BIO_CTRL_RESET:
  ------------------
  |  |   88|      0|# define BIO_CTRL_RESET          1/* opt - rewind/zero etc */
  ------------------
  |  Branch (261:5): [True: 0, False: 1.04M]
  ------------------
  262|      0|        bm = bbm->buf;
  263|      0|        if (bm->data != NULL) {
  ------------------
  |  Branch (263:13): [True: 0, False: 0]
  ------------------
  264|      0|            if (!(b->flags & BIO_FLAGS_MEM_RDONLY)) {
  ------------------
  |  |  237|      0|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (264:17): [True: 0, False: 0]
  ------------------
  265|      0|                if (!(b->flags & BIO_FLAGS_NONCLEAR_RST)) {
  ------------------
  |  |  238|      0|# define BIO_FLAGS_NONCLEAR_RST  0x400
  ------------------
  |  Branch (265:21): [True: 0, False: 0]
  ------------------
  266|      0|                    memset(bm->data, 0, bm->max);
  267|      0|                    bm->length = 0;
  268|      0|                }
  269|      0|                *bbm->readp = *bbm->buf;
  270|      0|            } else {
  271|       |                /* For read only case just reset to the start again */
  272|      0|                *bbm->buf = *bbm->readp;
  273|      0|            }
  274|      0|        }
  275|      0|        break;
  276|   466k|    case BIO_C_FILE_SEEK:
  ------------------
  |  |  459|   466k|# define BIO_C_FILE_SEEK                         128
  ------------------
  |  Branch (276:5): [True: 466k, False: 576k]
  ------------------
  277|   466k|        if (num < 0 || num > off + remain)
  ------------------
  |  Branch (277:13): [True: 0, False: 466k]
  |  Branch (277:24): [True: 0, False: 466k]
  ------------------
  278|      0|            return -1;   /* Can't see outside of the current buffer */
  279|       |
  280|   466k|        bm->data = (num != 0) ? bo->data + num : bo->data;
  ------------------
  |  Branch (280:20): [True: 0, False: 466k]
  ------------------
  281|   466k|        bm->length = bo->length - num;
  282|   466k|        bm->max = bo->max - num;
  283|   466k|        off = num;
  284|       |        /* FALLTHRU */
  285|  1.03M|    case BIO_C_FILE_TELL:
  ------------------
  |  |  465|  1.03M|# define BIO_C_FILE_TELL                         133
  ------------------
  |  Branch (285:5): [True: 566k, False: 475k]
  ------------------
  286|  1.03M|        ret = off;
  287|  1.03M|        break;
  288|      0|    case BIO_CTRL_EOF:
  ------------------
  |  |   89|      0|# define BIO_CTRL_EOF            2/* opt - are we at the eof */
  ------------------
  |  Branch (288:5): [True: 0, False: 1.04M]
  ------------------
  289|      0|        ret = (long)(bm->length == 0);
  290|      0|        break;
  291|      0|    case BIO_C_SET_BUF_MEM_EOF_RETURN:
  ------------------
  |  |  461|      0|# define BIO_C_SET_BUF_MEM_EOF_RETURN            130/* return end of input
  ------------------
  |  Branch (291:5): [True: 0, False: 1.04M]
  ------------------
  292|      0|        b->num = (int)num;
  293|      0|        break;
  294|  8.30k|    case BIO_CTRL_INFO:
  ------------------
  |  |   90|  8.30k|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  ------------------
  |  Branch (294:5): [True: 8.30k, False: 1.03M]
  ------------------
  295|  8.30k|        ret = (long)bm->length;
  296|  8.30k|        if (ptr != NULL) {
  ------------------
  |  Branch (296:13): [True: 8.30k, False: 0]
  ------------------
  297|  8.30k|            pptr = (char **)ptr;
  298|  8.30k|            *pptr = (char *)(bm->data);
  299|  8.30k|        }
  300|  8.30k|        break;
  301|      0|    case BIO_C_SET_BUF_MEM:
  ------------------
  |  |  445|      0|# define BIO_C_SET_BUF_MEM                       114
  ------------------
  |  Branch (301:5): [True: 0, False: 1.04M]
  ------------------
  302|      0|        mem_buf_free(b);
  303|      0|        b->shutdown = (int)num;
  304|      0|        bbm->buf = ptr;
  305|      0|        *bbm->readp = *bbm->buf;
  306|      0|        break;
  307|  1.19k|    case BIO_C_GET_BUF_MEM_PTR:
  ------------------
  |  |  446|  1.19k|# define BIO_C_GET_BUF_MEM_PTR                   115
  ------------------
  |  Branch (307:5): [True: 1.19k, False: 1.04M]
  ------------------
  308|  1.19k|        if (ptr != NULL) {
  ------------------
  |  Branch (308:13): [True: 1.19k, False: 0]
  ------------------
  309|  1.19k|            if (!(b->flags & BIO_FLAGS_MEM_RDONLY))
  ------------------
  |  |  237|  1.19k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (309:17): [True: 1.19k, False: 0]
  ------------------
  310|  1.19k|                mem_buf_sync(b);
  311|  1.19k|            bm = bbm->buf;
  312|  1.19k|            pptr = (char **)ptr;
  313|  1.19k|            *pptr = (char *)bm;
  314|  1.19k|        }
  315|  1.19k|        break;
  316|      0|    case BIO_CTRL_GET_CLOSE:
  ------------------
  |  |   95|      0|# define BIO_CTRL_GET_CLOSE      8/* man - set the 'close' on free */
  ------------------
  |  Branch (316:5): [True: 0, False: 1.04M]
  ------------------
  317|      0|        ret = (long)b->shutdown;
  318|      0|        break;
  319|      0|    case BIO_CTRL_SET_CLOSE:
  ------------------
  |  |   96|      0|# define BIO_CTRL_SET_CLOSE      9/* man - set the 'close' on free */
  ------------------
  |  Branch (319:5): [True: 0, False: 1.04M]
  ------------------
  320|      0|        b->shutdown = (int)num;
  321|      0|        break;
  322|      0|    case BIO_CTRL_WPENDING:
  ------------------
  |  |  100|      0|# define BIO_CTRL_WPENDING       13/* opt - number of bytes still to write */
  ------------------
  |  Branch (322:5): [True: 0, False: 1.04M]
  ------------------
  323|      0|        ret = 0L;
  324|      0|        break;
  325|      0|    case BIO_CTRL_PENDING:
  ------------------
  |  |   97|      0|# define BIO_CTRL_PENDING        10/* opt - is their more data buffered */
  ------------------
  |  Branch (325:5): [True: 0, False: 1.04M]
  ------------------
  326|      0|        ret = (long)bm->length;
  327|      0|        break;
  328|      0|    case BIO_CTRL_DUP:
  ------------------
  |  |   99|      0|# define BIO_CTRL_DUP            12/* man - extra stuff for 'duped' BIO */
  ------------------
  |  Branch (328:5): [True: 0, False: 1.04M]
  ------------------
  329|      0|    case BIO_CTRL_FLUSH:
  ------------------
  |  |   98|      0|# define BIO_CTRL_FLUSH          11/* opt - 'flush' buffered output */
  ------------------
  |  Branch (329:5): [True: 0, False: 1.04M]
  ------------------
  330|      0|        ret = 1;
  331|      0|        break;
  332|      0|    case BIO_CTRL_PUSH:
  ------------------
  |  |   93|      0|# define BIO_CTRL_PUSH           6/* opt - internal, used to signify change */
  ------------------
  |  Branch (332:5): [True: 0, False: 1.04M]
  ------------------
  333|      0|    case BIO_CTRL_POP:
  ------------------
  |  |   94|      0|# define BIO_CTRL_POP            7/* opt - internal, used to signify change */
  ------------------
  |  Branch (333:5): [True: 0, False: 1.04M]
  ------------------
  334|      0|    default:
  ------------------
  |  Branch (334:5): [True: 0, False: 1.04M]
  ------------------
  335|      0|        ret = 0;
  336|      0|        break;
  337|  1.04M|    }
  338|  1.04M|    return ret;
  339|  1.04M|}
bss_mem.c:mem_buf_free:
  158|  67.6k|{
  159|  67.6k|    if (a == NULL)
  ------------------
  |  Branch (159:9): [True: 0, False: 67.6k]
  ------------------
  160|      0|        return 0;
  161|       |
  162|  67.6k|    if (a->shutdown && a->init && a->ptr != NULL) {
  ------------------
  |  Branch (162:9): [True: 67.6k, False: 0]
  |  Branch (162:24): [True: 67.6k, False: 0]
  |  Branch (162:35): [True: 67.6k, False: 0]
  ------------------
  163|  67.6k|        BIO_BUF_MEM *bb = (BIO_BUF_MEM *)a->ptr;
  164|  67.6k|        BUF_MEM *b = bb->buf;
  165|       |
  166|  67.6k|        if (a->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  237|  67.6k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (166:13): [True: 66.0k, False: 1.64k]
  ------------------
  167|  66.0k|            b->data = NULL;
  168|  67.6k|        BUF_MEM_free(b);
  169|  67.6k|    }
  170|  67.6k|    return 1;
  171|  67.6k|}
bss_mem.c:mem_new:
  133|  67.6k|{
  134|  67.6k|    return mem_init(bi, 0L);
  135|  67.6k|}
bss_mem.c:mem_init:
  110|  67.6k|{
  111|  67.6k|    BIO_BUF_MEM *bb = OPENSSL_zalloc(sizeof(*bb));
  ------------------
  |  |  104|  67.6k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  67.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  67.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|       |
  113|  67.6k|    if (bb == NULL)
  ------------------
  |  Branch (113:9): [True: 0, False: 67.6k]
  ------------------
  114|      0|        return 0;
  115|  67.6k|    if ((bb->buf = BUF_MEM_new_ex(flags)) == NULL) {
  ------------------
  |  Branch (115:9): [True: 0, False: 67.6k]
  ------------------
  116|      0|        OPENSSL_free(bb);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  117|      0|        return 0;
  118|      0|    }
  119|  67.6k|    if ((bb->readp = OPENSSL_zalloc(sizeof(*bb->readp))) == NULL) {
  ------------------
  |  |  104|  67.6k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  67.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  67.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (119:9): [True: 0, False: 67.6k]
  ------------------
  120|      0|        BUF_MEM_free(bb->buf);
  121|      0|        OPENSSL_free(bb);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  122|      0|        return 0;
  123|      0|    }
  124|  67.6k|    *bb->readp = *bb->buf;
  125|  67.6k|    bi->shutdown = 1;
  126|  67.6k|    bi->init = 1;
  127|  67.6k|    bi->num = -1;
  128|  67.6k|    bi->ptr = (char *)bb;
  129|  67.6k|    return 1;
  130|  67.6k|}
bss_mem.c:mem_free:
  143|  67.6k|{
  144|  67.6k|    BIO_BUF_MEM *bb;
  145|       |
  146|  67.6k|    if (a == NULL)
  ------------------
  |  Branch (146:9): [True: 0, False: 67.6k]
  ------------------
  147|      0|        return 0;
  148|       |
  149|  67.6k|    bb = (BIO_BUF_MEM *)a->ptr;
  150|  67.6k|    if (!mem_buf_free(a))
  ------------------
  |  Branch (150:9): [True: 0, False: 67.6k]
  ------------------
  151|      0|        return 0;
  152|  67.6k|    OPENSSL_free(bb->readp);
  ------------------
  |  |  115|  67.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  67.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  67.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  153|  67.6k|    OPENSSL_free(bb);
  ------------------
  |  |  115|  67.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  67.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  67.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|  67.6k|    return 1;
  155|  67.6k|}

BIO_s_null:
   36|  53.8k|{
   37|  53.8k|    return &null_method;
   38|  53.8k|}
bss_null.c:null_write:
   46|  14.7M|{
   47|  14.7M|    return inl;
   48|  14.7M|}
bss_null.c:null_puts:
   81|  1.17M|{
   82|  1.17M|    if (str == NULL)
  ------------------
  |  Branch (82:9): [True: 0, False: 1.17M]
  ------------------
   83|      0|        return 0;
   84|  1.17M|    return strlen(str);
   85|  1.17M|}
bss_null.c:null_ctrl:
   51|  5.12M|{
   52|  5.12M|    long ret = 1;
   53|       |
   54|  5.12M|    switch (cmd) {
   55|      0|    case BIO_CTRL_RESET:
  ------------------
  |  |   88|      0|# define BIO_CTRL_RESET          1/* opt - rewind/zero etc */
  ------------------
  |  Branch (55:5): [True: 0, False: 5.12M]
  ------------------
   56|      0|    case BIO_CTRL_EOF:
  ------------------
  |  |   89|      0|# define BIO_CTRL_EOF            2/* opt - are we at the eof */
  ------------------
  |  Branch (56:5): [True: 0, False: 5.12M]
  ------------------
   57|      0|    case BIO_CTRL_SET:
  ------------------
  |  |   91|      0|# define BIO_CTRL_SET            4/* man - set the 'IO' type */
  ------------------
  |  Branch (57:5): [True: 0, False: 5.12M]
  ------------------
   58|      0|    case BIO_CTRL_SET_CLOSE:
  ------------------
  |  |   96|      0|# define BIO_CTRL_SET_CLOSE      9/* man - set the 'close' on free */
  ------------------
  |  Branch (58:5): [True: 0, False: 5.12M]
  ------------------
   59|      0|    case BIO_CTRL_FLUSH:
  ------------------
  |  |   98|      0|# define BIO_CTRL_FLUSH          11/* opt - 'flush' buffered output */
  ------------------
  |  Branch (59:5): [True: 0, False: 5.12M]
  ------------------
   60|      0|    case BIO_CTRL_DUP:
  ------------------
  |  |   99|      0|# define BIO_CTRL_DUP            12/* man - extra stuff for 'duped' BIO */
  ------------------
  |  Branch (60:5): [True: 0, False: 5.12M]
  ------------------
   61|      0|        ret = 1;
   62|      0|        break;
   63|      0|    case BIO_CTRL_GET_CLOSE:
  ------------------
  |  |   95|      0|# define BIO_CTRL_GET_CLOSE      8/* man - set the 'close' on free */
  ------------------
  |  Branch (63:5): [True: 0, False: 5.12M]
  ------------------
   64|      0|    case BIO_CTRL_INFO:
  ------------------
  |  |   90|      0|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  ------------------
  |  Branch (64:5): [True: 0, False: 5.12M]
  ------------------
   65|      0|    case BIO_CTRL_GET:
  ------------------
  |  |   92|      0|# define BIO_CTRL_GET            5/* man - get the 'IO' type */
  ------------------
  |  Branch (65:5): [True: 0, False: 5.12M]
  ------------------
   66|      0|    case BIO_CTRL_PENDING:
  ------------------
  |  |   97|      0|# define BIO_CTRL_PENDING        10/* opt - is their more data buffered */
  ------------------
  |  Branch (66:5): [True: 0, False: 5.12M]
  ------------------
   67|      0|    case BIO_CTRL_WPENDING:
  ------------------
  |  |  100|      0|# define BIO_CTRL_WPENDING       13/* opt - number of bytes still to write */
  ------------------
  |  Branch (67:5): [True: 0, False: 5.12M]
  ------------------
   68|  5.12M|    default:
  ------------------
  |  Branch (68:5): [True: 5.12M, False: 0]
  ------------------
   69|  5.12M|        ret = 0;
   70|  5.12M|        break;
   71|  5.12M|    }
   72|  5.12M|    return ret;
   73|  5.12M|}

ossl_core_bio_up_ref:
   35|   469k|{
   36|   469k|    int ref = 0;
   37|       |
   38|   469k|    return CRYPTO_UP_REF(&cb->ref_cnt, &ref);
   39|   469k|}
ossl_core_bio_free:
   42|   543k|{
   43|   543k|    int ref = 0, res = 1;
   44|       |
   45|   543k|    if (cb != NULL) {
  ------------------
  |  Branch (45:9): [True: 535k, False: 8.30k]
  ------------------
   46|   535k|        CRYPTO_DOWN_REF(&cb->ref_cnt, &ref);
   47|   535k|        if (ref <= 0) {
  ------------------
  |  Branch (47:13): [True: 66.3k, False: 469k]
  ------------------
   48|  66.3k|            res = BIO_free(cb->bio);
   49|  66.3k|            CRYPTO_FREE_REF(&cb->ref_cnt);
   50|  66.3k|            OPENSSL_free(cb);
  ------------------
  |  |  115|  66.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  66.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  66.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   51|  66.3k|        }
   52|   535k|    }
   53|   543k|    return res;
   54|   543k|}
ossl_core_bio_new_from_bio:
   57|  66.3k|{
   58|  66.3k|    OSSL_CORE_BIO *cb = core_bio_new();
   59|       |
   60|  66.3k|    if (cb == NULL || !BIO_up_ref(bio)) {
  ------------------
  |  Branch (60:9): [True: 0, False: 66.3k]
  |  Branch (60:23): [True: 0, False: 66.3k]
  ------------------
   61|      0|        ossl_core_bio_free(cb);
   62|      0|        return NULL;
   63|      0|    }
   64|  66.3k|    cb->bio = bio;
   65|  66.3k|    return cb;
   66|  66.3k|}
ossl_core_bio_read_ex:
   94|   193M|{
   95|   193M|    return BIO_read_ex(cb->bio, data, dlen, readbytes);
   96|   193M|}
ossl_core_bio_write_ex:
  100|   630k|{
  101|   630k|    return BIO_write_ex(cb->bio, data, dlen, written);
  102|   630k|}
ossl_core_bio.c:core_bio_new:
   24|  66.3k|{
   25|  66.3k|    OSSL_CORE_BIO *cb = OPENSSL_malloc(sizeof(*cb));
  ------------------
  |  |  102|  66.3k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  66.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  66.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|       |
   27|  66.3k|    if (cb == NULL || !CRYPTO_NEW_REF(&cb->ref_cnt, 1)) {
  ------------------
  |  Branch (27:9): [True: 0, False: 66.3k]
  |  Branch (27:23): [True: 0, False: 66.3k]
  ------------------
   28|      0|        OPENSSL_free(cb);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   29|      0|        return NULL;
   30|      0|    }
   31|  66.3k|    return cb;
   32|  66.3k|}

bn_mul_add_words:
  112|  1.41M|{
  113|  1.41M|    BN_ULONG c1 = 0;
  ------------------
  |  |   37|  1.41M|#  define BN_ULONG        unsigned long
  ------------------
  114|       |
  115|  1.41M|    if (num <= 0)
  ------------------
  |  Branch (115:9): [True: 0, False: 1.41M]
  ------------------
  116|      0|        return c1;
  117|       |
  118|   180M|    while (num & ~3) {
  ------------------
  |  Branch (118:12): [True: 179M, False: 1.41M]
  ------------------
  119|   179M|        mul_add(rp[0], ap[0], w, c1);
  ------------------
  |  |   74|   179M|# define mul_add(r,a,word,carry) do {   \
  |  |   75|   179M|        register BN_ULONG high,low;     \
  |  |   76|   179M|        asm ("mulq %3"                  \
  |  |   77|   179M|                : "=a"(low),"=d"(high)  \
  |  |   78|   179M|                : "a"(word),"m"(a)      \
  |  |   79|   179M|                : "cc");                \
  |  |   80|   179M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   81|   179M|                : "+r"(carry),"+d"(high)\
  |  |   82|   179M|                : "a"(low),"g"(0)       \
  |  |   83|   179M|                : "cc");                \
  |  |   84|   179M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   85|   179M|                : "+m"(r),"+d"(high)    \
  |  |   86|   179M|                : "r"(carry),"g"(0)     \
  |  |   87|   179M|                : "cc");                \
  |  |   88|   179M|        carry=high;                     \
  |  |   89|   179M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (89:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  120|   179M|        mul_add(rp[1], ap[1], w, c1);
  ------------------
  |  |   74|   179M|# define mul_add(r,a,word,carry) do {   \
  |  |   75|   179M|        register BN_ULONG high,low;     \
  |  |   76|   179M|        asm ("mulq %3"                  \
  |  |   77|   179M|                : "=a"(low),"=d"(high)  \
  |  |   78|   179M|                : "a"(word),"m"(a)      \
  |  |   79|   179M|                : "cc");                \
  |  |   80|   179M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   81|   179M|                : "+r"(carry),"+d"(high)\
  |  |   82|   179M|                : "a"(low),"g"(0)       \
  |  |   83|   179M|                : "cc");                \
  |  |   84|   179M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   85|   179M|                : "+m"(r),"+d"(high)    \
  |  |   86|   179M|                : "r"(carry),"g"(0)     \
  |  |   87|   179M|                : "cc");                \
  |  |   88|   179M|        carry=high;                     \
  |  |   89|   179M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (89:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  121|   179M|        mul_add(rp[2], ap[2], w, c1);
  ------------------
  |  |   74|   179M|# define mul_add(r,a,word,carry) do {   \
  |  |   75|   179M|        register BN_ULONG high,low;     \
  |  |   76|   179M|        asm ("mulq %3"                  \
  |  |   77|   179M|                : "=a"(low),"=d"(high)  \
  |  |   78|   179M|                : "a"(word),"m"(a)      \
  |  |   79|   179M|                : "cc");                \
  |  |   80|   179M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   81|   179M|                : "+r"(carry),"+d"(high)\
  |  |   82|   179M|                : "a"(low),"g"(0)       \
  |  |   83|   179M|                : "cc");                \
  |  |   84|   179M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   85|   179M|                : "+m"(r),"+d"(high)    \
  |  |   86|   179M|                : "r"(carry),"g"(0)     \
  |  |   87|   179M|                : "cc");                \
  |  |   88|   179M|        carry=high;                     \
  |  |   89|   179M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (89:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  122|   179M|        mul_add(rp[3], ap[3], w, c1);
  ------------------
  |  |   74|   179M|# define mul_add(r,a,word,carry) do {   \
  |  |   75|   179M|        register BN_ULONG high,low;     \
  |  |   76|   179M|        asm ("mulq %3"                  \
  |  |   77|   179M|                : "=a"(low),"=d"(high)  \
  |  |   78|   179M|                : "a"(word),"m"(a)      \
  |  |   79|   179M|                : "cc");                \
  |  |   80|   179M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   81|   179M|                : "+r"(carry),"+d"(high)\
  |  |   82|   179M|                : "a"(low),"g"(0)       \
  |  |   83|   179M|                : "cc");                \
  |  |   84|   179M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   85|   179M|                : "+m"(r),"+d"(high)    \
  |  |   86|   179M|                : "r"(carry),"g"(0)     \
  |  |   87|   179M|                : "cc");                \
  |  |   88|   179M|        carry=high;                     \
  |  |   89|   179M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (89:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  123|   179M|        ap += 4;
  124|   179M|        rp += 4;
  125|   179M|        num -= 4;
  126|   179M|    }
  127|  1.41M|    if (num) {
  ------------------
  |  Branch (127:9): [True: 511k, False: 907k]
  ------------------
  128|   511k|        mul_add(rp[0], ap[0], w, c1);
  ------------------
  |  |   74|   511k|# define mul_add(r,a,word,carry) do {   \
  |  |   75|   511k|        register BN_ULONG high,low;     \
  |  |   76|   511k|        asm ("mulq %3"                  \
  |  |   77|   511k|                : "=a"(low),"=d"(high)  \
  |  |   78|   511k|                : "a"(word),"m"(a)      \
  |  |   79|   511k|                : "cc");                \
  |  |   80|   511k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   81|   511k|                : "+r"(carry),"+d"(high)\
  |  |   82|   511k|                : "a"(low),"g"(0)       \
  |  |   83|   511k|                : "cc");                \
  |  |   84|   511k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   85|   511k|                : "+m"(r),"+d"(high)    \
  |  |   86|   511k|                : "r"(carry),"g"(0)     \
  |  |   87|   511k|                : "cc");                \
  |  |   88|   511k|        carry=high;                     \
  |  |   89|   511k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (89:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  129|   511k|        if (--num == 0)
  ------------------
  |  Branch (129:13): [True: 84.0k, False: 427k]
  ------------------
  130|  84.0k|            return c1;
  131|   427k|        mul_add(rp[1], ap[1], w, c1);
  ------------------
  |  |   74|   427k|# define mul_add(r,a,word,carry) do {   \
  |  |   75|   427k|        register BN_ULONG high,low;     \
  |  |   76|   427k|        asm ("mulq %3"                  \
  |  |   77|   427k|                : "=a"(low),"=d"(high)  \
  |  |   78|   427k|                : "a"(word),"m"(a)      \
  |  |   79|   427k|                : "cc");                \
  |  |   80|   427k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   81|   427k|                : "+r"(carry),"+d"(high)\
  |  |   82|   427k|                : "a"(low),"g"(0)       \
  |  |   83|   427k|                : "cc");                \
  |  |   84|   427k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   85|   427k|                : "+m"(r),"+d"(high)    \
  |  |   86|   427k|                : "r"(carry),"g"(0)     \
  |  |   87|   427k|                : "cc");                \
  |  |   88|   427k|        carry=high;                     \
  |  |   89|   427k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (89:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  132|   427k|        if (--num == 0)
  ------------------
  |  Branch (132:13): [True: 106k, False: 321k]
  ------------------
  133|   106k|            return c1;
  134|   321k|        mul_add(rp[2], ap[2], w, c1);
  ------------------
  |  |   74|   321k|# define mul_add(r,a,word,carry) do {   \
  |  |   75|   321k|        register BN_ULONG high,low;     \
  |  |   76|   321k|        asm ("mulq %3"                  \
  |  |   77|   321k|                : "=a"(low),"=d"(high)  \
  |  |   78|   321k|                : "a"(word),"m"(a)      \
  |  |   79|   321k|                : "cc");                \
  |  |   80|   321k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   81|   321k|                : "+r"(carry),"+d"(high)\
  |  |   82|   321k|                : "a"(low),"g"(0)       \
  |  |   83|   321k|                : "cc");                \
  |  |   84|   321k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   85|   321k|                : "+m"(r),"+d"(high)    \
  |  |   86|   321k|                : "r"(carry),"g"(0)     \
  |  |   87|   321k|                : "cc");                \
  |  |   88|   321k|        carry=high;                     \
  |  |   89|   321k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (89:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  135|   321k|        return c1;
  136|   427k|    }
  137|       |
  138|   907k|    return c1;
  139|  1.41M|}
bn_mul_words:
  142|  4.33M|{
  143|  4.33M|    BN_ULONG c1 = 0;
  ------------------
  |  |   37|  4.33M|#  define BN_ULONG        unsigned long
  ------------------
  144|       |
  145|  4.33M|    if (num <= 0)
  ------------------
  |  Branch (145:9): [True: 0, False: 4.33M]
  ------------------
  146|      0|        return c1;
  147|       |
  148|  23.4M|    while (num & ~3) {
  ------------------
  |  Branch (148:12): [True: 19.0M, False: 4.33M]
  ------------------
  149|  19.0M|        mul(rp[0], ap[0], w, c1);
  ------------------
  |  |   91|  19.0M|# define mul(r,a,word,carry) do {       \
  |  |   92|  19.0M|        register BN_ULONG high,low;     \
  |  |   93|  19.0M|        asm ("mulq %3"                  \
  |  |   94|  19.0M|                : "=a"(low),"=d"(high)  \
  |  |   95|  19.0M|                : "a"(word),"g"(a)      \
  |  |   96|  19.0M|                : "cc");                \
  |  |   97|  19.0M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   98|  19.0M|                : "+r"(carry),"+d"(high)\
  |  |   99|  19.0M|                : "a"(low),"g"(0)       \
  |  |  100|  19.0M|                : "cc");                \
  |  |  101|  19.0M|        (r)=carry, carry=high;          \
  |  |  102|  19.0M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (102:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  150|  19.0M|        mul(rp[1], ap[1], w, c1);
  ------------------
  |  |   91|  19.0M|# define mul(r,a,word,carry) do {       \
  |  |   92|  19.0M|        register BN_ULONG high,low;     \
  |  |   93|  19.0M|        asm ("mulq %3"                  \
  |  |   94|  19.0M|                : "=a"(low),"=d"(high)  \
  |  |   95|  19.0M|                : "a"(word),"g"(a)      \
  |  |   96|  19.0M|                : "cc");                \
  |  |   97|  19.0M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   98|  19.0M|                : "+r"(carry),"+d"(high)\
  |  |   99|  19.0M|                : "a"(low),"g"(0)       \
  |  |  100|  19.0M|                : "cc");                \
  |  |  101|  19.0M|        (r)=carry, carry=high;          \
  |  |  102|  19.0M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (102:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  151|  19.0M|        mul(rp[2], ap[2], w, c1);
  ------------------
  |  |   91|  19.0M|# define mul(r,a,word,carry) do {       \
  |  |   92|  19.0M|        register BN_ULONG high,low;     \
  |  |   93|  19.0M|        asm ("mulq %3"                  \
  |  |   94|  19.0M|                : "=a"(low),"=d"(high)  \
  |  |   95|  19.0M|                : "a"(word),"g"(a)      \
  |  |   96|  19.0M|                : "cc");                \
  |  |   97|  19.0M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   98|  19.0M|                : "+r"(carry),"+d"(high)\
  |  |   99|  19.0M|                : "a"(low),"g"(0)       \
  |  |  100|  19.0M|                : "cc");                \
  |  |  101|  19.0M|        (r)=carry, carry=high;          \
  |  |  102|  19.0M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (102:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  152|  19.0M|        mul(rp[3], ap[3], w, c1);
  ------------------
  |  |   91|  19.0M|# define mul(r,a,word,carry) do {       \
  |  |   92|  19.0M|        register BN_ULONG high,low;     \
  |  |   93|  19.0M|        asm ("mulq %3"                  \
  |  |   94|  19.0M|                : "=a"(low),"=d"(high)  \
  |  |   95|  19.0M|                : "a"(word),"g"(a)      \
  |  |   96|  19.0M|                : "cc");                \
  |  |   97|  19.0M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   98|  19.0M|                : "+r"(carry),"+d"(high)\
  |  |   99|  19.0M|                : "a"(low),"g"(0)       \
  |  |  100|  19.0M|                : "cc");                \
  |  |  101|  19.0M|        (r)=carry, carry=high;          \
  |  |  102|  19.0M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (102:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  153|  19.0M|        ap += 4;
  154|  19.0M|        rp += 4;
  155|  19.0M|        num -= 4;
  156|  19.0M|    }
  157|  4.33M|    if (num) {
  ------------------
  |  Branch (157:9): [True: 582k, False: 3.75M]
  ------------------
  158|   582k|        mul(rp[0], ap[0], w, c1);
  ------------------
  |  |   91|   582k|# define mul(r,a,word,carry) do {       \
  |  |   92|   582k|        register BN_ULONG high,low;     \
  |  |   93|   582k|        asm ("mulq %3"                  \
  |  |   94|   582k|                : "=a"(low),"=d"(high)  \
  |  |   95|   582k|                : "a"(word),"g"(a)      \
  |  |   96|   582k|                : "cc");                \
  |  |   97|   582k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   98|   582k|                : "+r"(carry),"+d"(high)\
  |  |   99|   582k|                : "a"(low),"g"(0)       \
  |  |  100|   582k|                : "cc");                \
  |  |  101|   582k|        (r)=carry, carry=high;          \
  |  |  102|   582k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (102:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  159|   582k|        if (--num == 0)
  ------------------
  |  Branch (159:13): [True: 269k, False: 313k]
  ------------------
  160|   269k|            return c1;
  161|   313k|        mul(rp[1], ap[1], w, c1);
  ------------------
  |  |   91|   313k|# define mul(r,a,word,carry) do {       \
  |  |   92|   313k|        register BN_ULONG high,low;     \
  |  |   93|   313k|        asm ("mulq %3"                  \
  |  |   94|   313k|                : "=a"(low),"=d"(high)  \
  |  |   95|   313k|                : "a"(word),"g"(a)      \
  |  |   96|   313k|                : "cc");                \
  |  |   97|   313k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   98|   313k|                : "+r"(carry),"+d"(high)\
  |  |   99|   313k|                : "a"(low),"g"(0)       \
  |  |  100|   313k|                : "cc");                \
  |  |  101|   313k|        (r)=carry, carry=high;          \
  |  |  102|   313k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (102:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  162|   313k|        if (--num == 0)
  ------------------
  |  Branch (162:13): [True: 95.5k, False: 218k]
  ------------------
  163|  95.5k|            return c1;
  164|   218k|        mul(rp[2], ap[2], w, c1);
  ------------------
  |  |   91|   218k|# define mul(r,a,word,carry) do {       \
  |  |   92|   218k|        register BN_ULONG high,low;     \
  |  |   93|   218k|        asm ("mulq %3"                  \
  |  |   94|   218k|                : "=a"(low),"=d"(high)  \
  |  |   95|   218k|                : "a"(word),"g"(a)      \
  |  |   96|   218k|                : "cc");                \
  |  |   97|   218k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   98|   218k|                : "+r"(carry),"+d"(high)\
  |  |   99|   218k|                : "a"(low),"g"(0)       \
  |  |  100|   218k|                : "cc");                \
  |  |  101|   218k|        (r)=carry, carry=high;          \
  |  |  102|   218k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (102:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  165|   218k|    }
  166|  3.97M|    return c1;
  167|  4.33M|}
bn_sqr_words:
  170|  6.66k|{
  171|  6.66k|    if (n <= 0)
  ------------------
  |  Branch (171:9): [True: 0, False: 6.66k]
  ------------------
  172|      0|        return;
  173|       |
  174|  8.01k|    while (n & ~3) {
  ------------------
  |  Branch (174:12): [True: 1.35k, False: 6.66k]
  ------------------
  175|  1.35k|        sqr(r[0], r[1], a[0]);
  ------------------
  |  |  105|  1.35k|        asm ("mulq %2"                  \
  |  |  106|  1.35k|                : "=a"(r0),"=d"(r1)     \
  |  |  107|  1.35k|                : "a"(a)                \
  |  |  108|  1.35k|                : "cc");
  ------------------
  176|  1.35k|        sqr(r[2], r[3], a[1]);
  ------------------
  |  |  105|  1.35k|        asm ("mulq %2"                  \
  |  |  106|  1.35k|                : "=a"(r0),"=d"(r1)     \
  |  |  107|  1.35k|                : "a"(a)                \
  |  |  108|  1.35k|                : "cc");
  ------------------
  177|  1.35k|        sqr(r[4], r[5], a[2]);
  ------------------
  |  |  105|  1.35k|        asm ("mulq %2"                  \
  |  |  106|  1.35k|                : "=a"(r0),"=d"(r1)     \
  |  |  107|  1.35k|                : "a"(a)                \
  |  |  108|  1.35k|                : "cc");
  ------------------
  178|  1.35k|        sqr(r[6], r[7], a[3]);
  ------------------
  |  |  105|  1.35k|        asm ("mulq %2"                  \
  |  |  106|  1.35k|                : "=a"(r0),"=d"(r1)     \
  |  |  107|  1.35k|                : "a"(a)                \
  |  |  108|  1.35k|                : "cc");
  ------------------
  179|  1.35k|        a += 4;
  180|  1.35k|        r += 8;
  181|  1.35k|        n -= 4;
  182|  1.35k|    }
  183|  6.66k|    if (n) {
  ------------------
  |  Branch (183:9): [True: 6.66k, False: 0]
  ------------------
  184|  6.66k|        sqr(r[0], r[1], a[0]);
  ------------------
  |  |  105|  6.66k|        asm ("mulq %2"                  \
  |  |  106|  6.66k|                : "=a"(r0),"=d"(r1)     \
  |  |  107|  6.66k|                : "a"(a)                \
  |  |  108|  6.66k|                : "cc");
  ------------------
  185|  6.66k|        if (--n == 0)
  ------------------
  |  Branch (185:13): [True: 3.68k, False: 2.97k]
  ------------------
  186|  3.68k|            return;
  187|  2.97k|        sqr(r[2], r[3], a[1]);
  ------------------
  |  |  105|  2.97k|        asm ("mulq %2"                  \
  |  |  106|  2.97k|                : "=a"(r0),"=d"(r1)     \
  |  |  107|  2.97k|                : "a"(a)                \
  |  |  108|  2.97k|                : "cc");
  ------------------
  188|  2.97k|        if (--n == 0)
  ------------------
  |  Branch (188:13): [True: 1.81k, False: 1.16k]
  ------------------
  189|  1.81k|            return;
  190|  1.16k|        sqr(r[4], r[5], a[2]);
  ------------------
  |  |  105|  1.16k|        asm ("mulq %2"                  \
  |  |  106|  1.16k|                : "=a"(r0),"=d"(r1)     \
  |  |  107|  1.16k|                : "a"(a)                \
  |  |  108|  1.16k|                : "cc");
  ------------------
  191|  1.16k|    }
  192|  6.66k|}
bn_div_words:
  195|  4.10M|{
  196|  4.10M|    BN_ULONG ret, waste;
  ------------------
  |  |   37|  4.10M|#  define BN_ULONG        unsigned long
  ------------------
  197|       |
  198|  4.10M| asm("divq      %4":"=a"(ret), "=d"(waste)
  199|  4.10M| :     "a"(l), "d"(h), "r"(d)
  200|  4.10M| :     "cc");
  201|       |
  202|  4.10M|    return ret;
  203|  4.10M|}
bn_add_words:
  207|  6.92M|{
  208|  6.92M|    BN_ULONG ret;
  ------------------
  |  |   37|  6.92M|#  define BN_ULONG        unsigned long
  ------------------
  209|  6.92M|    size_t i = 0;
  210|       |
  211|  6.92M|    if (n <= 0)
  ------------------
  |  Branch (211:9): [True: 30.7k, False: 6.89M]
  ------------------
  212|  30.7k|        return 0;
  213|       |
  214|  6.89M|    asm volatile ("       subq    %0,%0           \n" /* clear carry */
  215|  6.89M|                  "       jmp     1f              \n"
  216|  6.89M|                  ".p2align 4                     \n"
  217|  6.89M|                  "1:     movq    (%4,%2,8),%0    \n"
  218|  6.89M|                  "       adcq    (%5,%2,8),%0    \n"
  219|  6.89M|                  "       movq    %0,(%3,%2,8)    \n"
  220|  6.89M|                  "       lea     1(%2),%2        \n"
  221|  6.89M|                  "       dec     %1              \n"
  222|  6.89M|                  "       jnz     1b              \n"
  223|  6.89M|                  "       sbbq    %0,%0           \n"
  224|  6.89M|                  :"=&r" (ret), "+c"(n), "+r"(i)
  225|  6.89M|                  :"r"(rp), "r"(ap), "r"(bp)
  226|  6.89M|                  :"cc", "memory");
  227|       |
  228|  6.89M|    return ret & 1;
  229|  6.92M|}
bn_sub_words:
  234|  8.98M|{
  235|  8.98M|    BN_ULONG ret;
  ------------------
  |  |   37|  8.98M|#  define BN_ULONG        unsigned long
  ------------------
  236|  8.98M|    size_t i = 0;
  237|       |
  238|  8.98M|    if (n <= 0)
  ------------------
  |  Branch (238:9): [True: 54.0k, False: 8.93M]
  ------------------
  239|  54.0k|        return 0;
  240|       |
  241|  8.93M|    asm volatile ("       subq    %0,%0           \n" /* clear borrow */
  242|  8.93M|                  "       jmp     1f              \n"
  243|  8.93M|                  ".p2align 4                     \n"
  244|  8.93M|                  "1:     movq    (%4,%2,8),%0    \n"
  245|  8.93M|                  "       sbbq    (%5,%2,8),%0    \n"
  246|  8.93M|                  "       movq    %0,(%3,%2,8)    \n"
  247|  8.93M|                  "       lea     1(%2),%2        \n"
  248|  8.93M|                  "       dec     %1              \n"
  249|  8.93M|                  "       jnz     1b              \n"
  250|  8.93M|                  "       sbbq    %0,%0           \n"
  251|  8.93M|                  :"=&r" (ret), "+c"(n), "+r"(i)
  252|  8.93M|                  :"r"(rp), "r"(ap), "r"(bp)
  253|  8.93M|                  :"cc", "memory");
  254|       |
  255|  8.93M|    return ret & 1;
  256|  8.98M|}
bn_mul_comba8:
  394|  18.7k|{
  395|  18.7k|    BN_ULONG c1, c2, c3;
  ------------------
  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  ------------------
  396|       |
  397|  18.7k|    c1 = 0;
  398|  18.7k|    c2 = 0;
  399|  18.7k|    c3 = 0;
  400|  18.7k|    mul_add_c(a[0], b[0], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  401|  18.7k|    r[0] = c1;
  402|  18.7k|    c1 = 0;
  403|  18.7k|    mul_add_c(a[0], b[1], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  404|  18.7k|    mul_add_c(a[1], b[0], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  405|  18.7k|    r[1] = c2;
  406|  18.7k|    c2 = 0;
  407|  18.7k|    mul_add_c(a[2], b[0], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  408|  18.7k|    mul_add_c(a[1], b[1], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  409|  18.7k|    mul_add_c(a[0], b[2], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  410|  18.7k|    r[2] = c3;
  411|  18.7k|    c3 = 0;
  412|  18.7k|    mul_add_c(a[0], b[3], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  413|  18.7k|    mul_add_c(a[1], b[2], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  414|  18.7k|    mul_add_c(a[2], b[1], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  415|  18.7k|    mul_add_c(a[3], b[0], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  416|  18.7k|    r[3] = c1;
  417|  18.7k|    c1 = 0;
  418|  18.7k|    mul_add_c(a[4], b[0], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  419|  18.7k|    mul_add_c(a[3], b[1], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  420|  18.7k|    mul_add_c(a[2], b[2], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  421|  18.7k|    mul_add_c(a[1], b[3], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  422|  18.7k|    mul_add_c(a[0], b[4], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  423|  18.7k|    r[4] = c2;
  424|  18.7k|    c2 = 0;
  425|  18.7k|    mul_add_c(a[0], b[5], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  426|  18.7k|    mul_add_c(a[1], b[4], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  427|  18.7k|    mul_add_c(a[2], b[3], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  428|  18.7k|    mul_add_c(a[3], b[2], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  429|  18.7k|    mul_add_c(a[4], b[1], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  430|  18.7k|    mul_add_c(a[5], b[0], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  431|  18.7k|    r[5] = c3;
  432|  18.7k|    c3 = 0;
  433|  18.7k|    mul_add_c(a[6], b[0], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  434|  18.7k|    mul_add_c(a[5], b[1], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  435|  18.7k|    mul_add_c(a[4], b[2], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  436|  18.7k|    mul_add_c(a[3], b[3], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  437|  18.7k|    mul_add_c(a[2], b[4], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  438|  18.7k|    mul_add_c(a[1], b[5], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  439|  18.7k|    mul_add_c(a[0], b[6], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  440|  18.7k|    r[6] = c1;
  441|  18.7k|    c1 = 0;
  442|  18.7k|    mul_add_c(a[0], b[7], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  443|  18.7k|    mul_add_c(a[1], b[6], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  444|  18.7k|    mul_add_c(a[2], b[5], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  445|  18.7k|    mul_add_c(a[3], b[4], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  446|  18.7k|    mul_add_c(a[4], b[3], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  447|  18.7k|    mul_add_c(a[5], b[2], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  448|  18.7k|    mul_add_c(a[6], b[1], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  449|  18.7k|    mul_add_c(a[7], b[0], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  450|  18.7k|    r[7] = c2;
  451|  18.7k|    c2 = 0;
  452|  18.7k|    mul_add_c(a[7], b[1], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  453|  18.7k|    mul_add_c(a[6], b[2], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  454|  18.7k|    mul_add_c(a[5], b[3], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  455|  18.7k|    mul_add_c(a[4], b[4], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  456|  18.7k|    mul_add_c(a[3], b[5], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  457|  18.7k|    mul_add_c(a[2], b[6], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  458|  18.7k|    mul_add_c(a[1], b[7], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  459|  18.7k|    r[8] = c3;
  460|  18.7k|    c3 = 0;
  461|  18.7k|    mul_add_c(a[2], b[7], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  462|  18.7k|    mul_add_c(a[3], b[6], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  463|  18.7k|    mul_add_c(a[4], b[5], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  464|  18.7k|    mul_add_c(a[5], b[4], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  465|  18.7k|    mul_add_c(a[6], b[3], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  466|  18.7k|    mul_add_c(a[7], b[2], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  467|  18.7k|    r[9] = c1;
  468|  18.7k|    c1 = 0;
  469|  18.7k|    mul_add_c(a[7], b[3], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  470|  18.7k|    mul_add_c(a[6], b[4], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  471|  18.7k|    mul_add_c(a[5], b[5], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  472|  18.7k|    mul_add_c(a[4], b[6], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  473|  18.7k|    mul_add_c(a[3], b[7], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  474|  18.7k|    r[10] = c2;
  475|  18.7k|    c2 = 0;
  476|  18.7k|    mul_add_c(a[4], b[7], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  477|  18.7k|    mul_add_c(a[5], b[6], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  478|  18.7k|    mul_add_c(a[6], b[5], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  479|  18.7k|    mul_add_c(a[7], b[4], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  480|  18.7k|    r[11] = c3;
  481|  18.7k|    c3 = 0;
  482|  18.7k|    mul_add_c(a[7], b[5], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  483|  18.7k|    mul_add_c(a[6], b[6], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  484|  18.7k|    mul_add_c(a[5], b[7], c1, c2, c3);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  485|  18.7k|    r[12] = c1;
  486|  18.7k|    c1 = 0;
  487|  18.7k|    mul_add_c(a[6], b[7], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  488|  18.7k|    mul_add_c(a[7], b[6], c2, c3, c1);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|  18.7k|    r[13] = c2;
  490|  18.7k|    c2 = 0;
  491|  18.7k|    mul_add_c(a[7], b[7], c3, c1, c2);
  ------------------
  |  |  349|  18.7k|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  18.7k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  18.7k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  18.7k|        asm ("mulq %3"                  \
  |  |  352|  18.7k|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  18.7k|                : "a"(a),"m"(b)         \
  |  |  354|  18.7k|                : "cc");                \
  |  |  355|  18.7k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  18.7k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  18.7k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  18.7k|                : "cc");                                \
  |  |  359|  18.7k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  492|  18.7k|    r[14] = c3;
  493|  18.7k|    r[15] = c1;
  494|  18.7k|}
bn_sqr_comba8:
  536|     46|{
  537|     46|    BN_ULONG c1, c2, c3;
  ------------------
  |  |   37|     46|#  define BN_ULONG        unsigned long
  ------------------
  538|       |
  539|     46|    c1 = 0;
  540|     46|    c2 = 0;
  541|     46|    c3 = 0;
  542|     46|    sqr_add_c(a, 0, c1, c2, c3);
  ------------------
  |  |  361|     46|#  define sqr_add_c(a,i,c0,c1,c2) do {  \
  |  |  362|     46|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  363|     46|        asm ("mulq %2"                  \
  |  |  364|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  365|     46|                : "a"(a[i])             \
  |  |  366|     46|                : "cc");                \
  |  |  367|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  368|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  369|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  370|     46|                : "cc");                                \
  |  |  371|     46|        } while (0)
  |  |  ------------------
  |  |  |  Branch (371:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  543|     46|    r[0] = c1;
  544|     46|    c1 = 0;
  545|     46|    sqr_add_c2(a, 1, 0, c2, c3, c1);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  546|     46|    r[1] = c2;
  547|     46|    c2 = 0;
  548|     46|    sqr_add_c(a, 1, c3, c1, c2);
  ------------------
  |  |  361|     46|#  define sqr_add_c(a,i,c0,c1,c2) do {  \
  |  |  362|     46|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  363|     46|        asm ("mulq %2"                  \
  |  |  364|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  365|     46|                : "a"(a[i])             \
  |  |  366|     46|                : "cc");                \
  |  |  367|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  368|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  369|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  370|     46|                : "cc");                                \
  |  |  371|     46|        } while (0)
  |  |  ------------------
  |  |  |  Branch (371:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  549|     46|    sqr_add_c2(a, 2, 0, c3, c1, c2);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  550|     46|    r[2] = c3;
  551|     46|    c3 = 0;
  552|     46|    sqr_add_c2(a, 3, 0, c1, c2, c3);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  553|     46|    sqr_add_c2(a, 2, 1, c1, c2, c3);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  554|     46|    r[3] = c1;
  555|     46|    c1 = 0;
  556|     46|    sqr_add_c(a, 2, c2, c3, c1);
  ------------------
  |  |  361|     46|#  define sqr_add_c(a,i,c0,c1,c2) do {  \
  |  |  362|     46|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  363|     46|        asm ("mulq %2"                  \
  |  |  364|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  365|     46|                : "a"(a[i])             \
  |  |  366|     46|                : "cc");                \
  |  |  367|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  368|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  369|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  370|     46|                : "cc");                                \
  |  |  371|     46|        } while (0)
  |  |  ------------------
  |  |  |  Branch (371:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  557|     46|    sqr_add_c2(a, 3, 1, c2, c3, c1);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  558|     46|    sqr_add_c2(a, 4, 0, c2, c3, c1);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  559|     46|    r[4] = c2;
  560|     46|    c2 = 0;
  561|     46|    sqr_add_c2(a, 5, 0, c3, c1, c2);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  562|     46|    sqr_add_c2(a, 4, 1, c3, c1, c2);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  563|     46|    sqr_add_c2(a, 3, 2, c3, c1, c2);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  564|     46|    r[5] = c3;
  565|     46|    c3 = 0;
  566|     46|    sqr_add_c(a, 3, c1, c2, c3);
  ------------------
  |  |  361|     46|#  define sqr_add_c(a,i,c0,c1,c2) do {  \
  |  |  362|     46|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  363|     46|        asm ("mulq %2"                  \
  |  |  364|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  365|     46|                : "a"(a[i])             \
  |  |  366|     46|                : "cc");                \
  |  |  367|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  368|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  369|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  370|     46|                : "cc");                                \
  |  |  371|     46|        } while (0)
  |  |  ------------------
  |  |  |  Branch (371:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  567|     46|    sqr_add_c2(a, 4, 2, c1, c2, c3);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  568|     46|    sqr_add_c2(a, 5, 1, c1, c2, c3);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  569|     46|    sqr_add_c2(a, 6, 0, c1, c2, c3);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  570|     46|    r[6] = c1;
  571|     46|    c1 = 0;
  572|     46|    sqr_add_c2(a, 7, 0, c2, c3, c1);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  573|     46|    sqr_add_c2(a, 6, 1, c2, c3, c1);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  574|     46|    sqr_add_c2(a, 5, 2, c2, c3, c1);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  575|     46|    sqr_add_c2(a, 4, 3, c2, c3, c1);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  576|     46|    r[7] = c2;
  577|     46|    c2 = 0;
  578|     46|    sqr_add_c(a, 4, c3, c1, c2);
  ------------------
  |  |  361|     46|#  define sqr_add_c(a,i,c0,c1,c2) do {  \
  |  |  362|     46|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  363|     46|        asm ("mulq %2"                  \
  |  |  364|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  365|     46|                : "a"(a[i])             \
  |  |  366|     46|                : "cc");                \
  |  |  367|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  368|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  369|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  370|     46|                : "cc");                                \
  |  |  371|     46|        } while (0)
  |  |  ------------------
  |  |  |  Branch (371:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  579|     46|    sqr_add_c2(a, 5, 3, c3, c1, c2);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  580|     46|    sqr_add_c2(a, 6, 2, c3, c1, c2);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  581|     46|    sqr_add_c2(a, 7, 1, c3, c1, c2);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  582|     46|    r[8] = c3;
  583|     46|    c3 = 0;
  584|     46|    sqr_add_c2(a, 7, 2, c1, c2, c3);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  585|     46|    sqr_add_c2(a, 6, 3, c1, c2, c3);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  586|     46|    sqr_add_c2(a, 5, 4, c1, c2, c3);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  587|     46|    r[9] = c1;
  588|     46|    c1 = 0;
  589|     46|    sqr_add_c(a, 5, c2, c3, c1);
  ------------------
  |  |  361|     46|#  define sqr_add_c(a,i,c0,c1,c2) do {  \
  |  |  362|     46|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  363|     46|        asm ("mulq %2"                  \
  |  |  364|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  365|     46|                : "a"(a[i])             \
  |  |  366|     46|                : "cc");                \
  |  |  367|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  368|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  369|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  370|     46|                : "cc");                                \
  |  |  371|     46|        } while (0)
  |  |  ------------------
  |  |  |  Branch (371:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  590|     46|    sqr_add_c2(a, 6, 4, c2, c3, c1);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  591|     46|    sqr_add_c2(a, 7, 3, c2, c3, c1);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  592|     46|    r[10] = c2;
  593|     46|    c2 = 0;
  594|     46|    sqr_add_c2(a, 7, 4, c3, c1, c2);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  595|     46|    sqr_add_c2(a, 6, 5, c3, c1, c2);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  596|     46|    r[11] = c3;
  597|     46|    c3 = 0;
  598|     46|    sqr_add_c(a, 6, c1, c2, c3);
  ------------------
  |  |  361|     46|#  define sqr_add_c(a,i,c0,c1,c2) do {  \
  |  |  362|     46|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  363|     46|        asm ("mulq %2"                  \
  |  |  364|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  365|     46|                : "a"(a[i])             \
  |  |  366|     46|                : "cc");                \
  |  |  367|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  368|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  369|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  370|     46|                : "cc");                                \
  |  |  371|     46|        } while (0)
  |  |  ------------------
  |  |  |  Branch (371:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  599|     46|    sqr_add_c2(a, 7, 5, c1, c2, c3);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  600|     46|    r[12] = c1;
  601|     46|    c1 = 0;
  602|     46|    sqr_add_c2(a, 7, 6, c2, c3, c1);
  ------------------
  |  |  391|     46|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|     46|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|     46|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|     46|        asm ("mulq %3"                  \
  |  |  |  |  376|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|     46|                : "a"(a),"m"(b)         \
  |  |  |  |  378|     46|                : "cc");                \
  |  |  |  |  379|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|     46|                : "cc");                                \
  |  |  |  |  383|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|     46|                : "cc");                                \
  |  |  |  |  387|     46|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  603|     46|    r[13] = c2;
  604|     46|    c2 = 0;
  605|     46|    sqr_add_c(a, 7, c3, c1, c2);
  ------------------
  |  |  361|     46|#  define sqr_add_c(a,i,c0,c1,c2) do {  \
  |  |  362|     46|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|     46|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  363|     46|        asm ("mulq %2"                  \
  |  |  364|     46|                : "=a"(t1),"=d"(t2)     \
  |  |  365|     46|                : "a"(a[i])             \
  |  |  366|     46|                : "cc");                \
  |  |  367|     46|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  368|     46|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  369|     46|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  370|     46|                : "cc");                                \
  |  |  371|     46|        } while (0)
  |  |  ------------------
  |  |  |  Branch (371:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  606|     46|    r[14] = c3;
  607|     46|    r[15] = c1;
  608|     46|}
bn_sqr_comba4:
  611|   822k|{
  612|   822k|    BN_ULONG c1, c2, c3;
  ------------------
  |  |   37|   822k|#  define BN_ULONG        unsigned long
  ------------------
  613|       |
  614|   822k|    c1 = 0;
  615|   822k|    c2 = 0;
  616|   822k|    c3 = 0;
  617|   822k|    sqr_add_c(a, 0, c1, c2, c3);
  ------------------
  |  |  361|   822k|#  define sqr_add_c(a,i,c0,c1,c2) do {  \
  |  |  362|   822k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|   822k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  363|   822k|        asm ("mulq %2"                  \
  |  |  364|   822k|                : "=a"(t1),"=d"(t2)     \
  |  |  365|   822k|                : "a"(a[i])             \
  |  |  366|   822k|                : "cc");                \
  |  |  367|   822k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  368|   822k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  369|   822k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  370|   822k|                : "cc");                                \
  |  |  371|   822k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (371:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  618|   822k|    r[0] = c1;
  619|   822k|    c1 = 0;
  620|   822k|    sqr_add_c2(a, 1, 0, c2, c3, c1);
  ------------------
  |  |  391|   822k|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|   822k|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|   822k|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|   822k|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|   822k|        asm ("mulq %3"                  \
  |  |  |  |  376|   822k|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|   822k|                : "a"(a),"m"(b)         \
  |  |  |  |  378|   822k|                : "cc");                \
  |  |  |  |  379|   822k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|   822k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|   822k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|   822k|                : "cc");                                \
  |  |  |  |  383|   822k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|   822k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|   822k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|   822k|                : "cc");                                \
  |  |  |  |  387|   822k|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  621|   822k|    r[1] = c2;
  622|   822k|    c2 = 0;
  623|   822k|    sqr_add_c(a, 1, c3, c1, c2);
  ------------------
  |  |  361|   822k|#  define sqr_add_c(a,i,c0,c1,c2) do {  \
  |  |  362|   822k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|   822k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  363|   822k|        asm ("mulq %2"                  \
  |  |  364|   822k|                : "=a"(t1),"=d"(t2)     \
  |  |  365|   822k|                : "a"(a[i])             \
  |  |  366|   822k|                : "cc");                \
  |  |  367|   822k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  368|   822k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  369|   822k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  370|   822k|                : "cc");                                \
  |  |  371|   822k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (371:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  624|   822k|    sqr_add_c2(a, 2, 0, c3, c1, c2);
  ------------------
  |  |  391|   822k|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|   822k|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|   822k|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|   822k|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|   822k|        asm ("mulq %3"                  \
  |  |  |  |  376|   822k|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|   822k|                : "a"(a),"m"(b)         \
  |  |  |  |  378|   822k|                : "cc");                \
  |  |  |  |  379|   822k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|   822k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|   822k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|   822k|                : "cc");                                \
  |  |  |  |  383|   822k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|   822k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|   822k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|   822k|                : "cc");                                \
  |  |  |  |  387|   822k|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  625|   822k|    r[2] = c3;
  626|   822k|    c3 = 0;
  627|   822k|    sqr_add_c2(a, 3, 0, c1, c2, c3);
  ------------------
  |  |  391|   822k|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|   822k|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|   822k|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|   822k|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|   822k|        asm ("mulq %3"                  \
  |  |  |  |  376|   822k|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|   822k|                : "a"(a),"m"(b)         \
  |  |  |  |  378|   822k|                : "cc");                \
  |  |  |  |  379|   822k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|   822k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|   822k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|   822k|                : "cc");                                \
  |  |  |  |  383|   822k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|   822k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|   822k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|   822k|                : "cc");                                \
  |  |  |  |  387|   822k|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  628|   822k|    sqr_add_c2(a, 2, 1, c1, c2, c3);
  ------------------
  |  |  391|   822k|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|   822k|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|   822k|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|   822k|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|   822k|        asm ("mulq %3"                  \
  |  |  |  |  376|   822k|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|   822k|                : "a"(a),"m"(b)         \
  |  |  |  |  378|   822k|                : "cc");                \
  |  |  |  |  379|   822k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|   822k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|   822k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|   822k|                : "cc");                                \
  |  |  |  |  383|   822k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|   822k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|   822k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|   822k|                : "cc");                                \
  |  |  |  |  387|   822k|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  629|   822k|    r[3] = c1;
  630|   822k|    c1 = 0;
  631|   822k|    sqr_add_c(a, 2, c2, c3, c1);
  ------------------
  |  |  361|   822k|#  define sqr_add_c(a,i,c0,c1,c2) do {  \
  |  |  362|   822k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|   822k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  363|   822k|        asm ("mulq %2"                  \
  |  |  364|   822k|                : "=a"(t1),"=d"(t2)     \
  |  |  365|   822k|                : "a"(a[i])             \
  |  |  366|   822k|                : "cc");                \
  |  |  367|   822k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  368|   822k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  369|   822k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  370|   822k|                : "cc");                                \
  |  |  371|   822k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (371:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  632|   822k|    sqr_add_c2(a, 3, 1, c2, c3, c1);
  ------------------
  |  |  391|   822k|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|   822k|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|   822k|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|   822k|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|   822k|        asm ("mulq %3"                  \
  |  |  |  |  376|   822k|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|   822k|                : "a"(a),"m"(b)         \
  |  |  |  |  378|   822k|                : "cc");                \
  |  |  |  |  379|   822k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|   822k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|   822k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|   822k|                : "cc");                                \
  |  |  |  |  383|   822k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|   822k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|   822k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|   822k|                : "cc");                                \
  |  |  |  |  387|   822k|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  633|   822k|    r[4] = c2;
  634|   822k|    c2 = 0;
  635|   822k|    sqr_add_c2(a, 3, 2, c3, c1, c2);
  ------------------
  |  |  391|   822k|        mul_add_c2((a)[i],(a)[j],c0,c1,c2)
  |  |  ------------------
  |  |  |  |  373|   822k|#  define mul_add_c2(a,b,c0,c1,c2) do { \
  |  |  |  |  374|   822k|        BN_ULONG t1,t2;                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|   822k|#  define BN_ULONG        unsigned long
  |  |  |  |  ------------------
  |  |  |  |  375|   822k|        asm ("mulq %3"                  \
  |  |  |  |  376|   822k|                : "=a"(t1),"=d"(t2)     \
  |  |  |  |  377|   822k|                : "a"(a),"m"(b)         \
  |  |  |  |  378|   822k|                : "cc");                \
  |  |  |  |  379|   822k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  380|   822k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  381|   822k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  382|   822k|                : "cc");                                \
  |  |  |  |  383|   822k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  |  |  384|   822k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  |  |  385|   822k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  |  |  386|   822k|                : "cc");                                \
  |  |  |  |  387|   822k|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  636|   822k|    r[5] = c3;
  637|   822k|    c3 = 0;
  638|   822k|    sqr_add_c(a, 3, c1, c2, c3);
  ------------------
  |  |  361|   822k|#  define sqr_add_c(a,i,c0,c1,c2) do {  \
  |  |  362|   822k|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|   822k|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  363|   822k|        asm ("mulq %2"                  \
  |  |  364|   822k|                : "=a"(t1),"=d"(t2)     \
  |  |  365|   822k|                : "a"(a[i])             \
  |  |  366|   822k|                : "cc");                \
  |  |  367|   822k|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  368|   822k|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  369|   822k|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  370|   822k|                : "cc");                                \
  |  |  371|   822k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (371:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  639|   822k|    r[6] = c1;
  640|   822k|    r[7] = c2;
  641|   822k|}

BN_add:
   15|   491k|{
   16|   491k|    int ret, r_neg, cmp_res;
   17|       |
   18|   491k|    bn_check_top(a);
   19|   491k|    bn_check_top(b);
   20|       |
   21|   491k|    if (a->neg == b->neg) {
  ------------------
  |  Branch (21:9): [True: 8.82k, False: 482k]
  ------------------
   22|  8.82k|        r_neg = a->neg;
   23|  8.82k|        ret = BN_uadd(r, a, b);
   24|   482k|    } else {
   25|   482k|        cmp_res = BN_ucmp(a, b);
   26|   482k|        if (cmp_res > 0) {
  ------------------
  |  Branch (26:13): [True: 0, False: 482k]
  ------------------
   27|      0|            r_neg = a->neg;
   28|      0|            ret = BN_usub(r, a, b);
   29|   482k|        } else if (cmp_res < 0) {
  ------------------
  |  Branch (29:20): [True: 482k, False: 0]
  ------------------
   30|   482k|            r_neg = b->neg;
   31|   482k|            ret = BN_usub(r, b, a);
   32|   482k|        } else {
   33|      0|            r_neg = 0;
   34|      0|            BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
   35|      0|            ret = 1;
   36|      0|        }
   37|   482k|    }
   38|       |
   39|   491k|    r->neg = r_neg;
   40|   491k|    bn_check_top(r);
   41|   491k|    return ret;
   42|   491k|}
BN_sub:
   46|  1.34M|{
   47|  1.34M|    int ret, r_neg, cmp_res;
   48|       |
   49|  1.34M|    bn_check_top(a);
   50|  1.34M|    bn_check_top(b);
   51|       |
   52|  1.34M|    if (a->neg != b->neg) {
  ------------------
  |  Branch (52:9): [True: 0, False: 1.34M]
  ------------------
   53|      0|        r_neg = a->neg;
   54|      0|        ret = BN_uadd(r, a, b);
   55|  1.34M|    } else {
   56|  1.34M|        cmp_res = BN_ucmp(a, b);
   57|  1.34M|        if (cmp_res > 0) {
  ------------------
  |  Branch (57:13): [True: 860k, False: 486k]
  ------------------
   58|   860k|            r_neg = a->neg;
   59|   860k|            ret = BN_usub(r, a, b);
   60|   860k|        } else if (cmp_res < 0) {
  ------------------
  |  Branch (60:20): [True: 482k, False: 3.95k]
  ------------------
   61|   482k|            r_neg = !b->neg;
   62|   482k|            ret = BN_usub(r, b, a);
   63|   482k|        } else {
   64|  3.95k|            r_neg = 0;
   65|  3.95k|            BN_zero(r);
  ------------------
  |  |  202|  3.95k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
   66|  3.95k|            ret = 1;
   67|  3.95k|        }
   68|  1.34M|    }
   69|       |
   70|  1.34M|    r->neg = r_neg;
   71|  1.34M|    bn_check_top(r);
   72|  1.34M|    return ret;
   73|  1.34M|}
BN_uadd:
   77|  2.82M|{
   78|  2.82M|    int max, min, dif;
   79|  2.82M|    const BN_ULONG *ap, *bp;
   80|  2.82M|    BN_ULONG *rp, carry, t1, t2;
  ------------------
  |  |   37|  2.82M|#  define BN_ULONG        unsigned long
  ------------------
   81|       |
   82|  2.82M|    bn_check_top(a);
   83|  2.82M|    bn_check_top(b);
   84|       |
   85|  2.82M|    if (a->top < b->top) {
  ------------------
  |  Branch (85:9): [True: 59.0k, False: 2.77M]
  ------------------
   86|  59.0k|        const BIGNUM *tmp;
   87|       |
   88|  59.0k|        tmp = a;
   89|  59.0k|        a = b;
   90|  59.0k|        b = tmp;
   91|  59.0k|    }
   92|  2.82M|    max = a->top;
   93|  2.82M|    min = b->top;
   94|  2.82M|    dif = max - min;
   95|       |
   96|  2.82M|    if (bn_wexpand(r, max + 1) == NULL)
  ------------------
  |  Branch (96:9): [True: 0, False: 2.82M]
  ------------------
   97|      0|        return 0;
   98|       |
   99|  2.82M|    r->top = max;
  100|       |
  101|  2.82M|    ap = a->d;
  102|  2.82M|    bp = b->d;
  103|  2.82M|    rp = r->d;
  104|       |
  105|  2.82M|    carry = bn_add_words(rp, ap, bp, min);
  106|  2.82M|    rp += min;
  107|  2.82M|    ap += min;
  108|       |
  109|  3.61M|    while (dif) {
  ------------------
  |  Branch (109:12): [True: 784k, False: 2.82M]
  ------------------
  110|   784k|        dif--;
  111|   784k|        t1 = *(ap++);
  112|   784k|        t2 = (t1 + carry) & BN_MASK2;
  ------------------
  |  |   94|   784k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  113|   784k|        *(rp++) = t2;
  114|   784k|        carry &= (t2 == 0);
  115|   784k|    }
  116|  2.82M|    *rp = carry;
  117|  2.82M|    r->top += carry;
  118|       |
  119|  2.82M|    r->neg = 0;
  120|  2.82M|    bn_check_top(r);
  121|  2.82M|    return 1;
  122|  2.82M|}
BN_usub:
  126|  3.68M|{
  127|  3.68M|    int max, min, dif;
  128|  3.68M|    BN_ULONG t1, t2, borrow, *rp;
  ------------------
  |  |   37|  3.68M|#  define BN_ULONG        unsigned long
  ------------------
  129|  3.68M|    const BN_ULONG *ap, *bp;
  130|       |
  131|  3.68M|    bn_check_top(a);
  132|  3.68M|    bn_check_top(b);
  133|       |
  134|  3.68M|    max = a->top;
  135|  3.68M|    min = b->top;
  136|  3.68M|    dif = max - min;
  137|       |
  138|  3.68M|    if (dif < 0) {              /* hmm... should not be happening */
  ------------------
  |  Branch (138:9): [True: 0, False: 3.68M]
  ------------------
  139|      0|        ERR_raise(ERR_LIB_BN, BN_R_ARG2_LT_ARG3);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  140|      0|        return 0;
  141|      0|    }
  142|       |
  143|  3.68M|    if (bn_wexpand(r, max) == NULL)
  ------------------
  |  Branch (143:9): [True: 0, False: 3.68M]
  ------------------
  144|      0|        return 0;
  145|       |
  146|  3.68M|    ap = a->d;
  147|  3.68M|    bp = b->d;
  148|  3.68M|    rp = r->d;
  149|       |
  150|  3.68M|    borrow = bn_sub_words(rp, ap, bp, min);
  151|  3.68M|    ap += min;
  152|  3.68M|    rp += min;
  153|       |
  154|  3.95M|    while (dif) {
  ------------------
  |  Branch (154:12): [True: 269k, False: 3.68M]
  ------------------
  155|   269k|        dif--;
  156|   269k|        t1 = *(ap++);
  157|   269k|        t2 = (t1 - borrow) & BN_MASK2;
  ------------------
  |  |   94|   269k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  158|   269k|        *(rp++) = t2;
  159|   269k|        borrow &= (t1 == 0);
  160|   269k|    }
  161|       |
  162|  3.76M|    while (max && *--rp == 0)
  ------------------
  |  Branch (162:12): [True: 3.73M, False: 30.4k]
  |  Branch (162:19): [True: 77.9k, False: 3.65M]
  ------------------
  163|  77.9k|        max--;
  164|       |
  165|  3.68M|    r->top = max;
  166|  3.68M|    r->neg = 0;
  167|  3.68M|    bn_pollute(r);
  168|       |
  169|  3.68M|    return 1;
  170|  3.68M|}

BN_BLINDING_free:
   80|  97.2k|{
   81|  97.2k|    if (r == NULL)
  ------------------
  |  Branch (81:9): [True: 97.2k, False: 0]
  ------------------
   82|  97.2k|        return;
   83|      0|    BN_free(r->A);
   84|      0|    BN_free(r->Ai);
   85|      0|    BN_free(r->e);
   86|      0|    BN_free(r->mod);
   87|      0|    CRYPTO_THREAD_lock_free(r->lock);
   88|      0|    OPENSSL_free(r);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   89|      0|}

BN_bn2hex:
   16|  3.37k|{
   17|  3.37k|    int i, j, v, z = 0;
   18|  3.37k|    char *buf;
   19|  3.37k|    char *p;
   20|       |
   21|  3.37k|    if (BN_is_zero(a))
  ------------------
  |  Branch (21:9): [True: 16, False: 3.35k]
  ------------------
   22|     16|        return OPENSSL_strdup("0");
  ------------------
  |  |  119|     16|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   23|  3.35k|    buf = OPENSSL_malloc(a->top * BN_BYTES * 2 + 2);
  ------------------
  |  |  102|  3.35k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.35k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.35k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   24|  3.35k|    if (buf == NULL)
  ------------------
  |  Branch (24:9): [True: 0, False: 3.35k]
  ------------------
   25|      0|        goto err;
   26|  3.35k|    p = buf;
   27|  3.35k|    if (a->neg)
  ------------------
  |  Branch (27:9): [True: 651, False: 2.70k]
  ------------------
   28|    651|        *p++ = '-';
   29|   108k|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (29:26): [True: 104k, False: 3.35k]
  ------------------
   30|   942k|        for (j = BN_BITS2 - 8; j >= 0; j -= 8) {
  ------------------
  |  |   54|   104k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   104k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (30:32): [True: 838k, False: 104k]
  ------------------
   31|       |            /* strip leading zeros */
   32|   838k|            v = (int)((a->d[i] >> j) & 0xff);
   33|   838k|            if (z || v != 0) {
  ------------------
  |  Branch (33:17): [True: 821k, False: 16.8k]
  |  Branch (33:22): [True: 3.35k, False: 13.4k]
  ------------------
   34|   824k|                p += ossl_to_hex(p, v);
   35|   824k|                z = 1;
   36|   824k|            }
   37|   838k|        }
   38|   104k|    }
   39|  3.35k|    *p = '\0';
   40|  3.35k| err:
   41|  3.35k|    return buf;
   42|  3.35k|}
BN_bn2dec:
   48|  19.0k|{
   49|  19.0k|    int i = 0, num, ok = 0, n, tbytes;
   50|  19.0k|    char *buf = NULL;
   51|  19.0k|    char *p;
   52|  19.0k|    BIGNUM *t = NULL;
   53|  19.0k|    BN_ULONG *bn_data = NULL, *lp;
  ------------------
  |  |   37|  19.0k|#  define BN_ULONG        unsigned long
  ------------------
   54|  19.0k|    int bn_data_num;
   55|       |
   56|       |    /*-
   57|       |     * get an upper bound for the length of the decimal integer
   58|       |     * num <= (BN_num_bits(a) + 1) * log(2)
   59|       |     *     <= 3 * BN_num_bits(a) * 0.101 + log(2) + 1     (rounding error)
   60|       |     *     <= 3 * BN_num_bits(a) / 10 + 3 * BN_num_bits / 1000 + 1 + 1
   61|       |     */
   62|  19.0k|    i = BN_num_bits(a) * 3;
   63|  19.0k|    num = (i / 10 + i / 1000 + 1) + 1;
   64|  19.0k|    tbytes = num + 3;   /* negative and terminator and one spare? */
   65|  19.0k|    bn_data_num = num / BN_DEC_NUM + 1;
  ------------------
  |  |   99|  19.0k|#  define BN_DEC_NUM      19
  ------------------
   66|  19.0k|    bn_data = OPENSSL_malloc(bn_data_num * sizeof(BN_ULONG));
  ------------------
  |  |  102|  19.0k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  19.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  19.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|  19.0k|    buf = OPENSSL_malloc(tbytes);
  ------------------
  |  |  102|  19.0k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  19.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  19.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   68|  19.0k|    if (buf == NULL || bn_data == NULL)
  ------------------
  |  Branch (68:9): [True: 0, False: 19.0k]
  |  Branch (68:24): [True: 0, False: 19.0k]
  ------------------
   69|      0|        goto err;
   70|  19.0k|    if ((t = BN_dup(a)) == NULL)
  ------------------
  |  Branch (70:9): [True: 0, False: 19.0k]
  ------------------
   71|      0|        goto err;
   72|       |
   73|  19.0k|    p = buf;
   74|  19.0k|    lp = bn_data;
   75|  19.0k|    if (BN_is_zero(t)) {
  ------------------
  |  Branch (75:9): [True: 2.07k, False: 17.0k]
  ------------------
   76|  2.07k|        *p++ = '0';
   77|  2.07k|        *p++ = '\0';
   78|  17.0k|    } else {
   79|  17.0k|        if (BN_is_negative(t))
  ------------------
  |  Branch (79:13): [True: 4.00k, False: 12.9k]
  ------------------
   80|  4.00k|            *p++ = '-';
   81|       |
   82|  41.2k|        while (!BN_is_zero(t)) {
  ------------------
  |  Branch (82:16): [True: 24.2k, False: 17.0k]
  ------------------
   83|  24.2k|            if (lp - bn_data >= bn_data_num)
  ------------------
  |  Branch (83:17): [True: 0, False: 24.2k]
  ------------------
   84|      0|                goto err;
   85|  24.2k|            *lp = BN_div_word(t, BN_DEC_CONV);
  ------------------
  |  |   98|  24.2k|#  define BN_DEC_CONV     (10000000000000000000UL)
  ------------------
   86|  24.2k|            if (*lp == (BN_ULONG)-1)
  ------------------
  |  Branch (86:17): [True: 0, False: 24.2k]
  ------------------
   87|      0|                goto err;
   88|  24.2k|            lp++;
   89|  24.2k|        }
   90|  17.0k|        lp--;
   91|       |        /*
   92|       |         * We now have a series of blocks, BN_DEC_NUM chars in length, where
   93|       |         * the last one needs truncation. The blocks need to be reversed in
   94|       |         * order.
   95|       |         */
   96|  17.0k|        n = BIO_snprintf(p, tbytes - (size_t)(p - buf), BN_DEC_FMT1, *lp);
  ------------------
  |  |  100|  17.0k|#  define BN_DEC_FMT1     "%lu"
  ------------------
   97|  17.0k|        if (n < 0)
  ------------------
  |  Branch (97:13): [True: 0, False: 17.0k]
  ------------------
   98|      0|            goto err;
   99|  17.0k|        p += n;
  100|  24.2k|        while (lp != bn_data) {
  ------------------
  |  Branch (100:16): [True: 7.24k, False: 17.0k]
  ------------------
  101|  7.24k|            lp--;
  102|  7.24k|            n = BIO_snprintf(p, tbytes - (size_t)(p - buf), BN_DEC_FMT2, *lp);
  ------------------
  |  |  101|  7.24k|#  define BN_DEC_FMT2     "%019lu"
  ------------------
  103|  7.24k|            if (n < 0)
  ------------------
  |  Branch (103:17): [True: 0, False: 7.24k]
  ------------------
  104|      0|                goto err;
  105|  7.24k|            p += n;
  106|  7.24k|        }
  107|  17.0k|    }
  108|  19.0k|    ok = 1;
  109|  19.0k| err:
  110|  19.0k|    OPENSSL_free(bn_data);
  ------------------
  |  |  115|  19.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  19.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  19.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  111|  19.0k|    BN_free(t);
  112|  19.0k|    if (ok)
  ------------------
  |  Branch (112:9): [True: 19.0k, False: 0]
  ------------------
  113|  19.0k|        return buf;
  114|      0|    OPENSSL_free(buf);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  115|      0|    return NULL;
  116|  19.0k|}

BN_CTX_new_ex:
  119|  96.9k|{
  120|  96.9k|    BN_CTX *ret;
  121|       |
  122|  96.9k|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  104|  96.9k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  96.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  96.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (122:9): [True: 0, False: 96.9k]
  ------------------
  123|      0|        return NULL;
  124|       |    /* Initialise the structure */
  125|  96.9k|    BN_POOL_init(&ret->pool);
  126|  96.9k|    BN_STACK_init(&ret->stack);
  127|  96.9k|    ret->libctx = ctx;
  128|  96.9k|    return ret;
  129|  96.9k|}
BN_CTX_new:
  133|  23.3k|{
  134|  23.3k|    return BN_CTX_new_ex(NULL);
  135|  23.3k|}
BN_CTX_free:
  155|   232k|{
  156|   232k|    if (ctx == NULL)
  ------------------
  |  Branch (156:9): [True: 135k, False: 96.9k]
  ------------------
  157|   135k|        return;
  158|  96.9k|#ifndef FIPS_MODULE
  159|  96.9k|    OSSL_TRACE_BEGIN(BN_CTX) {
  ------------------
  |  |  220|  96.9k|    do {                                        \
  |  |  221|  96.9k|        BIO *trc_out = NULL;                    \
  |  |  222|  96.9k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  160|      0|        BN_POOL_ITEM *pool = ctx->pool.head;
  161|      0|        BIO_printf(trc_out,
  162|      0|                   "BN_CTX_free(): stack-size=%d, pool-bignums=%d\n",
  163|      0|                   ctx->stack.size, ctx->pool.size);
  164|      0|        BIO_printf(trc_out, "  dmaxs: ");
  165|      0|        while (pool) {
  ------------------
  |  Branch (165:16): [True: 0, False: 0]
  ------------------
  166|      0|            unsigned loop = 0;
  167|      0|            while (loop < BN_CTX_POOL_SIZE)
  ------------------
  |  |   15|      0|#define BN_CTX_POOL_SIZE        16
  ------------------
  |  Branch (167:20): [True: 0, False: 0]
  ------------------
  168|      0|                BIO_printf(trc_out, "%02x ", pool->vals[loop++].dmax);
  169|      0|            pool = pool->next;
  170|      0|        }
  171|      0|        BIO_printf(trc_out, "\n");
  172|  96.9k|    } OSSL_TRACE_END(BN_CTX);
  ------------------
  |  |  225|  96.9k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  173|  96.9k|#endif
  174|  96.9k|    BN_STACK_finish(&ctx->stack);
  175|  96.9k|    BN_POOL_finish(&ctx->pool);
  176|  96.9k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  96.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  96.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  96.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  177|  96.9k|}
BN_CTX_start:
  180|  52.1M|{
  181|  52.1M|    CTXDBG("ENTER BN_CTX_start()", ctx);
  ------------------
  |  |  110|  52.1M|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  220|  52.1M|    do {                                        \
  |  |  |  |  221|  52.1M|        BIO *trc_out = NULL;                    \
  |  |  |  |  222|  52.1M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  52.1M|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  225|  52.1M|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|       |    /* If we're already overflowing ... */
  183|  52.1M|    if (ctx->err_stack || ctx->too_many)
  ------------------
  |  Branch (183:9): [True: 0, False: 52.1M]
  |  Branch (183:27): [True: 0, False: 52.1M]
  ------------------
  184|      0|        ctx->err_stack++;
  185|       |    /* (Try to) get a new frame pointer */
  186|  52.1M|    else if (!BN_STACK_push(&ctx->stack, ctx->used)) {
  ------------------
  |  Branch (186:14): [True: 0, False: 52.1M]
  ------------------
  187|      0|        ERR_raise(ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  188|      0|        ctx->err_stack++;
  189|      0|    }
  190|  52.1M|    CTXDBG("LEAVE BN_CTX_start()", ctx);
  ------------------
  |  |  110|  52.1M|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  220|  52.1M|    do {                                        \
  |  |  |  |  221|  52.1M|        BIO *trc_out = NULL;                    \
  |  |  |  |  222|  52.1M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  52.1M|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  225|  52.1M|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|  52.1M|}
BN_CTX_end:
  194|  52.1M|{
  195|  52.1M|    if (ctx == NULL)
  ------------------
  |  Branch (195:9): [True: 0, False: 52.1M]
  ------------------
  196|      0|        return;
  197|  52.1M|    CTXDBG("ENTER BN_CTX_end()", ctx);
  ------------------
  |  |  110|  52.1M|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  220|  52.1M|    do {                                        \
  |  |  |  |  221|  52.1M|        BIO *trc_out = NULL;                    \
  |  |  |  |  222|  52.1M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  52.1M|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  225|  52.1M|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  198|  52.1M|    if (ctx->err_stack)
  ------------------
  |  Branch (198:9): [True: 0, False: 52.1M]
  ------------------
  199|      0|        ctx->err_stack--;
  200|  52.1M|    else {
  201|  52.1M|        unsigned int fp = BN_STACK_pop(&ctx->stack);
  202|       |        /* Does this stack frame have anything to release? */
  203|  52.1M|        if (fp < ctx->used)
  ------------------
  |  Branch (203:13): [True: 51.9M, False: 241k]
  ------------------
  204|  51.9M|            BN_POOL_release(&ctx->pool, ctx->used - fp);
  205|  52.1M|        ctx->used = fp;
  206|       |        /* Unjam "too_many" in case "get" had failed */
  207|  52.1M|        ctx->too_many = 0;
  208|  52.1M|    }
  209|  52.1M|    CTXDBG("LEAVE BN_CTX_end()", ctx);
  ------------------
  |  |  110|  52.1M|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  220|  52.1M|    do {                                        \
  |  |  |  |  221|  52.1M|        BIO *trc_out = NULL;                    \
  |  |  |  |  222|  52.1M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  52.1M|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  225|  52.1M|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|  52.1M|}
BN_CTX_get:
  213|  56.8M|{
  214|  56.8M|    BIGNUM *ret;
  215|       |
  216|  56.8M|    CTXDBG("ENTER BN_CTX_get()", ctx);
  ------------------
  |  |  110|  56.8M|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  220|  56.8M|    do {                                        \
  |  |  |  |  221|  56.8M|        BIO *trc_out = NULL;                    \
  |  |  |  |  222|  56.8M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  56.8M|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  225|  56.8M|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  217|  56.8M|    if (ctx->err_stack || ctx->too_many)
  ------------------
  |  Branch (217:9): [True: 0, False: 56.8M]
  |  Branch (217:27): [True: 0, False: 56.8M]
  ------------------
  218|      0|        return NULL;
  219|  56.8M|    if ((ret = BN_POOL_get(&ctx->pool, ctx->flags)) == NULL) {
  ------------------
  |  Branch (219:9): [True: 0, False: 56.8M]
  ------------------
  220|       |        /*
  221|       |         * Setting too_many prevents repeated "get" attempts from cluttering
  222|       |         * the error stack.
  223|       |         */
  224|      0|        ctx->too_many = 1;
  225|      0|        ERR_raise(ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  226|      0|        return NULL;
  227|      0|    }
  228|       |    /* OK, make sure the returned bignum is "zero" */
  229|  56.8M|    BN_zero(ret);
  ------------------
  |  |  202|  56.8M|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  230|       |    /* clear BN_FLG_CONSTTIME if leaked from previous frames */
  231|  56.8M|    ret->flags &= (~BN_FLG_CONSTTIME);
  ------------------
  |  |   67|  56.8M|# define BN_FLG_CONSTTIME        0x04
  ------------------
  232|  56.8M|    ctx->used++;
  233|  56.8M|    CTXDBG("LEAVE BN_CTX_get()", ctx);
  ------------------
  |  |  110|  56.8M|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  220|  56.8M|    do {                                        \
  |  |  |  |  221|  56.8M|        BIO *trc_out = NULL;                    \
  |  |  |  |  222|  56.8M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  56.8M|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  225|  56.8M|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|  56.8M|    return ret;
  235|  56.8M|}
ossl_bn_get_libctx:
  238|  84.6k|{
  239|  84.6k|    if (ctx == NULL)
  ------------------
  |  Branch (239:9): [True: 1.14k, False: 83.4k]
  ------------------
  240|  1.14k|        return NULL;
  241|  83.4k|    return ctx->libctx;
  242|  84.6k|}
bn_ctx.c:BN_STACK_init:
  249|  96.9k|{
  250|  96.9k|    st->indexes = NULL;
  251|  96.9k|    st->depth = st->size = 0;
  252|  96.9k|}
bn_ctx.c:BN_STACK_finish:
  255|  96.9k|{
  256|  96.9k|    OPENSSL_free(st->indexes);
  ------------------
  |  |  115|  96.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  96.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  96.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  257|  96.9k|    st->indexes = NULL;
  258|  96.9k|}
bn_ctx.c:BN_STACK_push:
  262|  52.1M|{
  263|  52.1M|    if (st->depth == st->size) {
  ------------------
  |  Branch (263:9): [True: 88.7k, False: 52.0M]
  ------------------
  264|       |        /* Need to expand */
  265|  88.7k|        unsigned int newsize =
  266|  88.7k|            st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES;
  ------------------
  |  |   17|  88.7k|#define BN_CTX_START_FRAMES     32
  ------------------
  |  Branch (266:13): [True: 0, False: 88.7k]
  ------------------
  267|  88.7k|        unsigned int *newitems;
  268|       |
  269|  88.7k|        if ((newitems = OPENSSL_malloc(sizeof(*newitems) * newsize)) == NULL)
  ------------------
  |  |  102|  88.7k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  88.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  88.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (269:13): [True: 0, False: 88.7k]
  ------------------
  270|      0|            return 0;
  271|  88.7k|        if (st->depth)
  ------------------
  |  Branch (271:13): [True: 0, False: 88.7k]
  ------------------
  272|      0|            memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth);
  273|  88.7k|        OPENSSL_free(st->indexes);
  ------------------
  |  |  115|  88.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  88.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  88.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  274|  88.7k|        st->indexes = newitems;
  275|  88.7k|        st->size = newsize;
  276|  88.7k|    }
  277|  52.1M|    st->indexes[(st->depth)++] = idx;
  278|  52.1M|    return 1;
  279|  52.1M|}
bn_ctx.c:BN_STACK_pop:
  282|  52.1M|{
  283|  52.1M|    return st->indexes[--(st->depth)];
  284|  52.1M|}
bn_ctx.c:BN_POOL_init:
  291|  96.9k|{
  292|  96.9k|    p->head = p->current = p->tail = NULL;
  293|  96.9k|    p->used = p->size = 0;
  294|  96.9k|}
bn_ctx.c:BN_POOL_finish:
  297|  96.9k|{
  298|  96.9k|    unsigned int loop;
  299|  96.9k|    BIGNUM *bn;
  300|       |
  301|   180k|    while (p->head) {
  ------------------
  |  Branch (301:12): [True: 83.1k, False: 96.9k]
  ------------------
  302|  1.41M|        for (loop = 0, bn = p->head->vals; loop++ < BN_CTX_POOL_SIZE; bn++)
  ------------------
  |  |   15|  1.41M|#define BN_CTX_POOL_SIZE        16
  ------------------
  |  Branch (302:44): [True: 1.33M, False: 83.1k]
  ------------------
  303|  1.33M|            if (bn->d)
  ------------------
  |  Branch (303:17): [True: 590k, False: 739k]
  ------------------
  304|   590k|                BN_clear_free(bn);
  305|  83.1k|        p->current = p->head->next;
  306|  83.1k|        OPENSSL_free(p->head);
  ------------------
  |  |  115|  83.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  83.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  83.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  307|  83.1k|        p->head = p->current;
  308|  83.1k|    }
  309|  96.9k|}
bn_ctx.c:BN_POOL_get:
  313|  56.8M|{
  314|  56.8M|    BIGNUM *bn;
  315|  56.8M|    unsigned int loop;
  316|       |
  317|       |    /* Full; allocate a new pool item and link it in. */
  318|  56.8M|    if (p->used == p->size) {
  ------------------
  |  Branch (318:9): [True: 83.1k, False: 56.7M]
  ------------------
  319|  83.1k|        BN_POOL_ITEM *item;
  320|       |
  321|  83.1k|        if ((item = OPENSSL_malloc(sizeof(*item))) == NULL)
  ------------------
  |  |  102|  83.1k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  83.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  83.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (321:13): [True: 0, False: 83.1k]
  ------------------
  322|      0|            return NULL;
  323|  1.41M|        for (loop = 0, bn = item->vals; loop++ < BN_CTX_POOL_SIZE; bn++) {
  ------------------
  |  |   15|  1.41M|#define BN_CTX_POOL_SIZE        16
  ------------------
  |  Branch (323:41): [True: 1.33M, False: 83.1k]
  ------------------
  324|  1.33M|            bn_init(bn);
  325|  1.33M|            if ((flag & BN_FLG_SECURE) != 0)
  ------------------
  |  |   68|  1.33M|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (325:17): [True: 0, False: 1.33M]
  ------------------
  326|      0|                BN_set_flags(bn, BN_FLG_SECURE);
  ------------------
  |  |   68|      0|# define BN_FLG_SECURE           0x08
  ------------------
  327|  1.33M|        }
  328|  83.1k|        item->prev = p->tail;
  329|  83.1k|        item->next = NULL;
  330|       |
  331|  83.1k|        if (p->head == NULL)
  ------------------
  |  Branch (331:13): [True: 80.8k, False: 2.32k]
  ------------------
  332|  80.8k|            p->head = p->current = p->tail = item;
  333|  2.32k|        else {
  334|  2.32k|            p->tail->next = item;
  335|  2.32k|            p->tail = item;
  336|  2.32k|            p->current = item;
  337|  2.32k|        }
  338|  83.1k|        p->size += BN_CTX_POOL_SIZE;
  ------------------
  |  |   15|  83.1k|#define BN_CTX_POOL_SIZE        16
  ------------------
  339|  83.1k|        p->used++;
  340|       |        /* Return the first bignum from the new pool */
  341|  83.1k|        return item->vals;
  342|  83.1k|    }
  343|       |
  344|  56.7M|    if (!p->used)
  ------------------
  |  Branch (344:9): [True: 53.5k, False: 56.6M]
  ------------------
  345|  53.5k|        p->current = p->head;
  346|  56.6M|    else if ((p->used % BN_CTX_POOL_SIZE) == 0)
  ------------------
  |  |   15|  56.6M|#define BN_CTX_POOL_SIZE        16
  ------------------
  |  Branch (346:14): [True: 989k, False: 55.6M]
  ------------------
  347|   989k|        p->current = p->current->next;
  348|  56.7M|    return p->current->vals + ((p->used++) % BN_CTX_POOL_SIZE);
  ------------------
  |  |   15|  56.7M|#define BN_CTX_POOL_SIZE        16
  ------------------
  349|  56.8M|}
bn_ctx.c:BN_POOL_release:
  352|  51.9M|{
  353|  51.9M|    unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;
  ------------------
  |  |   15|  51.9M|#define BN_CTX_POOL_SIZE        16
  ------------------
  354|       |
  355|  51.9M|    p->used -= num;
  356|   108M|    while (num--) {
  ------------------
  |  Branch (356:12): [True: 56.8M, False: 51.9M]
  ------------------
  357|  56.8M|        bn_check_top(p->current->vals + offset);
  358|  56.8M|        if (offset == 0) {
  ------------------
  |  Branch (358:13): [True: 1.12M, False: 55.6M]
  ------------------
  359|  1.12M|            offset = BN_CTX_POOL_SIZE - 1;
  ------------------
  |  |   15|  1.12M|#define BN_CTX_POOL_SIZE        16
  ------------------
  360|  1.12M|            p->current = p->current->prev;
  361|  1.12M|        } else
  362|  55.6M|            offset--;
  363|  56.8M|    }
  364|  51.9M|}

BN_div:
  211|  1.16M|{
  212|  1.16M|    int ret;
  213|       |
  214|  1.16M|    if (BN_is_zero(divisor)) {
  ------------------
  |  Branch (214:9): [True: 0, False: 1.16M]
  ------------------
  215|      0|        ERR_raise(ERR_LIB_BN, BN_R_DIV_BY_ZERO);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  216|      0|        return 0;
  217|      0|    }
  218|       |
  219|       |    /*
  220|       |     * Invalid zero-padding would have particularly bad consequences so don't
  221|       |     * just rely on bn_check_top() here (bn_check_top() works only for
  222|       |     * BN_DEBUG builds)
  223|       |     */
  224|  1.16M|    if (divisor->d[divisor->top - 1] == 0) {
  ------------------
  |  Branch (224:9): [True: 0, False: 1.16M]
  ------------------
  225|      0|        ERR_raise(ERR_LIB_BN, BN_R_NOT_INITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  226|      0|        return 0;
  227|      0|    }
  228|       |
  229|  1.16M|    ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);
  230|       |
  231|  1.16M|    if (ret) {
  ------------------
  |  Branch (231:9): [True: 1.16M, False: 0]
  ------------------
  232|  1.16M|        if (dv != NULL)
  ------------------
  |  Branch (232:13): [True: 33.2k, False: 1.13M]
  ------------------
  233|  33.2k|            bn_correct_top(dv);
  234|  1.16M|        if (rm != NULL)
  ------------------
  |  Branch (234:13): [True: 1.13M, False: 31.9k]
  ------------------
  235|  1.13M|            bn_correct_top(rm);
  236|  1.16M|    }
  237|       |
  238|  1.16M|    return ret;
  239|  1.16M|}
bn_div_fixed_top:
  266|  1.16M|{
  267|  1.16M|    int norm_shift, i, j, loop;
  268|  1.16M|    BIGNUM *tmp, *snum, *sdiv, *res;
  269|  1.16M|    BN_ULONG *resp, *wnum, *wnumtop;
  ------------------
  |  |   37|  1.16M|#  define BN_ULONG        unsigned long
  ------------------
  270|  1.16M|    BN_ULONG d0, d1;
  ------------------
  |  |   37|  1.16M|#  define BN_ULONG        unsigned long
  ------------------
  271|  1.16M|    int num_n, div_n, num_neg;
  272|       |
  273|  1.16M|    assert(divisor->top > 0 && divisor->d[divisor->top - 1] != 0);
  274|       |
  275|  1.16M|    bn_check_top(num);
  276|  1.16M|    bn_check_top(divisor);
  277|  1.16M|    bn_check_top(dv);
  278|  1.16M|    bn_check_top(rm);
  279|       |
  280|  1.16M|    BN_CTX_start(ctx);
  281|  1.16M|    res = (dv == NULL) ? BN_CTX_get(ctx) : dv;
  ------------------
  |  Branch (281:11): [True: 1.13M, False: 33.2k]
  ------------------
  282|  1.16M|    tmp = BN_CTX_get(ctx);
  283|  1.16M|    snum = BN_CTX_get(ctx);
  284|  1.16M|    sdiv = BN_CTX_get(ctx);
  285|  1.16M|    if (sdiv == NULL)
  ------------------
  |  Branch (285:9): [True: 0, False: 1.16M]
  ------------------
  286|      0|        goto err;
  287|       |
  288|       |    /* First we normalise the numbers */
  289|  1.16M|    if (!BN_copy(sdiv, divisor))
  ------------------
  |  Branch (289:9): [True: 0, False: 1.16M]
  ------------------
  290|      0|        goto err;
  291|  1.16M|    norm_shift = bn_left_align(sdiv);
  292|  1.16M|    sdiv->neg = 0;
  293|       |    /*
  294|       |     * Note that bn_lshift_fixed_top's output is always one limb longer
  295|       |     * than input, even when norm_shift is zero. This means that amount of
  296|       |     * inner loop iterations is invariant of dividend value, and that one
  297|       |     * doesn't need to compare dividend and divisor if they were originally
  298|       |     * of the same bit length.
  299|       |     */
  300|  1.16M|    if (!(bn_lshift_fixed_top(snum, num, norm_shift)))
  ------------------
  |  Branch (300:9): [True: 0, False: 1.16M]
  ------------------
  301|      0|        goto err;
  302|       |
  303|  1.16M|    div_n = sdiv->top;
  304|  1.16M|    num_n = snum->top;
  305|       |
  306|  1.16M|    if (num_n <= div_n) {
  ------------------
  |  Branch (306:9): [True: 9.21k, False: 1.16M]
  ------------------
  307|       |        /* caller didn't pad dividend -> no constant-time guarantee... */
  308|  9.21k|        if (bn_wexpand(snum, div_n + 1) == NULL)
  ------------------
  |  Branch (308:13): [True: 0, False: 9.21k]
  ------------------
  309|      0|            goto err;
  310|  9.21k|        memset(&(snum->d[num_n]), 0, (div_n - num_n + 1) * sizeof(BN_ULONG));
  311|  9.21k|        snum->top = num_n = div_n + 1;
  312|  9.21k|    }
  313|       |
  314|  1.16M|    loop = num_n - div_n;
  315|       |    /*
  316|       |     * Lets setup a 'window' into snum This is the part that corresponds to
  317|       |     * the current 'area' being divided
  318|       |     */
  319|  1.16M|    wnum = &(snum->d[loop]);
  320|  1.16M|    wnumtop = &(snum->d[num_n - 1]);
  321|       |
  322|       |    /* Get the top 2 words of sdiv */
  323|  1.16M|    d0 = sdiv->d[div_n - 1];
  324|  1.16M|    d1 = (div_n == 1) ? 0 : sdiv->d[div_n - 2];
  ------------------
  |  Branch (324:10): [True: 136k, False: 1.03M]
  ------------------
  325|       |
  326|       |    /* Setup quotient */
  327|  1.16M|    if (!bn_wexpand(res, loop))
  ------------------
  |  Branch (327:9): [True: 0, False: 1.16M]
  ------------------
  328|      0|        goto err;
  329|  1.16M|    num_neg = num->neg;
  330|  1.16M|    res->neg = (num_neg ^ divisor->neg);
  331|  1.16M|    res->top = loop;
  332|  1.16M|    res->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  1.16M|#  define BN_FLG_FIXED_TOP 0
  ------------------
  333|  1.16M|    resp = &(res->d[loop]);
  334|       |
  335|       |    /* space for temp */
  336|  1.16M|    if (!bn_wexpand(tmp, (div_n + 1)))
  ------------------
  |  Branch (336:9): [True: 0, False: 1.16M]
  ------------------
  337|      0|        goto err;
  338|       |
  339|  5.22M|    for (i = 0; i < loop; i++, wnumtop--) {
  ------------------
  |  Branch (339:17): [True: 4.05M, False: 1.16M]
  ------------------
  340|  4.05M|        BN_ULONG q, l0;
  ------------------
  |  |   37|  4.05M|#  define BN_ULONG        unsigned long
  ------------------
  341|       |        /*
  342|       |         * the first part of the loop uses the top two words of snum and sdiv
  343|       |         * to calculate a BN_ULONG q such that | wnum - sdiv * q | < sdiv
  344|       |         */
  345|       |# if defined(BN_DIV3W)
  346|       |        q = bn_div_3_words(wnumtop, d1, d0);
  347|       |# else
  348|  4.05M|        BN_ULONG n0, n1, rem = 0;
  ------------------
  |  |   37|  4.05M|#  define BN_ULONG        unsigned long
  ------------------
  349|       |
  350|  4.05M|        n0 = wnumtop[0];
  351|  4.05M|        n1 = wnumtop[-1];
  352|  4.05M|        if (n0 == d0)
  ------------------
  |  Branch (352:13): [True: 17.1k, False: 4.03M]
  ------------------
  353|  17.1k|            q = BN_MASK2;
  ------------------
  |  |   94|  17.1k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  354|  4.03M|        else {                  /* n0 < d0 */
  355|  4.03M|            BN_ULONG n2 = (wnumtop == wnum) ? 0 : wnumtop[-2];
  ------------------
  |  |   37|  4.03M|#  define BN_ULONG        unsigned long
  ------------------
  |  Branch (355:27): [True: 247k, False: 3.78M]
  ------------------
  356|       |#  ifdef BN_LLONG
  357|       |            BN_ULLONG t2;
  358|       |
  359|       |#   if defined(BN_LLONG) && defined(BN_DIV2W) && !defined(bn_div_words)
  360|       |            q = (BN_ULONG)(((((BN_ULLONG) n0) << BN_BITS2) | n1) / d0);
  361|       |#   else
  362|       |            q = bn_div_words(n0, n1, d0);
  363|       |#   endif
  364|       |
  365|       |#   ifndef REMAINDER_IS_ALREADY_CALCULATED
  366|       |            /*
  367|       |             * rem doesn't have to be BN_ULLONG. The least we
  368|       |             * know it's less that d0, isn't it?
  369|       |             */
  370|       |            rem = (n1 - q * d0) & BN_MASK2;
  371|       |#   endif
  372|       |            t2 = (BN_ULLONG) d1 *q;
  373|       |
  374|       |            for (;;) {
  375|       |                if (t2 <= ((((BN_ULLONG) rem) << BN_BITS2) | n2))
  376|       |                    break;
  377|       |                q--;
  378|       |                rem += d0;
  379|       |                if (rem < d0)
  380|       |                    break;      /* don't let rem overflow */
  381|       |                t2 -= d1;
  382|       |            }
  383|       |#  else                         /* !BN_LLONG */
  384|  4.03M|            BN_ULONG t2l, t2h;
  ------------------
  |  |   37|  4.03M|#  define BN_ULONG        unsigned long
  ------------------
  385|       |
  386|  4.03M|            q = bn_div_words(n0, n1, d0);
  387|  4.03M|#   ifndef REMAINDER_IS_ALREADY_CALCULATED
  388|  4.03M|            rem = (n1 - q * d0) & BN_MASK2;
  ------------------
  |  |   94|  4.03M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  389|  4.03M|#   endif
  390|       |
  391|       |#   if defined(BN_UMULT_LOHI)
  392|       |            BN_UMULT_LOHI(t2l, t2h, d1, q);
  393|       |#   elif defined(BN_UMULT_HIGH)
  394|       |            t2l = d1 * q;
  395|       |            t2h = BN_UMULT_HIGH(d1, q);
  396|       |#   else
  397|  4.03M|            {
  398|  4.03M|                BN_ULONG ql, qh;
  ------------------
  |  |   37|  4.03M|#  define BN_ULONG        unsigned long
  ------------------
  399|  4.03M|                t2l = LBITS(d1);
  ------------------
  |  |  566|  4.03M|#  define LBITS(a)        ((a)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   95|  4.03M|#  define BN_MASK2l       (0xffffffffL)
  |  |  ------------------
  ------------------
  400|  4.03M|                t2h = HBITS(d1);
  ------------------
  |  |  567|  4.03M|#  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   93|  4.03M|#  define BN_BITS4        32
  |  |  ------------------
  |  |               #  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   95|  4.03M|#  define BN_MASK2l       (0xffffffffL)
  |  |  ------------------
  ------------------
  401|  4.03M|                ql = LBITS(q);
  ------------------
  |  |  566|  4.03M|#  define LBITS(a)        ((a)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   95|  4.03M|#  define BN_MASK2l       (0xffffffffL)
  |  |  ------------------
  ------------------
  402|  4.03M|                qh = HBITS(q);
  ------------------
  |  |  567|  4.03M|#  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   93|  4.03M|#  define BN_BITS4        32
  |  |  ------------------
  |  |               #  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   95|  4.03M|#  define BN_MASK2l       (0xffffffffL)
  |  |  ------------------
  ------------------
  403|  4.03M|                mul64(t2l, t2h, ql, qh); /* t2=(BN_ULLONG)d1*q; */
  ------------------
  |  |  575|  4.03M|        { \
  |  |  576|  4.03M|        BN_ULONG m,m1,lt,ht; \
  |  |  ------------------
  |  |  |  |   37|  4.03M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  577|  4.03M| \
  |  |  578|  4.03M|        lt=l; \
  |  |  579|  4.03M|        ht=h; \
  |  |  580|  4.03M|        m =(bh)*(lt); \
  |  |  581|  4.03M|        lt=(bl)*(lt); \
  |  |  582|  4.03M|        m1=(bl)*(ht); \
  |  |  583|  4.03M|        ht =(bh)*(ht); \
  |  |  584|  4.03M|        m=(m+m1)&BN_MASK2; ht += L2HBITS((BN_ULONG)(m < m1)); \
  |  |  ------------------
  |  |  |  |   94|  4.03M|#  define BN_MASK2        (0xffffffffffffffffL)
  |  |  ------------------
  |  |                       m=(m+m1)&BN_MASK2; ht += L2HBITS((BN_ULONG)(m < m1)); \
  |  |  ------------------
  |  |  |  |  568|  4.03M|#  define L2HBITS(a)      (((a)<<BN_BITS4)&BN_MASK2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  4.03M|#  define BN_BITS4        32
  |  |  |  |  ------------------
  |  |  |  |               #  define L2HBITS(a)      (((a)<<BN_BITS4)&BN_MASK2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|  4.03M|#  define BN_MASK2        (0xffffffffffffffffL)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  585|  4.03M|        ht+=HBITS(m); \
  |  |  ------------------
  |  |  |  |  567|  4.03M|#  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  4.03M|#  define BN_BITS4        32
  |  |  |  |  ------------------
  |  |  |  |               #  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  4.03M|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  586|  4.03M|        m1=L2HBITS(m); \
  |  |  ------------------
  |  |  |  |  568|  4.03M|#  define L2HBITS(a)      (((a)<<BN_BITS4)&BN_MASK2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  4.03M|#  define BN_BITS4        32
  |  |  |  |  ------------------
  |  |  |  |               #  define L2HBITS(a)      (((a)<<BN_BITS4)&BN_MASK2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|  4.03M|#  define BN_MASK2        (0xffffffffffffffffL)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  587|  4.03M|        lt=(lt+m1)&BN_MASK2; ht += (lt < m1); \
  |  |  ------------------
  |  |  |  |   94|  4.03M|#  define BN_MASK2        (0xffffffffffffffffL)
  |  |  ------------------
  |  |  588|  4.03M|        (l)=lt; \
  |  |  589|  4.03M|        (h)=ht; \
  |  |  590|  4.03M|        }
  ------------------
  404|  4.03M|            }
  405|  4.03M|#   endif
  406|       |
  407|  4.10M|            for (;;) {
  408|  4.10M|                if ((t2h < rem) || ((t2h == rem) && (t2l <= n2)))
  ------------------
  |  Branch (408:21): [True: 2.78M, False: 1.32M]
  |  Branch (408:37): [True: 112k, False: 1.21M]
  |  Branch (408:53): [True: 93.7k, False: 18.6k]
  ------------------
  409|  2.87M|                    break;
  410|  1.23M|                q--;
  411|  1.23M|                rem += d0;
  412|  1.23M|                if (rem < d0)
  ------------------
  |  Branch (412:21): [True: 1.16M, False: 72.1k]
  ------------------
  413|  1.16M|                    break;      /* don't let rem overflow */
  414|  72.1k|                if (t2l < d1)
  ------------------
  |  Branch (414:21): [True: 25.0k, False: 47.0k]
  ------------------
  415|  25.0k|                    t2h--;
  416|  72.1k|                t2l -= d1;
  417|  72.1k|            }
  418|  4.03M|#  endif                        /* !BN_LLONG */
  419|  4.03M|        }
  420|  4.05M|# endif                         /* !BN_DIV3W */
  421|       |
  422|  4.05M|        l0 = bn_mul_words(tmp->d, sdiv->d, div_n, q);
  423|  4.05M|        tmp->d[div_n] = l0;
  424|  4.05M|        wnum--;
  425|       |        /*
  426|       |         * ignore top values of the bignums just sub the two BN_ULONG arrays
  427|       |         * with bn_sub_words
  428|       |         */
  429|  4.05M|        l0 = bn_sub_words(wnum, wnum, tmp->d, div_n + 1);
  430|  4.05M|        q -= l0;
  431|       |        /*
  432|       |         * Note: As we have considered only the leading two BN_ULONGs in
  433|       |         * the calculation of q, sdiv * q might be greater than wnum (but
  434|       |         * then (q-1) * sdiv is less or equal than wnum)
  435|       |         */
  436|  19.4M|        for (l0 = 0 - l0, j = 0; j < div_n; j++)
  ------------------
  |  Branch (436:34): [True: 15.3M, False: 4.05M]
  ------------------
  437|  15.3M|            tmp->d[j] = sdiv->d[j] & l0;
  438|  4.05M|        l0 = bn_add_words(wnum, wnum, tmp->d, div_n);
  439|  4.05M|        (*wnumtop) += l0;
  440|  4.05M|        assert((*wnumtop) == 0);
  441|       |
  442|       |        /* store part of the result */
  443|  4.05M|        *--resp = q;
  444|  4.05M|    }
  445|       |    /* snum holds remainder, it's as wide as divisor */
  446|  1.16M|    snum->neg = num_neg;
  447|  1.16M|    snum->top = div_n;
  448|  1.16M|    snum->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  1.16M|#  define BN_FLG_FIXED_TOP 0
  ------------------
  449|       |
  450|  1.16M|    if (rm != NULL && bn_rshift_fixed_top(rm, snum, norm_shift) == 0)
  ------------------
  |  Branch (450:9): [True: 1.13M, False: 31.9k]
  |  Branch (450:23): [True: 0, False: 1.13M]
  ------------------
  451|      0|        goto err;
  452|       |
  453|  1.16M|    BN_CTX_end(ctx);
  454|  1.16M|    return 1;
  455|      0| err:
  456|      0|    bn_check_top(rm);
  457|      0|    BN_CTX_end(ctx);
  458|      0|    return 0;
  459|  1.16M|}
bn_div.c:bn_left_align:
  142|  1.16M|{
  143|  1.16M|    BN_ULONG *d = num->d, n, m, rmask;
  ------------------
  |  |   37|  1.16M|#  define BN_ULONG        unsigned long
  ------------------
  144|  1.16M|    int top = num->top;
  145|  1.16M|    int rshift = BN_num_bits_word(d[top - 1]), lshift, i;
  146|       |
  147|  1.16M|    lshift = BN_BITS2 - rshift;
  ------------------
  |  |   54|  1.16M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.16M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  148|  1.16M|    rshift %= BN_BITS2;            /* say no to undefined behaviour */
  ------------------
  |  |   54|  1.16M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.16M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  149|  1.16M|    rmask = (BN_ULONG)0 - rshift;  /* rmask = 0 - (rshift != 0) */
  150|  1.16M|    rmask |= rmask >> 8;
  151|       |
  152|  5.32M|    for (i = 0, m = 0; i < top; i++) {
  ------------------
  |  Branch (152:24): [True: 4.15M, False: 1.16M]
  ------------------
  153|  4.15M|        n = d[i];
  154|  4.15M|        d[i] = ((n << lshift) | m) & BN_MASK2;
  ------------------
  |  |   94|  4.15M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  155|  4.15M|        m = (n >> rshift) & rmask;
  156|  4.15M|    }
  157|       |
  158|  1.16M|    return lshift;
  159|  1.16M|}

ossl_err_load_BN_strings:
   50|      2|{
   51|      2|#ifndef OPENSSL_NO_ERR
   52|      2|    if (ERR_reason_error_string(BN_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (52:9): [True: 2, False: 0]
  ------------------
   53|      2|        ERR_load_strings_const(BN_str_reasons);
   54|      2|#endif
   55|      2|    return 1;
   56|      2|}

BN_mod_exp:
   99|  3.06k|{
  100|  3.06k|    int ret;
  101|       |
  102|  3.06k|    bn_check_top(a);
  103|  3.06k|    bn_check_top(p);
  104|  3.06k|    bn_check_top(m);
  105|       |
  106|       |    /*-
  107|       |     * For even modulus  m = 2^k*m_odd, it might make sense to compute
  108|       |     * a^p mod m_odd  and  a^p mod 2^k  separately (with Montgomery
  109|       |     * exponentiation for the odd part), using appropriate exponent
  110|       |     * reductions, and combine the results using the CRT.
  111|       |     *
  112|       |     * For now, we use Montgomery only if the modulus is odd; otherwise,
  113|       |     * exponentiation using the reciprocal-based quick remaindering
  114|       |     * algorithm is used.
  115|       |     *
  116|       |     * (Timing obtained with expspeed.c [computations  a^p mod m
  117|       |     * where  a, p, m  are of the same length: 256, 512, 1024, 2048,
  118|       |     * 4096, 8192 bits], compared to the running time of the
  119|       |     * standard algorithm:
  120|       |     *
  121|       |     *   BN_mod_exp_mont   33 .. 40 %  [AMD K6-2, Linux, debug configuration]
  122|       |     *                     55 .. 77 %  [UltraSparc processor, but
  123|       |     *                                  debug-solaris-sparcv8-gcc conf.]
  124|       |     *
  125|       |     *   BN_mod_exp_recp   50 .. 70 %  [AMD K6-2, Linux, debug configuration]
  126|       |     *                     62 .. 118 % [UltraSparc, debug-solaris-sparcv8-gcc]
  127|       |     *
  128|       |     * On the Sparc, BN_mod_exp_recp was faster than BN_mod_exp_mont
  129|       |     * at 2048 and more bits, but at 512 and 1024 bits, it was
  130|       |     * slower even than the standard algorithm!
  131|       |     *
  132|       |     * "Real" timings [linux-elf, solaris-sparcv9-gcc configurations]
  133|       |     * should be obtained when the new Montgomery reduction code
  134|       |     * has been integrated into OpenSSL.)
  135|       |     */
  136|       |
  137|  3.06k|#define MONT_MUL_MOD
  138|  3.06k|#define MONT_EXP_WORD
  139|  3.06k|#define RECP_MUL_MOD
  140|       |
  141|  3.06k|#ifdef MONT_MUL_MOD
  142|  3.06k|    if (BN_is_odd(m)) {
  ------------------
  |  Branch (142:9): [True: 3.06k, False: 4]
  ------------------
  143|  3.06k|# ifdef MONT_EXP_WORD
  144|  3.06k|        if (a->top == 1 && !a->neg
  ------------------
  |  Branch (144:13): [True: 1.20k, False: 1.86k]
  |  Branch (144:28): [True: 1.20k, False: 0]
  ------------------
  145|  3.06k|            && (BN_get_flags(p, BN_FLG_CONSTTIME) == 0)
  ------------------
  |  |   67|  1.20k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (145:16): [True: 1.05k, False: 150]
  ------------------
  146|  3.06k|            && (BN_get_flags(a, BN_FLG_CONSTTIME) == 0)
  ------------------
  |  |   67|  1.05k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (146:16): [True: 1.05k, False: 0]
  ------------------
  147|  3.06k|            && (BN_get_flags(m, BN_FLG_CONSTTIME) == 0)) {
  ------------------
  |  |   67|  1.05k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (147:16): [True: 1.05k, False: 0]
  ------------------
  148|  1.05k|            BN_ULONG A = a->d[0];
  ------------------
  |  |   37|  1.05k|#  define BN_ULONG        unsigned long
  ------------------
  149|  1.05k|            ret = BN_mod_exp_mont_word(r, A, p, m, ctx, NULL);
  150|  1.05k|        } else
  151|  2.01k|# endif
  152|  2.01k|            ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL);
  153|  3.06k|    } else
  154|      4|#endif
  155|      4|#ifdef RECP_MUL_MOD
  156|      4|    {
  157|      4|        ret = BN_mod_exp_recp(r, a, p, m, ctx);
  158|      4|    }
  159|       |#else
  160|       |    {
  161|       |        ret = BN_mod_exp_simple(r, a, p, m, ctx);
  162|       |    }
  163|       |#endif
  164|       |
  165|  3.06k|    bn_check_top(r);
  166|  3.06k|    return ret;
  167|  3.06k|}
BN_mod_exp_recp:
  171|      4|{
  172|      4|    int i, j, bits, ret = 0, wstart, wend, window;
  173|      4|    int start = 1;
  174|      4|    BIGNUM *aa;
  175|       |    /* Table of variables obtained from 'ctx' */
  176|      4|    BIGNUM *val[TABLE_SIZE];
  177|      4|    BN_RECP_CTX recp;
  178|       |
  179|      4|    if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0
  ------------------
  |  |   67|      4|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (179:9): [True: 4, False: 0]
  ------------------
  180|      4|            || BN_get_flags(a, BN_FLG_CONSTTIME) != 0
  ------------------
  |  |   67|      0|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (180:16): [True: 0, False: 0]
  ------------------
  181|      4|            || BN_get_flags(m, BN_FLG_CONSTTIME) != 0) {
  ------------------
  |  |   67|      0|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (181:16): [True: 0, False: 0]
  ------------------
  182|       |        /* BN_FLG_CONSTTIME only supported by BN_mod_exp_mont() */
  183|      4|        ERR_raise(ERR_LIB_BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      4|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      4|    (ERR_new(),                                                 \
  |  |  |  |  404|      4|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      4|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      4|     ERR_set_error)
  |  |  ------------------
  ------------------
  184|      4|        return 0;
  185|      4|    }
  186|       |
  187|      0|    bits = BN_num_bits(p);
  188|      0|    if (bits == 0) {
  ------------------
  |  Branch (188:9): [True: 0, False: 0]
  ------------------
  189|       |        /* x**0 mod 1, or x**0 mod -1 is still zero. */
  190|      0|        if (BN_abs_is_word(m, 1)) {
  ------------------
  |  Branch (190:13): [True: 0, False: 0]
  ------------------
  191|      0|            ret = 1;
  192|      0|            BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  193|      0|        } else {
  194|      0|            ret = BN_one(r);
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  195|      0|        }
  196|      0|        return ret;
  197|      0|    }
  198|       |
  199|      0|    BN_RECP_CTX_init(&recp);
  200|       |
  201|      0|    BN_CTX_start(ctx);
  202|      0|    aa = BN_CTX_get(ctx);
  203|      0|    val[0] = BN_CTX_get(ctx);
  204|      0|    if (val[0] == NULL)
  ------------------
  |  Branch (204:9): [True: 0, False: 0]
  ------------------
  205|      0|        goto err;
  206|       |
  207|      0|    if (m->neg) {
  ------------------
  |  Branch (207:9): [True: 0, False: 0]
  ------------------
  208|       |        /* ignore sign of 'm' */
  209|      0|        if (!BN_copy(aa, m))
  ------------------
  |  Branch (209:13): [True: 0, False: 0]
  ------------------
  210|      0|            goto err;
  211|      0|        aa->neg = 0;
  212|      0|        if (BN_RECP_CTX_set(&recp, aa, ctx) <= 0)
  ------------------
  |  Branch (212:13): [True: 0, False: 0]
  ------------------
  213|      0|            goto err;
  214|      0|    } else {
  215|      0|        if (BN_RECP_CTX_set(&recp, m, ctx) <= 0)
  ------------------
  |  Branch (215:13): [True: 0, False: 0]
  ------------------
  216|      0|            goto err;
  217|      0|    }
  218|       |
  219|      0|    if (!BN_nnmod(val[0], a, m, ctx))
  ------------------
  |  Branch (219:9): [True: 0, False: 0]
  ------------------
  220|      0|        goto err;               /* 1 */
  221|      0|    if (BN_is_zero(val[0])) {
  ------------------
  |  Branch (221:9): [True: 0, False: 0]
  ------------------
  222|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  223|      0|        ret = 1;
  224|      0|        goto err;
  225|      0|    }
  226|       |
  227|      0|    window = BN_window_bits_for_exponent_size(bits);
  ------------------
  |  |  322|      0|                ((b) > 671 ? 6 : \
  |  |  ------------------
  |  |  |  Branch (322:18): [True: 0, False: 0]
  |  |  ------------------
  |  |  323|      0|                 (b) > 239 ? 5 : \
  |  |  ------------------
  |  |  |  Branch (323:18): [True: 0, False: 0]
  |  |  ------------------
  |  |  324|      0|                 (b) >  79 ? 4 : \
  |  |  ------------------
  |  |  |  Branch (324:18): [True: 0, False: 0]
  |  |  ------------------
  |  |  325|      0|                 (b) >  23 ? 3 : 1)
  |  |  ------------------
  |  |  |  Branch (325:18): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  228|      0|    if (window > 1) {
  ------------------
  |  Branch (228:9): [True: 0, False: 0]
  ------------------
  229|      0|        if (!BN_mod_mul_reciprocal(aa, val[0], val[0], &recp, ctx))
  ------------------
  |  Branch (229:13): [True: 0, False: 0]
  ------------------
  230|      0|            goto err;           /* 2 */
  231|      0|        j = 1 << (window - 1);
  232|      0|        for (i = 1; i < j; i++) {
  ------------------
  |  Branch (232:21): [True: 0, False: 0]
  ------------------
  233|      0|            if (((val[i] = BN_CTX_get(ctx)) == NULL) ||
  ------------------
  |  Branch (233:17): [True: 0, False: 0]
  ------------------
  234|      0|                !BN_mod_mul_reciprocal(val[i], val[i - 1], aa, &recp, ctx))
  ------------------
  |  Branch (234:17): [True: 0, False: 0]
  ------------------
  235|      0|                goto err;
  236|      0|        }
  237|      0|    }
  238|       |
  239|      0|    start = 1;                  /* This is used to avoid multiplication etc
  240|       |                                 * when there is only the value '1' in the
  241|       |                                 * buffer. */
  242|      0|    wstart = bits - 1;          /* The top bit of the window */
  243|      0|    wend = 0;                   /* The bottom bit of the window */
  244|       |
  245|      0|    if (r == p) {
  ------------------
  |  Branch (245:9): [True: 0, False: 0]
  ------------------
  246|      0|        BIGNUM *p_dup = BN_CTX_get(ctx);
  247|       |
  248|      0|        if (p_dup == NULL || BN_copy(p_dup, p) == NULL)
  ------------------
  |  Branch (248:13): [True: 0, False: 0]
  |  Branch (248:30): [True: 0, False: 0]
  ------------------
  249|      0|            goto err;
  250|      0|        p = p_dup;
  251|      0|    }
  252|       |
  253|      0|    if (!BN_one(r))
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (253:9): [True: 0, False: 0]
  ------------------
  254|      0|        goto err;
  255|       |
  256|      0|    for (;;) {
  257|      0|        int wvalue;             /* The 'value' of the window */
  258|       |
  259|      0|        if (BN_is_bit_set(p, wstart) == 0) {
  ------------------
  |  Branch (259:13): [True: 0, False: 0]
  ------------------
  260|      0|            if (!start)
  ------------------
  |  Branch (260:17): [True: 0, False: 0]
  ------------------
  261|      0|                if (!BN_mod_mul_reciprocal(r, r, r, &recp, ctx))
  ------------------
  |  Branch (261:21): [True: 0, False: 0]
  ------------------
  262|      0|                    goto err;
  263|      0|            if (wstart == 0)
  ------------------
  |  Branch (263:17): [True: 0, False: 0]
  ------------------
  264|      0|                break;
  265|      0|            wstart--;
  266|      0|            continue;
  267|      0|        }
  268|       |        /*
  269|       |         * We now have wstart on a 'set' bit, we now need to work out how bit
  270|       |         * a window to do.  To do this we need to scan forward until the last
  271|       |         * set bit before the end of the window
  272|       |         */
  273|      0|        wvalue = 1;
  274|      0|        wend = 0;
  275|      0|        for (i = 1; i < window; i++) {
  ------------------
  |  Branch (275:21): [True: 0, False: 0]
  ------------------
  276|      0|            if (wstart - i < 0)
  ------------------
  |  Branch (276:17): [True: 0, False: 0]
  ------------------
  277|      0|                break;
  278|      0|            if (BN_is_bit_set(p, wstart - i)) {
  ------------------
  |  Branch (278:17): [True: 0, False: 0]
  ------------------
  279|      0|                wvalue <<= (i - wend);
  280|      0|                wvalue |= 1;
  281|      0|                wend = i;
  282|      0|            }
  283|      0|        }
  284|       |
  285|       |        /* wend is the size of the current window */
  286|      0|        j = wend + 1;
  287|       |        /* add the 'bytes above' */
  288|      0|        if (!start)
  ------------------
  |  Branch (288:13): [True: 0, False: 0]
  ------------------
  289|      0|            for (i = 0; i < j; i++) {
  ------------------
  |  Branch (289:25): [True: 0, False: 0]
  ------------------
  290|      0|                if (!BN_mod_mul_reciprocal(r, r, r, &recp, ctx))
  ------------------
  |  Branch (290:21): [True: 0, False: 0]
  ------------------
  291|      0|                    goto err;
  292|      0|            }
  293|       |
  294|       |        /* wvalue will be an odd number < 2^window */
  295|      0|        if (!BN_mod_mul_reciprocal(r, r, val[wvalue >> 1], &recp, ctx))
  ------------------
  |  Branch (295:13): [True: 0, False: 0]
  ------------------
  296|      0|            goto err;
  297|       |
  298|       |        /* move the 'window' down further */
  299|      0|        wstart -= wend + 1;
  300|      0|        start = 0;
  301|      0|        if (wstart < 0)
  ------------------
  |  Branch (301:13): [True: 0, False: 0]
  ------------------
  302|      0|            break;
  303|      0|    }
  304|      0|    ret = 1;
  305|      0| err:
  306|      0|    BN_CTX_end(ctx);
  307|      0|    BN_RECP_CTX_free(&recp);
  308|      0|    bn_check_top(r);
  309|      0|    return ret;
  310|      0|}
BN_mod_exp_mont:
  314|  2.85k|{
  315|  2.85k|    int i, j, bits, ret = 0, wstart, wend, window;
  316|  2.85k|    int start = 1;
  317|  2.85k|    BIGNUM *d, *r;
  318|  2.85k|    const BIGNUM *aa;
  319|       |    /* Table of variables obtained from 'ctx' */
  320|  2.85k|    BIGNUM *val[TABLE_SIZE];
  321|  2.85k|    BN_MONT_CTX *mont = NULL;
  322|       |
  323|  2.85k|    bn_check_top(a);
  324|  2.85k|    bn_check_top(p);
  325|  2.85k|    bn_check_top(m);
  326|       |
  327|  2.85k|    if (!BN_is_odd(m)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 2.85k]
  ------------------
  328|      0|        ERR_raise(ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  329|      0|        return 0;
  330|      0|    }
  331|       |
  332|  2.85k|    if (m->top <= BN_CONSTTIME_SIZE_LIMIT
  ------------------
  |  |   46|  5.71k|#define BN_CONSTTIME_SIZE_LIMIT (INT_MAX / BN_BYTES / 256)
  |  |  ------------------
  |  |  |  |   38|  2.85k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (332:9): [True: 2.85k, False: 0]
  ------------------
  333|  2.85k|        && (BN_get_flags(p, BN_FLG_CONSTTIME) != 0
  ------------------
  |  |   67|  2.85k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (333:13): [True: 462, False: 2.39k]
  ------------------
  334|  2.85k|            || BN_get_flags(a, BN_FLG_CONSTTIME) != 0
  ------------------
  |  |   67|  2.39k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (334:16): [True: 0, False: 2.39k]
  ------------------
  335|  2.85k|            || BN_get_flags(m, BN_FLG_CONSTTIME) != 0)) {
  ------------------
  |  |   67|  2.39k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (335:16): [True: 0, False: 2.39k]
  ------------------
  336|    462|        return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
  337|    462|    }
  338|       |
  339|  2.39k|    bits = BN_num_bits(p);
  340|  2.39k|    if (bits == 0) {
  ------------------
  |  Branch (340:9): [True: 0, False: 2.39k]
  ------------------
  341|       |        /* x**0 mod 1, or x**0 mod -1 is still zero. */
  342|      0|        if (BN_abs_is_word(m, 1)) {
  ------------------
  |  Branch (342:13): [True: 0, False: 0]
  ------------------
  343|      0|            ret = 1;
  344|      0|            BN_zero(rr);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  345|      0|        } else {
  346|      0|            ret = BN_one(rr);
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  347|      0|        }
  348|      0|        return ret;
  349|      0|    }
  350|       |
  351|  2.39k|    BN_CTX_start(ctx);
  352|  2.39k|    d = BN_CTX_get(ctx);
  353|  2.39k|    r = BN_CTX_get(ctx);
  354|  2.39k|    val[0] = BN_CTX_get(ctx);
  355|  2.39k|    if (val[0] == NULL)
  ------------------
  |  Branch (355:9): [True: 0, False: 2.39k]
  ------------------
  356|      0|        goto err;
  357|       |
  358|       |    /*
  359|       |     * If this is not done, things will break in the montgomery part
  360|       |     */
  361|       |
  362|  2.39k|    if (in_mont != NULL)
  ------------------
  |  Branch (362:9): [True: 826, False: 1.56k]
  ------------------
  363|    826|        mont = in_mont;
  364|  1.56k|    else {
  365|  1.56k|        if ((mont = BN_MONT_CTX_new()) == NULL)
  ------------------
  |  Branch (365:13): [True: 0, False: 1.56k]
  ------------------
  366|      0|            goto err;
  367|  1.56k|        if (!BN_MONT_CTX_set(mont, m, ctx))
  ------------------
  |  Branch (367:13): [True: 0, False: 1.56k]
  ------------------
  368|      0|            goto err;
  369|  1.56k|    }
  370|       |
  371|  2.39k|    if (a->neg || BN_ucmp(a, m) >= 0) {
  ------------------
  |  Branch (371:9): [True: 0, False: 2.39k]
  |  Branch (371:19): [True: 0, False: 2.39k]
  ------------------
  372|      0|        if (!BN_nnmod(val[0], a, m, ctx))
  ------------------
  |  Branch (372:13): [True: 0, False: 0]
  ------------------
  373|      0|            goto err;
  374|      0|        aa = val[0];
  375|      0|    } else
  376|  2.39k|        aa = a;
  377|  2.39k|    if (!bn_to_mont_fixed_top(val[0], aa, mont, ctx))
  ------------------
  |  Branch (377:9): [True: 0, False: 2.39k]
  ------------------
  378|      0|        goto err;               /* 1 */
  379|       |
  380|  2.39k|    window = BN_window_bits_for_exponent_size(bits);
  ------------------
  |  |  322|  2.39k|                ((b) > 671 ? 6 : \
  |  |  ------------------
  |  |  |  Branch (322:18): [True: 0, False: 2.39k]
  |  |  ------------------
  |  |  323|  2.39k|                 (b) > 239 ? 5 : \
  |  |  ------------------
  |  |  |  Branch (323:18): [True: 280, False: 2.11k]
  |  |  ------------------
  |  |  324|  2.39k|                 (b) >  79 ? 4 : \
  |  |  ------------------
  |  |  |  Branch (324:18): [True: 2.06k, False: 46]
  |  |  ------------------
  |  |  325|  2.11k|                 (b) >  23 ? 3 : 1)
  |  |  ------------------
  |  |  |  Branch (325:18): [True: 13, False: 33]
  |  |  ------------------
  ------------------
  381|  2.39k|    if (window > 1) {
  ------------------
  |  Branch (381:9): [True: 2.36k, False: 33]
  ------------------
  382|  2.36k|        if (!bn_mul_mont_fixed_top(d, val[0], val[0], mont, ctx))
  ------------------
  |  Branch (382:13): [True: 0, False: 2.36k]
  ------------------
  383|      0|            goto err;           /* 2 */
  384|  2.36k|        j = 1 << (window - 1);
  385|  21.0k|        for (i = 1; i < j; i++) {
  ------------------
  |  Branch (385:21): [True: 18.7k, False: 2.36k]
  ------------------
  386|  18.7k|            if (((val[i] = BN_CTX_get(ctx)) == NULL) ||
  ------------------
  |  Branch (386:17): [True: 0, False: 18.7k]
  ------------------
  387|  18.7k|                !bn_mul_mont_fixed_top(val[i], val[i - 1], d, mont, ctx))
  ------------------
  |  Branch (387:17): [True: 0, False: 18.7k]
  ------------------
  388|      0|                goto err;
  389|  18.7k|        }
  390|  2.36k|    }
  391|       |
  392|  2.39k|    start = 1;                  /* This is used to avoid multiplication etc
  393|       |                                 * when there is only the value '1' in the
  394|       |                                 * buffer. */
  395|  2.39k|    wstart = bits - 1;          /* The top bit of the window */
  396|  2.39k|    wend = 0;                   /* The bottom bit of the window */
  397|       |
  398|  2.39k|#if 1                           /* by Shay Gueron's suggestion */
  399|  2.39k|    j = m->top;                 /* borrow j */
  400|  2.39k|    if (m->d[j - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) {
  ------------------
  |  |   54|  2.39k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.39k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (400:9): [True: 580, False: 1.81k]
  ------------------
  401|    580|        if (bn_wexpand(r, j) == NULL)
  ------------------
  |  Branch (401:13): [True: 0, False: 580]
  ------------------
  402|      0|            goto err;
  403|       |        /* 2^(top*BN_BITS2) - m */
  404|    580|        r->d[0] = (0 - m->d[0]) & BN_MASK2;
  ------------------
  |  |   94|    580|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  405|  2.26k|        for (i = 1; i < j; i++)
  ------------------
  |  Branch (405:21): [True: 1.68k, False: 580]
  ------------------
  406|  1.68k|            r->d[i] = (~m->d[i]) & BN_MASK2;
  ------------------
  |  |   94|  2.26k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  407|    580|        r->top = j;
  408|    580|        r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|    580|#  define BN_FLG_FIXED_TOP 0
  ------------------
  409|    580|    } else
  410|  1.81k|#endif
  411|  1.81k|    if (!bn_to_mont_fixed_top(r, BN_value_one(), mont, ctx))
  ------------------
  |  Branch (411:9): [True: 0, False: 1.81k]
  ------------------
  412|      0|        goto err;
  413|   253k|    for (;;) {
  414|   253k|        int wvalue;             /* The 'value' of the window */
  415|       |
  416|   253k|        if (BN_is_bit_set(p, wstart) == 0) {
  ------------------
  |  Branch (416:13): [True: 169k, False: 83.8k]
  ------------------
  417|   169k|            if (!start) {
  ------------------
  |  Branch (417:17): [True: 169k, False: 0]
  ------------------
  418|   169k|                if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx))
  ------------------
  |  Branch (418:21): [True: 0, False: 169k]
  ------------------
  419|      0|                    goto err;
  420|   169k|            }
  421|   169k|            if (wstart == 0)
  ------------------
  |  Branch (421:17): [True: 787, False: 168k]
  ------------------
  422|    787|                break;
  423|   168k|            wstart--;
  424|   168k|            continue;
  425|   169k|        }
  426|       |        /*
  427|       |         * We now have wstart on a 'set' bit, we now need to work out how bit
  428|       |         * a window to do.  To do this we need to scan forward until the last
  429|       |         * set bit before the end of the window
  430|       |         */
  431|  83.8k|        wvalue = 1;
  432|  83.8k|        wend = 0;
  433|   346k|        for (i = 1; i < window; i++) {
  ------------------
  |  Branch (433:21): [True: 263k, False: 82.6k]
  ------------------
  434|   263k|            if (wstart - i < 0)
  ------------------
  |  Branch (434:17): [True: 1.25k, False: 262k]
  ------------------
  435|  1.25k|                break;
  436|   262k|            if (BN_is_bit_set(p, wstart - i)) {
  ------------------
  |  Branch (436:17): [True: 209k, False: 53.3k]
  ------------------
  437|   209k|                wvalue <<= (i - wend);
  438|   209k|                wvalue |= 1;
  439|   209k|                wend = i;
  440|   209k|            }
  441|   262k|        }
  442|       |
  443|       |        /* wend is the size of the current window */
  444|  83.8k|        j = wend + 1;
  445|       |        /* add the 'bytes above' */
  446|  83.8k|        if (!start)
  ------------------
  |  Branch (446:13): [True: 81.4k, False: 2.39k]
  ------------------
  447|   381k|            for (i = 0; i < j; i++) {
  ------------------
  |  Branch (447:25): [True: 300k, False: 81.4k]
  ------------------
  448|   300k|                if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx))
  ------------------
  |  Branch (448:21): [True: 0, False: 300k]
  ------------------
  449|      0|                    goto err;
  450|   300k|            }
  451|       |
  452|       |        /* wvalue will be an odd number < 2^window */
  453|  83.8k|        if (!bn_mul_mont_fixed_top(r, r, val[wvalue >> 1], mont, ctx))
  ------------------
  |  Branch (453:13): [True: 0, False: 83.8k]
  ------------------
  454|      0|            goto err;
  455|       |
  456|       |        /* move the 'window' down further */
  457|  83.8k|        wstart -= wend + 1;
  458|  83.8k|        start = 0;
  459|  83.8k|        if (wstart < 0)
  ------------------
  |  Branch (459:13): [True: 1.60k, False: 82.2k]
  ------------------
  460|  1.60k|            break;
  461|  83.8k|    }
  462|       |    /*
  463|       |     * Done with zero-padded intermediate BIGNUMs. Final BN_from_montgomery
  464|       |     * removes padding [if any] and makes return value suitable for public
  465|       |     * API consumer.
  466|       |     */
  467|       |#if defined(SPARC_T4_MONT)
  468|       |    if (OPENSSL_sparcv9cap_P[0] & (SPARCV9_VIS3 | SPARCV9_PREFER_FPU)) {
  469|       |        j = mont->N.top;        /* borrow j */
  470|       |        val[0]->d[0] = 1;       /* borrow val[0] */
  471|       |        for (i = 1; i < j; i++)
  472|       |            val[0]->d[i] = 0;
  473|       |        val[0]->top = j;
  474|       |        if (!BN_mod_mul_montgomery(rr, r, val[0], mont, ctx))
  475|       |            goto err;
  476|       |    } else
  477|       |#endif
  478|  2.39k|    if (!BN_from_montgomery(rr, r, mont, ctx))
  ------------------
  |  Branch (478:9): [True: 0, False: 2.39k]
  ------------------
  479|      0|        goto err;
  480|  2.39k|    ret = 1;
  481|  2.39k| err:
  482|  2.39k|    if (in_mont == NULL)
  ------------------
  |  Branch (482:9): [True: 1.56k, False: 826]
  ------------------
  483|  1.56k|        BN_MONT_CTX_free(mont);
  484|  2.39k|    BN_CTX_end(ctx);
  485|  2.39k|    bn_check_top(rr);
  486|  2.39k|    return ret;
  487|  2.39k|}
bn_mod_exp_mont_fixed_top:
  612|    462|{
  613|    462|    int i, bits, ret = 0, window, wvalue, wmask, window0;
  614|    462|    int top;
  615|    462|    BN_MONT_CTX *mont = NULL;
  616|       |
  617|    462|    int numPowers;
  618|    462|    unsigned char *powerbufFree = NULL;
  619|    462|    int powerbufLen = 0;
  620|    462|    unsigned char *powerbuf = NULL;
  621|    462|    BIGNUM tmp, am;
  622|       |#if defined(SPARC_T4_MONT)
  623|       |    unsigned int t4 = 0;
  624|       |#endif
  625|       |
  626|    462|    if (!BN_is_odd(m)) {
  ------------------
  |  Branch (626:9): [True: 0, False: 462]
  ------------------
  627|      0|        ERR_raise(ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  628|      0|        return 0;
  629|      0|    }
  630|       |
  631|    462|    top = m->top;
  632|       |
  633|    462|    if (top > BN_CONSTTIME_SIZE_LIMIT) {
  ------------------
  |  |   46|    462|#define BN_CONSTTIME_SIZE_LIMIT (INT_MAX / BN_BYTES / 256)
  |  |  ------------------
  |  |  |  |   38|    462|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (633:9): [True: 0, False: 462]
  ------------------
  634|       |        /* Prevent overflowing the powerbufLen computation below */
  635|      0|        return BN_mod_exp_mont(rr, a, p, m, ctx, in_mont);
  636|      0|    }
  637|       |
  638|       |    /*
  639|       |     * Use all bits stored in |p|, rather than |BN_num_bits|, so we do not leak
  640|       |     * whether the top bits are zero.
  641|       |     */
  642|    462|    bits = p->top * BN_BITS2;
  ------------------
  |  |   54|    462|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|    462|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  643|    462|    if (bits == 0) {
  ------------------
  |  Branch (643:9): [True: 3, False: 459]
  ------------------
  644|       |        /* x**0 mod 1, or x**0 mod -1 is still zero. */
  645|      3|        if (BN_abs_is_word(m, 1)) {
  ------------------
  |  Branch (645:13): [True: 1, False: 2]
  ------------------
  646|      1|            ret = 1;
  647|      1|            BN_zero(rr);
  ------------------
  |  |  202|      1|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  648|      2|        } else {
  649|      2|            ret = BN_one(rr);
  ------------------
  |  |  197|      2|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  650|      2|        }
  651|      3|        return ret;
  652|      3|    }
  653|       |
  654|    459|    BN_CTX_start(ctx);
  655|       |
  656|       |    /*
  657|       |     * Allocate a montgomery context if it was not supplied by the caller. If
  658|       |     * this is not done, things will break in the montgomery part.
  659|       |     */
  660|    459|    if (in_mont != NULL)
  ------------------
  |  Branch (660:9): [True: 18, False: 441]
  ------------------
  661|     18|        mont = in_mont;
  662|    441|    else {
  663|    441|        if ((mont = BN_MONT_CTX_new()) == NULL)
  ------------------
  |  Branch (663:13): [True: 0, False: 441]
  ------------------
  664|      0|            goto err;
  665|    441|        if (!BN_MONT_CTX_set(mont, m, ctx))
  ------------------
  |  Branch (665:13): [True: 0, False: 441]
  ------------------
  666|      0|            goto err;
  667|    441|    }
  668|       |
  669|    459|    if (a->neg || BN_ucmp(a, m) >= 0) {
  ------------------
  |  Branch (669:9): [True: 0, False: 459]
  |  Branch (669:19): [True: 20, False: 439]
  ------------------
  670|     20|        BIGNUM *reduced = BN_CTX_get(ctx);
  671|     20|        if (reduced == NULL
  ------------------
  |  Branch (671:13): [True: 0, False: 20]
  ------------------
  672|     20|            || !BN_nnmod(reduced, a, m, ctx)) {
  ------------------
  |  Branch (672:16): [True: 0, False: 20]
  ------------------
  673|      0|            goto err;
  674|      0|        }
  675|     20|        a = reduced;
  676|     20|    }
  677|       |
  678|    459|#ifdef RSAZ_ENABLED
  679|       |    /*
  680|       |     * If the size of the operands allow it, perform the optimized
  681|       |     * RSAZ exponentiation. For further information see
  682|       |     * crypto/bn/rsaz_exp.c and accompanying assembly modules.
  683|       |     */
  684|    459|    if ((16 == a->top) && (16 == p->top) && (BN_num_bits(m) == 1024)
  ------------------
  |  Branch (684:9): [True: 5, False: 454]
  |  Branch (684:27): [True: 0, False: 5]
  |  Branch (684:45): [True: 0, False: 0]
  ------------------
  685|    459|        && rsaz_avx2_eligible()) {
  ------------------
  |  Branch (685:12): [True: 0, False: 0]
  ------------------
  686|      0|        if (NULL == bn_wexpand(rr, 16))
  ------------------
  |  Branch (686:13): [True: 0, False: 0]
  ------------------
  687|      0|            goto err;
  688|      0|        RSAZ_1024_mod_exp_avx2(rr->d, a->d, p->d, m->d, mont->RR.d,
  689|      0|                               mont->n0[0]);
  690|      0|        rr->top = 16;
  691|      0|        rr->neg = 0;
  692|      0|        bn_correct_top(rr);
  693|      0|        ret = 1;
  694|      0|        goto err;
  695|    459|    } else if ((8 == a->top) && (8 == p->top) && (BN_num_bits(m) == 512)) {
  ------------------
  |  Branch (695:16): [True: 7, False: 452]
  |  Branch (695:33): [True: 5, False: 2]
  |  Branch (695:50): [True: 1, False: 4]
  ------------------
  696|      1|        if (NULL == bn_wexpand(rr, 8))
  ------------------
  |  Branch (696:13): [True: 0, False: 1]
  ------------------
  697|      0|            goto err;
  698|      1|        RSAZ_512_mod_exp(rr->d, a->d, p->d, m->d, mont->n0[0], mont->RR.d);
  699|      1|        rr->top = 8;
  700|      1|        rr->neg = 0;
  701|      1|        bn_correct_top(rr);
  702|      1|        ret = 1;
  703|      1|        goto err;
  704|      1|    }
  705|    458|#endif
  706|       |
  707|       |    /* Get the window size to use with size of p. */
  708|    458|    window = BN_window_bits_for_ctime_exponent_size(bits);
  ------------------
  |  |  346|    458|                ((b) > 937 ? 6 : \
  |  |  ------------------
  |  |  |  Branch (346:18): [True: 1, False: 457]
  |  |  ------------------
  |  |  347|    458|                 (b) > 306 ? 5 : \
  |  |  ------------------
  |  |  |  Branch (347:18): [True: 62, False: 395]
  |  |  ------------------
  |  |  348|    457|                 (b) >  89 ? 4 : \
  |  |  ------------------
  |  |  |  Branch (348:18): [True: 53, False: 342]
  |  |  ------------------
  |  |  349|    395|                 (b) >  22 ? 3 : 1)
  |  |  ------------------
  |  |  |  Branch (349:18): [True: 342, False: 0]
  |  |  ------------------
  ------------------
  709|       |#if defined(SPARC_T4_MONT)
  710|       |    if (window >= 5 && (top & 15) == 0 && top <= 64 &&
  711|       |        (OPENSSL_sparcv9cap_P[1] & (CFR_MONTMUL | CFR_MONTSQR)) ==
  712|       |        (CFR_MONTMUL | CFR_MONTSQR) && (t4 = OPENSSL_sparcv9cap_P[0]))
  713|       |        window = 5;
  714|       |    else
  715|       |#endif
  716|    458|#if defined(OPENSSL_BN_ASM_MONT5)
  717|    458|    if (window >= 5 && top <= BN_SOFT_LIMIT) {
  ------------------
  |  |   62|     63|#  define BN_SOFT_LIMIT         (4096 / BN_BYTES)
  |  |  ------------------
  |  |  |  |   38|     63|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (717:9): [True: 63, False: 395]
  |  Branch (717:24): [True: 63, False: 0]
  ------------------
  718|     63|        window = 5;             /* ~5% improvement for RSA2048 sign, and even
  719|       |                                 * for RSA4096 */
  720|       |        /* reserve space for mont->N.d[] copy */
  721|     63|        powerbufLen += top * sizeof(mont->N.d[0]);
  722|     63|    }
  723|    458|#endif
  724|    458|    (void)0;
  725|       |
  726|       |    /*
  727|       |     * Allocate a buffer large enough to hold all of the pre-computed powers
  728|       |     * of am, am itself and tmp.
  729|       |     */
  730|    458|    numPowers = 1 << window;
  731|    458|    powerbufLen += sizeof(m->d[0]) * (top * numPowers +
  732|    458|                                      ((2 * top) >
  ------------------
  |  Branch (732:40): [True: 300, False: 158]
  ------------------
  733|    458|                                       numPowers ? (2 * top) : numPowers));
  734|    458|#ifdef alloca
  735|    458|    if (powerbufLen < 3072)
  ------------------
  |  Branch (735:9): [True: 453, False: 5]
  ------------------
  736|    453|        powerbufFree =
  737|    453|            alloca(powerbufLen + MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH);
  738|      5|    else
  739|      5|#endif
  740|      5|        if ((powerbufFree =
  ------------------
  |  Branch (740:13): [True: 0, False: 5]
  ------------------
  741|      5|             OPENSSL_malloc(powerbufLen + MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH))
  ------------------
  |  |  102|      5|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  742|      5|            == NULL)
  743|      0|        goto err;
  744|       |
  745|    458|    powerbuf = MOD_EXP_CTIME_ALIGN(powerbufFree);
  ------------------
  |  |  600|    458|        ((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((size_t)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
  |  |  ------------------
  |  |  |  |  331|    458|# define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH      ( 64 )
  |  |  ------------------
  |  |                       ((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((size_t)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
  |  |  ------------------
  |  |  |  |  332|    458|# define MOD_EXP_CTIME_MIN_CACHE_LINE_MASK       (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  331|    458|# define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH      ( 64 )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  746|    458|    memset(powerbuf, 0, powerbufLen);
  747|       |
  748|    458|#ifdef alloca
  749|    458|    if (powerbufLen < 3072)
  ------------------
  |  Branch (749:9): [True: 453, False: 5]
  ------------------
  750|    453|        powerbufFree = NULL;
  751|    458|#endif
  752|       |
  753|       |    /* lay down tmp and am right after powers table */
  754|    458|    tmp.d = (BN_ULONG *)(powerbuf + sizeof(m->d[0]) * top * numPowers);
  755|    458|    am.d = tmp.d + top;
  756|    458|    tmp.top = am.top = 0;
  757|    458|    tmp.dmax = am.dmax = top;
  758|    458|    tmp.neg = am.neg = 0;
  759|    458|    tmp.flags = am.flags = BN_FLG_STATIC_DATA;
  ------------------
  |  |   59|    458|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  760|       |
  761|       |    /* prepare a^0 in Montgomery domain */
  762|    458|#if 1                           /* by Shay Gueron's suggestion */
  763|    458|    if (m->d[top - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) {
  ------------------
  |  |   54|    458|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|    458|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (763:9): [True: 87, False: 371]
  ------------------
  764|       |        /* 2^(top*BN_BITS2) - m */
  765|     87|        tmp.d[0] = (0 - m->d[0]) & BN_MASK2;
  ------------------
  |  |   94|     87|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  766|    346|        for (i = 1; i < top; i++)
  ------------------
  |  Branch (766:21): [True: 259, False: 87]
  ------------------
  767|    259|            tmp.d[i] = (~m->d[i]) & BN_MASK2;
  ------------------
  |  |   94|    259|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  768|     87|        tmp.top = top;
  769|     87|    } else
  770|    371|#endif
  771|    371|    if (!bn_to_mont_fixed_top(&tmp, BN_value_one(), mont, ctx))
  ------------------
  |  Branch (771:9): [True: 0, False: 371]
  ------------------
  772|      0|        goto err;
  773|       |
  774|       |    /* prepare a^1 in Montgomery domain */
  775|    458|    if (!bn_to_mont_fixed_top(&am, a, mont, ctx))
  ------------------
  |  Branch (775:9): [True: 0, False: 458]
  ------------------
  776|      0|        goto err;
  777|       |
  778|    458|    if (top > BN_SOFT_LIMIT)
  ------------------
  |  |   62|    458|#  define BN_SOFT_LIMIT         (4096 / BN_BYTES)
  |  |  ------------------
  |  |  |  |   38|    458|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (778:9): [True: 0, False: 458]
  ------------------
  779|      0|        goto fallback;
  780|       |
  781|       |#if defined(SPARC_T4_MONT)
  782|       |    if (t4) {
  783|       |        typedef int (*bn_pwr5_mont_f) (BN_ULONG *tp, const BN_ULONG *np,
  784|       |                                       const BN_ULONG *n0, const void *table,
  785|       |                                       int power, int bits);
  786|       |        int bn_pwr5_mont_t4_8(BN_ULONG *tp, const BN_ULONG *np,
  787|       |                              const BN_ULONG *n0, const void *table,
  788|       |                              int power, int bits);
  789|       |        int bn_pwr5_mont_t4_16(BN_ULONG *tp, const BN_ULONG *np,
  790|       |                               const BN_ULONG *n0, const void *table,
  791|       |                               int power, int bits);
  792|       |        int bn_pwr5_mont_t4_24(BN_ULONG *tp, const BN_ULONG *np,
  793|       |                               const BN_ULONG *n0, const void *table,
  794|       |                               int power, int bits);
  795|       |        int bn_pwr5_mont_t4_32(BN_ULONG *tp, const BN_ULONG *np,
  796|       |                               const BN_ULONG *n0, const void *table,
  797|       |                               int power, int bits);
  798|       |        static const bn_pwr5_mont_f pwr5_funcs[4] = {
  799|       |            bn_pwr5_mont_t4_8, bn_pwr5_mont_t4_16,
  800|       |            bn_pwr5_mont_t4_24, bn_pwr5_mont_t4_32
  801|       |        };
  802|       |        bn_pwr5_mont_f pwr5_worker = pwr5_funcs[top / 16 - 1];
  803|       |
  804|       |        typedef int (*bn_mul_mont_f) (BN_ULONG *rp, const BN_ULONG *ap,
  805|       |                                      const void *bp, const BN_ULONG *np,
  806|       |                                      const BN_ULONG *n0);
  807|       |        int bn_mul_mont_t4_8(BN_ULONG *rp, const BN_ULONG *ap, const void *bp,
  808|       |                             const BN_ULONG *np, const BN_ULONG *n0);
  809|       |        int bn_mul_mont_t4_16(BN_ULONG *rp, const BN_ULONG *ap,
  810|       |                              const void *bp, const BN_ULONG *np,
  811|       |                              const BN_ULONG *n0);
  812|       |        int bn_mul_mont_t4_24(BN_ULONG *rp, const BN_ULONG *ap,
  813|       |                              const void *bp, const BN_ULONG *np,
  814|       |                              const BN_ULONG *n0);
  815|       |        int bn_mul_mont_t4_32(BN_ULONG *rp, const BN_ULONG *ap,
  816|       |                              const void *bp, const BN_ULONG *np,
  817|       |                              const BN_ULONG *n0);
  818|       |        static const bn_mul_mont_f mul_funcs[4] = {
  819|       |            bn_mul_mont_t4_8, bn_mul_mont_t4_16,
  820|       |            bn_mul_mont_t4_24, bn_mul_mont_t4_32
  821|       |        };
  822|       |        bn_mul_mont_f mul_worker = mul_funcs[top / 16 - 1];
  823|       |
  824|       |        void bn_mul_mont_vis3(BN_ULONG *rp, const BN_ULONG *ap,
  825|       |                              const void *bp, const BN_ULONG *np,
  826|       |                              const BN_ULONG *n0, int num);
  827|       |        void bn_mul_mont_t4(BN_ULONG *rp, const BN_ULONG *ap,
  828|       |                            const void *bp, const BN_ULONG *np,
  829|       |                            const BN_ULONG *n0, int num);
  830|       |        void bn_mul_mont_gather5_t4(BN_ULONG *rp, const BN_ULONG *ap,
  831|       |                                    const void *table, const BN_ULONG *np,
  832|       |                                    const BN_ULONG *n0, int num, int power);
  833|       |        void bn_flip_n_scatter5_t4(const BN_ULONG *inp, size_t num,
  834|       |                                   void *table, size_t power);
  835|       |        void bn_gather5_t4(BN_ULONG *out, size_t num,
  836|       |                           void *table, size_t power);
  837|       |        void bn_flip_t4(BN_ULONG *dst, BN_ULONG *src, size_t num);
  838|       |
  839|       |        BN_ULONG *np = mont->N.d, *n0 = mont->n0;
  840|       |        int stride = 5 * (6 - (top / 16 - 1)); /* multiple of 5, but less
  841|       |                                                * than 32 */
  842|       |
  843|       |        /*
  844|       |         * BN_to_montgomery can contaminate words above .top [in
  845|       |         * BN_DEBUG build...
  846|       |         */
  847|       |        for (i = am.top; i < top; i++)
  848|       |            am.d[i] = 0;
  849|       |        for (i = tmp.top; i < top; i++)
  850|       |            tmp.d[i] = 0;
  851|       |
  852|       |        bn_flip_n_scatter5_t4(tmp.d, top, powerbuf, 0);
  853|       |        bn_flip_n_scatter5_t4(am.d, top, powerbuf, 1);
  854|       |        if (!(*mul_worker) (tmp.d, am.d, am.d, np, n0) &&
  855|       |            !(*mul_worker) (tmp.d, am.d, am.d, np, n0))
  856|       |            bn_mul_mont_vis3(tmp.d, am.d, am.d, np, n0, top);
  857|       |        bn_flip_n_scatter5_t4(tmp.d, top, powerbuf, 2);
  858|       |
  859|       |        for (i = 3; i < 32; i++) {
  860|       |            /* Calculate a^i = a^(i-1) * a */
  861|       |            if (!(*mul_worker) (tmp.d, tmp.d, am.d, np, n0) &&
  862|       |                !(*mul_worker) (tmp.d, tmp.d, am.d, np, n0))
  863|       |                bn_mul_mont_vis3(tmp.d, tmp.d, am.d, np, n0, top);
  864|       |            bn_flip_n_scatter5_t4(tmp.d, top, powerbuf, i);
  865|       |        }
  866|       |
  867|       |        /* switch to 64-bit domain */
  868|       |        np = alloca(top * sizeof(BN_ULONG));
  869|       |        top /= 2;
  870|       |        bn_flip_t4(np, mont->N.d, top);
  871|       |
  872|       |        /*
  873|       |         * The exponent may not have a whole number of fixed-size windows.
  874|       |         * To simplify the main loop, the initial window has between 1 and
  875|       |         * full-window-size bits such that what remains is always a whole
  876|       |         * number of windows
  877|       |         */
  878|       |        window0 = (bits - 1) % 5 + 1;
  879|       |        wmask = (1 << window0) - 1;
  880|       |        bits -= window0;
  881|       |        wvalue = bn_get_bits(p, bits) & wmask;
  882|       |        bn_gather5_t4(tmp.d, top, powerbuf, wvalue);
  883|       |
  884|       |        /*
  885|       |         * Scan the exponent one window at a time starting from the most
  886|       |         * significant bits.
  887|       |         */
  888|       |        while (bits > 0) {
  889|       |            if (bits < stride)
  890|       |                stride = bits;
  891|       |            bits -= stride;
  892|       |            wvalue = bn_get_bits(p, bits);
  893|       |
  894|       |            if ((*pwr5_worker) (tmp.d, np, n0, powerbuf, wvalue, stride))
  895|       |                continue;
  896|       |            /* retry once and fall back */
  897|       |            if ((*pwr5_worker) (tmp.d, np, n0, powerbuf, wvalue, stride))
  898|       |                continue;
  899|       |
  900|       |            bits += stride - 5;
  901|       |            wvalue >>= stride - 5;
  902|       |            wvalue &= 31;
  903|       |            bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
  904|       |            bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
  905|       |            bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
  906|       |            bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
  907|       |            bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
  908|       |            bn_mul_mont_gather5_t4(tmp.d, tmp.d, powerbuf, np, n0, top,
  909|       |                                   wvalue);
  910|       |        }
  911|       |
  912|       |        bn_flip_t4(tmp.d, tmp.d, top);
  913|       |        top *= 2;
  914|       |        /* back to 32-bit domain */
  915|       |        tmp.top = top;
  916|       |        bn_correct_top(&tmp);
  917|       |        OPENSSL_cleanse(np, top * sizeof(BN_ULONG));
  918|       |    } else
  919|       |#endif
  920|    458|#if defined(OPENSSL_BN_ASM_MONT5)
  921|    458|    if (window == 5 && top > 1) {
  ------------------
  |  Branch (921:9): [True: 63, False: 395]
  |  Branch (921:24): [True: 62, False: 1]
  ------------------
  922|       |        /*
  923|       |         * This optimization uses ideas from https://eprint.iacr.org/2011/239,
  924|       |         * specifically optimization of cache-timing attack countermeasures,
  925|       |         * pre-computation optimization, and Almost Montgomery Multiplication.
  926|       |         *
  927|       |         * The paper discusses a 4-bit window to optimize 512-bit modular
  928|       |         * exponentiation, used in RSA-1024 with CRT, but RSA-1024 is no longer
  929|       |         * important.
  930|       |         *
  931|       |         * |bn_mul_mont_gather5| and |bn_power5| implement the "almost"
  932|       |         * reduction variant, so the values here may not be fully reduced.
  933|       |         * They are bounded by R (i.e. they fit in |top| words), not |m|.
  934|       |         * Additionally, we pass these "almost" reduced inputs into
  935|       |         * |bn_mul_mont|, which implements the normal reduction variant.
  936|       |         * Given those inputs, |bn_mul_mont| may not give reduced
  937|       |         * output, but it will still produce "almost" reduced output.
  938|       |         */
  939|     62|        void bn_mul_mont_gather5(BN_ULONG *rp, const BN_ULONG *ap,
  940|     62|                                 const void *table, const BN_ULONG *np,
  941|     62|                                 const BN_ULONG *n0, int num, int power);
  942|     62|        void bn_scatter5(const BN_ULONG *inp, size_t num,
  943|     62|                         void *table, size_t power);
  944|     62|        void bn_gather5(BN_ULONG *out, size_t num, void *table, size_t power);
  945|     62|        void bn_power5(BN_ULONG *rp, const BN_ULONG *ap,
  946|     62|                       const void *table, const BN_ULONG *np,
  947|     62|                       const BN_ULONG *n0, int num, int power);
  948|     62|        int bn_get_bits5(const BN_ULONG *ap, int off);
  949|       |
  950|     62|        BN_ULONG *n0 = mont->n0, *np;
  ------------------
  |  |   37|     62|#  define BN_ULONG        unsigned long
  ------------------
  951|       |
  952|       |        /*
  953|       |         * BN_to_montgomery can contaminate words above .top [in
  954|       |         * BN_DEBUG build...
  955|       |         */
  956|     62|        for (i = am.top; i < top; i++)
  ------------------
  |  Branch (956:26): [True: 0, False: 62]
  ------------------
  957|      0|            am.d[i] = 0;
  958|     62|        for (i = tmp.top; i < top; i++)
  ------------------
  |  Branch (958:27): [True: 0, False: 62]
  ------------------
  959|      0|            tmp.d[i] = 0;
  960|       |
  961|       |        /*
  962|       |         * copy mont->N.d[] to improve cache locality
  963|       |         */
  964|    390|        for (np = am.d + top, i = 0; i < top; i++)
  ------------------
  |  Branch (964:38): [True: 328, False: 62]
  ------------------
  965|    328|            np[i] = mont->N.d[i];
  966|       |
  967|     62|        bn_scatter5(tmp.d, top, powerbuf, 0);
  968|     62|        bn_scatter5(am.d, am.top, powerbuf, 1);
  969|     62|        bn_mul_mont(tmp.d, am.d, am.d, np, n0, top);
  970|     62|        bn_scatter5(tmp.d, top, powerbuf, 2);
  971|       |
  972|       |# if 0
  973|       |        for (i = 3; i < 32; i++) {
  974|       |            /* Calculate a^i = a^(i-1) * a */
  975|       |            bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);
  976|       |            bn_scatter5(tmp.d, top, powerbuf, i);
  977|       |        }
  978|       |# else
  979|       |        /* same as above, but uses squaring for 1/2 of operations */
  980|    248|        for (i = 4; i < 32; i *= 2) {
  ------------------
  |  Branch (980:21): [True: 186, False: 62]
  ------------------
  981|    186|            bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
  982|    186|            bn_scatter5(tmp.d, top, powerbuf, i);
  983|    186|        }
  984|    248|        for (i = 3; i < 8; i += 2) {
  ------------------
  |  Branch (984:21): [True: 186, False: 62]
  ------------------
  985|    186|            int j;
  986|    186|            bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);
  987|    186|            bn_scatter5(tmp.d, top, powerbuf, i);
  988|    620|            for (j = 2 * i; j < 32; j *= 2) {
  ------------------
  |  Branch (988:29): [True: 434, False: 186]
  ------------------
  989|    434|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
  990|    434|                bn_scatter5(tmp.d, top, powerbuf, j);
  991|    434|            }
  992|    186|        }
  993|    310|        for (; i < 16; i += 2) {
  ------------------
  |  Branch (993:16): [True: 248, False: 62]
  ------------------
  994|    248|            bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);
  995|    248|            bn_scatter5(tmp.d, top, powerbuf, i);
  996|    248|            bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
  997|    248|            bn_scatter5(tmp.d, top, powerbuf, 2 * i);
  998|    248|        }
  999|    558|        for (; i < 32; i += 2) {
  ------------------
  |  Branch (999:16): [True: 496, False: 62]
  ------------------
 1000|    496|            bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);
 1001|    496|            bn_scatter5(tmp.d, top, powerbuf, i);
 1002|    496|        }
 1003|     62|# endif
 1004|       |        /*
 1005|       |         * The exponent may not have a whole number of fixed-size windows.
 1006|       |         * To simplify the main loop, the initial window has between 1 and
 1007|       |         * full-window-size bits such that what remains is always a whole
 1008|       |         * number of windows
 1009|       |         */
 1010|     62|        window0 = (bits - 1) % 5 + 1;
 1011|     62|        wmask = (1 << window0) - 1;
 1012|     62|        bits -= window0;
 1013|     62|        wvalue = bn_get_bits(p, bits) & wmask;
 1014|     62|        bn_gather5(tmp.d, top, powerbuf, wvalue);
 1015|       |
 1016|       |        /*
 1017|       |         * Scan the exponent one window at a time starting from the most
 1018|       |         * significant bits.
 1019|       |         */
 1020|     62|        if (top & 7) {
  ------------------
  |  Branch (1020:13): [True: 55, False: 7]
  ------------------
 1021|  3.77k|            while (bits > 0) {
  ------------------
  |  Branch (1021:20): [True: 3.72k, False: 55]
  ------------------
 1022|  3.72k|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
 1023|  3.72k|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
 1024|  3.72k|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
 1025|  3.72k|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
 1026|  3.72k|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
 1027|  3.72k|                bn_mul_mont_gather5(tmp.d, tmp.d, powerbuf, np, n0, top,
 1028|  3.72k|                                    bn_get_bits5(p->d, bits -= 5));
 1029|  3.72k|            }
 1030|     55|        } else {
 1031|    836|            while (bits > 0) {
  ------------------
  |  Branch (1031:20): [True: 829, False: 7]
  ------------------
 1032|    829|                bn_power5(tmp.d, tmp.d, powerbuf, np, n0, top,
 1033|    829|                          bn_get_bits5(p->d, bits -= 5));
 1034|    829|            }
 1035|      7|        }
 1036|       |
 1037|     62|        tmp.top = top;
 1038|       |        /*
 1039|       |         * The result is now in |tmp| in Montgomery form, but it may not be
 1040|       |         * fully reduced. This is within bounds for |BN_from_montgomery|
 1041|       |         * (tmp < R <= m*R) so it will, when converting from Montgomery form,
 1042|       |         * produce a fully reduced result.
 1043|       |         *
 1044|       |         * This differs from Figure 2 of the paper, which uses AMM(h, 1) to
 1045|       |         * convert from Montgomery form with unreduced output, followed by an
 1046|       |         * extra reduction step. In the paper's terminology, we replace
 1047|       |         * steps 9 and 10 with MM(h, 1).
 1048|       |         */
 1049|     62|    } else
 1050|    396|#endif
 1051|    396|    {
 1052|    396| fallback:
 1053|    396|        if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 0, window))
  ------------------
  |  Branch (1053:13): [True: 0, False: 396]
  ------------------
 1054|      0|            goto err;
 1055|    396|        if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&am, top, powerbuf, 1, window))
  ------------------
  |  Branch (1055:13): [True: 0, False: 396]
  ------------------
 1056|      0|            goto err;
 1057|       |
 1058|       |        /*
 1059|       |         * If the window size is greater than 1, then calculate
 1060|       |         * val[i=2..2^winsize-1]. Powers are computed as a*a^(i-1) (even
 1061|       |         * powers could instead be computed as (a^(i/2))^2 to use the slight
 1062|       |         * performance advantage of sqr over mul).
 1063|       |         */
 1064|    396|        if (window > 1) {
  ------------------
  |  Branch (1064:13): [True: 396, False: 0]
  ------------------
 1065|    396|            if (!bn_mul_mont_fixed_top(&tmp, &am, &am, mont, ctx))
  ------------------
  |  Branch (1065:17): [True: 0, False: 396]
  ------------------
 1066|      0|                goto err;
 1067|    396|            if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 2,
  ------------------
  |  Branch (1067:17): [True: 0, False: 396]
  ------------------
 1068|    396|                                              window))
 1069|      0|                goto err;
 1070|  2.82k|            for (i = 3; i < numPowers; i++) {
  ------------------
  |  Branch (1070:25): [True: 2.42k, False: 396]
  ------------------
 1071|       |                /* Calculate a^i = a^(i-1) * a */
 1072|  2.42k|                if (!bn_mul_mont_fixed_top(&tmp, &am, &tmp, mont, ctx))
  ------------------
  |  Branch (1072:21): [True: 0, False: 2.42k]
  ------------------
 1073|      0|                    goto err;
 1074|  2.42k|                if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, i,
  ------------------
  |  Branch (1074:21): [True: 0, False: 2.42k]
  ------------------
 1075|  2.42k|                                                  window))
 1076|      0|                    goto err;
 1077|  2.42k|            }
 1078|    396|        }
 1079|       |
 1080|       |        /*
 1081|       |         * The exponent may not have a whole number of fixed-size windows.
 1082|       |         * To simplify the main loop, the initial window has between 1 and
 1083|       |         * full-window-size bits such that what remains is always a whole
 1084|       |         * number of windows
 1085|       |         */
 1086|    396|        window0 = (bits - 1) % window + 1;
 1087|    396|        wmask = (1 << window0) - 1;
 1088|    396|        bits -= window0;
 1089|    396|        wvalue = bn_get_bits(p, bits) & wmask;
 1090|    396|        if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp, top, powerbuf, wvalue,
  ------------------
  |  Branch (1090:13): [True: 0, False: 396]
  ------------------
 1091|    396|                                            window))
 1092|      0|            goto err;
 1093|       |
 1094|    396|        wmask = (1 << window) - 1;
 1095|       |        /*
 1096|       |         * Scan the exponent one window at a time starting from the most
 1097|       |         * significant bits.
 1098|       |         */
 1099|  10.1k|        while (bits > 0) {
  ------------------
  |  Branch (1099:16): [True: 9.75k, False: 396]
  ------------------
 1100|       |
 1101|       |            /* Square the result window-size times */
 1102|  41.6k|            for (i = 0; i < window; i++)
  ------------------
  |  Branch (1102:25): [True: 31.8k, False: 9.75k]
  ------------------
 1103|  31.8k|                if (!bn_mul_mont_fixed_top(&tmp, &tmp, &tmp, mont, ctx))
  ------------------
  |  Branch (1103:21): [True: 0, False: 31.8k]
  ------------------
 1104|      0|                    goto err;
 1105|       |
 1106|       |            /*
 1107|       |             * Get a window's worth of bits from the exponent
 1108|       |             * This avoids calling BN_is_bit_set for each bit, which
 1109|       |             * is not only slower but also makes each bit vulnerable to
 1110|       |             * EM (and likely other) side-channel attacks like One&Done
 1111|       |             * (for details see "One&Done: A Single-Decryption EM-Based
 1112|       |             *  Attack on OpenSSL's Constant-Time Blinded RSA" by M. Alam,
 1113|       |             *  H. Khan, M. Dey, N. Sinha, R. Callan, A. Zajic, and
 1114|       |             *  M. Prvulovic, in USENIX Security'18)
 1115|       |             */
 1116|  9.75k|            bits -= window;
 1117|  9.75k|            wvalue = bn_get_bits(p, bits) & wmask;
 1118|       |            /*
 1119|       |             * Fetch the appropriate pre-computed value from the pre-buf
 1120|       |             */
 1121|  9.75k|            if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&am, top, powerbuf, wvalue,
  ------------------
  |  Branch (1121:17): [True: 0, False: 9.75k]
  ------------------
 1122|  9.75k|                                                window))
 1123|      0|                goto err;
 1124|       |
 1125|       |            /* Multiply the result into the intermediate result */
 1126|  9.75k|            if (!bn_mul_mont_fixed_top(&tmp, &tmp, &am, mont, ctx))
  ------------------
  |  Branch (1126:17): [True: 0, False: 9.75k]
  ------------------
 1127|      0|                goto err;
 1128|  9.75k|        }
 1129|    396|    }
 1130|       |
 1131|       |    /*
 1132|       |     * Done with zero-padded intermediate BIGNUMs. Final BN_from_montgomery
 1133|       |     * removes padding [if any] and makes return value suitable for public
 1134|       |     * API consumer.
 1135|       |     */
 1136|       |#if defined(SPARC_T4_MONT)
 1137|       |    if (OPENSSL_sparcv9cap_P[0] & (SPARCV9_VIS3 | SPARCV9_PREFER_FPU)) {
 1138|       |        am.d[0] = 1;            /* borrow am */
 1139|       |        for (i = 1; i < top; i++)
 1140|       |            am.d[i] = 0;
 1141|       |        if (!BN_mod_mul_montgomery(rr, &tmp, &am, mont, ctx))
 1142|       |            goto err;
 1143|       |    } else
 1144|       |#endif
 1145|    458|    if (!bn_from_mont_fixed_top(rr, &tmp, mont, ctx))
  ------------------
  |  Branch (1145:9): [True: 0, False: 458]
  ------------------
 1146|      0|        goto err;
 1147|    458|    ret = 1;
 1148|    459| err:
 1149|    459|    if (in_mont == NULL)
  ------------------
  |  Branch (1149:9): [True: 441, False: 18]
  ------------------
 1150|    441|        BN_MONT_CTX_free(mont);
 1151|    459|    if (powerbuf != NULL) {
  ------------------
  |  Branch (1151:9): [True: 458, False: 1]
  ------------------
 1152|    458|        OPENSSL_cleanse(powerbuf, powerbufLen);
 1153|    458|        OPENSSL_free(powerbufFree);
  ------------------
  |  |  115|    458|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    458|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    458|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1154|    458|    }
 1155|    459|    BN_CTX_end(ctx);
 1156|    459|    return ret;
 1157|    458|}
BN_mod_exp_mont_consttime:
 1162|    462|{
 1163|    462|    bn_check_top(a);
 1164|    462|    bn_check_top(p);
 1165|    462|    bn_check_top(m);
 1166|    462|    if (!bn_mod_exp_mont_fixed_top(rr, a, p, m, ctx, in_mont))
  ------------------
  |  Branch (1166:9): [True: 0, False: 462]
  ------------------
 1167|      0|        return 0;
 1168|    462|    bn_correct_top(rr);
 1169|    462|    return 1;
 1170|    462|}
BN_mod_exp_mont_word:
 1174|  1.05k|{
 1175|  1.05k|    BN_MONT_CTX *mont = NULL;
 1176|  1.05k|    int b, bits, ret = 0;
 1177|  1.05k|    int r_is_one;
 1178|  1.05k|    BN_ULONG w, next_w;
  ------------------
  |  |   37|  1.05k|#  define BN_ULONG        unsigned long
  ------------------
 1179|  1.05k|    BIGNUM *r, *t;
 1180|  1.05k|    BIGNUM *swap_tmp;
 1181|  1.05k|#define BN_MOD_MUL_WORD(r, w, m) \
 1182|  1.05k|                (BN_mul_word(r, (w)) && \
 1183|  1.05k|                (/* BN_ucmp(r, (m)) < 0 ? 1 :*/  \
 1184|  1.05k|                        (BN_mod(t, r, m, ctx) && (swap_tmp = r, r = t, t = swap_tmp, 1))))
 1185|       |    /*
 1186|       |     * BN_MOD_MUL_WORD is only used with 'w' large, so the BN_ucmp test is
 1187|       |     * probably more overhead than always using BN_mod (which uses BN_copy if
 1188|       |     * a similar test returns true).
 1189|       |     */
 1190|       |    /*
 1191|       |     * We can use BN_mod and do not need BN_nnmod because our accumulator is
 1192|       |     * never negative (the result of BN_mod does not depend on the sign of
 1193|       |     * the modulus).
 1194|       |     */
 1195|  1.05k|#define BN_TO_MONTGOMERY_WORD(r, w, mont) \
 1196|  1.05k|                (BN_set_word(r, (w)) && BN_to_montgomery(r, r, (mont), ctx))
 1197|       |
 1198|  1.05k|    if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0
  ------------------
  |  |   67|  1.05k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (1198:9): [True: 0, False: 1.05k]
  ------------------
 1199|  1.05k|            || BN_get_flags(m, BN_FLG_CONSTTIME) != 0) {
  ------------------
  |  |   67|  1.05k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (1199:16): [True: 0, False: 1.05k]
  ------------------
 1200|       |        /* BN_FLG_CONSTTIME only supported by BN_mod_exp_mont() */
 1201|      0|        ERR_raise(ERR_LIB_BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1202|      0|        return 0;
 1203|      0|    }
 1204|       |
 1205|  1.05k|    bn_check_top(p);
 1206|  1.05k|    bn_check_top(m);
 1207|       |
 1208|  1.05k|    if (!BN_is_odd(m)) {
  ------------------
  |  Branch (1208:9): [True: 0, False: 1.05k]
  ------------------
 1209|      0|        ERR_raise(ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1210|      0|        return 0;
 1211|      0|    }
 1212|  1.05k|    if (m->top == 1)
  ------------------
  |  Branch (1212:9): [True: 0, False: 1.05k]
  ------------------
 1213|      0|        a %= m->d[0];           /* make sure that 'a' is reduced */
 1214|       |
 1215|  1.05k|    bits = BN_num_bits(p);
 1216|  1.05k|    if (bits == 0) {
  ------------------
  |  Branch (1216:9): [True: 0, False: 1.05k]
  ------------------
 1217|       |        /* x**0 mod 1, or x**0 mod -1 is still zero. */
 1218|      0|        if (BN_abs_is_word(m, 1)) {
  ------------------
  |  Branch (1218:13): [True: 0, False: 0]
  ------------------
 1219|      0|            ret = 1;
 1220|      0|            BN_zero(rr);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
 1221|      0|        } else {
 1222|      0|            ret = BN_one(rr);
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
 1223|      0|        }
 1224|      0|        return ret;
 1225|      0|    }
 1226|  1.05k|    if (a == 0) {
  ------------------
  |  Branch (1226:9): [True: 0, False: 1.05k]
  ------------------
 1227|      0|        BN_zero(rr);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
 1228|      0|        ret = 1;
 1229|      0|        return ret;
 1230|      0|    }
 1231|       |
 1232|  1.05k|    BN_CTX_start(ctx);
 1233|  1.05k|    r = BN_CTX_get(ctx);
 1234|  1.05k|    t = BN_CTX_get(ctx);
 1235|  1.05k|    if (t == NULL)
  ------------------
  |  Branch (1235:9): [True: 0, False: 1.05k]
  ------------------
 1236|      0|        goto err;
 1237|       |
 1238|  1.05k|    if (in_mont != NULL)
  ------------------
  |  Branch (1238:9): [True: 0, False: 1.05k]
  ------------------
 1239|      0|        mont = in_mont;
 1240|  1.05k|    else {
 1241|  1.05k|        if ((mont = BN_MONT_CTX_new()) == NULL)
  ------------------
  |  Branch (1241:13): [True: 0, False: 1.05k]
  ------------------
 1242|      0|            goto err;
 1243|  1.05k|        if (!BN_MONT_CTX_set(mont, m, ctx))
  ------------------
  |  Branch (1243:13): [True: 0, False: 1.05k]
  ------------------
 1244|      0|            goto err;
 1245|  1.05k|    }
 1246|       |
 1247|  1.05k|    r_is_one = 1;               /* except for Montgomery factor */
 1248|       |
 1249|       |    /* bits-1 >= 0 */
 1250|       |
 1251|       |    /* The result is accumulated in the product r*w. */
 1252|  1.05k|    w = a;                      /* bit 'bits-1' of 'p' is always set */
 1253|   174k|    for (b = bits - 2; b >= 0; b--) {
  ------------------
  |  Branch (1253:24): [True: 173k, False: 1.05k]
  ------------------
 1254|       |        /* First, square r*w. */
 1255|   173k|        next_w = w * w;
 1256|   173k|        if ((next_w / w) != w) { /* overflow */
  ------------------
  |  Branch (1256:13): [True: 42.9k, False: 130k]
  ------------------
 1257|  42.9k|            if (r_is_one) {
  ------------------
  |  Branch (1257:17): [True: 985, False: 42.0k]
  ------------------
 1258|    985|                if (!BN_TO_MONTGOMERY_WORD(r, w, mont))
  ------------------
  |  | 1196|    985|                (BN_set_word(r, (w)) && BN_to_montgomery(r, r, (mont), ctx))
  |  |  ------------------
  |  |  |  Branch (1196:18): [True: 985, False: 0]
  |  |  |  Branch (1196:41): [True: 985, False: 0]
  |  |  ------------------
  ------------------
 1259|      0|                    goto err;
 1260|    985|                r_is_one = 0;
 1261|  42.0k|            } else {
 1262|  42.0k|                if (!BN_MOD_MUL_WORD(r, w, m))
  ------------------
  |  | 1182|  42.0k|                (BN_mul_word(r, (w)) && \
  |  |  ------------------
  |  |  |  Branch (1182:18): [True: 42.0k, False: 0]
  |  |  ------------------
  |  | 1183|  42.0k|                (/* BN_ucmp(r, (m)) < 0 ? 1 :*/  \
  |  | 1184|  42.0k|                        (BN_mod(t, r, m, ctx) && (swap_tmp = r, r = t, t = swap_tmp, 1))))
  |  |  ------------------
  |  |  |  |  277|  84.0k|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:30): [True: 42.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1184:50): [True: 42.0k, False: 0]
  |  |  ------------------
  ------------------
 1263|      0|                    goto err;
 1264|  42.0k|            }
 1265|  42.9k|            next_w = 1;
 1266|  42.9k|        }
 1267|   173k|        w = next_w;
 1268|   173k|        if (!r_is_one) {
  ------------------
  |  Branch (1268:13): [True: 170k, False: 3.08k]
  ------------------
 1269|   170k|            if (!BN_mod_mul_montgomery(r, r, r, mont, ctx))
  ------------------
  |  Branch (1269:17): [True: 0, False: 170k]
  ------------------
 1270|      0|                goto err;
 1271|   170k|        }
 1272|       |
 1273|       |        /* Second, multiply r*w by 'a' if exponent bit is set. */
 1274|   173k|        if (BN_is_bit_set(p, b)) {
  ------------------
  |  Branch (1274:13): [True: 108k, False: 65.0k]
  ------------------
 1275|   108k|            next_w = w * a;
 1276|   108k|            if ((next_w / a) != w) { /* overflow */
  ------------------
  |  Branch (1276:17): [True: 3.38k, False: 105k]
  ------------------
 1277|  3.38k|                if (r_is_one) {
  ------------------
  |  Branch (1277:21): [True: 55, False: 3.33k]
  ------------------
 1278|     55|                    if (!BN_TO_MONTGOMERY_WORD(r, w, mont))
  ------------------
  |  | 1196|     55|                (BN_set_word(r, (w)) && BN_to_montgomery(r, r, (mont), ctx))
  |  |  ------------------
  |  |  |  Branch (1196:18): [True: 55, False: 0]
  |  |  |  Branch (1196:41): [True: 55, False: 0]
  |  |  ------------------
  ------------------
 1279|      0|                        goto err;
 1280|     55|                    r_is_one = 0;
 1281|  3.33k|                } else {
 1282|  3.33k|                    if (!BN_MOD_MUL_WORD(r, w, m))
  ------------------
  |  | 1182|  3.33k|                (BN_mul_word(r, (w)) && \
  |  |  ------------------
  |  |  |  Branch (1182:18): [True: 3.33k, False: 0]
  |  |  ------------------
  |  | 1183|  3.33k|                (/* BN_ucmp(r, (m)) < 0 ? 1 :*/  \
  |  | 1184|  3.33k|                        (BN_mod(t, r, m, ctx) && (swap_tmp = r, r = t, t = swap_tmp, 1))))
  |  |  ------------------
  |  |  |  |  277|  6.66k|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:30): [True: 3.33k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1184:50): [True: 3.33k, False: 0]
  |  |  ------------------
  ------------------
 1283|      0|                        goto err;
 1284|  3.33k|                }
 1285|  3.38k|                next_w = a;
 1286|  3.38k|            }
 1287|   108k|            w = next_w;
 1288|   108k|        }
 1289|   173k|    }
 1290|       |
 1291|       |    /* Finally, set r:=r*w. */
 1292|  1.05k|    if (w != 1) {
  ------------------
  |  Branch (1292:9): [True: 1.00k, False: 51]
  ------------------
 1293|  1.00k|        if (r_is_one) {
  ------------------
  |  Branch (1293:13): [True: 12, False: 989]
  ------------------
 1294|     12|            if (!BN_TO_MONTGOMERY_WORD(r, w, mont))
  ------------------
  |  | 1196|     12|                (BN_set_word(r, (w)) && BN_to_montgomery(r, r, (mont), ctx))
  |  |  ------------------
  |  |  |  Branch (1196:18): [True: 12, False: 0]
  |  |  |  Branch (1196:41): [True: 12, False: 0]
  |  |  ------------------
  ------------------
 1295|      0|                goto err;
 1296|     12|            r_is_one = 0;
 1297|    989|        } else {
 1298|    989|            if (!BN_MOD_MUL_WORD(r, w, m))
  ------------------
  |  | 1182|    989|                (BN_mul_word(r, (w)) && \
  |  |  ------------------
  |  |  |  Branch (1182:18): [True: 989, False: 0]
  |  |  ------------------
  |  | 1183|    989|                (/* BN_ucmp(r, (m)) < 0 ? 1 :*/  \
  |  | 1184|    989|                        (BN_mod(t, r, m, ctx) && (swap_tmp = r, r = t, t = swap_tmp, 1))))
  |  |  ------------------
  |  |  |  |  277|  1.97k|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:30): [True: 989, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1184:50): [True: 989, False: 0]
  |  |  ------------------
  ------------------
 1299|      0|                goto err;
 1300|    989|        }
 1301|  1.00k|    }
 1302|       |
 1303|  1.05k|    if (r_is_one) {             /* can happen only if a == 1 */
  ------------------
  |  Branch (1303:9): [True: 0, False: 1.05k]
  ------------------
 1304|      0|        if (!BN_one(rr))
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (1304:13): [True: 0, False: 0]
  ------------------
 1305|      0|            goto err;
 1306|  1.05k|    } else {
 1307|  1.05k|        if (!BN_from_montgomery(rr, r, mont, ctx))
  ------------------
  |  Branch (1307:13): [True: 0, False: 1.05k]
  ------------------
 1308|      0|            goto err;
 1309|  1.05k|    }
 1310|  1.05k|    ret = 1;
 1311|  1.05k| err:
 1312|  1.05k|    if (in_mont == NULL)
  ------------------
  |  Branch (1312:9): [True: 1.05k, False: 0]
  ------------------
 1313|  1.05k|        BN_MONT_CTX_free(mont);
 1314|  1.05k|    BN_CTX_end(ctx);
 1315|  1.05k|    bn_check_top(rr);
 1316|  1.05k|    return ret;
 1317|  1.05k|}
bn_exp.c:bn_get_bits:
  490|  10.2k|{
  491|  10.2k|    BN_ULONG ret = 0;
  ------------------
  |  |   37|  10.2k|#  define BN_ULONG        unsigned long
  ------------------
  492|  10.2k|    int wordpos;
  493|       |
  494|  10.2k|    wordpos = bitpos / BN_BITS2;
  ------------------
  |  |   54|  10.2k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  10.2k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  495|  10.2k|    bitpos %= BN_BITS2;
  ------------------
  |  |   54|  10.2k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  10.2k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  496|  10.2k|    if (wordpos >= 0 && wordpos < a->top) {
  ------------------
  |  Branch (496:9): [True: 10.2k, False: 0]
  |  Branch (496:25): [True: 10.2k, False: 0]
  ------------------
  497|  10.2k|        ret = a->d[wordpos] & BN_MASK2;
  ------------------
  |  |   94|  10.2k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  498|  10.2k|        if (bitpos) {
  ------------------
  |  Branch (498:13): [True: 9.70k, False: 503]
  ------------------
  499|  9.70k|            ret >>= bitpos;
  500|  9.70k|            if (++wordpos < a->top)
  ------------------
  |  Branch (500:17): [True: 1.65k, False: 8.05k]
  ------------------
  501|  1.65k|                ret |= a->d[wordpos] << (BN_BITS2 - bitpos);
  ------------------
  |  |   54|  1.65k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.65k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  502|  9.70k|        }
  503|  10.2k|    }
  504|       |
  505|  10.2k|    return ret & BN_MASK2;
  ------------------
  |  |   94|  10.2k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  506|  10.2k|}
bn_exp.c:MOD_EXP_CTIME_COPY_TO_PREBUF:
  518|  3.61k|{
  519|  3.61k|    int i, j;
  520|  3.61k|    int width = 1 << window;
  521|  3.61k|    BN_ULONG *table = (BN_ULONG *)buf;
  ------------------
  |  |   37|  3.61k|#  define BN_ULONG        unsigned long
  ------------------
  522|       |
  523|  3.61k|    if (top > b->top)
  ------------------
  |  Branch (523:9): [True: 0, False: 3.61k]
  ------------------
  524|      0|        top = b->top;           /* this works because 'buf' is explicitly
  525|       |                                 * zeroed */
  526|  50.2k|    for (i = 0, j = idx; i < top; i++, j += width) {
  ------------------
  |  Branch (526:26): [True: 46.6k, False: 3.61k]
  ------------------
  527|  46.6k|        table[j] = b->d[i];
  528|  46.6k|    }
  529|       |
  530|  3.61k|    return 1;
  531|  3.61k|}
bn_exp.c:MOD_EXP_CTIME_COPY_FROM_PREBUF:
  536|  10.1k|{
  537|  10.1k|    int i, j;
  538|  10.1k|    int width = 1 << window;
  539|       |    /*
  540|       |     * We declare table 'volatile' in order to discourage compiler
  541|       |     * from reordering loads from the table. Concern is that if
  542|       |     * reordered in specific manner loads might give away the
  543|       |     * information we are trying to conceal. Some would argue that
  544|       |     * compiler can reorder them anyway, but it can as well be
  545|       |     * argued that doing so would be violation of standard...
  546|       |     */
  547|  10.1k|    volatile BN_ULONG *table = (volatile BN_ULONG *)buf;
  548|       |
  549|  10.1k|    if (bn_wexpand(b, top) == NULL)
  ------------------
  |  Branch (549:9): [True: 0, False: 10.1k]
  ------------------
  550|      0|        return 0;
  551|       |
  552|  10.1k|    if (window <= 3) {
  ------------------
  |  Branch (552:9): [True: 7.52k, False: 2.62k]
  ------------------
  553|   124k|        for (i = 0; i < top; i++, table += width) {
  ------------------
  |  Branch (553:21): [True: 116k, False: 7.52k]
  ------------------
  554|   116k|            BN_ULONG acc = 0;
  ------------------
  |  |   37|   116k|#  define BN_ULONG        unsigned long
  ------------------
  555|       |
  556|  1.05M|            for (j = 0; j < width; j++) {
  ------------------
  |  Branch (556:25): [True: 933k, False: 116k]
  ------------------
  557|   933k|                acc |= table[j] &
  558|   933k|                       ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1));
  559|   933k|            }
  560|       |
  561|   116k|            b->d[i] = acc;
  562|   116k|        }
  563|  7.52k|    } else {
  564|  2.62k|        int xstride = 1 << (window - 2);
  565|  2.62k|        BN_ULONG y0, y1, y2, y3;
  ------------------
  |  |   37|  2.62k|#  define BN_ULONG        unsigned long
  ------------------
  566|       |
  567|  2.62k|        i = idx >> (window - 2);        /* equivalent of idx / xstride */
  568|  2.62k|        idx &= xstride - 1;             /* equivalent of idx % xstride */
  569|       |
  570|  2.62k|        y0 = (BN_ULONG)0 - (constant_time_eq_int(i,0)&1);
  571|  2.62k|        y1 = (BN_ULONG)0 - (constant_time_eq_int(i,1)&1);
  572|  2.62k|        y2 = (BN_ULONG)0 - (constant_time_eq_int(i,2)&1);
  573|  2.62k|        y3 = (BN_ULONG)0 - (constant_time_eq_int(i,3)&1);
  574|       |
  575|  14.6k|        for (i = 0; i < top; i++, table += width) {
  ------------------
  |  Branch (575:21): [True: 12.0k, False: 2.62k]
  ------------------
  576|  12.0k|            BN_ULONG acc = 0;
  ------------------
  |  |   37|  12.0k|#  define BN_ULONG        unsigned long
  ------------------
  577|       |
  578|  60.2k|            for (j = 0; j < xstride; j++) {
  ------------------
  |  Branch (578:25): [True: 48.2k, False: 12.0k]
  ------------------
  579|  48.2k|                acc |= ( (table[j + 0 * xstride] & y0) |
  580|  48.2k|                         (table[j + 1 * xstride] & y1) |
  581|  48.2k|                         (table[j + 2 * xstride] & y2) |
  582|  48.2k|                         (table[j + 3 * xstride] & y3) )
  583|  48.2k|                       & ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1));
  584|  48.2k|            }
  585|       |
  586|  12.0k|            b->d[i] = acc;
  587|  12.0k|        }
  588|  2.62k|    }
  589|       |
  590|  10.1k|    b->top = top;
  591|  10.1k|    b->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  10.1k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  592|  10.1k|    return 1;
  593|  10.1k|}

int_bn_mod_inverse:
  201|  30.6k|{
  202|  30.6k|    BIGNUM *A, *B, *X, *Y, *M, *D, *T, *R = NULL;
  203|  30.6k|    BIGNUM *ret = NULL;
  204|  30.6k|    int sign;
  205|       |
  206|       |    /* This is invalid input so we don't worry about constant time here */
  207|  30.6k|    if (BN_abs_is_word(n, 1) || BN_is_zero(n)) {
  ------------------
  |  Branch (207:9): [True: 0, False: 30.6k]
  |  Branch (207:33): [True: 10, False: 30.6k]
  ------------------
  208|     10|        *pnoinv = 1;
  209|     10|        return NULL;
  210|     10|    }
  211|       |
  212|  30.6k|    *pnoinv = 0;
  213|       |
  214|  30.6k|    if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
  ------------------
  |  |   67|  30.6k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (214:9): [True: 0, False: 30.6k]
  ------------------
  215|  30.6k|        || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) {
  ------------------
  |  |   67|  30.6k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (215:12): [True: 0, False: 30.6k]
  ------------------
  216|      0|        return bn_mod_inverse_no_branch(in, a, n, ctx, pnoinv);
  217|      0|    }
  218|       |
  219|  30.6k|    bn_check_top(a);
  220|  30.6k|    bn_check_top(n);
  221|       |
  222|  30.6k|    BN_CTX_start(ctx);
  223|  30.6k|    A = BN_CTX_get(ctx);
  224|  30.6k|    B = BN_CTX_get(ctx);
  225|  30.6k|    X = BN_CTX_get(ctx);
  226|  30.6k|    D = BN_CTX_get(ctx);
  227|  30.6k|    M = BN_CTX_get(ctx);
  228|  30.6k|    Y = BN_CTX_get(ctx);
  229|  30.6k|    T = BN_CTX_get(ctx);
  230|  30.6k|    if (T == NULL)
  ------------------
  |  Branch (230:9): [True: 0, False: 30.6k]
  ------------------
  231|      0|        goto err;
  232|       |
  233|  30.6k|    if (in == NULL)
  ------------------
  |  Branch (233:9): [True: 0, False: 30.6k]
  ------------------
  234|      0|        R = BN_new();
  235|  30.6k|    else
  236|  30.6k|        R = in;
  237|  30.6k|    if (R == NULL)
  ------------------
  |  Branch (237:9): [True: 0, False: 30.6k]
  ------------------
  238|      0|        goto err;
  239|       |
  240|  30.6k|    if (!BN_one(X))
  ------------------
  |  |  197|  30.6k|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (240:9): [True: 0, False: 30.6k]
  ------------------
  241|      0|        goto err;
  242|  30.6k|    BN_zero(Y);
  ------------------
  |  |  202|  30.6k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  243|  30.6k|    if (BN_copy(B, a) == NULL)
  ------------------
  |  Branch (243:9): [True: 0, False: 30.6k]
  ------------------
  244|      0|        goto err;
  245|  30.6k|    if (BN_copy(A, n) == NULL)
  ------------------
  |  Branch (245:9): [True: 0, False: 30.6k]
  ------------------
  246|      0|        goto err;
  247|  30.6k|    A->neg = 0;
  248|  30.6k|    if (B->neg || (BN_ucmp(B, A) >= 0)) {
  ------------------
  |  Branch (248:9): [True: 0, False: 30.6k]
  |  Branch (248:19): [True: 30.6k, False: 0]
  ------------------
  249|  30.6k|        if (!BN_nnmod(B, B, A, ctx))
  ------------------
  |  Branch (249:13): [True: 0, False: 30.6k]
  ------------------
  250|      0|            goto err;
  251|  30.6k|    }
  252|  30.6k|    sign = -1;
  253|       |    /*-
  254|       |     * From  B = a mod |n|,  A = |n|  it follows that
  255|       |     *
  256|       |     *      0 <= B < A,
  257|       |     *     -sign*X*a  ==  B   (mod |n|),
  258|       |     *      sign*Y*a  ==  A   (mod |n|).
  259|       |     */
  260|       |
  261|  30.6k|    if (BN_is_odd(n) && (BN_num_bits(n) <= 2048)) {
  ------------------
  |  Branch (261:9): [True: 30.4k, False: 185]
  |  Branch (261:25): [True: 30.4k, False: 0]
  ------------------
  262|       |        /*
  263|       |         * Binary inversion algorithm; requires odd modulus. This is faster
  264|       |         * than the general algorithm if the modulus is sufficiently small
  265|       |         * (about 400 .. 500 bits on 32-bit systems, but much more on 64-bit
  266|       |         * systems)
  267|       |         */
  268|  30.4k|        int shift;
  269|       |
  270|  1.88M|        while (!BN_is_zero(B)) {
  ------------------
  |  Branch (270:16): [True: 1.85M, False: 30.4k]
  ------------------
  271|       |            /*-
  272|       |             *      0 < B < |n|,
  273|       |             *      0 < A <= |n|,
  274|       |             * (1) -sign*X*a  ==  B   (mod |n|),
  275|       |             * (2)  sign*Y*a  ==  A   (mod |n|)
  276|       |             */
  277|       |
  278|       |            /*
  279|       |             * Now divide B by the maximum possible power of two in the
  280|       |             * integers, and divide X by the same value mod |n|. When we're
  281|       |             * done, (1) still holds.
  282|       |             */
  283|  1.85M|            shift = 0;
  284|  2.79M|            while (!BN_is_bit_set(B, shift)) { /* note that 0 < B */
  ------------------
  |  Branch (284:20): [True: 942k, False: 1.85M]
  ------------------
  285|   942k|                shift++;
  286|       |
  287|   942k|                if (BN_is_odd(X)) {
  ------------------
  |  Branch (287:21): [True: 482k, False: 460k]
  ------------------
  288|   482k|                    if (!BN_uadd(X, X, n))
  ------------------
  |  Branch (288:25): [True: 0, False: 482k]
  ------------------
  289|      0|                        goto err;
  290|   482k|                }
  291|       |                /*
  292|       |                 * now X is even, so we can easily divide it by two
  293|       |                 */
  294|   942k|                if (!BN_rshift1(X, X))
  ------------------
  |  Branch (294:21): [True: 0, False: 942k]
  ------------------
  295|      0|                    goto err;
  296|   942k|            }
  297|  1.85M|            if (shift > 0) {
  ------------------
  |  Branch (297:17): [True: 923k, False: 933k]
  ------------------
  298|   923k|                if (!BN_rshift(B, B, shift))
  ------------------
  |  Branch (298:21): [True: 0, False: 923k]
  ------------------
  299|      0|                    goto err;
  300|   923k|            }
  301|       |
  302|       |            /*
  303|       |             * Same for A and Y.  Afterwards, (2) still holds.
  304|       |             */
  305|  1.85M|            shift = 0;
  306|  2.79M|            while (!BN_is_bit_set(A, shift)) { /* note that 0 < A */
  ------------------
  |  Branch (306:20): [True: 937k, False: 1.85M]
  ------------------
  307|   937k|                shift++;
  308|       |
  309|   937k|                if (BN_is_odd(Y)) {
  ------------------
  |  Branch (309:21): [True: 480k, False: 456k]
  ------------------
  310|   480k|                    if (!BN_uadd(Y, Y, n))
  ------------------
  |  Branch (310:25): [True: 0, False: 480k]
  ------------------
  311|      0|                        goto err;
  312|   480k|                }
  313|       |                /* now Y is even */
  314|   937k|                if (!BN_rshift1(Y, Y))
  ------------------
  |  Branch (314:21): [True: 0, False: 937k]
  ------------------
  315|      0|                    goto err;
  316|   937k|            }
  317|  1.85M|            if (shift > 0) {
  ------------------
  |  Branch (317:17): [True: 921k, False: 935k]
  ------------------
  318|   921k|                if (!BN_rshift(A, A, shift))
  ------------------
  |  Branch (318:21): [True: 0, False: 921k]
  ------------------
  319|      0|                    goto err;
  320|   921k|            }
  321|       |
  322|       |            /*-
  323|       |             * We still have (1) and (2).
  324|       |             * Both  A  and  B  are odd.
  325|       |             * The following computations ensure that
  326|       |             *
  327|       |             *     0 <= B < |n|,
  328|       |             *      0 < A < |n|,
  329|       |             * (1) -sign*X*a  ==  B   (mod |n|),
  330|       |             * (2)  sign*Y*a  ==  A   (mod |n|),
  331|       |             *
  332|       |             * and that either  A  or  B  is even in the next iteration.
  333|       |             */
  334|  1.85M|            if (BN_ucmp(B, A) >= 0) {
  ------------------
  |  Branch (334:17): [True: 935k, False: 921k]
  ------------------
  335|       |                /* -sign*(X + Y)*a == B - A  (mod |n|) */
  336|   935k|                if (!BN_uadd(X, X, Y))
  ------------------
  |  Branch (336:21): [True: 0, False: 935k]
  ------------------
  337|      0|                    goto err;
  338|       |                /*
  339|       |                 * NB: we could use BN_mod_add_quick(X, X, Y, n), but that
  340|       |                 * actually makes the algorithm slower
  341|       |                 */
  342|   935k|                if (!BN_usub(B, B, A))
  ------------------
  |  Branch (342:21): [True: 0, False: 935k]
  ------------------
  343|      0|                    goto err;
  344|   935k|            } else {
  345|       |                /*  sign*(X + Y)*a == A - B  (mod |n|) */
  346|   921k|                if (!BN_uadd(Y, Y, X))
  ------------------
  |  Branch (346:21): [True: 0, False: 921k]
  ------------------
  347|      0|                    goto err;
  348|       |                /*
  349|       |                 * as above, BN_mod_add_quick(Y, Y, X, n) would slow things down
  350|       |                 */
  351|   921k|                if (!BN_usub(A, A, B))
  ------------------
  |  Branch (351:21): [True: 0, False: 921k]
  ------------------
  352|      0|                    goto err;
  353|   921k|            }
  354|  1.85M|        }
  355|  30.4k|    } else {
  356|       |        /* general inversion algorithm */
  357|       |
  358|  3.36k|        while (!BN_is_zero(B)) {
  ------------------
  |  Branch (358:16): [True: 3.17k, False: 185]
  ------------------
  359|  3.17k|            BIGNUM *tmp;
  360|       |
  361|       |            /*-
  362|       |             *      0 < B < A,
  363|       |             * (*) -sign*X*a  ==  B   (mod |n|),
  364|       |             *      sign*Y*a  ==  A   (mod |n|)
  365|       |             */
  366|       |
  367|       |            /* (D, M) := (A/B, A%B) ... */
  368|  3.17k|            if (BN_num_bits(A) == BN_num_bits(B)) {
  ------------------
  |  Branch (368:17): [True: 574, False: 2.60k]
  ------------------
  369|    574|                if (!BN_one(D))
  ------------------
  |  |  197|    574|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (369:21): [True: 0, False: 574]
  ------------------
  370|      0|                    goto err;
  371|    574|                if (!BN_sub(M, A, B))
  ------------------
  |  Branch (371:21): [True: 0, False: 574]
  ------------------
  372|      0|                    goto err;
  373|  2.60k|            } else if (BN_num_bits(A) == BN_num_bits(B) + 1) {
  ------------------
  |  Branch (373:24): [True: 1.29k, False: 1.31k]
  ------------------
  374|       |                /* A/B is 1, 2, or 3 */
  375|  1.29k|                if (!BN_lshift1(T, B))
  ------------------
  |  Branch (375:21): [True: 0, False: 1.29k]
  ------------------
  376|      0|                    goto err;
  377|  1.29k|                if (BN_ucmp(A, T) < 0) {
  ------------------
  |  Branch (377:21): [True: 758, False: 532]
  ------------------
  378|       |                    /* A < 2*B, so D=1 */
  379|    758|                    if (!BN_one(D))
  ------------------
  |  |  197|    758|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (379:25): [True: 0, False: 758]
  ------------------
  380|      0|                        goto err;
  381|    758|                    if (!BN_sub(M, A, B))
  ------------------
  |  Branch (381:25): [True: 0, False: 758]
  ------------------
  382|      0|                        goto err;
  383|    758|                } else {
  384|       |                    /* A >= 2*B, so D=2 or D=3 */
  385|    532|                    if (!BN_sub(M, A, T))
  ------------------
  |  Branch (385:25): [True: 0, False: 532]
  ------------------
  386|      0|                        goto err;
  387|    532|                    if (!BN_add(D, T, B))
  ------------------
  |  Branch (387:25): [True: 0, False: 532]
  ------------------
  388|      0|                        goto err; /* use D (:= 3*B) as temp */
  389|    532|                    if (BN_ucmp(A, D) < 0) {
  ------------------
  |  Branch (389:25): [True: 440, False: 92]
  ------------------
  390|       |                        /* A < 3*B, so D=2 */
  391|    440|                        if (!BN_set_word(D, 2))
  ------------------
  |  Branch (391:29): [True: 0, False: 440]
  ------------------
  392|      0|                            goto err;
  393|       |                        /*
  394|       |                         * M (= A - 2*B) already has the correct value
  395|       |                         */
  396|    440|                    } else {
  397|       |                        /* only D=3 remains */
  398|     92|                        if (!BN_set_word(D, 3))
  ------------------
  |  Branch (398:29): [True: 0, False: 92]
  ------------------
  399|      0|                            goto err;
  400|       |                        /*
  401|       |                         * currently M = A - 2*B, but we need M = A - 3*B
  402|       |                         */
  403|     92|                        if (!BN_sub(M, M, B))
  ------------------
  |  Branch (403:29): [True: 0, False: 92]
  ------------------
  404|      0|                            goto err;
  405|     92|                    }
  406|    532|                }
  407|  1.31k|            } else {
  408|  1.31k|                if (!BN_div(D, M, A, B, ctx))
  ------------------
  |  Branch (408:21): [True: 0, False: 1.31k]
  ------------------
  409|      0|                    goto err;
  410|  1.31k|            }
  411|       |
  412|       |            /*-
  413|       |             * Now
  414|       |             *      A = D*B + M;
  415|       |             * thus we have
  416|       |             * (**)  sign*Y*a  ==  D*B + M   (mod |n|).
  417|       |             */
  418|       |
  419|  3.17k|            tmp = A;    /* keep the BIGNUM object, the value does not matter */
  420|       |
  421|       |            /* (A, B) := (B, A mod B) ... */
  422|  3.17k|            A = B;
  423|  3.17k|            B = M;
  424|       |            /* ... so we have  0 <= B < A  again */
  425|       |
  426|       |            /*-
  427|       |             * Since the former  M  is now  B  and the former  B  is now  A,
  428|       |             * (**) translates into
  429|       |             *       sign*Y*a  ==  D*A + B    (mod |n|),
  430|       |             * i.e.
  431|       |             *       sign*Y*a - D*A  ==  B    (mod |n|).
  432|       |             * Similarly, (*) translates into
  433|       |             *      -sign*X*a  ==  A          (mod |n|).
  434|       |             *
  435|       |             * Thus,
  436|       |             *   sign*Y*a + D*sign*X*a  ==  B  (mod |n|),
  437|       |             * i.e.
  438|       |             *        sign*(Y + D*X)*a  ==  B  (mod |n|).
  439|       |             *
  440|       |             * So if we set  (X, Y, sign) := (Y + D*X, X, -sign), we arrive back at
  441|       |             *      -sign*X*a  ==  B   (mod |n|),
  442|       |             *       sign*Y*a  ==  A   (mod |n|).
  443|       |             * Note that  X  and  Y  stay non-negative all the time.
  444|       |             */
  445|       |
  446|       |            /*
  447|       |             * most of the time D is very small, so we can optimize tmp := D*X+Y
  448|       |             */
  449|  3.17k|            if (BN_is_one(D)) {
  ------------------
  |  Branch (449:17): [True: 1.33k, False: 1.84k]
  ------------------
  450|  1.33k|                if (!BN_add(tmp, X, Y))
  ------------------
  |  Branch (450:21): [True: 0, False: 1.33k]
  ------------------
  451|      0|                    goto err;
  452|  1.84k|            } else {
  453|  1.84k|                if (BN_is_word(D, 2)) {
  ------------------
  |  Branch (453:21): [True: 569, False: 1.27k]
  ------------------
  454|    569|                    if (!BN_lshift1(tmp, X))
  ------------------
  |  Branch (454:25): [True: 0, False: 569]
  ------------------
  455|      0|                        goto err;
  456|  1.27k|                } else if (BN_is_word(D, 4)) {
  ------------------
  |  Branch (456:28): [True: 217, False: 1.05k]
  ------------------
  457|    217|                    if (!BN_lshift(tmp, X, 2))
  ------------------
  |  Branch (457:25): [True: 0, False: 217]
  ------------------
  458|      0|                        goto err;
  459|  1.05k|                } else if (D->top == 1) {
  ------------------
  |  Branch (459:28): [True: 1.05k, False: 0]
  ------------------
  460|  1.05k|                    if (!BN_copy(tmp, X))
  ------------------
  |  Branch (460:25): [True: 0, False: 1.05k]
  ------------------
  461|      0|                        goto err;
  462|  1.05k|                    if (!BN_mul_word(tmp, D->d[0]))
  ------------------
  |  Branch (462:25): [True: 0, False: 1.05k]
  ------------------
  463|      0|                        goto err;
  464|  1.05k|                } else {
  465|      0|                    if (!BN_mul(tmp, D, X, ctx))
  ------------------
  |  Branch (465:25): [True: 0, False: 0]
  ------------------
  466|      0|                        goto err;
  467|      0|                }
  468|  1.84k|                if (!BN_add(tmp, tmp, Y))
  ------------------
  |  Branch (468:21): [True: 0, False: 1.84k]
  ------------------
  469|      0|                    goto err;
  470|  1.84k|            }
  471|       |
  472|  3.17k|            M = Y;      /* keep the BIGNUM object, the value does not matter */
  473|  3.17k|            Y = X;
  474|  3.17k|            X = tmp;
  475|  3.17k|            sign = -sign;
  476|  3.17k|        }
  477|    185|    }
  478|       |
  479|       |    /*-
  480|       |     * The while loop (Euclid's algorithm) ends when
  481|       |     *      A == gcd(a,n);
  482|       |     * we have
  483|       |     *       sign*Y*a  ==  A  (mod |n|),
  484|       |     * where  Y  is non-negative.
  485|       |     */
  486|       |
  487|  30.6k|    if (sign < 0) {
  ------------------
  |  Branch (487:9): [True: 30.5k, False: 95]
  ------------------
  488|  30.5k|        if (!BN_sub(Y, n, Y))
  ------------------
  |  Branch (488:13): [True: 0, False: 30.5k]
  ------------------
  489|      0|            goto err;
  490|  30.5k|    }
  491|       |    /* Now  Y*a  ==  A  (mod |n|).  */
  492|       |
  493|  30.6k|    if (BN_is_one(A)) {
  ------------------
  |  Branch (493:9): [True: 30.4k, False: 185]
  ------------------
  494|       |        /* Y*a == 1  (mod |n|) */
  495|  30.4k|        if (!Y->neg && BN_ucmp(Y, n) < 0) {
  ------------------
  |  Branch (495:13): [True: 1.48k, False: 28.9k]
  |  Branch (495:24): [True: 1.48k, False: 0]
  ------------------
  496|  1.48k|            if (!BN_copy(R, Y))
  ------------------
  |  Branch (496:17): [True: 0, False: 1.48k]
  ------------------
  497|      0|                goto err;
  498|  28.9k|        } else {
  499|  28.9k|            if (!BN_nnmod(R, Y, n, ctx))
  ------------------
  |  Branch (499:17): [True: 0, False: 28.9k]
  ------------------
  500|      0|                goto err;
  501|  28.9k|        }
  502|  30.4k|    } else {
  503|    185|        *pnoinv = 1;
  504|    185|        goto err;
  505|    185|    }
  506|  30.4k|    ret = R;
  507|  30.6k| err:
  508|  30.6k|    if ((ret == NULL) && (in == NULL))
  ------------------
  |  Branch (508:9): [True: 185, False: 30.4k]
  |  Branch (508:26): [True: 0, False: 185]
  ------------------
  509|      0|        BN_free(R);
  510|  30.6k|    BN_CTX_end(ctx);
  511|  30.6k|    bn_check_top(ret);
  512|  30.6k|    return ret;
  513|  30.4k|}
BN_mod_inverse:
  518|  30.6k|{
  519|  30.6k|    BN_CTX *new_ctx = NULL;
  520|  30.6k|    BIGNUM *rv;
  521|  30.6k|    int noinv = 0;
  522|       |
  523|  30.6k|    if (ctx == NULL) {
  ------------------
  |  Branch (523:9): [True: 0, False: 30.6k]
  ------------------
  524|      0|        ctx = new_ctx = BN_CTX_new_ex(NULL);
  525|      0|        if (ctx == NULL) {
  ------------------
  |  Branch (525:13): [True: 0, False: 0]
  ------------------
  526|      0|            ERR_raise(ERR_LIB_BN, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  527|      0|            return NULL;
  528|      0|        }
  529|      0|    }
  530|       |
  531|  30.6k|    rv = int_bn_mod_inverse(in, a, n, ctx, &noinv);
  532|  30.6k|    if (noinv)
  ------------------
  |  Branch (532:9): [True: 195, False: 30.4k]
  ------------------
  533|  30.6k|        ERR_raise(ERR_LIB_BN, BN_R_NO_INVERSE);
  ------------------
  |  |  401|    195|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    195|    (ERR_new(),                                                 \
  |  |  |  |  404|    195|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    195|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    195|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    195|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    195|     ERR_set_error)
  |  |  ------------------
  ------------------
  534|  30.6k|    BN_CTX_free(new_ctx);
  535|  30.6k|    return rv;
  536|  30.6k|}

BN_GF2m_add:
  254|  31.1M|{
  255|  31.1M|    int i;
  256|  31.1M|    const BIGNUM *at, *bt;
  257|       |
  258|  31.1M|    bn_check_top(a);
  259|  31.1M|    bn_check_top(b);
  260|       |
  261|  31.1M|    if (a->top < b->top) {
  ------------------
  |  Branch (261:9): [True: 136k, False: 31.0M]
  ------------------
  262|   136k|        at = b;
  263|   136k|        bt = a;
  264|  31.0M|    } else {
  265|  31.0M|        at = a;
  266|  31.0M|        bt = b;
  267|  31.0M|    }
  268|       |
  269|  31.1M|    if (bn_wexpand(r, at->top) == NULL)
  ------------------
  |  Branch (269:9): [True: 0, False: 31.1M]
  ------------------
  270|      0|        return 0;
  271|       |
  272|   215M|    for (i = 0; i < bt->top; i++) {
  ------------------
  |  Branch (272:17): [True: 184M, False: 31.1M]
  ------------------
  273|   184M|        r->d[i] = at->d[i] ^ bt->d[i];
  274|   184M|    }
  275|  31.5M|    for (; i < at->top; i++) {
  ------------------
  |  Branch (275:12): [True: 442k, False: 31.1M]
  ------------------
  276|   442k|        r->d[i] = at->d[i];
  277|   442k|    }
  278|       |
  279|  31.1M|    r->top = at->top;
  280|  31.1M|    bn_correct_top(r);
  281|       |
  282|  31.1M|    return 1;
  283|  31.1M|}
BN_GF2m_mod_arr:
  294|  48.5M|{
  295|  48.5M|    int j, k;
  296|  48.5M|    int n, dN, d0, d1;
  297|  48.5M|    BN_ULONG zz, *z;
  ------------------
  |  |   37|  48.5M|#  define BN_ULONG        unsigned long
  ------------------
  298|       |
  299|  48.5M|    bn_check_top(a);
  300|       |
  301|  48.5M|    if (p[0] == 0) {
  ------------------
  |  Branch (301:9): [True: 0, False: 48.5M]
  ------------------
  302|       |        /* reduction mod 1 => return 0 */
  303|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  304|      0|        return 1;
  305|      0|    }
  306|       |
  307|       |    /*
  308|       |     * Since the algorithm does reduction in the r value, if a != r, copy the
  309|       |     * contents of a into r so we can do reduction in r.
  310|       |     */
  311|  48.5M|    if (a != r) {
  ------------------
  |  Branch (311:9): [True: 48.5M, False: 41.0k]
  ------------------
  312|  48.5M|        if (!bn_wexpand(r, a->top))
  ------------------
  |  Branch (312:13): [True: 0, False: 48.5M]
  ------------------
  313|      0|            return 0;
  314|   614M|        for (j = 0; j < a->top; j++) {
  ------------------
  |  Branch (314:21): [True: 565M, False: 48.5M]
  ------------------
  315|   565M|            r->d[j] = a->d[j];
  316|   565M|        }
  317|  48.5M|        r->top = a->top;
  318|  48.5M|    }
  319|  48.5M|    z = r->d;
  320|       |
  321|       |    /* start reduction */
  322|  48.5M|    dN = p[0] / BN_BITS2;
  ------------------
  |  |   54|  48.5M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  48.5M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  323|   611M|    for (j = r->top - 1; j > dN;) {
  ------------------
  |  Branch (323:26): [True: 562M, False: 48.5M]
  ------------------
  324|   562M|        zz = z[j];
  325|   562M|        if (z[j] == 0) {
  ------------------
  |  Branch (325:13): [True: 281M, False: 281M]
  ------------------
  326|   281M|            j--;
  327|   281M|            continue;
  328|   281M|        }
  329|   281M|        z[j] = 0;
  330|       |
  331|  1.11G|        for (k = 1; p[k] != 0; k++) {
  ------------------
  |  Branch (331:21): [True: 837M, False: 281M]
  ------------------
  332|       |            /* reducing component t^p[k] */
  333|   837M|            n = p[0] - p[k];
  334|   837M|            d0 = n % BN_BITS2;
  ------------------
  |  |   54|   837M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   837M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  335|   837M|            d1 = BN_BITS2 - d0;
  ------------------
  |  |   54|   837M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   837M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  336|   837M|            n /= BN_BITS2;
  ------------------
  |  |   54|   837M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   837M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  337|   837M|            z[j - n] ^= (zz >> d0);
  338|   837M|            if (d0)
  ------------------
  |  Branch (338:17): [True: 834M, False: 2.93M]
  ------------------
  339|   834M|                z[j - n - 1] ^= (zz << d1);
  340|   837M|        }
  341|       |
  342|       |        /* reducing component t^0 */
  343|   281M|        n = dN;
  344|   281M|        d0 = p[0] % BN_BITS2;
  ------------------
  |  |   54|   281M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   281M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  345|   281M|        d1 = BN_BITS2 - d0;
  ------------------
  |  |   54|   281M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   281M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  346|   281M|        z[j - n] ^= (zz >> d0);
  347|   281M|        if (d0)
  ------------------
  |  Branch (347:13): [True: 281M, False: 0]
  ------------------
  348|   281M|            z[j - n - 1] ^= (zz << d1);
  349|   281M|    }
  350|       |
  351|       |    /* final round of reduction */
  352|  96.7M|    while (j == dN) {
  ------------------
  |  Branch (352:12): [True: 96.7M, False: 79.6k]
  ------------------
  353|       |
  354|  96.7M|        d0 = p[0] % BN_BITS2;
  ------------------
  |  |   54|  96.7M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  96.7M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  355|  96.7M|        zz = z[dN] >> d0;
  356|  96.7M|        if (zz == 0)
  ------------------
  |  Branch (356:13): [True: 48.4M, False: 48.2M]
  ------------------
  357|  48.4M|            break;
  358|  48.2M|        d1 = BN_BITS2 - d0;
  ------------------
  |  |   54|  48.2M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  48.2M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  359|       |
  360|       |        /* clear up the top d1 bits */
  361|  48.2M|        if (d0)
  ------------------
  |  Branch (361:13): [True: 48.2M, False: 0]
  ------------------
  362|  48.2M|            z[dN] = (z[dN] << d1) >> d1;
  363|      0|        else
  364|      0|            z[dN] = 0;
  365|  48.2M|        z[0] ^= zz;             /* reduction t^0 component */
  366|       |
  367|   191M|        for (k = 1; p[k] != 0; k++) {
  ------------------
  |  Branch (367:21): [True: 142M, False: 48.2M]
  ------------------
  368|   142M|            BN_ULONG tmp_ulong;
  ------------------
  |  |   37|   142M|#  define BN_ULONG        unsigned long
  ------------------
  369|       |
  370|       |            /* reducing component t^p[k] */
  371|   142M|            n = p[k] / BN_BITS2;
  ------------------
  |  |   54|   142M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   142M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  372|   142M|            d0 = p[k] % BN_BITS2;
  ------------------
  |  |   54|   142M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   142M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  373|   142M|            d1 = BN_BITS2 - d0;
  ------------------
  |  |   54|   142M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   142M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  374|   142M|            z[n] ^= (zz << d0);
  375|   142M|            if (d0 && (tmp_ulong = zz >> d1))
  ------------------
  |  Branch (375:17): [True: 142M, False: 0]
  |  Branch (375:23): [True: 1.35M, False: 141M]
  ------------------
  376|  1.35M|                z[n + 1] ^= tmp_ulong;
  377|   142M|        }
  378|       |
  379|  48.2M|    }
  380|       |
  381|  48.5M|    bn_correct_top(r);
  382|  48.5M|    return 1;
  383|  48.5M|}
BN_GF2m_mod:
  392|  13.6k|{
  393|  13.6k|    int ret = 0;
  394|  13.6k|    int arr[6];
  395|  13.6k|    bn_check_top(a);
  396|  13.6k|    bn_check_top(p);
  397|  13.6k|    ret = BN_GF2m_poly2arr(p, arr, OSSL_NELEM(arr));
  ------------------
  |  |   14|  13.6k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  398|  13.6k|    if (!ret || ret > (int)OSSL_NELEM(arr)) {
  ------------------
  |  |   14|  13.6k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (398:9): [True: 0, False: 13.6k]
  |  Branch (398:17): [True: 0, False: 13.6k]
  ------------------
  399|      0|        ERR_raise(ERR_LIB_BN, BN_R_INVALID_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  400|      0|        return 0;
  401|      0|    }
  402|  13.6k|    ret = BN_GF2m_mod_arr(r, a, arr);
  403|  13.6k|    bn_check_top(r);
  404|  13.6k|    return ret;
  405|  13.6k|}
BN_GF2m_mod_mul_arr:
  413|  16.1M|{
  414|  16.1M|    int zlen, i, j, k, ret = 0;
  415|  16.1M|    BIGNUM *s;
  416|  16.1M|    BN_ULONG x1, x0, y1, y0, zz[4];
  ------------------
  |  |   37|  16.1M|#  define BN_ULONG        unsigned long
  ------------------
  417|       |
  418|  16.1M|    bn_check_top(a);
  419|  16.1M|    bn_check_top(b);
  420|       |
  421|  16.1M|    if (a == b) {
  ------------------
  |  Branch (421:9): [True: 0, False: 16.1M]
  ------------------
  422|      0|        return BN_GF2m_mod_sqr_arr(r, a, p, ctx);
  423|      0|    }
  424|       |
  425|  16.1M|    BN_CTX_start(ctx);
  426|  16.1M|    if ((s = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (426:9): [True: 0, False: 16.1M]
  ------------------
  427|      0|        goto err;
  428|       |
  429|  16.1M|    zlen = a->top + b->top + 4;
  430|  16.1M|    if (!bn_wexpand(s, zlen))
  ------------------
  |  Branch (430:9): [True: 0, False: 16.1M]
  ------------------
  431|      0|        goto err;
  432|  16.1M|    s->top = zlen;
  433|       |
  434|   271M|    for (i = 0; i < zlen; i++)
  ------------------
  |  Branch (434:17): [True: 255M, False: 16.1M]
  ------------------
  435|   255M|        s->d[i] = 0;
  436|       |
  437|  64.0M|    for (j = 0; j < b->top; j += 2) {
  ------------------
  |  Branch (437:17): [True: 47.8M, False: 16.1M]
  ------------------
  438|  47.8M|        y0 = b->d[j];
  439|  47.8M|        y1 = ((j + 1) == b->top) ? 0 : b->d[j + 1];
  ------------------
  |  Branch (439:14): [True: 705k, False: 47.1M]
  ------------------
  440|   192M|        for (i = 0; i < a->top; i += 2) {
  ------------------
  |  Branch (440:21): [True: 144M, False: 47.8M]
  ------------------
  441|   144M|            x0 = a->d[i];
  442|   144M|            x1 = ((i + 1) == a->top) ? 0 : a->d[i + 1];
  ------------------
  |  Branch (442:18): [True: 2.12M, False: 142M]
  ------------------
  443|   144M|            bn_GF2m_mul_2x2(zz, x1, x0, y1, y0);
  444|   724M|            for (k = 0; k < 4; k++)
  ------------------
  |  Branch (444:25): [True: 579M, False: 144M]
  ------------------
  445|   579M|                s->d[i + j + k] ^= zz[k];
  446|   144M|        }
  447|  47.8M|    }
  448|       |
  449|  16.1M|    bn_correct_top(s);
  450|  16.1M|    if (BN_GF2m_mod_arr(r, s, p))
  ------------------
  |  Branch (450:9): [True: 16.1M, False: 0]
  ------------------
  451|  16.1M|        ret = 1;
  452|  16.1M|    bn_check_top(r);
  453|       |
  454|  16.1M| err:
  455|  16.1M|    BN_CTX_end(ctx);
  456|  16.1M|    return ret;
  457|  16.1M|}
BN_GF2m_mod_mul:
  468|  40.3k|{
  469|  40.3k|    int ret = 0;
  470|  40.3k|    const int max = BN_num_bits(p) + 1;
  471|  40.3k|    int *arr;
  472|       |
  473|  40.3k|    bn_check_top(a);
  474|  40.3k|    bn_check_top(b);
  475|  40.3k|    bn_check_top(p);
  476|       |
  477|  40.3k|    arr = OPENSSL_malloc(sizeof(*arr) * max);
  ------------------
  |  |  102|  40.3k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  40.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  40.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  478|  40.3k|    if (arr == NULL)
  ------------------
  |  Branch (478:9): [True: 0, False: 40.3k]
  ------------------
  479|      0|        return 0;
  480|  40.3k|    ret = BN_GF2m_poly2arr(p, arr, max);
  481|  40.3k|    if (!ret || ret > max) {
  ------------------
  |  Branch (481:9): [True: 0, False: 40.3k]
  |  Branch (481:17): [True: 0, False: 40.3k]
  ------------------
  482|      0|        ERR_raise(ERR_LIB_BN, BN_R_INVALID_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  483|      0|        goto err;
  484|      0|    }
  485|  40.3k|    ret = BN_GF2m_mod_mul_arr(r, a, b, arr, ctx);
  486|  40.3k|    bn_check_top(r);
  487|  40.3k| err:
  488|  40.3k|    OPENSSL_free(arr);
  ------------------
  |  |  115|  40.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  40.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  40.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  489|  40.3k|    return ret;
  490|  40.3k|}
BN_GF2m_mod_sqr_arr:
  495|  32.3M|{
  496|  32.3M|    int i, ret = 0;
  497|  32.3M|    BIGNUM *s;
  498|       |
  499|  32.3M|    bn_check_top(a);
  500|  32.3M|    BN_CTX_start(ctx);
  501|  32.3M|    if ((s = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (501:9): [True: 0, False: 32.3M]
  ------------------
  502|      0|        goto err;
  503|  32.3M|    if (!bn_wexpand(s, 2 * a->top))
  ------------------
  |  Branch (503:9): [True: 0, False: 32.3M]
  ------------------
  504|      0|        goto err;
  505|       |
  506|   220M|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (506:26): [True: 188M, False: 32.3M]
  ------------------
  507|   188M|        s->d[2 * i + 1] = SQR1(a->d[i]);
  ------------------
  |  |   35|   188M|    SQR_nibble((w) >> 60) << 56 | SQR_nibble((w) >> 56) << 48 | \
  |  |  ------------------
  |  |  |  |   26|   188M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   27|   188M|                       |  (((w) & 4) << 2) \
  |  |  |  |   28|   188M|                       |  (((w) & 2) << 1) \
  |  |  |  |   29|   188M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 60) << 56 | SQR_nibble((w) >> 56) << 48 | \
  |  |  ------------------
  |  |  |  |   26|   188M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   27|   188M|                       |  (((w) & 4) << 2) \
  |  |  |  |   28|   188M|                       |  (((w) & 2) << 1) \
  |  |  |  |   29|   188M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   36|   188M|    SQR_nibble((w) >> 52) << 40 | SQR_nibble((w) >> 48) << 32 | \
  |  |  ------------------
  |  |  |  |   26|   188M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   27|   188M|                       |  (((w) & 4) << 2) \
  |  |  |  |   28|   188M|                       |  (((w) & 2) << 1) \
  |  |  |  |   29|   188M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 52) << 40 | SQR_nibble((w) >> 48) << 32 | \
  |  |  ------------------
  |  |  |  |   26|   188M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   27|   188M|                       |  (((w) & 4) << 2) \
  |  |  |  |   28|   188M|                       |  (((w) & 2) << 1) \
  |  |  |  |   29|   188M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   37|   188M|    SQR_nibble((w) >> 44) << 24 | SQR_nibble((w) >> 40) << 16 | \
  |  |  ------------------
  |  |  |  |   26|   188M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   27|   188M|                       |  (((w) & 4) << 2) \
  |  |  |  |   28|   188M|                       |  (((w) & 2) << 1) \
  |  |  |  |   29|   188M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 44) << 24 | SQR_nibble((w) >> 40) << 16 | \
  |  |  ------------------
  |  |  |  |   26|   188M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   27|   188M|                       |  (((w) & 4) << 2) \
  |  |  |  |   28|   188M|                       |  (((w) & 2) << 1) \
  |  |  |  |   29|   188M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   38|   188M|    SQR_nibble((w) >> 36) <<  8 | SQR_nibble((w) >> 32)
  |  |  ------------------
  |  |  |  |   26|   188M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   27|   188M|                       |  (((w) & 4) << 2) \
  |  |  |  |   28|   188M|                       |  (((w) & 2) << 1) \
  |  |  |  |   29|   188M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 36) <<  8 | SQR_nibble((w) >> 32)
  |  |  ------------------
  |  |  |  |   26|   188M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   27|   188M|                       |  (((w) & 4) << 2) \
  |  |  |  |   28|   188M|                       |  (((w) & 2) << 1) \
  |  |  |  |   29|   188M|                       |   ((w) & 1))
  |  |  ------------------
  ------------------
  508|   188M|        s->d[2 * i] = SQR0(a->d[i]);
  ------------------
  |  |   40|   188M|    SQR_nibble((w) >> 28) << 56 | SQR_nibble((w) >> 24) << 48 | \
  |  |  ------------------
  |  |  |  |   26|   188M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   27|   188M|                       |  (((w) & 4) << 2) \
  |  |  |  |   28|   188M|                       |  (((w) & 2) << 1) \
  |  |  |  |   29|   188M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 28) << 56 | SQR_nibble((w) >> 24) << 48 | \
  |  |  ------------------
  |  |  |  |   26|   188M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   27|   188M|                       |  (((w) & 4) << 2) \
  |  |  |  |   28|   188M|                       |  (((w) & 2) << 1) \
  |  |  |  |   29|   188M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   41|   188M|    SQR_nibble((w) >> 20) << 40 | SQR_nibble((w) >> 16) << 32 | \
  |  |  ------------------
  |  |  |  |   26|   188M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   27|   188M|                       |  (((w) & 4) << 2) \
  |  |  |  |   28|   188M|                       |  (((w) & 2) << 1) \
  |  |  |  |   29|   188M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 20) << 40 | SQR_nibble((w) >> 16) << 32 | \
  |  |  ------------------
  |  |  |  |   26|   188M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   27|   188M|                       |  (((w) & 4) << 2) \
  |  |  |  |   28|   188M|                       |  (((w) & 2) << 1) \
  |  |  |  |   29|   188M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   42|   188M|    SQR_nibble((w) >> 12) << 24 | SQR_nibble((w) >>  8) << 16 | \
  |  |  ------------------
  |  |  |  |   26|   188M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   27|   188M|                       |  (((w) & 4) << 2) \
  |  |  |  |   28|   188M|                       |  (((w) & 2) << 1) \
  |  |  |  |   29|   188M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 12) << 24 | SQR_nibble((w) >>  8) << 16 | \
  |  |  ------------------
  |  |  |  |   26|   188M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   27|   188M|                       |  (((w) & 4) << 2) \
  |  |  |  |   28|   188M|                       |  (((w) & 2) << 1) \
  |  |  |  |   29|   188M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   43|   188M|    SQR_nibble((w) >>  4) <<  8 | SQR_nibble((w)      )
  |  |  ------------------
  |  |  |  |   26|   188M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   27|   188M|                       |  (((w) & 4) << 2) \
  |  |  |  |   28|   188M|                       |  (((w) & 2) << 1) \
  |  |  |  |   29|   188M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >>  4) <<  8 | SQR_nibble((w)      )
  |  |  ------------------
  |  |  |  |   26|   188M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   27|   188M|                       |  (((w) & 4) << 2) \
  |  |  |  |   28|   188M|                       |  (((w) & 2) << 1) \
  |  |  |  |   29|   188M|                       |   ((w) & 1))
  |  |  ------------------
  ------------------
  509|   188M|    }
  510|       |
  511|  32.3M|    s->top = 2 * a->top;
  512|  32.3M|    bn_correct_top(s);
  513|  32.3M|    if (!BN_GF2m_mod_arr(r, s, p))
  ------------------
  |  Branch (513:9): [True: 0, False: 32.3M]
  ------------------
  514|      0|        goto err;
  515|  32.3M|    bn_check_top(r);
  516|  32.3M|    ret = 1;
  517|  32.3M| err:
  518|  32.3M|    BN_CTX_end(ctx);
  519|  32.3M|    return ret;
  520|  32.3M|}
BN_GF2m_mod_inv:
  731|  13.6k|{
  732|  13.6k|    BIGNUM *b = NULL;
  733|  13.6k|    int ret = 0;
  734|  13.6k|    int numbits;
  735|       |
  736|  13.6k|    BN_CTX_start(ctx);
  737|  13.6k|    if ((b = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (737:9): [True: 0, False: 13.6k]
  ------------------
  738|      0|        goto err;
  739|       |
  740|       |    /* Fail on a non-sensical input p value */
  741|  13.6k|    numbits = BN_num_bits(p);
  742|  13.6k|    if (numbits <= 1)
  ------------------
  |  Branch (742:9): [True: 0, False: 13.6k]
  ------------------
  743|      0|        goto err;
  744|       |
  745|       |    /* generate blinding value */
  746|  13.6k|    do {
  747|  13.6k|        if (!BN_priv_rand_ex(b, numbits - 1,
  ------------------
  |  Branch (747:13): [True: 0, False: 13.6k]
  ------------------
  748|  13.6k|                             BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY, 0, ctx))
  ------------------
  |  |   80|  13.6k|#define BN_RAND_TOP_ANY    -1
  ------------------
                                           BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY, 0, ctx))
  ------------------
  |  |   85|  13.6k|#define BN_RAND_BOTTOM_ANY  0
  ------------------
  749|      0|            goto err;
  750|  13.6k|    } while (BN_is_zero(b));
  ------------------
  |  Branch (750:14): [True: 0, False: 13.6k]
  ------------------
  751|       |
  752|       |    /* r := a * b */
  753|  13.6k|    if (!BN_GF2m_mod_mul(r, a, b, p, ctx))
  ------------------
  |  Branch (753:9): [True: 0, False: 13.6k]
  ------------------
  754|      0|        goto err;
  755|       |
  756|       |    /* r := 1/(a * b) */
  757|  13.6k|    if (!BN_GF2m_mod_inv_vartime(r, r, p, ctx))
  ------------------
  |  Branch (757:9): [True: 0, False: 13.6k]
  ------------------
  758|      0|        goto err;
  759|       |
  760|       |    /* r := b/(a * b) = 1/a */
  761|  13.6k|    if (!BN_GF2m_mod_mul(r, r, b, p, ctx))
  ------------------
  |  Branch (761:9): [True: 0, False: 13.6k]
  ------------------
  762|      0|        goto err;
  763|       |
  764|  13.6k|    ret = 1;
  765|       |
  766|  13.6k| err:
  767|  13.6k|    BN_CTX_end(ctx);
  768|  13.6k|    return ret;
  769|  13.6k|}
BN_GF2m_mod_div:
  804|  12.9k|{
  805|  12.9k|    BIGNUM *xinv = NULL;
  806|  12.9k|    int ret = 0;
  807|       |
  808|  12.9k|    bn_check_top(y);
  809|  12.9k|    bn_check_top(x);
  810|  12.9k|    bn_check_top(p);
  811|       |
  812|  12.9k|    BN_CTX_start(ctx);
  813|  12.9k|    xinv = BN_CTX_get(ctx);
  814|  12.9k|    if (xinv == NULL)
  ------------------
  |  Branch (814:9): [True: 0, False: 12.9k]
  ------------------
  815|      0|        goto err;
  816|       |
  817|  12.9k|    if (!BN_GF2m_mod_inv(xinv, x, p, ctx))
  ------------------
  |  Branch (817:9): [True: 0, False: 12.9k]
  ------------------
  818|      0|        goto err;
  819|  12.9k|    if (!BN_GF2m_mod_mul(r, y, xinv, p, ctx))
  ------------------
  |  Branch (819:9): [True: 0, False: 12.9k]
  ------------------
  820|      0|        goto err;
  821|  12.9k|    bn_check_top(r);
  822|  12.9k|    ret = 1;
  823|       |
  824|  12.9k| err:
  825|  12.9k|    BN_CTX_end(ctx);
  826|  12.9k|    return ret;
  827|  12.9k|}
BN_GF2m_mod_exp_arr:
  865|  3.97k|{
  866|  3.97k|    int ret = 0, i, n;
  867|  3.97k|    BIGNUM *u;
  868|       |
  869|  3.97k|    bn_check_top(a);
  870|  3.97k|    bn_check_top(b);
  871|       |
  872|  3.97k|    if (BN_is_zero(b))
  ------------------
  |  Branch (872:9): [True: 0, False: 3.97k]
  ------------------
  873|      0|        return BN_one(r);
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  874|       |
  875|  3.97k|    if (BN_abs_is_word(b, 1))
  ------------------
  |  Branch (875:9): [True: 0, False: 3.97k]
  ------------------
  876|      0|        return (BN_copy(r, a) != NULL);
  877|       |
  878|  3.97k|    BN_CTX_start(ctx);
  879|  3.97k|    if ((u = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (879:9): [True: 0, False: 3.97k]
  ------------------
  880|      0|        goto err;
  881|       |
  882|  3.97k|    if (!BN_GF2m_mod_arr(u, a, p))
  ------------------
  |  Branch (882:9): [True: 0, False: 3.97k]
  ------------------
  883|      0|        goto err;
  884|       |
  885|  3.97k|    n = BN_num_bits(b) - 1;
  886|   521k|    for (i = n - 1; i >= 0; i--) {
  ------------------
  |  Branch (886:21): [True: 517k, False: 3.97k]
  ------------------
  887|   517k|        if (!BN_GF2m_mod_sqr_arr(u, u, p, ctx))
  ------------------
  |  Branch (887:13): [True: 0, False: 517k]
  ------------------
  888|      0|            goto err;
  889|   517k|        if (BN_is_bit_set(b, i)) {
  ------------------
  |  Branch (889:13): [True: 0, False: 517k]
  ------------------
  890|      0|            if (!BN_GF2m_mod_mul_arr(u, u, a, p, ctx))
  ------------------
  |  Branch (890:17): [True: 0, False: 0]
  ------------------
  891|      0|                goto err;
  892|      0|        }
  893|   517k|    }
  894|  3.97k|    if (!BN_copy(r, u))
  ------------------
  |  Branch (894:9): [True: 0, False: 3.97k]
  ------------------
  895|      0|        goto err;
  896|  3.97k|    bn_check_top(r);
  897|  3.97k|    ret = 1;
  898|  3.97k| err:
  899|  3.97k|    BN_CTX_end(ctx);
  900|  3.97k|    return ret;
  901|  3.97k|}
BN_GF2m_mod_sqrt_arr:
  941|  3.97k|{
  942|  3.97k|    int ret = 0;
  943|  3.97k|    BIGNUM *u;
  944|       |
  945|  3.97k|    bn_check_top(a);
  946|       |
  947|  3.97k|    if (p[0] == 0) {
  ------------------
  |  Branch (947:9): [True: 0, False: 3.97k]
  ------------------
  948|       |        /* reduction mod 1 => return 0 */
  949|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  950|      0|        return 1;
  951|      0|    }
  952|       |
  953|  3.97k|    BN_CTX_start(ctx);
  954|  3.97k|    if ((u = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (954:9): [True: 0, False: 3.97k]
  ------------------
  955|      0|        goto err;
  956|       |
  957|  3.97k|    if (!BN_set_bit(u, p[0] - 1))
  ------------------
  |  Branch (957:9): [True: 0, False: 3.97k]
  ------------------
  958|      0|        goto err;
  959|  3.97k|    ret = BN_GF2m_mod_exp_arr(r, a, u, p, ctx);
  960|  3.97k|    bn_check_top(r);
  961|       |
  962|  3.97k| err:
  963|  3.97k|    BN_CTX_end(ctx);
  964|  3.97k|    return ret;
  965|  3.97k|}
BN_GF2m_mod_solve_quad_arr:
 1003|  7.25k|{
 1004|  7.25k|    int ret = 0, count = 0, j;
 1005|  7.25k|    BIGNUM *a, *z, *rho, *w, *w2, *tmp;
 1006|       |
 1007|  7.25k|    bn_check_top(a_);
 1008|       |
 1009|  7.25k|    if (p[0] == 0) {
  ------------------
  |  Branch (1009:9): [True: 0, False: 7.25k]
  ------------------
 1010|       |        /* reduction mod 1 => return 0 */
 1011|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
 1012|      0|        return 1;
 1013|      0|    }
 1014|       |
 1015|  7.25k|    BN_CTX_start(ctx);
 1016|  7.25k|    a = BN_CTX_get(ctx);
 1017|  7.25k|    z = BN_CTX_get(ctx);
 1018|  7.25k|    w = BN_CTX_get(ctx);
 1019|  7.25k|    if (w == NULL)
  ------------------
  |  Branch (1019:9): [True: 0, False: 7.25k]
  ------------------
 1020|      0|        goto err;
 1021|       |
 1022|  7.25k|    if (!BN_GF2m_mod_arr(a, a_, p))
  ------------------
  |  Branch (1022:9): [True: 0, False: 7.25k]
  ------------------
 1023|      0|        goto err;
 1024|       |
 1025|  7.25k|    if (BN_is_zero(a)) {
  ------------------
  |  Branch (1025:9): [True: 1, False: 7.25k]
  ------------------
 1026|      1|        BN_zero(r);
  ------------------
  |  |  202|      1|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
 1027|      1|        ret = 1;
 1028|      1|        goto err;
 1029|      1|    }
 1030|       |
 1031|  7.25k|    if (p[0] & 0x1) {           /* m is odd */
  ------------------
  |  Branch (1031:9): [True: 6.42k, False: 828]
  ------------------
 1032|       |        /* compute half-trace of a */
 1033|  6.42k|        if (!BN_copy(z, a))
  ------------------
  |  Branch (1033:13): [True: 0, False: 6.42k]
  ------------------
 1034|      0|            goto err;
 1035|   426k|        for (j = 1; j <= (p[0] - 1) / 2; j++) {
  ------------------
  |  Branch (1035:21): [True: 420k, False: 6.42k]
  ------------------
 1036|   420k|            if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx))
  ------------------
  |  Branch (1036:17): [True: 0, False: 420k]
  ------------------
 1037|      0|                goto err;
 1038|   420k|            if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx))
  ------------------
  |  Branch (1038:17): [True: 0, False: 420k]
  ------------------
 1039|      0|                goto err;
 1040|   420k|            if (!BN_GF2m_add(z, z, a))
  ------------------
  |  Branch (1040:17): [True: 0, False: 420k]
  ------------------
 1041|      0|                goto err;
 1042|   420k|        }
 1043|       |
 1044|  6.42k|    } else {                    /* m is even */
 1045|       |
 1046|    828|        rho = BN_CTX_get(ctx);
 1047|    828|        w2 = BN_CTX_get(ctx);
 1048|    828|        tmp = BN_CTX_get(ctx);
 1049|    828|        if (tmp == NULL)
  ------------------
  |  Branch (1049:13): [True: 0, False: 828]
  ------------------
 1050|      0|            goto err;
 1051|  41.0k|        do {
 1052|  41.0k|            if (!BN_priv_rand_ex(rho, p[0], BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   81|  41.0k|#define BN_RAND_TOP_ONE     0
  ------------------
                          if (!BN_priv_rand_ex(rho, p[0], BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   85|  41.0k|#define BN_RAND_BOTTOM_ANY  0
  ------------------
  |  Branch (1052:17): [True: 0, False: 41.0k]
  ------------------
 1053|  41.0k|                                 0, ctx))
 1054|      0|                goto err;
 1055|  41.0k|            if (!BN_GF2m_mod_arr(rho, rho, p))
  ------------------
  |  Branch (1055:17): [True: 0, False: 41.0k]
  ------------------
 1056|      0|                goto err;
 1057|  41.0k|            BN_zero(z);
  ------------------
  |  |  202|  41.0k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
 1058|  41.0k|            if (!BN_copy(w, rho))
  ------------------
  |  Branch (1058:17): [True: 0, False: 41.0k]
  ------------------
 1059|      0|                goto err;
 1060|  15.0M|            for (j = 1; j <= p[0] - 1; j++) {
  ------------------
  |  Branch (1060:25): [True: 15.0M, False: 41.0k]
  ------------------
 1061|  15.0M|                if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx))
  ------------------
  |  Branch (1061:21): [True: 0, False: 15.0M]
  ------------------
 1062|      0|                    goto err;
 1063|  15.0M|                if (!BN_GF2m_mod_sqr_arr(w2, w, p, ctx))
  ------------------
  |  Branch (1063:21): [True: 0, False: 15.0M]
  ------------------
 1064|      0|                    goto err;
 1065|  15.0M|                if (!BN_GF2m_mod_mul_arr(tmp, w2, a, p, ctx))
  ------------------
  |  Branch (1065:21): [True: 0, False: 15.0M]
  ------------------
 1066|      0|                    goto err;
 1067|  15.0M|                if (!BN_GF2m_add(z, z, tmp))
  ------------------
  |  Branch (1067:21): [True: 0, False: 15.0M]
  ------------------
 1068|      0|                    goto err;
 1069|  15.0M|                if (!BN_GF2m_add(w, w2, rho))
  ------------------
  |  Branch (1069:21): [True: 0, False: 15.0M]
  ------------------
 1070|      0|                    goto err;
 1071|  15.0M|            }
 1072|  41.0k|            count++;
 1073|  41.0k|        } while (BN_is_zero(w) && (count < MAX_ITERATIONS));
  ------------------
  |  |   24|  41.0k|# define MAX_ITERATIONS 50
  ------------------
  |  Branch (1073:18): [True: 41.0k, False: 8]
  |  Branch (1073:35): [True: 40.1k, False: 820]
  ------------------
 1074|    828|        if (BN_is_zero(w)) {
  ------------------
  |  Branch (1074:13): [True: 820, False: 8]
  ------------------
 1075|    820|            ERR_raise(ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS);
  ------------------
  |  |  401|    820|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    820|    (ERR_new(),                                                 \
  |  |  |  |  404|    820|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    820|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    820|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    820|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    820|     ERR_set_error)
  |  |  ------------------
  ------------------
 1076|    820|            goto err;
 1077|    820|        }
 1078|    828|    }
 1079|       |
 1080|  6.43k|    if (!BN_GF2m_mod_sqr_arr(w, z, p, ctx))
  ------------------
  |  Branch (1080:9): [True: 0, False: 6.43k]
  ------------------
 1081|      0|        goto err;
 1082|  6.43k|    if (!BN_GF2m_add(w, z, w))
  ------------------
  |  Branch (1082:9): [True: 0, False: 6.43k]
  ------------------
 1083|      0|        goto err;
 1084|  6.43k|    if (BN_GF2m_cmp(w, a)) {
  ------------------
  |  |  504|  6.43k|#  define BN_GF2m_cmp(a, b) BN_ucmp((a), (b))
  |  |  ------------------
  |  |  |  Branch (504:29): [True: 3.83k, False: 2.59k]
  |  |  ------------------
  ------------------
 1085|  3.83k|        ERR_raise(ERR_LIB_BN, BN_R_NO_SOLUTION);
  ------------------
  |  |  401|  3.83k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  3.83k|    (ERR_new(),                                                 \
  |  |  |  |  404|  3.83k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  3.83k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  3.83k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.83k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  3.83k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1086|  3.83k|        goto err;
 1087|  3.83k|    }
 1088|       |
 1089|  2.59k|    if (!BN_copy(r, z))
  ------------------
  |  Branch (1089:9): [True: 0, False: 2.59k]
  ------------------
 1090|      0|        goto err;
 1091|  2.59k|    bn_check_top(r);
 1092|       |
 1093|  2.59k|    ret = 1;
 1094|       |
 1095|  7.25k| err:
 1096|  7.25k|    BN_CTX_end(ctx);
 1097|  7.25k|    return ret;
 1098|  2.59k|}
BN_GF2m_poly2arr:
 1149|  77.2k|{
 1150|  77.2k|    int i, j, k = 0;
 1151|  77.2k|    BN_ULONG mask;
  ------------------
  |  |   37|  77.2k|#  define BN_ULONG        unsigned long
  ------------------
 1152|       |
 1153|  77.2k|    if (!BN_is_odd(a))
  ------------------
  |  Branch (1153:9): [True: 0, False: 77.2k]
  ------------------
 1154|      0|        return 0;
 1155|       |
 1156|   326k|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (1156:26): [True: 248k, False: 77.2k]
  ------------------
 1157|   248k|        if (!a->d[i])
  ------------------
  |  Branch (1157:13): [True: 87.6k, False: 161k]
  ------------------
 1158|       |            /* skip word if a->d[i] == 0 */
 1159|  87.6k|            continue;
 1160|   161k|        mask = BN_TBIT;
  ------------------
  |  |   56|   161k|# define BN_TBIT        ((BN_ULONG)1 << (BN_BITS2 - 1))
  |  |  ------------------
  |  |  |  |   54|   161k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|   161k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1161|  10.4M|        for (j = BN_BITS2 - 1; j >= 0; j--) {
  ------------------
  |  |   54|   161k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   161k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (1161:32): [True: 10.3M, False: 161k]
  ------------------
 1162|  10.3M|            if (a->d[i] & mask) {
  ------------------
  |  Branch (1162:17): [True: 377k, False: 9.92M]
  ------------------
 1163|   377k|                if (k < max)
  ------------------
  |  Branch (1163:21): [True: 377k, False: 0]
  ------------------
 1164|   377k|                    p[k] = BN_BITS2 * i + j;
  ------------------
  |  |   54|   377k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   377k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
 1165|   377k|                k++;
 1166|   377k|            }
 1167|  10.3M|            mask >>= 1;
 1168|  10.3M|        }
 1169|   161k|    }
 1170|       |
 1171|  77.2k|    if (k > 0 && p[0] > OPENSSL_ECC_MAX_FIELD_BITS)
  ------------------
  |  |  103|  77.2k|#   define OPENSSL_ECC_MAX_FIELD_BITS 661
  ------------------
  |  Branch (1171:9): [True: 77.2k, False: 0]
  |  Branch (1171:18): [True: 0, False: 77.2k]
  ------------------
 1172|      0|        return 0;
 1173|       |
 1174|  77.2k|    if (k < max)
  ------------------
  |  Branch (1174:9): [True: 77.2k, False: 0]
  ------------------
 1175|  77.2k|        p[k] = -1;
 1176|       |
 1177|  77.2k|    return k + 1;
 1178|  77.2k|}
bn_gf2m.c:BN_GF2m_mod_inv_vartime:
  560|  13.6k|{
  561|  13.6k|    BIGNUM *b, *c = NULL, *u = NULL, *v = NULL, *tmp;
  562|  13.6k|    int ret = 0;
  563|       |
  564|  13.6k|    bn_check_top(a);
  565|  13.6k|    bn_check_top(p);
  566|       |
  567|  13.6k|    BN_CTX_start(ctx);
  568|       |
  569|  13.6k|    b = BN_CTX_get(ctx);
  570|  13.6k|    c = BN_CTX_get(ctx);
  571|  13.6k|    u = BN_CTX_get(ctx);
  572|  13.6k|    v = BN_CTX_get(ctx);
  573|  13.6k|    if (v == NULL)
  ------------------
  |  Branch (573:9): [True: 0, False: 13.6k]
  ------------------
  574|      0|        goto err;
  575|       |
  576|  13.6k|    if (!BN_GF2m_mod(u, a, p))
  ------------------
  |  Branch (576:9): [True: 0, False: 13.6k]
  ------------------
  577|      0|        goto err;
  578|  13.6k|    if (BN_is_zero(u))
  ------------------
  |  Branch (578:9): [True: 0, False: 13.6k]
  ------------------
  579|      0|        goto err;
  580|       |
  581|  13.6k|    if (!BN_copy(v, p))
  ------------------
  |  Branch (581:9): [True: 0, False: 13.6k]
  ------------------
  582|      0|        goto err;
  583|       |# if 0
  584|       |    if (!BN_one(b))
  585|       |        goto err;
  586|       |
  587|       |    while (1) {
  588|       |        while (!BN_is_odd(u)) {
  589|       |            if (BN_is_zero(u))
  590|       |                goto err;
  591|       |            if (!BN_rshift1(u, u))
  592|       |                goto err;
  593|       |            if (BN_is_odd(b)) {
  594|       |                if (!BN_GF2m_add(b, b, p))
  595|       |                    goto err;
  596|       |            }
  597|       |            if (!BN_rshift1(b, b))
  598|       |                goto err;
  599|       |        }
  600|       |
  601|       |        if (BN_abs_is_word(u, 1))
  602|       |            break;
  603|       |
  604|       |        if (BN_num_bits(u) < BN_num_bits(v)) {
  605|       |            tmp = u;
  606|       |            u = v;
  607|       |            v = tmp;
  608|       |            tmp = b;
  609|       |            b = c;
  610|       |            c = tmp;
  611|       |        }
  612|       |
  613|       |        if (!BN_GF2m_add(u, u, v))
  614|       |            goto err;
  615|       |        if (!BN_GF2m_add(b, b, c))
  616|       |            goto err;
  617|       |    }
  618|       |# else
  619|  13.6k|    {
  620|  13.6k|        int i;
  621|  13.6k|        int ubits = BN_num_bits(u);
  622|  13.6k|        int vbits = BN_num_bits(v); /* v is copy of p */
  623|  13.6k|        int top = p->top;
  624|  13.6k|        BN_ULONG *udp, *bdp, *vdp, *cdp;
  ------------------
  |  |   37|  13.6k|#  define BN_ULONG        unsigned long
  ------------------
  625|       |
  626|  13.6k|        if (!bn_wexpand(u, top))
  ------------------
  |  Branch (626:13): [True: 0, False: 13.6k]
  ------------------
  627|      0|            goto err;
  628|  13.6k|        udp = u->d;
  629|  13.9k|        for (i = u->top; i < top; i++)
  ------------------
  |  Branch (629:26): [True: 247, False: 13.6k]
  ------------------
  630|    247|            udp[i] = 0;
  631|  13.6k|        u->top = top;
  632|  13.6k|        if (!bn_wexpand(b, top))
  ------------------
  |  Branch (632:13): [True: 0, False: 13.6k]
  ------------------
  633|      0|          goto err;
  634|  13.6k|        bdp = b->d;
  635|  13.6k|        bdp[0] = 1;
  636|  43.9k|        for (i = 1; i < top; i++)
  ------------------
  |  Branch (636:21): [True: 30.2k, False: 13.6k]
  ------------------
  637|  30.2k|            bdp[i] = 0;
  638|  13.6k|        b->top = top;
  639|  13.6k|        if (!bn_wexpand(c, top))
  ------------------
  |  Branch (639:13): [True: 0, False: 13.6k]
  ------------------
  640|      0|          goto err;
  641|  13.6k|        cdp = c->d;
  642|  57.6k|        for (i = 0; i < top; i++)
  ------------------
  |  Branch (642:21): [True: 43.9k, False: 13.6k]
  ------------------
  643|  43.9k|            cdp[i] = 0;
  644|  13.6k|        c->top = top;
  645|  13.6k|        vdp = v->d;             /* It pays off to "cache" *->d pointers,
  646|       |                                 * because it allows optimizer to be more
  647|       |                                 * aggressive. But we don't have to "cache"
  648|       |                                 * p->d, because *p is declared 'const'... */
  649|  1.86M|        while (1) {
  ------------------
  |  Branch (649:16): [Folded - Ignored]
  ------------------
  650|  5.51M|            while (ubits && !(udp[0] & 1)) {
  ------------------
  |  Branch (650:20): [True: 5.51M, False: 0]
  |  Branch (650:29): [True: 3.64M, False: 1.86M]
  ------------------
  651|  3.64M|                BN_ULONG u0, u1, b0, b1, mask;
  ------------------
  |  |   37|  3.64M|#  define BN_ULONG        unsigned long
  ------------------
  652|       |
  653|  3.64M|                u0 = udp[0];
  654|  3.64M|                b0 = bdp[0];
  655|  3.64M|                mask = (BN_ULONG)0 - (b0 & 1);
  656|  3.64M|                b0 ^= p->d[0] & mask;
  657|  12.9M|                for (i = 0; i < top - 1; i++) {
  ------------------
  |  Branch (657:29): [True: 9.26M, False: 3.64M]
  ------------------
  658|  9.26M|                    u1 = udp[i + 1];
  659|  9.26M|                    udp[i] = ((u0 >> 1) | (u1 << (BN_BITS2 - 1))) & BN_MASK2;
  ------------------
  |  |   54|  9.26M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  9.26M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                                  udp[i] = ((u0 >> 1) | (u1 << (BN_BITS2 - 1))) & BN_MASK2;
  ------------------
  |  |   94|  9.26M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  660|  9.26M|                    u0 = u1;
  661|  9.26M|                    b1 = bdp[i + 1] ^ (p->d[i + 1] & mask);
  662|  9.26M|                    bdp[i] = ((b0 >> 1) | (b1 << (BN_BITS2 - 1))) & BN_MASK2;
  ------------------
  |  |   54|  9.26M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  9.26M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                                  bdp[i] = ((b0 >> 1) | (b1 << (BN_BITS2 - 1))) & BN_MASK2;
  ------------------
  |  |   94|  9.26M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  663|  9.26M|                    b0 = b1;
  664|  9.26M|                }
  665|  3.64M|                udp[i] = u0 >> 1;
  666|  3.64M|                bdp[i] = b0 >> 1;
  667|  3.64M|                ubits--;
  668|  3.64M|            }
  669|       |
  670|  1.86M|            if (ubits <= BN_BITS2) {
  ------------------
  |  |   54|  1.86M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.86M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (670:17): [True: 722k, False: 1.14M]
  ------------------
  671|   722k|                if (udp[0] == 0) /* poly was reducible */
  ------------------
  |  Branch (671:21): [True: 0, False: 722k]
  ------------------
  672|      0|                    goto err;
  673|   722k|                if (udp[0] == 1)
  ------------------
  |  Branch (673:21): [True: 13.6k, False: 709k]
  ------------------
  674|  13.6k|                    break;
  675|   722k|            }
  676|       |
  677|  1.85M|            if (ubits < vbits) {
  ------------------
  |  Branch (677:17): [True: 768k, False: 1.08M]
  ------------------
  678|   768k|                i = ubits;
  679|   768k|                ubits = vbits;
  680|   768k|                vbits = i;
  681|   768k|                tmp = u;
  682|   768k|                u = v;
  683|   768k|                v = tmp;
  684|   768k|                tmp = b;
  685|   768k|                b = c;
  686|   768k|                c = tmp;
  687|   768k|                udp = vdp;
  688|   768k|                vdp = v->d;
  689|   768k|                bdp = cdp;
  690|   768k|                cdp = c->d;
  691|   768k|            }
  692|  8.42M|            for (i = 0; i < top; i++) {
  ------------------
  |  Branch (692:25): [True: 6.57M, False: 1.85M]
  ------------------
  693|  6.57M|                udp[i] ^= vdp[i];
  694|  6.57M|                bdp[i] ^= cdp[i];
  695|  6.57M|            }
  696|  1.85M|            if (ubits == vbits) {
  ------------------
  |  Branch (696:17): [True: 383k, False: 1.46M]
  ------------------
  697|   383k|                BN_ULONG ul;
  ------------------
  |  |   37|   383k|#  define BN_ULONG        unsigned long
  ------------------
  698|   383k|                int utop = (ubits - 1) / BN_BITS2;
  ------------------
  |  |   54|   383k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   383k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  699|       |
  700|   388k|                while ((ul = udp[utop]) == 0 && utop)
  ------------------
  |  Branch (700:24): [True: 4.93k, False: 383k]
  |  Branch (700:49): [True: 4.93k, False: 0]
  ------------------
  701|  4.93k|                    utop--;
  702|   383k|                ubits = utop * BN_BITS2 + BN_num_bits_word(ul);
  ------------------
  |  |   54|   383k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   383k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  703|   383k|            }
  704|  1.85M|        }
  705|  13.6k|        bn_correct_top(b);
  706|  13.6k|    }
  707|      0|# endif
  708|       |
  709|  13.6k|    if (!BN_copy(r, b))
  ------------------
  |  Branch (709:9): [True: 0, False: 13.6k]
  ------------------
  710|      0|        goto err;
  711|  13.6k|    bn_check_top(r);
  712|  13.6k|    ret = 1;
  713|       |
  714|  13.6k| err:
  715|       |# ifdef BN_DEBUG
  716|       |    /* BN_CTX_end would complain about the expanded form */
  717|       |    bn_correct_top(c);
  718|       |    bn_correct_top(u);
  719|       |    bn_correct_top(v);
  720|       |# endif
  721|  13.6k|    BN_CTX_end(ctx);
  722|  13.6k|    return ret;
  723|  13.6k|}

bn_compute_wNAF:
   23|    269|{
   24|    269|    int window_val;
   25|    269|    signed char *r = NULL;
   26|    269|    int sign = 1;
   27|    269|    int bit, next_bit, mask;
   28|    269|    size_t len = 0, j;
   29|       |
   30|    269|    if (BN_is_zero(scalar)) {
  ------------------
  |  Branch (30:9): [True: 18, False: 251]
  ------------------
   31|     18|        r = OPENSSL_malloc(1);
  ------------------
  |  |  102|     18|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     18|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   32|     18|        if (r == NULL)
  ------------------
  |  Branch (32:13): [True: 0, False: 18]
  ------------------
   33|      0|            goto err;
   34|     18|        r[0] = 0;
   35|     18|        *ret_len = 1;
   36|     18|        return r;
   37|     18|    }
   38|       |
   39|    251|    if (w <= 0 || w > 7) {      /* 'signed char' can represent integers with
  ------------------
  |  Branch (39:9): [True: 0, False: 251]
  |  Branch (39:19): [True: 0, False: 251]
  ------------------
   40|       |                                 * absolute values less than 2^7 */
   41|      0|        ERR_raise(ERR_LIB_BN, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   42|      0|        goto err;
   43|      0|    }
   44|    251|    bit = 1 << w;               /* at most 128 */
   45|    251|    next_bit = bit << 1;        /* at most 256 */
   46|    251|    mask = next_bit - 1;        /* at most 255 */
   47|       |
   48|    251|    if (BN_is_negative(scalar)) {
  ------------------
  |  Branch (48:9): [True: 0, False: 251]
  ------------------
   49|      0|        sign = -1;
   50|      0|    }
   51|       |
   52|    251|    if (scalar->d == NULL || scalar->top == 0) {
  ------------------
  |  Branch (52:9): [True: 0, False: 251]
  |  Branch (52:30): [True: 0, False: 251]
  ------------------
   53|      0|        ERR_raise(ERR_LIB_BN, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   54|      0|        goto err;
   55|      0|    }
   56|       |
   57|    251|    len = BN_num_bits(scalar);
   58|    251|    r = OPENSSL_malloc(len + 1); /*
  ------------------
  |  |  102|    251|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    251|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    251|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   59|       |                                  * Modified wNAF may be one digit longer than binary representation
   60|       |                                  * (*ret_len will be set to the actual length, i.e. at most
   61|       |                                  * BN_num_bits(scalar) + 1)
   62|       |                                  */
   63|    251|    if (r == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 251]
  ------------------
   64|      0|        goto err;
   65|    251|    window_val = scalar->d[0] & mask;
   66|    251|    j = 0;
   67|  39.5k|    while ((window_val != 0) || (j + w + 1 < len)) { /* if j+w+1 >= len,
  ------------------
  |  Branch (67:12): [True: 29.8k, False: 9.70k]
  |  Branch (67:33): [True: 9.45k, False: 251]
  ------------------
   68|       |                                                      * window_val will not
   69|       |                                                      * increase */
   70|  39.2k|        int digit = 0;
   71|       |
   72|       |        /* 0 <= window_val <= 2^(w+1) */
   73|       |
   74|  39.2k|        if (window_val & 1) {
  ------------------
  |  Branch (74:13): [True: 5.32k, False: 33.9k]
  ------------------
   75|       |            /* 0 < window_val < 2^(w+1) */
   76|       |
   77|  5.32k|            if (window_val & bit) {
  ------------------
  |  Branch (77:17): [True: 2.06k, False: 3.25k]
  ------------------
   78|  2.06k|                digit = window_val - next_bit; /* -2^w < digit < 0 */
   79|       |
   80|  2.06k|#if 1                           /* modified wNAF */
   81|  2.06k|                if (j + w + 1 >= len) {
  ------------------
  |  Branch (81:21): [True: 65, False: 2.00k]
  ------------------
   82|       |                    /*
   83|       |                     * Special case for generating modified wNAFs:
   84|       |                     * no new bits will be added into window_val,
   85|       |                     * so using a positive digit here will decrease
   86|       |                     * the total length of the representation
   87|       |                     */
   88|       |
   89|     65|                    digit = window_val & (mask >> 1); /* 0 < digit < 2^w */
   90|     65|                }
   91|  2.06k|#endif
   92|  3.25k|            } else {
   93|  3.25k|                digit = window_val; /* 0 < digit < 2^w */
   94|  3.25k|            }
   95|       |
   96|  5.32k|            if (digit <= -bit || digit >= bit || !(digit & 1)) {
  ------------------
  |  Branch (96:17): [True: 0, False: 5.32k]
  |  Branch (96:34): [True: 0, False: 5.32k]
  |  Branch (96:50): [True: 0, False: 5.32k]
  ------------------
   97|      0|                ERR_raise(ERR_LIB_BN, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   98|      0|                goto err;
   99|      0|            }
  100|       |
  101|  5.32k|            window_val -= digit;
  102|       |
  103|       |            /*
  104|       |             * now window_val is 0 or 2^(w+1) in standard wNAF generation;
  105|       |             * for modified window NAFs, it may also be 2^w
  106|       |             */
  107|  5.32k|            if (window_val != 0 && window_val != next_bit
  ------------------
  |  Branch (107:17): [True: 2.06k, False: 3.25k]
  |  Branch (107:36): [True: 65, False: 2.00k]
  ------------------
  108|  5.32k|                && window_val != bit) {
  ------------------
  |  Branch (108:20): [True: 0, False: 65]
  ------------------
  109|      0|                ERR_raise(ERR_LIB_BN, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  110|      0|                goto err;
  111|      0|            }
  112|  5.32k|        }
  113|       |
  114|  39.2k|        r[j++] = sign * digit;
  115|       |
  116|  39.2k|        window_val >>= 1;
  117|  39.2k|        window_val += bit * BN_is_bit_set(scalar, j + w);
  118|       |
  119|  39.2k|        if (window_val > next_bit) {
  ------------------
  |  Branch (119:13): [True: 0, False: 39.2k]
  ------------------
  120|      0|            ERR_raise(ERR_LIB_BN, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  121|      0|            goto err;
  122|      0|        }
  123|  39.2k|    }
  124|       |
  125|    251|    if (j > len + 1) {
  ------------------
  |  Branch (125:9): [True: 0, False: 251]
  ------------------
  126|      0|        ERR_raise(ERR_LIB_BN, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  127|      0|        goto err;
  128|      0|    }
  129|    251|    *ret_len = j;
  130|    251|    return r;
  131|       |
  132|      0| err:
  133|      0|    OPENSSL_free(r);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  134|      0|    return NULL;
  135|    251|}
bn_get_top:
  138|  2.75k|{
  139|  2.75k|    return a->top;
  140|  2.75k|}
bn_set_all_zero:
  148|  91.2k|{
  149|  91.2k|    int i;
  150|       |
  151|   169k|    for (i = a->top; i < a->dmax; i++)
  ------------------
  |  Branch (151:22): [True: 78.3k, False: 91.2k]
  ------------------
  152|  78.3k|        a->d[i] = 0;
  153|  91.2k|}
bn_copy_words:
  156|     75|{
  157|     75|    if (in->top > size)
  ------------------
  |  Branch (157:9): [True: 0, False: 75]
  ------------------
  158|      0|        return 0;
  159|       |
  160|     75|    memset(out, 0, sizeof(*out) * size);
  161|     75|    if (in->d != NULL)
  ------------------
  |  Branch (161:9): [True: 75, False: 0]
  ------------------
  162|     75|        memcpy(out, in->d, sizeof(*out) * in->top);
  163|     75|    return 1;
  164|     75|}
bn_get_words:
  167|  63.7k|{
  168|  63.7k|    return a->d;
  169|  63.7k|}
bn_set_words:
  185|    131|{
  186|    131|    if (bn_wexpand(a, num_words) == NULL) {
  ------------------
  |  Branch (186:9): [True: 0, False: 131]
  ------------------
  187|      0|        ERR_raise(ERR_LIB_BN, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  188|      0|        return 0;
  189|      0|    }
  190|       |
  191|    131|    memcpy(a->d, words, sizeof(BN_ULONG) * num_words);
  192|    131|    a->top = num_words;
  193|    131|    bn_correct_top(a);
  194|    131|    return 1;
  195|    131|}

BN_kronecker:
   18|  9.05k|{
   19|  9.05k|    int i;
   20|  9.05k|    int ret = -2;               /* avoid 'uninitialized' warning */
   21|  9.05k|    int err = 0;
   22|  9.05k|    BIGNUM *A, *B, *tmp;
   23|       |    /*-
   24|       |     * In 'tab', only odd-indexed entries are relevant:
   25|       |     * For any odd BIGNUM n,
   26|       |     *     tab[BN_lsw(n) & 7]
   27|       |     * is $(-1)^{(n^2-1)/8}$ (using TeX notation).
   28|       |     * Note that the sign of n does not matter.
   29|       |     */
   30|  9.05k|    static const int tab[8] = { 0, 1, 0, -1, 0, -1, 0, 1 };
   31|       |
   32|  9.05k|    bn_check_top(a);
   33|  9.05k|    bn_check_top(b);
   34|       |
   35|  9.05k|    BN_CTX_start(ctx);
   36|  9.05k|    A = BN_CTX_get(ctx);
   37|  9.05k|    B = BN_CTX_get(ctx);
   38|  9.05k|    if (B == NULL)
  ------------------
  |  Branch (38:9): [True: 0, False: 9.05k]
  ------------------
   39|      0|        goto end;
   40|       |
   41|  9.05k|    err = !BN_copy(A, a);
   42|  9.05k|    if (err)
  ------------------
  |  Branch (42:9): [True: 0, False: 9.05k]
  ------------------
   43|      0|        goto end;
   44|  9.05k|    err = !BN_copy(B, b);
   45|  9.05k|    if (err)
  ------------------
  |  Branch (45:9): [True: 0, False: 9.05k]
  ------------------
   46|      0|        goto end;
   47|       |
   48|       |    /*
   49|       |     * Kronecker symbol, implemented according to Henri Cohen,
   50|       |     * "A Course in Computational Algebraic Number Theory"
   51|       |     * (algorithm 1.4.10).
   52|       |     */
   53|       |
   54|       |    /* Cohen's step 1: */
   55|       |
   56|  9.05k|    if (BN_is_zero(B)) {
  ------------------
  |  Branch (56:9): [True: 0, False: 9.05k]
  ------------------
   57|      0|        ret = BN_abs_is_word(A, 1);
   58|      0|        goto end;
   59|      0|    }
   60|       |
   61|       |    /* Cohen's step 2: */
   62|       |
   63|  9.05k|    if (!BN_is_odd(A) && !BN_is_odd(B)) {
  ------------------
  |  Branch (63:9): [True: 4.79k, False: 4.26k]
  |  Branch (63:26): [True: 0, False: 4.79k]
  ------------------
   64|      0|        ret = 0;
   65|      0|        goto end;
   66|      0|    }
   67|       |
   68|       |    /* now  B  is non-zero */
   69|  9.05k|    i = 0;
   70|  9.05k|    while (!BN_is_bit_set(B, i))
  ------------------
  |  Branch (70:12): [True: 0, False: 9.05k]
  ------------------
   71|      0|        i++;
   72|  9.05k|    err = !BN_rshift(B, B, i);
   73|  9.05k|    if (err)
  ------------------
  |  Branch (73:9): [True: 0, False: 9.05k]
  ------------------
   74|      0|        goto end;
   75|  9.05k|    if (i & 1) {
  ------------------
  |  Branch (75:9): [True: 0, False: 9.05k]
  ------------------
   76|       |        /* i is odd */
   77|       |        /* (thus  B  was even, thus  A  must be odd!)  */
   78|       |
   79|       |        /* set 'ret' to $(-1)^{(A^2-1)/8}$ */
   80|      0|        ret = tab[BN_lsw(A) & 7];
  ------------------
  |  |   14|      0|#define BN_lsw(n) (((n)->top == 0) ? (BN_ULONG) 0 : (n)->d[0])
  |  |  ------------------
  |  |  |  Branch (14:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   81|  9.05k|    } else {
   82|       |        /* i is even */
   83|  9.05k|        ret = 1;
   84|  9.05k|    }
   85|       |
   86|  9.05k|    if (B->neg) {
  ------------------
  |  Branch (86:9): [True: 0, False: 9.05k]
  ------------------
   87|      0|        B->neg = 0;
   88|      0|        if (A->neg)
  ------------------
  |  Branch (88:13): [True: 0, False: 0]
  ------------------
   89|      0|            ret = -ret;
   90|      0|    }
   91|       |
   92|       |    /*
   93|       |     * now B is positive and odd, so what remains to be done is to compute
   94|       |     * the Jacobi symbol (A/B) and multiply it by 'ret'
   95|       |     */
   96|       |
   97|   124k|    while (1) {
  ------------------
  |  Branch (97:12): [Folded - Ignored]
  ------------------
   98|       |        /* Cohen's step 3: */
   99|       |
  100|       |        /*  B  is positive and odd */
  101|       |
  102|   124k|        if (BN_is_zero(A)) {
  ------------------
  |  Branch (102:13): [True: 9.05k, False: 115k]
  ------------------
  103|  9.05k|            ret = BN_is_one(B) ? ret : 0;
  ------------------
  |  Branch (103:19): [True: 9.02k, False: 35]
  ------------------
  104|  9.05k|            goto end;
  105|  9.05k|        }
  106|       |
  107|       |        /* now  A  is non-zero */
  108|   115k|        i = 0;
  109|   237k|        while (!BN_is_bit_set(A, i))
  ------------------
  |  Branch (109:16): [True: 122k, False: 115k]
  ------------------
  110|   122k|            i++;
  111|   115k|        err = !BN_rshift(A, A, i);
  112|   115k|        if (err)
  ------------------
  |  Branch (112:13): [True: 0, False: 115k]
  ------------------
  113|      0|            goto end;
  114|   115k|        if (i & 1) {
  ------------------
  |  Branch (114:13): [True: 39.5k, False: 76.0k]
  ------------------
  115|       |            /* i is odd */
  116|       |            /* multiply 'ret' by  $(-1)^{(B^2-1)/8}$ */
  117|  39.5k|            ret = ret * tab[BN_lsw(B) & 7];
  ------------------
  |  |   14|  39.5k|#define BN_lsw(n) (((n)->top == 0) ? (BN_ULONG) 0 : (n)->d[0])
  |  |  ------------------
  |  |  |  Branch (14:20): [True: 0, False: 39.5k]
  |  |  ------------------
  ------------------
  118|  39.5k|        }
  119|       |
  120|       |        /* Cohen's step 4: */
  121|       |        /* multiply 'ret' by  $(-1)^{(A-1)(B-1)/4}$ */
  122|   115k|        if ((A->neg ? ~BN_lsw(A) : BN_lsw(A)) & BN_lsw(B) & 2)
  ------------------
  |  |   14|      0|#define BN_lsw(n) (((n)->top == 0) ? (BN_ULONG) 0 : (n)->d[0])
  |  |  ------------------
  |  |  |  Branch (14:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                      if ((A->neg ? ~BN_lsw(A) : BN_lsw(A)) & BN_lsw(B) & 2)
  ------------------
  |  |   14|   115k|#define BN_lsw(n) (((n)->top == 0) ? (BN_ULONG) 0 : (n)->d[0])
  |  |  ------------------
  |  |  |  Branch (14:20): [True: 0, False: 115k]
  |  |  ------------------
  ------------------
                      if ((A->neg ? ~BN_lsw(A) : BN_lsw(A)) & BN_lsw(B) & 2)
  ------------------
  |  |   14|   115k|#define BN_lsw(n) (((n)->top == 0) ? (BN_ULONG) 0 : (n)->d[0])
  |  |  ------------------
  |  |  |  Branch (14:20): [True: 0, False: 115k]
  |  |  ------------------
  ------------------
  |  Branch (122:13): [True: 25.1k, False: 90.4k]
  |  Branch (122:14): [True: 0, False: 115k]
  ------------------
  123|  25.1k|            ret = -ret;
  124|       |
  125|       |        /* (A, B) := (B mod |A|, |A|) */
  126|   115k|        err = !BN_nnmod(B, B, A, ctx);
  127|   115k|        if (err)
  ------------------
  |  Branch (127:13): [True: 0, False: 115k]
  ------------------
  128|      0|            goto end;
  129|   115k|        tmp = A;
  130|   115k|        A = B;
  131|   115k|        B = tmp;
  132|   115k|        tmp->neg = 0;
  133|   115k|    }
  134|  9.05k| end:
  135|  9.05k|    BN_CTX_end(ctx);
  136|  9.05k|    if (err)
  ------------------
  |  Branch (136:9): [True: 0, False: 9.05k]
  ------------------
  137|      0|        return -2;
  138|  9.05k|    else
  139|  9.05k|        return ret;
  140|  9.05k|}

BN_value_one:
   83|  41.0k|{
   84|  41.0k|    static const BN_ULONG data_one = 1L;
   85|  41.0k|    static const BIGNUM const_one = {
   86|  41.0k|        (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA
  ------------------
  |  |   59|  41.0k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
   87|  41.0k|    };
   88|       |
   89|  41.0k|    return &const_one;
   90|  41.0k|}
BN_num_bits_word:
  102|  11.6M|{
  103|  11.6M|    BN_ULONG x, mask;
  ------------------
  |  |   37|  11.6M|#  define BN_ULONG        unsigned long
  ------------------
  104|  11.6M|    int bits = (l != 0);
  105|       |
  106|  11.6M|#if BN_BITS2 > 32
  107|  11.6M|    x = l >> 32;
  108|  11.6M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  11.6M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  109|  11.6M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  11.6M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  11.6M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  110|  11.6M|    bits += 32 & mask;
  111|  11.6M|    l ^= (x ^ l) & mask;
  112|  11.6M|#endif
  113|       |
  114|  11.6M|    x = l >> 16;
  115|  11.6M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  11.6M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  116|  11.6M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  11.6M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  11.6M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  117|  11.6M|    bits += 16 & mask;
  118|  11.6M|    l ^= (x ^ l) & mask;
  119|       |
  120|  11.6M|    x = l >> 8;
  121|  11.6M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  11.6M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  122|  11.6M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  11.6M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  11.6M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  123|  11.6M|    bits += 8 & mask;
  124|  11.6M|    l ^= (x ^ l) & mask;
  125|       |
  126|  11.6M|    x = l >> 4;
  127|  11.6M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  11.6M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  128|  11.6M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  11.6M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  11.6M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  129|  11.6M|    bits += 4 & mask;
  130|  11.6M|    l ^= (x ^ l) & mask;
  131|       |
  132|  11.6M|    x = l >> 2;
  133|  11.6M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  11.6M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  134|  11.6M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  11.6M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  11.6M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  135|  11.6M|    bits += 2 & mask;
  136|  11.6M|    l ^= (x ^ l) & mask;
  137|       |
  138|  11.6M|    x = l >> 1;
  139|  11.6M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  11.6M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  140|  11.6M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  11.6M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  11.6M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  141|  11.6M|    bits += 1 & mask;
  142|       |
  143|  11.6M|    return bits;
  144|  11.6M|}
BN_num_bits:
  180|  2.74M|{
  181|  2.74M|    int i = a->top - 1;
  182|  2.74M|    bn_check_top(a);
  183|       |
  184|  2.74M|    if (a->flags & BN_FLG_CONSTTIME) {
  ------------------
  |  |   67|  2.74M|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (184:9): [True: 1.62M, False: 1.11M]
  ------------------
  185|       |        /*
  186|       |         * We assume that BIGNUMs flagged as CONSTTIME have also been expanded
  187|       |         * so that a->dmax is not leaking secret information.
  188|       |         *
  189|       |         * In other words, it's the caller's responsibility to ensure `a` has
  190|       |         * been preallocated in advance to a public length if we hit this
  191|       |         * branch.
  192|       |         *
  193|       |         */
  194|  1.62M|        return bn_num_bits_consttime(a);
  195|  1.62M|    }
  196|       |
  197|  1.11M|    if (BN_is_zero(a))
  ------------------
  |  Branch (197:9): [True: 22.1k, False: 1.09M]
  ------------------
  198|  22.1k|        return 0;
  199|       |
  200|  1.09M|    return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
  ------------------
  |  |   54|  1.09M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.09M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  201|  1.11M|}
BN_clear_free:
  215|  1.56M|{
  216|  1.56M|    if (a == NULL)
  ------------------
  |  Branch (216:9): [True: 478k, False: 1.08M]
  ------------------
  217|   478k|        return;
  218|  1.08M|    if (a->d != NULL && !BN_get_flags(a, BN_FLG_STATIC_DATA))
  ------------------
  |  |   59|   889k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  |  Branch (218:9): [True: 889k, False: 197k]
  |  Branch (218:25): [True: 889k, False: 18]
  ------------------
  219|   889k|        bn_free_d(a, 1);
  220|  1.08M|    if (BN_get_flags(a, BN_FLG_MALLOCED)) {
  ------------------
  |  |   58|  1.08M|# define BN_FLG_MALLOCED         0x01
  ------------------
  |  Branch (220:9): [True: 325k, False: 760k]
  ------------------
  221|   325k|        OPENSSL_cleanse(a, sizeof(*a));
  222|   325k|        OPENSSL_free(a);
  ------------------
  |  |  115|   325k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   325k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   325k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  223|   325k|    }
  224|  1.08M|}
BN_free:
  227|  1.34M|{
  228|  1.34M|    if (a == NULL)
  ------------------
  |  Branch (228:9): [True: 502k, False: 847k]
  ------------------
  229|   502k|        return;
  230|   847k|    if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
  ------------------
  |  |   59|   847k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  |  Branch (230:9): [True: 847k, False: 0]
  ------------------
  231|   847k|        bn_free_d(a, 0);
  232|   847k|    if (a->flags & BN_FLG_MALLOCED)
  ------------------
  |  |   58|   847k|# define BN_FLG_MALLOCED         0x01
  ------------------
  |  Branch (232:9): [True: 847k, False: 0]
  ------------------
  233|   847k|        OPENSSL_free(a);
  ------------------
  |  |  115|   847k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   847k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   847k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  234|   847k|}
bn_init:
  237|  1.53M|{
  238|  1.53M|    static BIGNUM nilbn;
  239|       |
  240|  1.53M|    *a = nilbn;
  241|  1.53M|    bn_check_top(a);
  242|  1.53M|}
BN_new:
  245|  1.17M|{
  246|  1.17M|    BIGNUM *ret;
  247|       |
  248|  1.17M|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  104|  1.17M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.17M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.17M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (248:9): [True: 0, False: 1.17M]
  ------------------
  249|      0|        return NULL;
  250|  1.17M|    ret->flags = BN_FLG_MALLOCED;
  ------------------
  |  |   58|  1.17M|# define BN_FLG_MALLOCED         0x01
  ------------------
  251|  1.17M|    bn_check_top(ret);
  252|  1.17M|    return ret;
  253|  1.17M|}
BN_secure_new:
  256|   259k|{
  257|   259k|    BIGNUM *ret = BN_new();
  258|       |
  259|   259k|    if (ret != NULL)
  ------------------
  |  Branch (259:9): [True: 259k, False: 0]
  ------------------
  260|   259k|        ret->flags |= BN_FLG_SECURE;
  ------------------
  |  |   68|   259k|# define BN_FLG_SECURE           0x08
  ------------------
  261|   259k|    return ret;
  262|   259k|}
bn_expand2:
  301|  2.12M|{
  302|  2.12M|    if (words > b->dmax) {
  ------------------
  |  Branch (302:9): [True: 2.12M, False: 0]
  ------------------
  303|  2.12M|        BN_ULONG *a = bn_expand_internal(b, words);
  ------------------
  |  |   37|  2.12M|#  define BN_ULONG        unsigned long
  ------------------
  304|  2.12M|        if (!a)
  ------------------
  |  Branch (304:13): [True: 0, False: 2.12M]
  ------------------
  305|      0|            return NULL;
  306|  2.12M|        if (b->d != NULL)
  ------------------
  |  Branch (306:13): [True: 485k, False: 1.63M]
  ------------------
  307|   485k|            bn_free_d(b, 1);
  308|  2.12M|        b->d = a;
  309|  2.12M|        b->dmax = words;
  310|  2.12M|    }
  311|       |
  312|  2.12M|    return b;
  313|  2.12M|}
BN_dup:
  316|  20.2k|{
  317|  20.2k|    BIGNUM *t;
  318|       |
  319|  20.2k|    if (a == NULL)
  ------------------
  |  Branch (319:9): [True: 0, False: 20.2k]
  ------------------
  320|      0|        return NULL;
  321|  20.2k|    bn_check_top(a);
  322|       |
  323|  20.2k|    t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new();
  ------------------
  |  |   68|  20.2k|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (323:9): [True: 0, False: 20.2k]
  ------------------
  324|  20.2k|    if (t == NULL)
  ------------------
  |  Branch (324:9): [True: 0, False: 20.2k]
  ------------------
  325|      0|        return NULL;
  326|  20.2k|    if (!BN_copy(t, a)) {
  ------------------
  |  Branch (326:9): [True: 0, False: 20.2k]
  ------------------
  327|      0|        BN_free(t);
  328|      0|        return NULL;
  329|      0|    }
  330|  20.2k|    bn_check_top(t);
  331|  20.2k|    return t;
  332|  20.2k|}
BN_copy:
  335|  2.15M|{
  336|  2.15M|    int bn_words;
  337|       |
  338|  2.15M|    bn_check_top(b);
  339|       |
  340|  2.15M|    bn_words = BN_get_flags(b, BN_FLG_CONSTTIME) ? b->dmax : b->top;
  ------------------
  |  |   67|  2.15M|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (340:16): [True: 1.53k, False: 2.15M]
  ------------------
  341|       |
  342|  2.15M|    if (a == b)
  ------------------
  |  Branch (342:9): [True: 0, False: 2.15M]
  ------------------
  343|      0|        return a;
  344|  2.15M|    if (bn_wexpand(a, bn_words) == NULL)
  ------------------
  |  Branch (344:9): [True: 0, False: 2.15M]
  ------------------
  345|      0|        return NULL;
  346|       |
  347|  2.15M|    if (b->top > 0)
  ------------------
  |  Branch (347:9): [True: 2.11M, False: 42.5k]
  ------------------
  348|  2.11M|        memcpy(a->d, b->d, sizeof(b->d[0]) * bn_words);
  349|       |
  350|  2.15M|    a->neg = b->neg;
  351|  2.15M|    a->top = b->top;
  352|  2.15M|    a->flags |= b->flags & BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  2.15M|#  define BN_FLG_FIXED_TOP 0
  ------------------
  353|  2.15M|    bn_check_top(a);
  354|  2.15M|    return a;
  355|  2.15M|}
BN_clear:
  397|  98.0k|{
  398|  98.0k|    if (a == NULL)
  ------------------
  |  Branch (398:9): [True: 0, False: 98.0k]
  ------------------
  399|      0|        return;
  400|  98.0k|    bn_check_top(a);
  401|  98.0k|    if (a->d != NULL)
  ------------------
  |  Branch (401:9): [True: 0, False: 98.0k]
  ------------------
  402|      0|        OPENSSL_cleanse(a->d, sizeof(*a->d) * a->dmax);
  403|  98.0k|    a->neg = 0;
  404|  98.0k|    a->top = 0;
  405|  98.0k|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  98.0k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  406|  98.0k|}
BN_get_word:
  409|     41|{
  410|     41|    if (a->top > 1)
  ------------------
  |  Branch (410:9): [True: 1, False: 40]
  ------------------
  411|      1|        return BN_MASK2;
  ------------------
  |  |   94|      1|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  412|     40|    else if (a->top == 1)
  ------------------
  |  Branch (412:14): [True: 37, False: 3]
  ------------------
  413|     37|        return a->d[0];
  414|       |    /* a->top == 0 */
  415|      3|    return 0;
  416|     41|}
BN_set_word:
  419|  74.4k|{
  420|  74.4k|    bn_check_top(a);
  421|  74.4k|    if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
  ------------------
  |  Branch (421:9): [True: 0, False: 74.4k]
  ------------------
  422|      0|        return 0;
  423|  74.4k|    a->neg = 0;
  424|  74.4k|    a->d[0] = w;
  425|  74.4k|    a->top = (w ? 1 : 0);
  ------------------
  |  Branch (425:15): [True: 74.3k, False: 73]
  ------------------
  426|  74.4k|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  74.4k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  427|  74.4k|    bn_check_top(a);
  428|  74.4k|    return 1;
  429|  74.4k|}
BN_bin2bn:
  537|   546k|{
  538|   546k|    return bin2bn(s, len, ret, BIG, UNSIGNED);
  539|   546k|}
BN_bn2binpad:
  630|  7.01k|{
  631|  7.01k|    if (tolen < 0)
  ------------------
  |  Branch (631:9): [True: 0, False: 7.01k]
  ------------------
  632|      0|        return -1;
  633|  7.01k|    return bn2binpad(a, to, tolen, BIG, UNSIGNED);
  634|  7.01k|}
BN_bn2bin:
  644|   135k|{
  645|   135k|    return bn2binpad(a, to, -1, BIG, UNSIGNED);
  646|   135k|}
BN_lebin2bn:
  649|  1.88k|{
  650|  1.88k|    return bin2bn(s, len, ret, LITTLE, UNSIGNED);
  651|  1.88k|}
BN_bn2lebinpad:
  659|  1.62k|{
  660|  1.62k|    if (tolen < 0)
  ------------------
  |  Branch (660:9): [True: 0, False: 1.62k]
  ------------------
  661|      0|        return -1;
  662|  1.62k|    return bn2binpad(a, to, tolen, LITTLE, UNSIGNED);
  663|  1.62k|}
BN_ucmp:
  709|  3.74M|{
  710|  3.74M|    int i;
  711|  3.74M|    BN_ULONG t1, t2, *ap, *bp;
  ------------------
  |  |   37|  3.74M|#  define BN_ULONG        unsigned long
  ------------------
  712|       |
  713|  3.74M|    ap = a->d;
  714|  3.74M|    bp = b->d;
  715|       |
  716|  3.74M|    if (BN_get_flags(a, BN_FLG_CONSTTIME)
  ------------------
  |  |   67|  3.74M|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (716:9): [True: 143k, False: 3.60M]
  ------------------
  717|  3.74M|            && a->top == b->top) {
  ------------------
  |  Branch (717:16): [True: 142k, False: 786]
  ------------------
  718|   142k|        int res = 0;
  719|       |
  720|   673k|        for (i = 0; i < b->top; i++) {
  ------------------
  |  Branch (720:21): [True: 531k, False: 142k]
  ------------------
  721|   531k|            res = constant_time_select_int(constant_time_lt_bn(ap[i], bp[i]),
  722|   531k|                                           -1, res);
  723|   531k|            res = constant_time_select_int(constant_time_lt_bn(bp[i], ap[i]),
  724|   531k|                                           1, res);
  725|   531k|        }
  726|   142k|        return res;
  727|   142k|    }
  728|       |
  729|  3.60M|    bn_check_top(a);
  730|  3.60M|    bn_check_top(b);
  731|       |
  732|  3.60M|    i = a->top - b->top;
  733|  3.60M|    if (i != 0)
  ------------------
  |  Branch (733:9): [True: 163k, False: 3.44M]
  ------------------
  734|   163k|        return i;
  735|       |
  736|  3.50M|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (736:26): [True: 3.46M, False: 40.5k]
  ------------------
  737|  3.46M|        t1 = ap[i];
  738|  3.46M|        t2 = bp[i];
  739|  3.46M|        if (t1 != t2)
  ------------------
  |  Branch (739:13): [True: 3.40M, False: 65.3k]
  ------------------
  740|  3.40M|            return ((t1 > t2) ? 1 : -1);
  ------------------
  |  Branch (740:21): [True: 1.66M, False: 1.73M]
  ------------------
  741|  3.46M|    }
  742|  40.5k|    return 0;
  743|  3.44M|}
BN_cmp:
  746|   729k|{
  747|   729k|    int i;
  748|   729k|    int gt, lt;
  749|   729k|    BN_ULONG t1, t2;
  ------------------
  |  |   37|   729k|#  define BN_ULONG        unsigned long
  ------------------
  750|       |
  751|   729k|    if ((a == NULL) || (b == NULL)) {
  ------------------
  |  Branch (751:9): [True: 0, False: 729k]
  |  Branch (751:24): [True: 0, False: 729k]
  ------------------
  752|      0|        if (a != NULL)
  ------------------
  |  Branch (752:13): [True: 0, False: 0]
  ------------------
  753|      0|            return -1;
  754|      0|        else if (b != NULL)
  ------------------
  |  Branch (754:18): [True: 0, False: 0]
  ------------------
  755|      0|            return 1;
  756|      0|        else
  757|      0|            return 0;
  758|      0|    }
  759|       |
  760|   729k|    bn_check_top(a);
  761|   729k|    bn_check_top(b);
  762|       |
  763|   729k|    if (a->neg != b->neg) {
  ------------------
  |  Branch (763:9): [True: 0, False: 729k]
  ------------------
  764|      0|        if (a->neg)
  ------------------
  |  Branch (764:13): [True: 0, False: 0]
  ------------------
  765|      0|            return -1;
  766|      0|        else
  767|      0|            return 1;
  768|      0|    }
  769|   729k|    if (a->neg == 0) {
  ------------------
  |  Branch (769:9): [True: 729k, False: 0]
  ------------------
  770|   729k|        gt = 1;
  771|   729k|        lt = -1;
  772|   729k|    } else {
  773|      0|        gt = -1;
  774|      0|        lt = 1;
  775|      0|    }
  776|       |
  777|   729k|    if (a->top > b->top)
  ------------------
  |  Branch (777:9): [True: 47.4k, False: 682k]
  ------------------
  778|  47.4k|        return gt;
  779|   682k|    if (a->top < b->top)
  ------------------
  |  Branch (779:9): [True: 61.1k, False: 621k]
  ------------------
  780|  61.1k|        return lt;
  781|   643k|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (781:26): [True: 638k, False: 5.14k]
  ------------------
  782|   638k|        t1 = a->d[i];
  783|   638k|        t2 = b->d[i];
  784|   638k|        if (t1 > t2)
  ------------------
  |  Branch (784:13): [True: 305k, False: 333k]
  ------------------
  785|   305k|            return gt;
  786|   333k|        if (t1 < t2)
  ------------------
  |  Branch (786:13): [True: 310k, False: 22.7k]
  ------------------
  787|   310k|            return lt;
  788|   333k|    }
  789|  5.14k|    return 0;
  790|   621k|}
BN_set_bit:
  793|  67.5k|{
  794|  67.5k|    int i, j, k;
  795|       |
  796|  67.5k|    if (n < 0)
  ------------------
  |  Branch (796:9): [True: 0, False: 67.5k]
  ------------------
  797|      0|        return 0;
  798|       |
  799|  67.5k|    i = n / BN_BITS2;
  ------------------
  |  |   54|  67.5k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  67.5k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  800|  67.5k|    j = n % BN_BITS2;
  ------------------
  |  |   54|  67.5k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  67.5k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  801|  67.5k|    if (a->top <= i) {
  ------------------
  |  Branch (801:9): [True: 67.5k, False: 0]
  ------------------
  802|  67.5k|        if (bn_wexpand(a, i + 1) == NULL)
  ------------------
  |  Branch (802:13): [True: 0, False: 67.5k]
  ------------------
  803|      0|            return 0;
  804|   394k|        for (k = a->top; k < i + 1; k++)
  ------------------
  |  Branch (804:26): [True: 327k, False: 67.5k]
  ------------------
  805|   327k|            a->d[k] = 0;
  806|  67.5k|        a->top = i + 1;
  807|  67.5k|        a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  67.5k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  808|  67.5k|    }
  809|       |
  810|  67.5k|    a->d[i] |= (((BN_ULONG)1) << j);
  811|  67.5k|    bn_check_top(a);
  812|  67.5k|    return 1;
  813|  67.5k|}
BN_is_bit_set:
  834|  7.45M|{
  835|  7.45M|    int i, j;
  836|       |
  837|  7.45M|    bn_check_top(a);
  838|  7.45M|    if (n < 0)
  ------------------
  |  Branch (838:9): [True: 0, False: 7.45M]
  ------------------
  839|      0|        return 0;
  840|  7.45M|    i = n / BN_BITS2;
  ------------------
  |  |   54|  7.45M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.45M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  841|  7.45M|    j = n % BN_BITS2;
  ------------------
  |  |   54|  7.45M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.45M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  842|  7.45M|    if (a->top <= i)
  ------------------
  |  Branch (842:9): [True: 237, False: 7.45M]
  ------------------
  843|    237|        return 0;
  844|  7.45M|    return (int)(((a->d[i]) >> j) & ((BN_ULONG)1));
  845|  7.45M|}
BN_set_negative:
  880|   106k|{
  881|   106k|    if (b && !BN_is_zero(a))
  ------------------
  |  Branch (881:9): [True: 4.74k, False: 102k]
  |  Branch (881:14): [True: 4.74k, False: 0]
  ------------------
  882|  4.74k|        a->neg = 1;
  883|   102k|    else
  884|   102k|        a->neg = 0;
  885|   106k|}
bn_cmp_words:
  888|  16.1k|{
  889|  16.1k|    int i;
  890|  16.1k|    BN_ULONG aa, bb;
  ------------------
  |  |   37|  16.1k|#  define BN_ULONG        unsigned long
  ------------------
  891|       |
  892|  16.1k|    if (n == 0)
  ------------------
  |  Branch (892:9): [True: 0, False: 16.1k]
  ------------------
  893|      0|        return 0;
  894|       |
  895|  16.1k|    aa = a[n - 1];
  896|  16.1k|    bb = b[n - 1];
  897|  16.1k|    if (aa != bb)
  ------------------
  |  Branch (897:9): [True: 12.7k, False: 3.48k]
  ------------------
  898|  12.7k|        return ((aa > bb) ? 1 : -1);
  ------------------
  |  Branch (898:17): [True: 6.36k, False: 6.34k]
  ------------------
  899|  16.4k|    for (i = n - 2; i >= 0; i--) {
  ------------------
  |  Branch (899:21): [True: 15.4k, False: 997]
  ------------------
  900|  15.4k|        aa = a[i];
  901|  15.4k|        bb = b[i];
  902|  15.4k|        if (aa != bb)
  ------------------
  |  Branch (902:13): [True: 2.48k, False: 13.0k]
  ------------------
  903|  2.48k|            return ((aa > bb) ? 1 : -1);
  ------------------
  |  Branch (903:21): [True: 1.44k, False: 1.03k]
  ------------------
  904|  15.4k|    }
  905|    997|    return 0;
  906|  3.48k|}
bn_cmp_part_words:
  918|  19.5k|{
  919|  19.5k|    int n, i;
  920|  19.5k|    n = cl - 1;
  921|       |
  922|  19.5k|    if (dl < 0) {
  ------------------
  |  Branch (922:9): [True: 1.96k, False: 17.5k]
  ------------------
  923|  5.20k|        for (i = dl; i < 0; i++) {
  ------------------
  |  Branch (923:22): [True: 4.87k, False: 329]
  ------------------
  924|  4.87k|            if (b[n - i] != 0)
  ------------------
  |  Branch (924:17): [True: 1.63k, False: 3.24k]
  ------------------
  925|  1.63k|                return -1;      /* a < b */
  926|  4.87k|        }
  927|  1.96k|    }
  928|  17.8k|    if (dl > 0) {
  ------------------
  |  Branch (928:9): [True: 1.96k, False: 15.9k]
  ------------------
  929|  5.45k|        for (i = dl; i > 0; i--) {
  ------------------
  |  Branch (929:22): [True: 5.16k, False: 284]
  ------------------
  930|  5.16k|            if (a[n + i] != 0)
  ------------------
  |  Branch (930:17): [True: 1.68k, False: 3.48k]
  ------------------
  931|  1.68k|                return 1;       /* a > b */
  932|  5.16k|        }
  933|  1.96k|    }
  934|  16.1k|    return bn_cmp_words(a, b, cl);
  935|  17.8k|}
BN_consttime_swap:
  945|   906k|{
  946|   906k|    BN_ULONG t;
  ------------------
  |  |   37|   906k|#  define BN_ULONG        unsigned long
  ------------------
  947|   906k|    int i;
  948|       |
  949|   906k|    bn_wcheck_size(a, nwords);
  950|   906k|    bn_wcheck_size(b, nwords);
  951|       |
  952|   906k|    condition = ((~condition & ((condition - 1))) >> (BN_BITS2 - 1)) - 1;
  ------------------
  |  |   54|   906k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   906k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  953|       |
  954|   906k|    t = (a->top ^ b->top) & condition;
  955|   906k|    a->top ^= t;
  956|   906k|    b->top ^= t;
  957|       |
  958|   906k|    t = (a->neg ^ b->neg) & condition;
  959|   906k|    a->neg ^= t;
  960|   906k|    b->neg ^= t;
  961|       |
  962|       |    /*-
  963|       |     * BN_FLG_STATIC_DATA: indicates that data may not be written to. Intention
  964|       |     * is actually to treat it as it's read-only data, and some (if not most)
  965|       |     * of it does reside in read-only segment. In other words observation of
  966|       |     * BN_FLG_STATIC_DATA in BN_consttime_swap should be treated as fatal
  967|       |     * condition. It would either cause SEGV or effectively cause data
  968|       |     * corruption.
  969|       |     *
  970|       |     * BN_FLG_MALLOCED: refers to BN structure itself, and hence must be
  971|       |     * preserved.
  972|       |     *
  973|       |     * BN_FLG_SECURE: must be preserved, because it determines how x->d was
  974|       |     * allocated and hence how to free it.
  975|       |     *
  976|       |     * BN_FLG_CONSTTIME: sufficient to mask and swap
  977|       |     *
  978|       |     * BN_FLG_FIXED_TOP: indicates that we haven't called bn_correct_top() on
  979|       |     * the data, so the d array may be padded with additional 0 values (i.e.
  980|       |     * top could be greater than the minimal value that it could be). We should
  981|       |     * be swapping it
  982|       |     */
  983|       |
  984|   906k|#define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP)
  985|       |
  986|   906k|    t = ((a->flags ^ b->flags) & BN_CONSTTIME_SWAP_FLAGS) & condition;
  ------------------
  |  |  984|   906k|#define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP)
  |  |  ------------------
  |  |  |  |   67|   906k|# define BN_FLG_CONSTTIME        0x04
  |  |  ------------------
  |  |               #define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP)
  |  |  ------------------
  |  |  |  |  226|   906k|#  define BN_FLG_FIXED_TOP 0
  |  |  ------------------
  ------------------
  987|   906k|    a->flags ^= t;
  988|   906k|    b->flags ^= t;
  989|       |
  990|       |    /* conditionally swap the data */
  991|  4.93M|    for (i = 0; i < nwords; i++) {
  ------------------
  |  Branch (991:17): [True: 4.03M, False: 906k]
  ------------------
  992|  4.03M|        t = (a->d[i] ^ b->d[i]) & condition;
  993|  4.03M|        a->d[i] ^= t;
  994|  4.03M|        b->d[i] ^= t;
  995|  4.03M|    }
  996|   906k|}
BN_security_bits:
 1003|    602|{
 1004|    602|    int secbits, bits;
 1005|    602|    if (L >= 15360)
  ------------------
  |  Branch (1005:9): [True: 2, False: 600]
  ------------------
 1006|      2|        secbits = 256;
 1007|    600|    else if (L >= 7680)
  ------------------
  |  Branch (1007:14): [True: 4, False: 596]
  ------------------
 1008|      4|        secbits = 192;
 1009|    596|    else if (L >= 3072)
  ------------------
  |  Branch (1009:14): [True: 8, False: 588]
  ------------------
 1010|      8|        secbits = 128;
 1011|    588|    else if (L >= 2048)
  ------------------
  |  Branch (1011:14): [True: 3, False: 585]
  ------------------
 1012|      3|        secbits = 112;
 1013|    585|    else if (L >= 1024)
  ------------------
  |  Branch (1013:14): [True: 315, False: 270]
  ------------------
 1014|    315|        secbits = 80;
 1015|    270|    else
 1016|    270|        return 0;
 1017|    332|    if (N == -1)
  ------------------
  |  Branch (1017:9): [True: 1, False: 331]
  ------------------
 1018|      1|        return secbits;
 1019|    331|    bits = N / 2;
 1020|    331|    if (bits < 80)
  ------------------
  |  Branch (1020:9): [True: 305, False: 26]
  ------------------
 1021|    305|        return 0;
 1022|     26|    return bits >= secbits ? secbits : bits;
  ------------------
  |  Branch (1022:12): [True: 25, False: 1]
  ------------------
 1023|    331|}
BN_zero_ex:
 1026|  57.0M|{
 1027|  57.0M|    a->neg = 0;
 1028|  57.0M|    a->top = 0;
 1029|  57.0M|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  57.0M|#  define BN_FLG_FIXED_TOP 0
  ------------------
 1030|  57.0M|}
BN_abs_is_word:
 1033|   925k|{
 1034|   925k|    return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
  ------------------
  |  Branch (1034:13): [True: 131k, False: 794k]
  |  Branch (1034:30): [True: 65.6k, False: 66.0k]
  |  Branch (1034:50): [True: 0, False: 860k]
  |  Branch (1034:62): [True: 0, False: 0]
  ------------------
 1035|   925k|}
BN_is_zero:
 1038|  6.84M|{
 1039|  6.84M|    return a->top == 0;
 1040|  6.84M|}
BN_is_one:
 1043|   885k|{
 1044|   885k|    return BN_abs_is_word(a, 1) && !a->neg;
  ------------------
  |  Branch (1044:12): [True: 64.7k, False: 821k]
  |  Branch (1044:36): [True: 64.7k, False: 0]
  ------------------
 1045|   885k|}
BN_is_word:
 1048|  3.37k|{
 1049|  3.37k|    return BN_abs_is_word(a, w) && (!w || !a->neg);
  ------------------
  |  Branch (1049:12): [True: 898, False: 2.48k]
  |  Branch (1049:37): [True: 0, False: 898]
  |  Branch (1049:43): [True: 898, False: 0]
  ------------------
 1050|  3.37k|}
BN_is_odd:
 1069|  2.05M|{
 1070|  2.05M|    return (a->top > 0) && (a->d[0] & 1);
  ------------------
  |  Branch (1070:12): [True: 2.05M, False: 212]
  |  Branch (1070:28): [True: 1.12M, False: 931k]
  ------------------
 1071|  2.05M|}
BN_is_negative:
 1074|   182k|{
 1075|   182k|    return (a->neg != 0);
 1076|   182k|}
BN_to_montgomery:
 1080|  15.7k|{
 1081|  15.7k|    return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx);
 1082|  15.7k|}
BN_with_flags:
 1085|     18|{
 1086|     18|    dest->d = b->d;
 1087|     18|    dest->top = b->top;
 1088|     18|    dest->dmax = b->dmax;
 1089|     18|    dest->neg = b->neg;
 1090|     18|    dest->flags = ((dest->flags & BN_FLG_MALLOCED)
  ------------------
  |  |   58|     18|# define BN_FLG_MALLOCED         0x01
  ------------------
 1091|     18|                   | (b->flags & ~BN_FLG_MALLOCED)
  ------------------
  |  |   58|     18|# define BN_FLG_MALLOCED         0x01
  ------------------
 1092|     18|                   | BN_FLG_STATIC_DATA | flags);
  ------------------
  |  |   59|     18|# define BN_FLG_STATIC_DATA      0x02
  ------------------
 1093|     18|}
BN_set_flags:
 1113|   222k|{
 1114|   222k|    b->flags |= n;
 1115|   222k|}
BN_get_flags:
 1118|  15.3M|{
 1119|  15.3M|    return b->flags & n;
 1120|  15.3M|}
bn_wexpand:
 1148|   149M|{
 1149|   149M|    return (words <= a->dmax) ? a : bn_expand2(a, words);
  ------------------
  |  Branch (1149:12): [True: 147M, False: 2.09M]
  ------------------
 1150|   149M|}
bn_correct_top:
 1175|   137M|{
 1176|   137M|    BN_ULONG *ftl;
  ------------------
  |  |   37|   137M|#  define BN_ULONG        unsigned long
  ------------------
 1177|   137M|    int tmp_top = a->top;
 1178|       |
 1179|   137M|    if (tmp_top > 0) {
  ------------------
  |  Branch (1179:9): [True: 137M, False: 101k]
  ------------------
 1180|   487M|        for (ftl = &(a->d[tmp_top]); tmp_top > 0; tmp_top--) {
  ------------------
  |  Branch (1180:38): [True: 487M, False: 241k]
  ------------------
 1181|   487M|            ftl--;
 1182|   487M|            if (*ftl != 0)
  ------------------
  |  Branch (1182:17): [True: 136M, False: 350M]
  ------------------
 1183|   136M|                break;
 1184|   487M|        }
 1185|   137M|        a->top = tmp_top;
 1186|   137M|    }
 1187|   137M|    if (a->top == 0)
  ------------------
  |  Branch (1187:9): [True: 342k, False: 136M]
  ------------------
 1188|   342k|        a->neg = 0;
 1189|   137M|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|   137M|#  define BN_FLG_FIXED_TOP 0
  ------------------
 1190|   137M|    bn_pollute(a);
 1191|   137M|}
bn_lib.c:bn_num_bits_consttime:
  155|  1.62M|{
  156|  1.62M|    int j, ret;
  157|  1.62M|    unsigned int mask, past_i;
  158|  1.62M|    int i = a->top - 1;
  159|  1.62M|    bn_check_top(a);
  160|       |
  161|  10.5M|    for (j = 0, past_i = 0, ret = 0; j < a->dmax; j++) {
  ------------------
  |  Branch (161:38): [True: 8.93M, False: 1.62M]
  ------------------
  162|  8.93M|        mask = constant_time_eq_int(i, j); /* 0xff..ff if i==j, 0x0 otherwise */
  163|       |
  164|  8.93M|        ret += BN_BITS2 & (~mask & ~past_i);
  ------------------
  |  |   54|  8.93M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  8.93M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  165|  8.93M|        ret += BN_num_bits_word(a->d[j]) & mask;
  166|       |
  167|  8.93M|        past_i |= mask; /* past_i will become 0xff..ff after i==j */
  168|  8.93M|    }
  169|       |
  170|       |    /*
  171|       |     * if BN_is_zero(a) => i is -1 and ret contains garbage, so we mask the
  172|       |     * final result.
  173|       |     */
  174|  1.62M|    mask = ~(constant_time_eq_int(i, ((int)-1)));
  175|       |
  176|  1.62M|    return ret & mask;
  177|  1.62M|}
bn_lib.c:bn_free_d:
  204|  2.22M|{
  205|  2.22M|    if (BN_get_flags(a, BN_FLG_SECURE))
  ------------------
  |  |   68|  2.22M|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (205:9): [True: 169k, False: 2.05M]
  ------------------
  206|   169k|        OPENSSL_secure_clear_free(a->d, a->dmax * sizeof(a->d[0]));
  ------------------
  |  |  129|   169k|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   169k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   169k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  207|  2.05M|    else if (clear != 0)
  ------------------
  |  Branch (207:14): [True: 1.20M, False: 847k]
  ------------------
  208|  1.20M|        OPENSSL_clear_free(a->d, a->dmax * sizeof(a->d[0]));
  ------------------
  |  |  113|  1.20M|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.20M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.20M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  209|   847k|    else
  210|   847k|        OPENSSL_free(a->d);
  ------------------
  |  |  115|   847k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   847k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   847k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  211|  2.22M|}
bn_lib.c:bn_expand_internal:
  267|  2.12M|{
  268|  2.12M|    BN_ULONG *a = NULL;
  ------------------
  |  |   37|  2.12M|#  define BN_ULONG        unsigned long
  ------------------
  269|       |
  270|  2.12M|    if (words > (INT_MAX / (4 * BN_BITS2))) {
  ------------------
  |  |   54|  2.12M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.12M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (270:9): [True: 0, False: 2.12M]
  ------------------
  271|      0|        ERR_raise(ERR_LIB_BN, BN_R_BIGNUM_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        return NULL;
  273|      0|    }
  274|  2.12M|    if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
  ------------------
  |  |   59|  2.12M|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  |  Branch (274:9): [True: 0, False: 2.12M]
  ------------------
  275|      0|        ERR_raise(ERR_LIB_BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  276|      0|        return NULL;
  277|      0|    }
  278|  2.12M|    if (BN_get_flags(b, BN_FLG_SECURE))
  ------------------
  |  |   68|  2.12M|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (278:9): [True: 169k, False: 1.95M]
  ------------------
  279|   169k|        a = OPENSSL_secure_zalloc(words * sizeof(*a));
  ------------------
  |  |  125|   169k|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   169k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   169k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  280|  1.95M|    else
  281|  1.95M|        a = OPENSSL_zalloc(words * sizeof(*a));
  ------------------
  |  |  104|  1.95M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.95M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.95M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  282|  2.12M|    if (a == NULL)
  ------------------
  |  Branch (282:9): [True: 0, False: 2.12M]
  ------------------
  283|      0|        return NULL;
  284|       |
  285|  2.12M|    assert(b->top <= words);
  286|  2.12M|    if (b->top > 0)
  ------------------
  |  Branch (286:9): [True: 224k, False: 1.90M]
  ------------------
  287|   224k|        memcpy(a, b->d, sizeof(*a) * b->top);
  288|       |
  289|  2.12M|    return a;
  290|  2.12M|}
bn_lib.c:bin2bn:
  436|   548k|{
  437|   548k|    int inc;
  438|   548k|    const unsigned char *s2;
  439|   548k|    int inc2;
  440|   548k|    int neg = 0, xor = 0, carry = 0;
  441|   548k|    unsigned int i;
  442|   548k|    unsigned int n;
  443|   548k|    BIGNUM *bn = NULL;
  444|       |
  445|       |    /* Negative length is not acceptable */
  446|   548k|    if (len < 0)
  ------------------
  |  Branch (446:9): [True: 0, False: 548k]
  ------------------
  447|      0|        return NULL;
  448|       |
  449|   548k|    if (ret == NULL)
  ------------------
  |  Branch (449:9): [True: 173k, False: 375k]
  ------------------
  450|   173k|        ret = bn = BN_new();
  451|   548k|    if (ret == NULL)
  ------------------
  |  Branch (451:9): [True: 0, False: 548k]
  ------------------
  452|      0|        return NULL;
  453|   548k|    bn_check_top(ret);
  454|       |
  455|       |    /*
  456|       |     * If the input has no bits, the number is considered zero.
  457|       |     * This makes calls with s==NULL and len==0 safe.
  458|       |     */
  459|   548k|    if (len == 0) {
  ------------------
  |  Branch (459:9): [True: 98.0k, False: 450k]
  ------------------
  460|  98.0k|        BN_clear(ret);
  461|  98.0k|        return ret;
  462|  98.0k|    }
  463|       |
  464|       |    /*
  465|       |     * The loop that does the work iterates from least to most
  466|       |     * significant BIGNUM chunk, so we adapt parameters to transfer
  467|       |     * input bytes accordingly.
  468|       |     */
  469|   450k|    if (endianness == LITTLE) {
  ------------------
  |  Branch (469:9): [True: 1.88k, False: 448k]
  ------------------
  470|  1.88k|        s2 = s + len - 1;
  471|  1.88k|        inc2 = -1;
  472|  1.88k|        inc = 1;
  473|   448k|    } else {
  474|   448k|        s2 = s;
  475|   448k|        inc2 = 1;
  476|   448k|        inc = -1;
  477|   448k|        s += len - 1;
  478|   448k|    }
  479|       |
  480|       |    /* Take note of the signedness of the input bytes*/
  481|   450k|    if (signedness == SIGNED) {
  ------------------
  |  Branch (481:9): [True: 0, False: 450k]
  ------------------
  482|      0|        neg = !!(*s2 & 0x80);
  483|      0|        xor = neg ? 0xff : 0x00;
  ------------------
  |  Branch (483:15): [True: 0, False: 0]
  ------------------
  484|      0|        carry = neg;
  485|      0|    }
  486|       |
  487|       |    /*
  488|       |     * Skip leading sign extensions (the value of |xor|).
  489|       |     * This is the only spot where |s2| and |inc2| are used.
  490|       |     */
  491|  1.09M|    for ( ; len > 0 && *s2 == xor; s2 += inc2, len--)
  ------------------
  |  Branch (491:13): [True: 1.07M, False: 16.7k]
  |  Branch (491:24): [True: 640k, False: 434k]
  ------------------
  492|   640k|        continue;
  493|       |
  494|       |    /*
  495|       |     * If there was a set of 0xff, we backtrack one byte unless the next
  496|       |     * one has a sign bit, as the last 0xff is then part of the actual
  497|       |     * number, rather then a mere sign extension.
  498|       |     */
  499|   450k|    if (xor == 0xff) {
  ------------------
  |  Branch (499:9): [True: 0, False: 450k]
  ------------------
  500|      0|        if (len == 0 || !(*s2 & 0x80))
  ------------------
  |  Branch (500:13): [True: 0, False: 0]
  |  Branch (500:25): [True: 0, False: 0]
  ------------------
  501|      0|            len++;
  502|      0|    }
  503|       |    /* If it was all zeros, we're done */
  504|   450k|    if (len == 0) {
  ------------------
  |  Branch (504:9): [True: 16.7k, False: 434k]
  ------------------
  505|  16.7k|        ret->top = 0;
  506|  16.7k|        return ret;
  507|  16.7k|    }
  508|   434k|    n = ((len - 1) / BN_BYTES) + 1; /* Number of resulting bignum chunks */
  ------------------
  |  |   38|   434k|#  define BN_BYTES        8
  ------------------
  509|   434k|    if (bn_wexpand(ret, (int)n) == NULL) {
  ------------------
  |  Branch (509:9): [True: 0, False: 434k]
  ------------------
  510|      0|        BN_free(bn);
  511|      0|        return NULL;
  512|      0|    }
  513|   434k|    ret->top = n;
  514|   434k|    ret->neg = neg;
  515|  5.71M|    for (i = 0; n-- > 0; i++) {
  ------------------
  |  Branch (515:17): [True: 5.27M, False: 434k]
  ------------------
  516|  5.27M|        BN_ULONG l = 0;        /* Accumulator */
  ------------------
  |  |   37|  5.27M|#  define BN_ULONG        unsigned long
  ------------------
  517|  5.27M|        unsigned int m = 0;    /* Offset in a bignum chunk, in bits */
  518|       |
  519|  45.3M|        for (; len > 0 && m < BN_BYTES * 8; len--, s += inc, m += 8) {
  ------------------
  |  |   38|  44.8M|#  define BN_BYTES        8
  ------------------
  |  Branch (519:16): [True: 44.8M, False: 434k]
  |  Branch (519:27): [True: 40.0M, False: 4.84M]
  ------------------
  520|  40.0M|            BN_ULONG byte_xored = *s ^ xor;
  ------------------
  |  |   37|  40.0M|#  define BN_ULONG        unsigned long
  ------------------
  521|  40.0M|            BN_ULONG byte = (byte_xored + carry) & 0xff;
  ------------------
  |  |   37|  40.0M|#  define BN_ULONG        unsigned long
  ------------------
  522|       |
  523|  40.0M|            carry = byte_xored > byte; /* Implicit 1 or 0 */
  524|  40.0M|            l |= (byte << m);
  525|  40.0M|        }
  526|  5.27M|        ret->d[i] = l;
  527|  5.27M|    }
  528|       |    /*
  529|       |     * need to call this due to clear byte at top if avoiding having the top
  530|       |     * bit set (-ve number)
  531|       |     */
  532|   434k|    bn_correct_top(ret);
  533|   434k|    return ret;
  534|   434k|}
bn_lib.c:bn2binpad:
  548|   143k|{
  549|   143k|    int inc;
  550|   143k|    int n, n8;
  551|   143k|    int xor = 0, carry = 0, ext = 0;
  552|   143k|    size_t i, lasti, j, atop, mask;
  553|   143k|    BN_ULONG l;
  ------------------
  |  |   37|   143k|#  define BN_ULONG        unsigned long
  ------------------
  554|       |
  555|       |    /*
  556|       |     * In case |a| is fixed-top, BN_num_bits can return bogus length,
  557|       |     * but it's assumed that fixed-top inputs ought to be "nominated"
  558|       |     * even for padded output, so it works out...
  559|       |     */
  560|   143k|    n8 = BN_num_bits(a);
  561|   143k|    n = (n8 + 7) / 8;           /* This is what BN_num_bytes() does */
  562|       |
  563|       |    /* Take note of the signedness of the bignum */
  564|   143k|    if (signedness == SIGNED) {
  ------------------
  |  Branch (564:9): [True: 0, False: 143k]
  ------------------
  565|      0|        xor = a->neg ? 0xff : 0x00;
  ------------------
  |  Branch (565:15): [True: 0, False: 0]
  ------------------
  566|      0|        carry = a->neg;
  567|       |
  568|       |        /*
  569|       |         * if |n * 8 == n|, then the MSbit is set, otherwise unset.
  570|       |         * We must compensate with one extra byte if that doesn't
  571|       |         * correspond to the signedness of the bignum with regards
  572|       |         * to 2's complement.
  573|       |         */
  574|      0|        ext = (n * 8 == n8)
  ------------------
  |  Branch (574:15): [True: 0, False: 0]
  ------------------
  575|      0|            ? !a->neg            /* MSbit set on nonnegative bignum */
  576|      0|            : a->neg;            /* MSbit unset on negative bignum */
  577|      0|    }
  578|       |
  579|   143k|    if (tolen == -1) {
  ------------------
  |  Branch (579:9): [True: 135k, False: 8.63k]
  ------------------
  580|   135k|        tolen = n + ext;
  581|   135k|    } else if (tolen < n + ext) { /* uncommon/unlike case */
  ------------------
  |  Branch (581:16): [True: 994, False: 7.63k]
  ------------------
  582|    994|        BIGNUM temp = *a;
  583|       |
  584|    994|        bn_correct_top(&temp);
  585|    994|        n8 = BN_num_bits(&temp);
  586|    994|        n = (n8 + 7) / 8;       /* This is what BN_num_bytes() does */
  587|    994|        if (tolen < n + ext)
  ------------------
  |  Branch (587:13): [True: 994, False: 0]
  ------------------
  588|    994|            return -1;
  589|    994|    }
  590|       |
  591|       |    /* Swipe through whole available data and don't give away padded zero. */
  592|   142k|    atop = a->dmax * BN_BYTES;
  ------------------
  |  |   38|   142k|#  define BN_BYTES        8
  ------------------
  593|   142k|    if (atop == 0) {
  ------------------
  |  Branch (593:9): [True: 57.3k, False: 85.3k]
  ------------------
  594|  57.3k|        if (tolen != 0)
  ------------------
  |  Branch (594:13): [True: 664, False: 56.6k]
  ------------------
  595|    664|            memset(to, '\0', tolen);
  596|  57.3k|        return tolen;
  597|  57.3k|    }
  598|       |
  599|       |    /*
  600|       |     * The loop that does the work iterates from least significant
  601|       |     * to most significant BIGNUM limb, so we adapt parameters to
  602|       |     * transfer output bytes accordingly.
  603|       |     */
  604|  85.3k|    if (endianness == LITTLE) {
  ------------------
  |  Branch (604:9): [True: 1.60k, False: 83.7k]
  ------------------
  605|  1.60k|        inc = 1;
  606|  83.7k|    } else {
  607|  83.7k|        inc = -1;
  608|  83.7k|        to += tolen - 1;         /* Move to the last byte, not beyond */
  609|  83.7k|    }
  610|       |
  611|  85.3k|    lasti = atop - 1;
  612|  85.3k|    atop = a->top * BN_BYTES;
  ------------------
  |  |   38|  85.3k|#  define BN_BYTES        8
  ------------------
  613|  17.1M|    for (i = 0, j = 0; j < (size_t)tolen; j++) {
  ------------------
  |  Branch (613:24): [True: 17.1M, False: 85.3k]
  ------------------
  614|  17.1M|        unsigned char byte, byte_xored;
  615|       |
  616|  17.1M|        l = a->d[i / BN_BYTES];
  ------------------
  |  |   38|  17.1M|#  define BN_BYTES        8
  ------------------
  617|  17.1M|        mask = 0 - ((j - atop) >> (8 * sizeof(i) - 1));
  618|  17.1M|        byte = (unsigned char)(l >> (8 * (i % BN_BYTES)) & mask);
  ------------------
  |  |   38|  17.1M|#  define BN_BYTES        8
  ------------------
  619|  17.1M|        byte_xored = byte ^ xor;
  620|  17.1M|        *to = (unsigned char)(byte_xored + carry);
  621|  17.1M|        carry = byte_xored > *to; /* Implicit 1 or 0 */
  622|  17.1M|        to += inc;
  623|  17.1M|        i += (i - lasti) >> (8 * sizeof(i) - 1); /* stay on last limb */
  624|  17.1M|    }
  625|       |
  626|  85.3k|    return tolen;
  627|   142k|}

bn_lib.c:bn_expand:
  670|  74.4k|{
  671|  74.4k|    if (bits > (INT_MAX - BN_BITS2 + 1))
  ------------------
  |  |   54|  74.4k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  74.4k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (671:9): [True: 0, False: 74.4k]
  ------------------
  672|      0|        return NULL;
  673|       |
  674|  74.4k|    if (((bits+BN_BITS2-1)/BN_BITS2) <= (a)->dmax)
  ------------------
  |  |   54|  74.4k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  74.4k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                  if (((bits+BN_BITS2-1)/BN_BITS2) <= (a)->dmax)
  ------------------
  |  |   54|  74.4k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  74.4k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (674:9): [True: 40.4k, False: 33.9k]
  ------------------
  675|  40.4k|        return a;
  676|       |
  677|  33.9k|    return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2);
  ------------------
  |  |   54|  33.9k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  33.9k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                  return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2);
  ------------------
  |  |   54|  33.9k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  33.9k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  678|  74.4k|}

BN_nnmod:
   15|  1.02M|{
   16|       |    /*
   17|       |     * like BN_mod, but returns non-negative remainder (i.e., 0 <= r < |d|
   18|       |     * always holds)
   19|       |     */
   20|       |
   21|  1.02M|    if (r == d) {
  ------------------
  |  Branch (21:9): [True: 0, False: 1.02M]
  ------------------
   22|      0|        ERR_raise(ERR_LIB_BN, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   23|      0|        return 0;
   24|      0|    }
   25|       |
   26|  1.02M|    if (!(BN_mod(r, m, d, ctx)))
  ------------------
  |  |  277|  1.02M|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  ------------------
  |  Branch (26:9): [True: 0, False: 1.02M]
  ------------------
   27|      0|        return 0;
   28|  1.02M|    if (!r->neg)
  ------------------
  |  Branch (28:9): [True: 991k, False: 28.9k]
  ------------------
   29|   991k|        return 1;
   30|       |    /* now   -|d| < r < 0,  so we have to set  r := r + |d| */
   31|  28.9k|    return (d->neg ? BN_sub : BN_add) (r, r, d);
  ------------------
  |  Branch (31:13): [True: 0, False: 28.9k]
  ------------------
   32|  1.02M|}
bn_mod_add_fixed_top:
   56|   928k|{
   57|   928k|    size_t i, ai, bi, mtop = m->top;
   58|   928k|    BN_ULONG storage[1024 / BN_BITS2];
  ------------------
  |  |   37|   928k|#  define BN_ULONG        unsigned long
  ------------------
   59|   928k|    BN_ULONG carry, temp, mask, *rp, *tp = storage;
  ------------------
  |  |   37|   928k|#  define BN_ULONG        unsigned long
  ------------------
   60|   928k|    const BN_ULONG *ap, *bp;
   61|       |
   62|   928k|    if (bn_wexpand(r, mtop) == NULL)
  ------------------
  |  Branch (62:9): [True: 0, False: 928k]
  ------------------
   63|      0|        return 0;
   64|       |
   65|   928k|    if (mtop > OSSL_NELEM(storage)) {
  ------------------
  |  |   14|   928k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (65:9): [True: 0, False: 928k]
  ------------------
   66|      0|        tp = OPENSSL_malloc(mtop * sizeof(BN_ULONG));
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|      0|        if (tp == NULL)
  ------------------
  |  Branch (67:13): [True: 0, False: 0]
  ------------------
   68|      0|            return 0;
   69|      0|    }
   70|       |
   71|   928k|    ap = a->d != NULL ? a->d : tp;
  ------------------
  |  Branch (71:10): [True: 928k, False: 0]
  ------------------
   72|   928k|    bp = b->d != NULL ? b->d : tp;
  ------------------
  |  Branch (72:10): [True: 928k, False: 76]
  ------------------
   73|       |
   74|  4.42M|    for (i = 0, ai = 0, bi = 0, carry = 0; i < mtop;) {
  ------------------
  |  Branch (74:44): [True: 3.49M, False: 928k]
  ------------------
   75|  3.49M|        mask = (BN_ULONG)0 - ((i - a->top) >> (8 * sizeof(i) - 1));
   76|  3.49M|        temp = ((ap[ai] & mask) + carry) & BN_MASK2;
  ------------------
  |  |   94|  3.49M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   77|  3.49M|        carry = (temp < carry);
   78|       |
   79|  3.49M|        mask = (BN_ULONG)0 - ((i - b->top) >> (8 * sizeof(i) - 1));
   80|  3.49M|        tp[i] = ((bp[bi] & mask) + temp) & BN_MASK2;
  ------------------
  |  |   94|  3.49M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   81|  3.49M|        carry += (tp[i] < temp);
   82|       |
   83|  3.49M|        i++;
   84|  3.49M|        ai += (i - a->dmax) >> (8 * sizeof(i) - 1);
   85|  3.49M|        bi += (i - b->dmax) >> (8 * sizeof(i) - 1);
   86|  3.49M|    }
   87|   928k|    rp = r->d;
   88|   928k|    carry -= bn_sub_words(rp, tp, m->d, mtop);
   89|  4.42M|    for (i = 0; i < mtop; i++) {
  ------------------
  |  Branch (89:17): [True: 3.49M, False: 928k]
  ------------------
   90|  3.49M|        rp[i] = (carry & tp[i]) | (~carry & rp[i]);
   91|  3.49M|        ((volatile BN_ULONG *)tp)[i] = 0;
   92|  3.49M|    }
   93|   928k|    r->top = mtop;
   94|   928k|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|   928k|#  define BN_FLG_FIXED_TOP 0
  ------------------
   95|   928k|    r->neg = 0;
   96|       |
   97|   928k|    if (tp != storage)
  ------------------
  |  Branch (97:9): [True: 0, False: 928k]
  ------------------
   98|      0|        OPENSSL_free(tp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   99|       |
  100|   928k|    return 1;
  101|   928k|}
BN_mod_add_quick:
  105|   928k|{
  106|   928k|    int ret = bn_mod_add_fixed_top(r, a, b, m);
  107|       |
  108|   928k|    if (ret)
  ------------------
  |  Branch (108:9): [True: 928k, False: 0]
  ------------------
  109|   928k|        bn_correct_top(r);
  110|       |
  111|   928k|    return ret;
  112|   928k|}
BN_mod_sub_quick:
  192|   961k|{
  193|   961k|    if (r == m) {
  ------------------
  |  Branch (193:9): [True: 0, False: 961k]
  ------------------
  194|      0|        ERR_raise(ERR_LIB_BN, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  195|      0|        return 0;
  196|      0|    }
  197|       |
  198|   961k|    if (!BN_sub(r, a, b))
  ------------------
  |  Branch (198:9): [True: 0, False: 961k]
  ------------------
  199|      0|        return 0;
  200|   961k|    if (r->neg)
  ------------------
  |  Branch (200:9): [True: 453k, False: 507k]
  ------------------
  201|   453k|        return BN_add(r, r, m);
  202|   507k|    return 1;
  203|   961k|}
BN_mod_mul:
  208|   823k|{
  209|   823k|    BIGNUM *t;
  210|   823k|    int ret = 0;
  211|       |
  212|   823k|    bn_check_top(a);
  213|   823k|    bn_check_top(b);
  214|   823k|    bn_check_top(m);
  215|       |
  216|   823k|    BN_CTX_start(ctx);
  217|   823k|    if ((t = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (217:9): [True: 0, False: 823k]
  ------------------
  218|      0|        goto err;
  219|   823k|    if (a == b) {
  ------------------
  |  Branch (219:9): [True: 784k, False: 38.5k]
  ------------------
  220|   784k|        if (!BN_sqr(t, a, ctx))
  ------------------
  |  Branch (220:13): [True: 0, False: 784k]
  ------------------
  221|      0|            goto err;
  222|   784k|    } else {
  223|  38.5k|        if (!BN_mul(t, a, b, ctx))
  ------------------
  |  Branch (223:13): [True: 0, False: 38.5k]
  ------------------
  224|      0|            goto err;
  225|  38.5k|    }
  226|   823k|    if (!BN_nnmod(r, t, m, ctx))
  ------------------
  |  Branch (226:9): [True: 0, False: 823k]
  ------------------
  227|      0|        goto err;
  228|   823k|    bn_check_top(r);
  229|   823k|    ret = 1;
  230|   823k| err:
  231|   823k|    BN_CTX_end(ctx);
  232|   823k|    return ret;
  233|   823k|}
BN_mod_sqr:
  236|  38.1k|{
  237|  38.1k|    if (!BN_sqr(r, a, ctx))
  ------------------
  |  Branch (237:9): [True: 0, False: 38.1k]
  ------------------
  238|      0|        return 0;
  239|       |    /* r->neg == 0,  thus we don't need BN_nnmod */
  240|  38.1k|    return BN_mod(r, r, m, ctx);
  ------------------
  |  |  277|  38.1k|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  ------------------
  241|  38.1k|}
BN_mod_lshift1_quick:
  256|   378k|{
  257|   378k|    if (!BN_lshift1(r, a))
  ------------------
  |  Branch (257:9): [True: 0, False: 378k]
  ------------------
  258|      0|        return 0;
  259|   378k|    bn_check_top(r);
  260|   378k|    if (BN_cmp(r, m) >= 0)
  ------------------
  |  Branch (260:9): [True: 186k, False: 192k]
  ------------------
  261|   186k|        return BN_sub(r, r, m);
  262|   192k|    return 1;
  263|   378k|}
BN_mod_lshift_quick:
  293|   202k|{
  294|   202k|    if (r != a) {
  ------------------
  |  Branch (294:9): [True: 171k, False: 31.2k]
  ------------------
  295|   171k|        if (BN_copy(r, a) == NULL)
  ------------------
  |  Branch (295:13): [True: 0, False: 171k]
  ------------------
  296|      0|            return 0;
  297|   171k|    }
  298|       |
  299|   540k|    while (n > 0) {
  ------------------
  |  Branch (299:12): [True: 337k, False: 202k]
  ------------------
  300|   337k|        int max_shift;
  301|       |
  302|       |        /* 0 < r < m */
  303|   337k|        max_shift = BN_num_bits(m) - BN_num_bits(r);
  304|       |        /* max_shift >= 0 */
  305|       |
  306|   337k|        if (max_shift < 0) {
  ------------------
  |  Branch (306:13): [True: 0, False: 337k]
  ------------------
  307|      0|            ERR_raise(ERR_LIB_BN, BN_R_INPUT_NOT_REDUCED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  308|      0|            return 0;
  309|      0|        }
  310|       |
  311|   337k|        if (max_shift > n)
  ------------------
  |  Branch (311:13): [True: 87.5k, False: 250k]
  ------------------
  312|  87.5k|            max_shift = n;
  313|       |
  314|   337k|        if (max_shift) {
  ------------------
  |  Branch (314:13): [True: 213k, False: 124k]
  ------------------
  315|   213k|            if (!BN_lshift(r, r, max_shift))
  ------------------
  |  Branch (315:17): [True: 0, False: 213k]
  ------------------
  316|      0|                return 0;
  317|   213k|            n -= max_shift;
  318|   213k|        } else {
  319|   124k|            if (!BN_lshift1(r, r))
  ------------------
  |  Branch (319:17): [True: 0, False: 124k]
  ------------------
  320|      0|                return 0;
  321|   124k|            --n;
  322|   124k|        }
  323|       |
  324|       |        /* BN_num_bits(r) <= BN_num_bits(m) */
  325|       |
  326|   337k|        if (BN_cmp(r, m) >= 0) {
  ------------------
  |  Branch (326:13): [True: 165k, False: 171k]
  ------------------
  327|   165k|            if (!BN_sub(r, r, m))
  ------------------
  |  Branch (327:17): [True: 0, False: 165k]
  ------------------
  328|      0|                return 0;
  329|   165k|        }
  330|   337k|    }
  331|   202k|    bn_check_top(r);
  332|       |
  333|   202k|    return 1;
  334|   202k|}

BN_mod_mul_montgomery:
   28|  3.37M|{
   29|  3.37M|    int ret = bn_mul_mont_fixed_top(r, a, b, mont, ctx);
   30|       |
   31|  3.37M|    bn_correct_top(r);
   32|  3.37M|    bn_check_top(r);
   33|       |
   34|  3.37M|    return ret;
   35|  3.37M|}
bn_mul_mont_fixed_top:
   39|  4.00M|{
   40|  4.00M|    BIGNUM *tmp;
   41|  4.00M|    int ret = 0;
   42|  4.00M|    int num = mont->N.top;
   43|       |
   44|  4.00M|#if defined(OPENSSL_BN_ASM_MONT) && defined(MONT_WORD)
   45|  4.00M|    if (num > 1 && num <= BN_SOFT_LIMIT && a->top == num && b->top == num) {
  ------------------
  |  |   62|  8.00M|#  define BN_SOFT_LIMIT         (4096 / BN_BYTES)
  |  |  ------------------
  |  |  |  |   38|  4.00M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (45:9): [True: 4.00M, False: 3.54k]
  |  Branch (45:20): [True: 4.00M, False: 0]
  |  Branch (45:44): [True: 3.83M, False: 165k]
  |  Branch (45:61): [True: 3.73M, False: 102k]
  ------------------
   46|  3.73M|        if (bn_wexpand(r, num) == NULL)
  ------------------
  |  Branch (46:13): [True: 0, False: 3.73M]
  ------------------
   47|      0|            return 0;
   48|  3.73M|        if (bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) {
  ------------------
  |  Branch (48:13): [True: 3.73M, False: 0]
  ------------------
   49|  3.73M|            r->neg = a->neg ^ b->neg;
   50|  3.73M|            r->top = num;
   51|  3.73M|            r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  3.73M|#  define BN_FLG_FIXED_TOP 0
  ------------------
   52|  3.73M|            return 1;
   53|  3.73M|        }
   54|  3.73M|    }
   55|   271k|#endif
   56|       |
   57|   271k|    if ((a->top + b->top) > 2 * num)
  ------------------
  |  Branch (57:9): [True: 0, False: 271k]
  ------------------
   58|      0|        return 0;
   59|       |
   60|   271k|    BN_CTX_start(ctx);
   61|   271k|    tmp = BN_CTX_get(ctx);
   62|   271k|    if (tmp == NULL)
  ------------------
  |  Branch (62:9): [True: 0, False: 271k]
  ------------------
   63|      0|        goto err;
   64|       |
   65|   271k|    bn_check_top(tmp);
   66|   271k|    if (a == b) {
  ------------------
  |  Branch (66:9): [True: 12.0k, False: 259k]
  ------------------
   67|  12.0k|        if (!bn_sqr_fixed_top(tmp, a, ctx))
  ------------------
  |  Branch (67:13): [True: 0, False: 12.0k]
  ------------------
   68|      0|            goto err;
   69|   259k|    } else {
   70|   259k|        if (!bn_mul_fixed_top(tmp, a, b, ctx))
  ------------------
  |  Branch (70:13): [True: 0, False: 259k]
  ------------------
   71|      0|            goto err;
   72|   259k|    }
   73|       |    /* reduce from aRR to aR */
   74|   271k|#ifdef MONT_WORD
   75|   271k|    if (!bn_from_montgomery_word(r, tmp, mont))
  ------------------
  |  Branch (75:9): [True: 0, False: 271k]
  ------------------
   76|      0|        goto err;
   77|       |#else
   78|       |    if (!BN_from_montgomery(r, tmp, mont, ctx))
   79|       |        goto err;
   80|       |#endif
   81|   271k|    ret = 1;
   82|   271k| err:
   83|   271k|    BN_CTX_end(ctx);
   84|   271k|    return ret;
   85|   271k|}
BN_from_montgomery:
  164|  13.0k|{
  165|  13.0k|    int retn;
  166|       |
  167|  13.0k|    retn = bn_from_mont_fixed_top(ret, a, mont, ctx);
  168|  13.0k|    bn_correct_top(ret);
  169|  13.0k|    bn_check_top(ret);
  170|       |
  171|  13.0k|    return retn;
  172|  13.0k|}
bn_from_mont_fixed_top:
  176|  13.5k|{
  177|  13.5k|    int retn = 0;
  178|  13.5k|#ifdef MONT_WORD
  179|  13.5k|    BIGNUM *t;
  180|       |
  181|  13.5k|    BN_CTX_start(ctx);
  182|  13.5k|    if ((t = BN_CTX_get(ctx)) && BN_copy(t, a)) {
  ------------------
  |  Branch (182:9): [True: 13.5k, False: 0]
  |  Branch (182:34): [True: 13.5k, False: 0]
  ------------------
  183|  13.5k|        retn = bn_from_montgomery_word(ret, t, mont);
  184|  13.5k|    }
  185|  13.5k|    BN_CTX_end(ctx);
  186|       |#else                           /* !MONT_WORD */
  187|       |    BIGNUM *t1, *t2;
  188|       |
  189|       |    BN_CTX_start(ctx);
  190|       |    t1 = BN_CTX_get(ctx);
  191|       |    t2 = BN_CTX_get(ctx);
  192|       |    if (t2 == NULL)
  193|       |        goto err;
  194|       |
  195|       |    if (!BN_copy(t1, a))
  196|       |        goto err;
  197|       |    BN_mask_bits(t1, mont->ri);
  198|       |
  199|       |    if (!BN_mul(t2, t1, &mont->Ni, ctx))
  200|       |        goto err;
  201|       |    BN_mask_bits(t2, mont->ri);
  202|       |
  203|       |    if (!BN_mul(t1, t2, &mont->N, ctx))
  204|       |        goto err;
  205|       |    if (!BN_add(t2, a, t1))
  206|       |        goto err;
  207|       |    if (!BN_rshift(ret, t2, mont->ri))
  208|       |        goto err;
  209|       |
  210|       |    if (BN_ucmp(ret, &(mont->N)) >= 0) {
  211|       |        if (!BN_usub(ret, ret, &(mont->N)))
  212|       |            goto err;
  213|       |    }
  214|       |    retn = 1;
  215|       |    bn_check_top(ret);
  216|       | err:
  217|       |    BN_CTX_end(ctx);
  218|       |#endif                          /* MONT_WORD */
  219|  13.5k|    return retn;
  220|  13.5k|}
bn_to_mont_fixed_top:
  224|  5.03k|{
  225|  5.03k|    return bn_mul_mont_fixed_top(r, a, &(mont->RR), mont, ctx);
  226|  5.03k|}
BN_MONT_CTX_new:
  229|  56.6k|{
  230|  56.6k|    BN_MONT_CTX *ret;
  231|       |
  232|  56.6k|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|  56.6k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  56.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  56.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (232:9): [True: 0, False: 56.6k]
  ------------------
  233|      0|        return NULL;
  234|       |
  235|  56.6k|    BN_MONT_CTX_init(ret);
  236|  56.6k|    ret->flags = BN_FLG_MALLOCED;
  ------------------
  |  |   58|  56.6k|# define BN_FLG_MALLOCED         0x01
  ------------------
  237|  56.6k|    return ret;
  238|  56.6k|}
BN_MONT_CTX_init:
  241|  56.6k|{
  242|  56.6k|    ctx->ri = 0;
  243|  56.6k|    bn_init(&ctx->RR);
  244|  56.6k|    bn_init(&ctx->N);
  245|  56.6k|    bn_init(&ctx->Ni);
  246|  56.6k|    ctx->n0[0] = ctx->n0[1] = 0;
  247|  56.6k|    ctx->flags = 0;
  248|  56.6k|}
BN_MONT_CTX_free:
  251|   378k|{
  252|   378k|    if (mont == NULL)
  ------------------
  |  Branch (252:9): [True: 321k, False: 56.6k]
  ------------------
  253|   321k|        return;
  254|  56.6k|    BN_clear_free(&mont->RR);
  255|  56.6k|    BN_clear_free(&mont->N);
  256|  56.6k|    BN_clear_free(&mont->Ni);
  257|  56.6k|    if (mont->flags & BN_FLG_MALLOCED)
  ------------------
  |  |   58|  56.6k|# define BN_FLG_MALLOCED         0x01
  ------------------
  |  Branch (257:9): [True: 56.6k, False: 0]
  ------------------
  258|  56.6k|        OPENSSL_free(mont);
  ------------------
  |  |  115|  56.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  56.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  56.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  259|  56.6k|}
BN_MONT_CTX_set:
  262|  31.8k|{
  263|  31.8k|    int i, ret = 0;
  264|  31.8k|    BIGNUM *Ri, *R;
  265|       |
  266|  31.8k|    if (BN_is_zero(mod))
  ------------------
  |  Branch (266:9): [True: 0, False: 31.8k]
  ------------------
  267|      0|        return 0;
  268|       |
  269|  31.8k|    BN_CTX_start(ctx);
  270|  31.8k|    if ((Ri = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (270:9): [True: 0, False: 31.8k]
  ------------------
  271|      0|        goto err;
  272|  31.8k|    R = &(mont->RR);            /* grab RR as a temp */
  273|  31.8k|    if (!BN_copy(&(mont->N), mod))
  ------------------
  |  Branch (273:9): [True: 0, False: 31.8k]
  ------------------
  274|      0|        goto err;               /* Set N */
  275|  31.8k|    if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)
  ------------------
  |  |   67|  31.8k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (275:9): [True: 0, False: 31.8k]
  ------------------
  276|      0|        BN_set_flags(&(mont->N), BN_FLG_CONSTTIME);
  ------------------
  |  |   67|      0|# define BN_FLG_CONSTTIME        0x04
  ------------------
  277|  31.8k|    mont->N.neg = 0;
  278|       |
  279|  31.8k|#ifdef MONT_WORD
  280|  31.8k|    {
  281|  31.8k|        BIGNUM tmod;
  282|  31.8k|        BN_ULONG buf[2];
  ------------------
  |  |   37|  31.8k|#  define BN_ULONG        unsigned long
  ------------------
  283|       |
  284|  31.8k|        bn_init(&tmod);
  285|  31.8k|        tmod.d = buf;
  286|  31.8k|        tmod.dmax = 2;
  287|  31.8k|        tmod.neg = 0;
  288|       |
  289|  31.8k|        if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)
  ------------------
  |  |   67|  31.8k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (289:13): [True: 0, False: 31.8k]
  ------------------
  290|      0|            BN_set_flags(&tmod, BN_FLG_CONSTTIME);
  ------------------
  |  |   67|      0|# define BN_FLG_CONSTTIME        0x04
  ------------------
  291|       |
  292|  31.8k|        mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2;
  ------------------
  |  |   54|  31.8k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  31.8k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                      mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2;
  ------------------
  |  |   54|  31.8k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  31.8k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                      mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2;
  ------------------
  |  |   54|  31.8k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  31.8k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  293|       |
  294|       |# if defined(OPENSSL_BN_ASM_MONT) && (BN_BITS2<=32)
  295|       |        /*
  296|       |         * Only certain BN_BITS2<=32 platforms actually make use of n0[1],
  297|       |         * and we could use the #else case (with a shorter R value) for the
  298|       |         * others.  However, currently only the assembler files do know which
  299|       |         * is which.
  300|       |         */
  301|       |
  302|       |        BN_zero(R);
  303|       |        if (!(BN_set_bit(R, 2 * BN_BITS2)))
  304|       |            goto err;
  305|       |
  306|       |        tmod.top = 0;
  307|       |        if ((buf[0] = mod->d[0]))
  308|       |            tmod.top = 1;
  309|       |        if ((buf[1] = mod->top > 1 ? mod->d[1] : 0))
  310|       |            tmod.top = 2;
  311|       |
  312|       |        if (BN_is_one(&tmod))
  313|       |            BN_zero(Ri);
  314|       |        else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
  315|       |            goto err;
  316|       |        if (!BN_lshift(Ri, Ri, 2 * BN_BITS2))
  317|       |            goto err;           /* R*Ri */
  318|       |        if (!BN_is_zero(Ri)) {
  319|       |            if (!BN_sub_word(Ri, 1))
  320|       |                goto err;
  321|       |        } else {                /* if N mod word size == 1 */
  322|       |
  323|       |            if (bn_expand(Ri, (int)sizeof(BN_ULONG) * 2) == NULL)
  324|       |                goto err;
  325|       |            /* Ri-- (mod double word size) */
  326|       |            Ri->neg = 0;
  327|       |            Ri->d[0] = BN_MASK2;
  328|       |            Ri->d[1] = BN_MASK2;
  329|       |            Ri->top = 2;
  330|       |        }
  331|       |        if (!BN_div(Ri, NULL, Ri, &tmod, ctx))
  332|       |            goto err;
  333|       |        /*
  334|       |         * Ni = (R*Ri-1)/N, keep only couple of least significant words:
  335|       |         */
  336|       |        mont->n0[0] = (Ri->top > 0) ? Ri->d[0] : 0;
  337|       |        mont->n0[1] = (Ri->top > 1) ? Ri->d[1] : 0;
  338|       |# else
  339|  31.8k|        BN_zero(R);
  ------------------
  |  |  202|  31.8k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  340|  31.8k|        if (!(BN_set_bit(R, BN_BITS2)))
  ------------------
  |  |   54|  31.8k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  31.8k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (340:13): [True: 0, False: 31.8k]
  ------------------
  341|      0|            goto err;           /* R */
  342|       |
  343|  31.8k|        buf[0] = mod->d[0];     /* tmod = N mod word size */
  344|  31.8k|        buf[1] = 0;
  345|  31.8k|        tmod.top = buf[0] != 0 ? 1 : 0;
  ------------------
  |  Branch (345:20): [True: 31.8k, False: 10]
  ------------------
  346|       |        /* Ri = R^-1 mod N */
  347|  31.8k|        if (BN_is_one(&tmod))
  ------------------
  |  Branch (347:13): [True: 1.26k, False: 30.6k]
  ------------------
  348|  1.26k|            BN_zero(Ri);
  ------------------
  |  |  202|  1.26k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  349|  30.6k|        else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
  ------------------
  |  Branch (349:18): [True: 195, False: 30.4k]
  ------------------
  350|    195|            goto err;
  351|  31.6k|        if (!BN_lshift(Ri, Ri, BN_BITS2))
  ------------------
  |  |   54|  31.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  31.6k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (351:13): [True: 0, False: 31.6k]
  ------------------
  352|      0|            goto err;           /* R*Ri */
  353|  31.6k|        if (!BN_is_zero(Ri)) {
  ------------------
  |  Branch (353:13): [True: 30.4k, False: 1.26k]
  ------------------
  354|  30.4k|            if (!BN_sub_word(Ri, 1))
  ------------------
  |  Branch (354:17): [True: 0, False: 30.4k]
  ------------------
  355|      0|                goto err;
  356|  30.4k|        } else {                /* if N mod word size == 1 */
  357|       |
  358|  1.26k|            if (!BN_set_word(Ri, BN_MASK2))
  ------------------
  |  |   94|  1.26k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  |  Branch (358:17): [True: 0, False: 1.26k]
  ------------------
  359|      0|                goto err;       /* Ri-- (mod word size) */
  360|  1.26k|        }
  361|  31.6k|        if (!BN_div(Ri, NULL, Ri, &tmod, ctx))
  ------------------
  |  Branch (361:13): [True: 0, False: 31.6k]
  ------------------
  362|      0|            goto err;
  363|       |        /*
  364|       |         * Ni = (R*Ri-1)/N, keep only least significant word:
  365|       |         */
  366|  31.6k|        mont->n0[0] = (Ri->top > 0) ? Ri->d[0] : 0;
  ------------------
  |  Branch (366:23): [True: 31.6k, False: 0]
  ------------------
  367|  31.6k|        mont->n0[1] = 0;
  368|  31.6k|# endif
  369|  31.6k|    }
  370|       |#else                           /* !MONT_WORD */
  371|       |    {                           /* bignum version */
  372|       |        mont->ri = BN_num_bits(&mont->N);
  373|       |        BN_zero(R);
  374|       |        if (!BN_set_bit(R, mont->ri))
  375|       |            goto err;           /* R = 2^ri */
  376|       |        /* Ri = R^-1 mod N */
  377|       |        if ((BN_mod_inverse(Ri, R, &mont->N, ctx)) == NULL)
  378|       |            goto err;
  379|       |        if (!BN_lshift(Ri, Ri, mont->ri))
  380|       |            goto err;           /* R*Ri */
  381|       |        if (!BN_sub_word(Ri, 1))
  382|       |            goto err;
  383|       |        /*
  384|       |         * Ni = (R*Ri-1) / N
  385|       |         */
  386|       |        if (!BN_div(&(mont->Ni), NULL, Ri, &mont->N, ctx))
  387|       |            goto err;
  388|       |    }
  389|       |#endif
  390|       |
  391|       |    /* setup RR for conversions */
  392|  31.6k|    BN_zero(&(mont->RR));
  ------------------
  |  |  202|  31.6k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  393|  31.6k|    if (!BN_set_bit(&(mont->RR), mont->ri * 2))
  ------------------
  |  Branch (393:9): [True: 0, False: 31.6k]
  ------------------
  394|      0|        goto err;
  395|  31.6k|    if (!BN_mod(&(mont->RR), &(mont->RR), &(mont->N), ctx))
  ------------------
  |  |  277|  31.6k|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  ------------------
  |  Branch (395:9): [True: 0, False: 31.6k]
  ------------------
  396|      0|        goto err;
  397|       |
  398|  33.8k|    for (i = mont->RR.top, ret = mont->N.top; i < ret; i++)
  ------------------
  |  Branch (398:47): [True: 2.18k, False: 31.6k]
  ------------------
  399|  2.18k|        mont->RR.d[i] = 0;
  400|  31.6k|    mont->RR.top = ret;
  401|  31.6k|    mont->RR.flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  31.6k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  402|       |
  403|  31.6k|    ret = 1;
  404|  31.8k| err:
  405|  31.8k|    BN_CTX_end(ctx);
  406|  31.8k|    return ret;
  407|  31.6k|}
BN_MONT_CTX_copy:
  410|  24.6k|{
  411|  24.6k|    if (to == from)
  ------------------
  |  Branch (411:9): [True: 0, False: 24.6k]
  ------------------
  412|      0|        return to;
  413|       |
  414|  24.6k|    if (!BN_copy(&(to->RR), &(from->RR)))
  ------------------
  |  Branch (414:9): [True: 0, False: 24.6k]
  ------------------
  415|      0|        return NULL;
  416|  24.6k|    if (!BN_copy(&(to->N), &(from->N)))
  ------------------
  |  Branch (416:9): [True: 0, False: 24.6k]
  ------------------
  417|      0|        return NULL;
  418|  24.6k|    if (!BN_copy(&(to->Ni), &(from->Ni)))
  ------------------
  |  Branch (418:9): [True: 0, False: 24.6k]
  ------------------
  419|      0|        return NULL;
  420|  24.6k|    to->ri = from->ri;
  421|  24.6k|    to->n0[0] = from->n0[0];
  422|  24.6k|    to->n0[1] = from->n0[1];
  423|  24.6k|    return to;
  424|  24.6k|}
BN_MONT_CTX_set_locked:
  428|     22|{
  429|     22|    BN_MONT_CTX *ret;
  430|       |
  431|     22|    if (!CRYPTO_THREAD_read_lock(lock))
  ------------------
  |  Branch (431:9): [True: 0, False: 22]
  ------------------
  432|      0|        return NULL;
  433|     22|    ret = *pmont;
  434|     22|    CRYPTO_THREAD_unlock(lock);
  435|     22|    if (ret)
  ------------------
  |  Branch (435:9): [True: 0, False: 22]
  ------------------
  436|      0|        return ret;
  437|       |
  438|       |    /*
  439|       |     * We don't want to serialize globally while doing our lazy-init math in
  440|       |     * BN_MONT_CTX_set. That punishes threads that are doing independent
  441|       |     * things. Instead, punish the case where more than one thread tries to
  442|       |     * lazy-init the same 'pmont', by having each do the lazy-init math work
  443|       |     * independently and only use the one from the thread that wins the race
  444|       |     * (the losers throw away the work they've done).
  445|       |     */
  446|     22|    ret = BN_MONT_CTX_new();
  447|     22|    if (ret == NULL)
  ------------------
  |  Branch (447:9): [True: 0, False: 22]
  ------------------
  448|      0|        return NULL;
  449|     22|    if (!BN_MONT_CTX_set(ret, mod, ctx)) {
  ------------------
  |  Branch (449:9): [True: 4, False: 18]
  ------------------
  450|      4|        BN_MONT_CTX_free(ret);
  451|      4|        return NULL;
  452|      4|    }
  453|       |
  454|       |    /* The locked compare-and-set, after the local work is done. */
  455|     18|    if (!CRYPTO_THREAD_write_lock(lock)) {
  ------------------
  |  Branch (455:9): [True: 0, False: 18]
  ------------------
  456|      0|        BN_MONT_CTX_free(ret);
  457|      0|        return NULL;
  458|      0|    }
  459|       |
  460|     18|    if (*pmont) {
  ------------------
  |  Branch (460:9): [True: 0, False: 18]
  ------------------
  461|      0|        BN_MONT_CTX_free(ret);
  462|      0|        ret = *pmont;
  463|      0|    } else
  464|     18|        *pmont = ret;
  465|     18|    CRYPTO_THREAD_unlock(lock);
  466|     18|    return ret;
  467|     18|}
ossl_bn_mont_ctx_set:
  471|     98|{
  472|     98|    if (BN_copy(&ctx->N, modulus) == NULL)
  ------------------
  |  Branch (472:9): [True: 0, False: 98]
  ------------------
  473|      0|        return 0;
  474|     98|    if (BN_bin2bn(rr, rrlen, &ctx->RR) == NULL)
  ------------------
  |  Branch (474:9): [True: 0, False: 98]
  ------------------
  475|      0|        return 0;
  476|     98|    ctx->ri = ri;
  477|       |#if (BN_BITS2 <= 32) && defined(OPENSSL_BN_ASM_MONT)
  478|       |    ctx->n0[0] = nlo;
  479|       |    ctx->n0[1] = nhi;
  480|       |#elif BN_BITS2 <= 32
  481|       |    ctx->n0[0] = nlo;
  482|       |    ctx->n0[1] = 0;
  483|       |#else
  484|     98|    ctx->n0[0] = ((BN_ULONG)nhi << 32)| nlo;
  485|     98|    ctx->n0[1] = 0;
  486|     98|#endif
  487|       |
  488|     98|    return 1;
  489|     98|}
bn_mont.c:bn_from_montgomery_word:
   89|   284k|{
   90|   284k|    BIGNUM *n;
   91|   284k|    BN_ULONG *ap, *np, *rp, n0, v, carry;
  ------------------
  |  |   37|   284k|#  define BN_ULONG        unsigned long
  ------------------
   92|   284k|    int nl, max, i;
   93|   284k|    unsigned int rtop;
   94|       |
   95|   284k|    n = &(mont->N);
   96|   284k|    nl = n->top;
   97|   284k|    if (nl == 0) {
  ------------------
  |  Branch (97:9): [True: 0, False: 284k]
  ------------------
   98|      0|        ret->top = 0;
   99|      0|        return 1;
  100|      0|    }
  101|       |
  102|   284k|    max = (2 * nl);             /* carry is stored separately */
  103|   284k|    if (bn_wexpand(r, max) == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 284k]
  ------------------
  104|      0|        return 0;
  105|       |
  106|   284k|    r->neg ^= n->neg;
  107|   284k|    np = n->d;
  108|   284k|    rp = r->d;
  109|       |
  110|       |    /* clear the top words of T */
  111|  2.32M|    for (rtop = r->top, i = 0; i < max; i++) {
  ------------------
  |  Branch (111:32): [True: 2.04M, False: 284k]
  ------------------
  112|  2.04M|        v = (BN_ULONG)0 - ((i - rtop) >> (8 * sizeof(rtop) - 1));
  113|  2.04M|        rp[i] &= v;
  114|  2.04M|    }
  115|       |
  116|   284k|    r->top = max;
  117|   284k|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|   284k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  118|   284k|    n0 = mont->n0[0];
  119|       |
  120|       |    /*
  121|       |     * Add multiples of |n| to |r| until R = 2^(nl * BN_BITS2) divides it. On
  122|       |     * input, we had |r| < |n| * R, so now |r| < 2 * |n| * R. Note that |r|
  123|       |     * includes |carry| which is stored separately.
  124|       |     */
  125|  1.30M|    for (carry = 0, i = 0; i < nl; i++, rp++) {
  ------------------
  |  Branch (125:28): [True: 1.02M, False: 284k]
  ------------------
  126|  1.02M|        v = bn_mul_add_words(rp, np, nl, (rp[0] * n0) & BN_MASK2);
  ------------------
  |  |   94|  1.02M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  127|  1.02M|        v = (v + carry + rp[nl]) & BN_MASK2;
  ------------------
  |  |   94|  1.02M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  128|  1.02M|        carry |= (v != rp[nl]);
  129|  1.02M|        carry &= (v <= rp[nl]);
  130|  1.02M|        rp[nl] = v;
  131|  1.02M|    }
  132|       |
  133|   284k|    if (bn_wexpand(ret, nl) == NULL)
  ------------------
  |  Branch (133:9): [True: 0, False: 284k]
  ------------------
  134|      0|        return 0;
  135|   284k|    ret->top = nl;
  136|   284k|    ret->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|   284k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  137|   284k|    ret->neg = r->neg;
  138|       |
  139|   284k|    rp = ret->d;
  140|       |
  141|       |    /*
  142|       |     * Shift |nl| words to divide by R. We have |ap| < 2 * |n|. Note that |ap|
  143|       |     * includes |carry| which is stored separately.
  144|       |     */
  145|   284k|    ap = &(r->d[nl]);
  146|       |
  147|   284k|    carry -= bn_sub_words(rp, ap, np, nl);
  148|       |    /*
  149|       |     * |carry| is -1 if |ap| - |np| underflowed or zero if it did not. Note
  150|       |     * |carry| cannot be 1. That would imply the subtraction did not fit in
  151|       |     * |nl| words, and we know at most one subtraction is needed.
  152|       |     */
  153|  1.30M|    for (i = 0; i < nl; i++) {
  ------------------
  |  Branch (153:17): [True: 1.02M, False: 284k]
  ------------------
  154|  1.02M|        rp[i] = (carry & ap[i]) | (~carry & rp[i]);
  155|  1.02M|        ap[i] = 0;
  156|  1.02M|    }
  157|       |
  158|   284k|    return 1;
  159|   284k|}

bn_sub_part_words:
   30|  17.9k|{
   31|  17.9k|    BN_ULONG c, t;
  ------------------
  |  |   37|  17.9k|#  define BN_ULONG        unsigned long
  ------------------
   32|       |
   33|  17.9k|    assert(cl >= 0);
   34|  17.9k|    c = bn_sub_words(r, a, b, cl);
   35|       |
   36|  17.9k|    if (dl == 0)
  ------------------
  |  Branch (36:9): [True: 14.0k, False: 3.93k]
  ------------------
   37|  14.0k|        return c;
   38|       |
   39|  3.93k|    r += cl;
   40|  3.93k|    a += cl;
   41|  3.93k|    b += cl;
   42|       |
   43|  3.93k|    if (dl < 0) {
  ------------------
  |  Branch (43:9): [True: 484, False: 3.44k]
  ------------------
   44|  1.20k|        for (;;) {
   45|  1.20k|            t = b[0];
   46|  1.20k|            r[0] = (0 - t - c) & BN_MASK2;
  ------------------
  |  |   94|  1.20k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   47|  1.20k|            if (t != 0)
  ------------------
  |  Branch (47:17): [True: 0, False: 1.20k]
  ------------------
   48|      0|                c = 1;
   49|  1.20k|            if (++dl >= 0)
  ------------------
  |  Branch (49:17): [True: 220, False: 986]
  ------------------
   50|    220|                break;
   51|       |
   52|    986|            t = b[1];
   53|    986|            r[1] = (0 - t - c) & BN_MASK2;
  ------------------
  |  |   94|    986|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   54|    986|            if (t != 0)
  ------------------
  |  Branch (54:17): [True: 0, False: 986]
  ------------------
   55|      0|                c = 1;
   56|    986|            if (++dl >= 0)
  ------------------
  |  Branch (56:17): [True: 80, False: 906]
  ------------------
   57|     80|                break;
   58|       |
   59|    906|            t = b[2];
   60|    906|            r[2] = (0 - t - c) & BN_MASK2;
  ------------------
  |  |   94|    906|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   61|    906|            if (t != 0)
  ------------------
  |  Branch (61:17): [True: 0, False: 906]
  ------------------
   62|      0|                c = 1;
   63|    906|            if (++dl >= 0)
  ------------------
  |  Branch (63:17): [True: 116, False: 790]
  ------------------
   64|    116|                break;
   65|       |
   66|    790|            t = b[3];
   67|    790|            r[3] = (0 - t - c) & BN_MASK2;
  ------------------
  |  |   94|    790|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   68|    790|            if (t != 0)
  ------------------
  |  Branch (68:17): [True: 0, False: 790]
  ------------------
   69|      0|                c = 1;
   70|    790|            if (++dl >= 0)
  ------------------
  |  Branch (70:17): [True: 68, False: 722]
  ------------------
   71|     68|                break;
   72|       |
   73|    722|            b += 4;
   74|    722|            r += 4;
   75|    722|        }
   76|  3.44k|    } else {
   77|  3.44k|        int save_dl = dl;
   78|  5.22k|        while (c) {
  ------------------
  |  Branch (78:16): [True: 2.46k, False: 2.76k]
  ------------------
   79|  2.46k|            t = a[0];
   80|  2.46k|            r[0] = (t - c) & BN_MASK2;
  ------------------
  |  |   94|  2.46k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   81|  2.46k|            if (t != 0)
  ------------------
  |  Branch (81:17): [True: 1.21k, False: 1.24k]
  ------------------
   82|  1.21k|                c = 0;
   83|  2.46k|            if (--dl <= 0)
  ------------------
  |  Branch (83:17): [True: 428, False: 2.03k]
  ------------------
   84|    428|                break;
   85|       |
   86|  2.03k|            t = a[1];
   87|  2.03k|            r[1] = (t - c) & BN_MASK2;
  ------------------
  |  |   94|  2.03k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   88|  2.03k|            if (t != 0)
  ------------------
  |  Branch (88:17): [True: 957, False: 1.07k]
  ------------------
   89|    957|                c = 0;
   90|  2.03k|            if (--dl <= 0)
  ------------------
  |  Branch (90:17): [True: 69, False: 1.96k]
  ------------------
   91|     69|                break;
   92|       |
   93|  1.96k|            t = a[2];
   94|  1.96k|            r[2] = (t - c) & BN_MASK2;
  ------------------
  |  |   94|  1.96k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   95|  1.96k|            if (t != 0)
  ------------------
  |  Branch (95:17): [True: 864, False: 1.10k]
  ------------------
   96|    864|                c = 0;
   97|  1.96k|            if (--dl <= 0)
  ------------------
  |  Branch (97:17): [True: 121, False: 1.84k]
  ------------------
   98|    121|                break;
   99|       |
  100|  1.84k|            t = a[3];
  101|  1.84k|            r[3] = (t - c) & BN_MASK2;
  ------------------
  |  |   94|  1.84k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  102|  1.84k|            if (t != 0)
  ------------------
  |  Branch (102:17): [True: 848, False: 998]
  ------------------
  103|    848|                c = 0;
  104|  1.84k|            if (--dl <= 0)
  ------------------
  |  Branch (104:17): [True: 66, False: 1.78k]
  ------------------
  105|     66|                break;
  106|       |
  107|  1.78k|            save_dl = dl;
  108|  1.78k|            a += 4;
  109|  1.78k|            r += 4;
  110|  1.78k|        }
  111|  3.44k|        if (dl > 0) {
  ------------------
  |  Branch (111:13): [True: 2.76k, False: 684]
  ------------------
  112|  2.76k|            if (save_dl > dl) {
  ------------------
  |  Branch (112:17): [True: 0, False: 2.76k]
  ------------------
  113|      0|                switch (save_dl - dl) {
  ------------------
  |  Branch (113:25): [True: 0, False: 0]
  ------------------
  114|      0|                case 1:
  ------------------
  |  Branch (114:17): [True: 0, False: 0]
  ------------------
  115|      0|                    r[1] = a[1];
  116|      0|                    if (--dl <= 0)
  ------------------
  |  Branch (116:25): [True: 0, False: 0]
  ------------------
  117|      0|                        break;
  118|       |                    /* fall through */
  119|      0|                case 2:
  ------------------
  |  Branch (119:17): [True: 0, False: 0]
  ------------------
  120|      0|                    r[2] = a[2];
  121|      0|                    if (--dl <= 0)
  ------------------
  |  Branch (121:25): [True: 0, False: 0]
  ------------------
  122|      0|                        break;
  123|       |                    /* fall through */
  124|      0|                case 3:
  ------------------
  |  Branch (124:17): [True: 0, False: 0]
  ------------------
  125|      0|                    r[3] = a[3];
  126|      0|                    if (--dl <= 0)
  ------------------
  |  Branch (126:25): [True: 0, False: 0]
  ------------------
  127|      0|                        break;
  128|      0|                }
  129|      0|                a += 4;
  130|      0|                r += 4;
  131|      0|            }
  132|  2.76k|        }
  133|  3.44k|        if (dl > 0) {
  ------------------
  |  Branch (133:13): [True: 2.76k, False: 684]
  ------------------
  134|  7.17k|            for (;;) {
  135|  7.17k|                r[0] = a[0];
  136|  7.17k|                if (--dl <= 0)
  ------------------
  |  Branch (136:21): [True: 834, False: 6.34k]
  ------------------
  137|    834|                    break;
  138|  6.34k|                r[1] = a[1];
  139|  6.34k|                if (--dl <= 0)
  ------------------
  |  Branch (139:21): [True: 838, False: 5.50k]
  ------------------
  140|    838|                    break;
  141|  5.50k|                r[2] = a[2];
  142|  5.50k|                if (--dl <= 0)
  ------------------
  |  Branch (142:21): [True: 618, False: 4.88k]
  ------------------
  143|    618|                    break;
  144|  4.88k|                r[3] = a[3];
  145|  4.88k|                if (--dl <= 0)
  ------------------
  |  Branch (145:21): [True: 472, False: 4.41k]
  ------------------
  146|    472|                    break;
  147|       |
  148|  4.41k|                a += 4;
  149|  4.41k|                r += 4;
  150|  4.41k|            }
  151|  2.76k|        }
  152|  3.44k|    }
  153|  3.93k|    return c;
  154|  3.93k|}
bn_mul_recursive:
  177|  7.89k|{
  178|  7.89k|    int n = n2 / 2, c1, c2;
  179|  7.89k|    int tna = n + dna, tnb = n + dnb;
  180|  7.89k|    unsigned int neg, zero;
  181|  7.89k|    BN_ULONG ln, lo, *p;
  ------------------
  |  |   37|  7.89k|#  define BN_ULONG        unsigned long
  ------------------
  182|       |
  183|  7.89k|# ifdef BN_MUL_COMBA
  184|       |#  if 0
  185|       |    if (n2 == 4) {
  186|       |        bn_mul_comba4(r, a, b);
  187|       |        return;
  188|       |    }
  189|       |#  endif
  190|       |    /*
  191|       |     * Only call bn_mul_comba 8 if n2 == 8 and the two arrays are complete
  192|       |     * [steve]
  193|       |     */
  194|  7.89k|    if (n2 == 8 && dna == 0 && dnb == 0) {
  ------------------
  |  Branch (194:9): [True: 86, False: 7.80k]
  |  Branch (194:20): [True: 64, False: 22]
  |  Branch (194:32): [True: 50, False: 14]
  ------------------
  195|     50|        bn_mul_comba8(r, a, b);
  196|     50|        return;
  197|     50|    }
  198|  7.84k|# endif                         /* BN_MUL_COMBA */
  199|       |    /* Else do normal multiply */
  200|  7.84k|    if (n2 < BN_MUL_RECURSIVE_SIZE_NORMAL) {
  ------------------
  |  |  365|  7.84k|# define BN_MUL_RECURSIVE_SIZE_NORMAL            (16)/* 32 less than */
  ------------------
  |  Branch (200:9): [True: 36, False: 7.80k]
  ------------------
  201|     36|        bn_mul_normal(r, a, n2 + dna, b, n2 + dnb);
  202|     36|        if ((dna + dnb) < 0)
  ------------------
  |  Branch (202:13): [True: 36, False: 0]
  ------------------
  203|     36|            memset(&r[2 * n2 + dna + dnb], 0,
  204|     36|                   sizeof(BN_ULONG) * -(dna + dnb));
  205|     36|        return;
  206|     36|    }
  207|       |    /* r=(a[0]-a[1])*(b[1]-b[0]) */
  208|  7.80k|    c1 = bn_cmp_part_words(a, &(a[n]), tna, n - tna);
  209|  7.80k|    c2 = bn_cmp_part_words(&(b[n]), b, tnb, tnb - n);
  210|  7.80k|    zero = neg = 0;
  211|  7.80k|    switch (c1 * 3 + c2) {
  ------------------
  |  Branch (211:13): [True: 0, False: 7.80k]
  ------------------
  212|  1.48k|    case -4:
  ------------------
  |  Branch (212:5): [True: 1.48k, False: 6.32k]
  ------------------
  213|  1.48k|        bn_sub_part_words(t, &(a[n]), a, tna, tna - n); /* - */
  214|  1.48k|        bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb); /* - */
  215|  1.48k|        break;
  216|    170|    case -3:
  ------------------
  |  Branch (216:5): [True: 170, False: 7.63k]
  ------------------
  217|    170|        zero = 1;
  218|    170|        break;
  219|  1.45k|    case -2:
  ------------------
  |  Branch (219:5): [True: 1.45k, False: 6.35k]
  ------------------
  220|  1.45k|        bn_sub_part_words(t, &(a[n]), a, tna, tna - n); /* - */
  221|  1.45k|        bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n); /* + */
  222|  1.45k|        neg = 1;
  223|  1.45k|        break;
  224|    183|    case -1:
  ------------------
  |  Branch (224:5): [True: 183, False: 7.62k]
  ------------------
  225|    305|    case 0:
  ------------------
  |  Branch (225:5): [True: 122, False: 7.68k]
  ------------------
  226|    433|    case 1:
  ------------------
  |  Branch (226:5): [True: 128, False: 7.67k]
  ------------------
  227|    433|        zero = 1;
  228|    433|        break;
  229|  2.35k|    case 2:
  ------------------
  |  Branch (229:5): [True: 2.35k, False: 5.44k]
  ------------------
  230|  2.35k|        bn_sub_part_words(t, a, &(a[n]), tna, n - tna); /* + */
  231|  2.35k|        bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb); /* - */
  232|  2.35k|        neg = 1;
  233|  2.35k|        break;
  234|    178|    case 3:
  ------------------
  |  Branch (234:5): [True: 178, False: 7.62k]
  ------------------
  235|    178|        zero = 1;
  236|    178|        break;
  237|  1.72k|    case 4:
  ------------------
  |  Branch (237:5): [True: 1.72k, False: 6.07k]
  ------------------
  238|  1.72k|        bn_sub_part_words(t, a, &(a[n]), tna, n - tna);
  239|  1.72k|        bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n);
  240|  1.72k|        break;
  241|  7.80k|    }
  242|       |
  243|  7.80k|# ifdef BN_MUL_COMBA
  244|  7.80k|    if (n == 4 && dna == 0 && dnb == 0) { /* XXX: bn_mul_comba4 could take
  ------------------
  |  Branch (244:9): [True: 0, False: 7.80k]
  |  Branch (244:19): [True: 0, False: 0]
  |  Branch (244:31): [True: 0, False: 0]
  ------------------
  245|       |                                           * extra args to do this well */
  246|      0|        if (!zero)
  ------------------
  |  Branch (246:13): [True: 0, False: 0]
  ------------------
  247|      0|            bn_mul_comba4(&(t[n2]), t, &(t[n]));
  248|      0|        else
  249|      0|            memset(&t[n2], 0, sizeof(*t) * 8);
  250|       |
  251|      0|        bn_mul_comba4(r, a, b);
  252|      0|        bn_mul_comba4(&(r[n2]), &(a[n]), &(b[n]));
  253|  7.80k|    } else if (n == 8 && dna == 0 && dnb == 0) { /* XXX: bn_mul_comba8 could
  ------------------
  |  Branch (253:16): [True: 6.15k, False: 1.64k]
  |  Branch (253:26): [True: 6.14k, False: 8]
  |  Branch (253:38): [True: 6.14k, False: 8]
  ------------------
  254|       |                                                  * take extra args to do
  255|       |                                                  * this well */
  256|  6.14k|        if (!zero)
  ------------------
  |  Branch (256:13): [True: 5.49k, False: 645]
  ------------------
  257|  5.49k|            bn_mul_comba8(&(t[n2]), t, &(t[n]));
  258|    645|        else
  259|    645|            memset(&t[n2], 0, sizeof(*t) * 16);
  260|       |
  261|  6.14k|        bn_mul_comba8(r, a, b);
  262|  6.14k|        bn_mul_comba8(&(r[n2]), &(a[n]), &(b[n]));
  263|  6.14k|    } else
  264|  1.66k|# endif                         /* BN_MUL_COMBA */
  265|  1.66k|    {
  266|  1.66k|        p = &(t[n2 * 2]);
  267|  1.66k|        if (!zero)
  ------------------
  |  Branch (267:13): [True: 1.52k, False: 136]
  ------------------
  268|  1.52k|            bn_mul_recursive(&(t[n2]), t, &(t[n]), n, 0, 0, p);
  269|    136|        else
  270|    136|            memset(&t[n2], 0, sizeof(*t) * n2);
  271|  1.66k|        bn_mul_recursive(r, a, b, n, 0, 0, p);
  272|  1.66k|        bn_mul_recursive(&(r[n2]), &(a[n]), &(b[n]), n, dna, dnb, p);
  273|  1.66k|    }
  274|       |
  275|       |    /*-
  276|       |     * t[32] holds (a[0]-a[1])*(b[1]-b[0]), c1 is the sign
  277|       |     * r[10] holds (a[0]*b[0])
  278|       |     * r[32] holds (b[1]*b[1])
  279|       |     */
  280|       |
  281|  7.80k|    c1 = (int)(bn_add_words(t, r, &(r[n2]), n2));
  282|       |
  283|  7.80k|    if (neg) {                  /* if t[32] is negative */
  ------------------
  |  Branch (283:9): [True: 3.81k, False: 3.99k]
  ------------------
  284|  3.81k|        c1 -= (int)(bn_sub_words(&(t[n2]), t, &(t[n2]), n2));
  285|  3.99k|    } else {
  286|       |        /* Might have a carry */
  287|  3.99k|        c1 += (int)(bn_add_words(&(t[n2]), &(t[n2]), t, n2));
  288|  3.99k|    }
  289|       |
  290|       |    /*-
  291|       |     * t[32] holds (a[0]-a[1])*(b[1]-b[0])+(a[0]*b[0])+(a[1]*b[1])
  292|       |     * r[10] holds (a[0]*b[0])
  293|       |     * r[32] holds (b[1]*b[1])
  294|       |     * c1 holds the carry bits
  295|       |     */
  296|  7.80k|    c1 += (int)(bn_add_words(&(r[n]), &(r[n]), &(t[n2]), n2));
  297|  7.80k|    if (c1) {
  ------------------
  |  Branch (297:9): [True: 1.97k, False: 5.83k]
  ------------------
  298|  1.97k|        p = &(r[n + n2]);
  299|  1.97k|        lo = *p;
  300|  1.97k|        ln = (lo + c1) & BN_MASK2;
  ------------------
  |  |   94|  1.97k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  301|  1.97k|        *p = ln;
  302|       |
  303|       |        /*
  304|       |         * The overflow will stop before we over write words we should not
  305|       |         * overwrite
  306|       |         */
  307|  1.97k|        if (ln < (BN_ULONG)c1) {
  ------------------
  |  Branch (307:13): [True: 119, False: 1.85k]
  ------------------
  308|    437|            do {
  309|    437|                p++;
  310|    437|                lo = *p;
  311|    437|                ln = (lo + 1) & BN_MASK2;
  ------------------
  |  |   94|    437|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  312|    437|                *p = ln;
  313|    437|            } while (ln == 0);
  ------------------
  |  Branch (313:22): [True: 318, False: 119]
  ------------------
  314|    119|        }
  315|  1.97k|    }
  316|  7.80k|}
bn_mul_part_recursive:
  324|  1.94k|{
  325|  1.94k|    int i, j, n2 = n * 2;
  326|  1.94k|    int c1, c2, neg;
  327|  1.94k|    BN_ULONG ln, lo, *p;
  ------------------
  |  |   37|  1.94k|#  define BN_ULONG        unsigned long
  ------------------
  328|       |
  329|  1.94k|    if (n < 8) {
  ------------------
  |  Branch (329:9): [True: 0, False: 1.94k]
  ------------------
  330|      0|        bn_mul_normal(r, a, n + tna, b, n + tnb);
  331|      0|        return;
  332|      0|    }
  333|       |
  334|       |    /* r=(a[0]-a[1])*(b[1]-b[0]) */
  335|  1.94k|    c1 = bn_cmp_part_words(a, &(a[n]), tna, n - tna);
  336|  1.94k|    c2 = bn_cmp_part_words(&(b[n]), b, tnb, tnb - n);
  337|  1.94k|    neg = 0;
  338|  1.94k|    switch (c1 * 3 + c2) {
  ------------------
  |  Branch (338:13): [True: 0, False: 1.94k]
  ------------------
  339|    147|    case -4:
  ------------------
  |  Branch (339:5): [True: 147, False: 1.80k]
  ------------------
  340|    147|        bn_sub_part_words(t, &(a[n]), a, tna, tna - n); /* - */
  341|    147|        bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb); /* - */
  342|    147|        break;
  343|     12|    case -3:
  ------------------
  |  Branch (343:5): [True: 12, False: 1.93k]
  ------------------
  344|     79|    case -2:
  ------------------
  |  Branch (344:5): [True: 67, False: 1.88k]
  ------------------
  345|     79|        bn_sub_part_words(t, &(a[n]), a, tna, tna - n); /* - */
  346|     79|        bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n); /* + */
  347|     79|        neg = 1;
  348|     79|        break;
  349|     23|    case -1:
  ------------------
  |  Branch (349:5): [True: 23, False: 1.92k]
  ------------------
  350|     35|    case 0:
  ------------------
  |  Branch (350:5): [True: 12, False: 1.93k]
  ------------------
  351|     54|    case 1:
  ------------------
  |  Branch (351:5): [True: 19, False: 1.93k]
  ------------------
  352|  1.54k|    case 2:
  ------------------
  |  Branch (352:5): [True: 1.49k, False: 455]
  ------------------
  353|  1.54k|        bn_sub_part_words(t, a, &(a[n]), tna, n - tna); /* + */
  354|  1.54k|        bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb); /* - */
  355|  1.54k|        neg = 1;
  356|  1.54k|        break;
  357|     16|    case 3:
  ------------------
  |  Branch (357:5): [True: 16, False: 1.93k]
  ------------------
  358|    175|    case 4:
  ------------------
  |  Branch (358:5): [True: 159, False: 1.79k]
  ------------------
  359|    175|        bn_sub_part_words(t, a, &(a[n]), tna, n - tna);
  360|    175|        bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n);
  361|    175|        break;
  362|  1.94k|    }
  363|       |    /*
  364|       |     * The zero case isn't yet implemented here. The speedup would probably
  365|       |     * be negligible.
  366|       |     */
  367|       |# if 0
  368|       |    if (n == 4) {
  369|       |        bn_mul_comba4(&(t[n2]), t, &(t[n]));
  370|       |        bn_mul_comba4(r, a, b);
  371|       |        bn_mul_normal(&(r[n2]), &(a[n]), tn, &(b[n]), tn);
  372|       |        memset(&r[n2 + tn * 2], 0, sizeof(*r) * (n2 - tn * 2));
  373|       |    } else
  374|       |# endif
  375|  1.94k|    if (n == 8) {
  ------------------
  |  Branch (375:9): [True: 468, False: 1.48k]
  ------------------
  376|    468|        bn_mul_comba8(&(t[n2]), t, &(t[n]));
  377|    468|        bn_mul_comba8(r, a, b);
  378|    468|        bn_mul_normal(&(r[n2]), &(a[n]), tna, &(b[n]), tnb);
  379|    468|        memset(&r[n2 + tna + tnb], 0, sizeof(*r) * (n2 - tna - tnb));
  380|  1.48k|    } else {
  381|  1.48k|        p = &(t[n2 * 2]);
  382|  1.48k|        bn_mul_recursive(&(t[n2]), t, &(t[n]), n, 0, 0, p);
  383|  1.48k|        bn_mul_recursive(r, a, b, n, 0, 0, p);
  384|  1.48k|        i = n / 2;
  385|       |        /*
  386|       |         * If there is only a bottom half to the number, just do it
  387|       |         */
  388|  1.48k|        if (tna > tnb)
  ------------------
  |  Branch (388:13): [True: 196, False: 1.28k]
  ------------------
  389|    196|            j = tna - i;
  390|  1.28k|        else
  391|  1.28k|            j = tnb - i;
  392|  1.48k|        if (j == 0) {
  ------------------
  |  Branch (392:13): [True: 46, False: 1.43k]
  ------------------
  393|     46|            bn_mul_recursive(&(r[n2]), &(a[n]), &(b[n]),
  394|     46|                             i, tna - i, tnb - i, p);
  395|     46|            memset(&r[n2 + i * 2], 0, sizeof(*r) * (n2 - i * 2));
  396|  1.43k|        } else if (j > 0) {     /* eg, n == 16, i == 8 and tn == 11 */
  ------------------
  |  Branch (396:20): [True: 886, False: 549]
  ------------------
  397|    886|            bn_mul_part_recursive(&(r[n2]), &(a[n]), &(b[n]),
  398|    886|                                  i, tna - i, tnb - i, p);
  399|    886|            memset(&(r[n2 + tna + tnb]), 0,
  400|    886|                   sizeof(BN_ULONG) * (n2 - tna - tnb));
  401|    886|        } else {                /* (j < 0) eg, n == 16, i == 8 and tn == 5 */
  402|       |
  403|    549|            memset(&r[n2], 0, sizeof(*r) * n2);
  404|    549|            if (tna < BN_MUL_RECURSIVE_SIZE_NORMAL
  ------------------
  |  |  365|  1.09k|# define BN_MUL_RECURSIVE_SIZE_NORMAL            (16)/* 32 less than */
  ------------------
  |  Branch (404:17): [True: 549, False: 0]
  ------------------
  405|    549|                && tnb < BN_MUL_RECURSIVE_SIZE_NORMAL) {
  ------------------
  |  |  365|    549|# define BN_MUL_RECURSIVE_SIZE_NORMAL            (16)/* 32 less than */
  ------------------
  |  Branch (405:20): [True: 549, False: 0]
  ------------------
  406|    549|                bn_mul_normal(&(r[n2]), &(a[n]), tna, &(b[n]), tnb);
  407|    549|            } else {
  408|      0|                for (;;) {
  409|      0|                    i /= 2;
  410|       |                    /*
  411|       |                     * these simplified conditions work exclusively because
  412|       |                     * difference between tna and tnb is 1 or 0
  413|       |                     */
  414|      0|                    if (i < tna || i < tnb) {
  ------------------
  |  Branch (414:25): [True: 0, False: 0]
  |  Branch (414:36): [True: 0, False: 0]
  ------------------
  415|      0|                        bn_mul_part_recursive(&(r[n2]),
  416|      0|                                              &(a[n]), &(b[n]),
  417|      0|                                              i, tna - i, tnb - i, p);
  418|      0|                        break;
  419|      0|                    } else if (i == tna || i == tnb) {
  ------------------
  |  Branch (419:32): [True: 0, False: 0]
  |  Branch (419:44): [True: 0, False: 0]
  ------------------
  420|      0|                        bn_mul_recursive(&(r[n2]),
  421|      0|                                         &(a[n]), &(b[n]),
  422|      0|                                         i, tna - i, tnb - i, p);
  423|      0|                        break;
  424|      0|                    }
  425|      0|                }
  426|      0|            }
  427|    549|        }
  428|  1.48k|    }
  429|       |
  430|       |    /*-
  431|       |     * t[32] holds (a[0]-a[1])*(b[1]-b[0]), c1 is the sign
  432|       |     * r[10] holds (a[0]*b[0])
  433|       |     * r[32] holds (b[1]*b[1])
  434|       |     */
  435|       |
  436|  1.94k|    c1 = (int)(bn_add_words(t, r, &(r[n2]), n2));
  437|       |
  438|  1.94k|    if (neg) {                  /* if t[32] is negative */
  ------------------
  |  Branch (438:9): [True: 1.62k, False: 322]
  ------------------
  439|  1.62k|        c1 -= (int)(bn_sub_words(&(t[n2]), t, &(t[n2]), n2));
  440|  1.62k|    } else {
  441|       |        /* Might have a carry */
  442|    322|        c1 += (int)(bn_add_words(&(t[n2]), &(t[n2]), t, n2));
  443|    322|    }
  444|       |
  445|       |    /*-
  446|       |     * t[32] holds (a[0]-a[1])*(b[1]-b[0])+(a[0]*b[0])+(a[1]*b[1])
  447|       |     * r[10] holds (a[0]*b[0])
  448|       |     * r[32] holds (b[1]*b[1])
  449|       |     * c1 holds the carry bits
  450|       |     */
  451|  1.94k|    c1 += (int)(bn_add_words(&(r[n]), &(r[n]), &(t[n2]), n2));
  452|  1.94k|    if (c1) {
  ------------------
  |  Branch (452:9): [True: 196, False: 1.75k]
  ------------------
  453|    196|        p = &(r[n + n2]);
  454|    196|        lo = *p;
  455|    196|        ln = (lo + c1) & BN_MASK2;
  ------------------
  |  |   94|    196|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  456|    196|        *p = ln;
  457|       |
  458|       |        /*
  459|       |         * The overflow will stop before we over write words we should not
  460|       |         * overwrite
  461|       |         */
  462|    196|        if (ln < (BN_ULONG)c1) {
  ------------------
  |  Branch (462:13): [True: 24, False: 172]
  ------------------
  463|    128|            do {
  464|    128|                p++;
  465|    128|                lo = *p;
  466|    128|                ln = (lo + 1) & BN_MASK2;
  ------------------
  |  |   94|    128|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  467|    128|                *p = ln;
  468|    128|            } while (ln == 0);
  ------------------
  |  Branch (468:22): [True: 104, False: 24]
  ------------------
  469|     24|        }
  470|    196|    }
  471|  1.94k|}
BN_mul:
  498|  89.0k|{
  499|  89.0k|    int ret = bn_mul_fixed_top(r, a, b, ctx);
  500|       |
  501|  89.0k|    bn_correct_top(r);
  502|  89.0k|    bn_check_top(r);
  503|       |
  504|  89.0k|    return ret;
  505|  89.0k|}
bn_mul_fixed_top:
  508|   348k|{
  509|   348k|    int ret = 0;
  510|   348k|    int top, al, bl;
  511|   348k|    BIGNUM *rr;
  512|   348k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  513|   348k|    int i;
  514|   348k|#endif
  515|   348k|#ifdef BN_RECURSION
  516|   348k|    BIGNUM *t = NULL;
  517|   348k|    int j = 0, k;
  518|   348k|#endif
  519|       |
  520|   348k|    bn_check_top(a);
  521|   348k|    bn_check_top(b);
  522|   348k|    bn_check_top(r);
  523|       |
  524|   348k|    al = a->top;
  525|   348k|    bl = b->top;
  526|       |
  527|   348k|    if ((al == 0) || (bl == 0)) {
  ------------------
  |  Branch (527:9): [True: 60.3k, False: 288k]
  |  Branch (527:22): [True: 51.9k, False: 236k]
  ------------------
  528|   112k|        BN_zero(r);
  ------------------
  |  |  202|   112k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  529|   112k|        return 1;
  530|   112k|    }
  531|   236k|    top = al + bl;
  532|       |
  533|   236k|    BN_CTX_start(ctx);
  534|   236k|    if ((r == a) || (r == b)) {
  ------------------
  |  Branch (534:9): [True: 1.07k, False: 235k]
  |  Branch (534:21): [True: 0, False: 235k]
  ------------------
  535|  1.07k|        if ((rr = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (535:13): [True: 0, False: 1.07k]
  ------------------
  536|      0|            goto err;
  537|  1.07k|    } else
  538|   235k|        rr = r;
  539|       |
  540|   236k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  541|   236k|    i = al - bl;
  542|   236k|#endif
  543|   236k|#ifdef BN_MUL_COMBA
  544|   236k|    if (i == 0) {
  ------------------
  |  Branch (544:9): [True: 42.4k, False: 193k]
  ------------------
  545|       |# if 0
  546|       |        if (al == 4) {
  547|       |            if (bn_wexpand(rr, 8) == NULL)
  548|       |                goto err;
  549|       |            rr->top = 8;
  550|       |            bn_mul_comba4(rr->d, a->d, b->d);
  551|       |            goto end;
  552|       |        }
  553|       |# endif
  554|  42.4k|        if (al == 8) {
  ------------------
  |  Branch (554:13): [True: 14, False: 42.3k]
  ------------------
  555|     14|            if (bn_wexpand(rr, 16) == NULL)
  ------------------
  |  Branch (555:17): [True: 0, False: 14]
  ------------------
  556|      0|                goto err;
  557|     14|            rr->top = 16;
  558|     14|            bn_mul_comba8(rr->d, a->d, b->d);
  559|     14|            goto end;
  560|     14|        }
  561|  42.4k|    }
  562|   236k|#endif                          /* BN_MUL_COMBA */
  563|   236k|#ifdef BN_RECURSION
  564|   236k|    if ((al >= BN_MULL_SIZE_NORMAL) && (bl >= BN_MULL_SIZE_NORMAL)) {
  ------------------
  |  |  364|   236k|# define BN_MULL_SIZE_NORMAL                     (16)/* 32 */
  ------------------
                  if ((al >= BN_MULL_SIZE_NORMAL) && (bl >= BN_MULL_SIZE_NORMAL)) {
  ------------------
  |  |  364|  40.8k|# define BN_MULL_SIZE_NORMAL                     (16)/* 32 */
  ------------------
  |  Branch (564:9): [True: 40.8k, False: 195k]
  |  Branch (564:40): [True: 3.98k, False: 36.8k]
  ------------------
  565|  3.98k|        if (i >= -1 && i <= 1) {
  ------------------
  |  Branch (565:13): [True: 3.91k, False: 73]
  |  Branch (565:24): [True: 1.08k, False: 2.82k]
  ------------------
  566|       |            /*
  567|       |             * Find out the power of two lower or equal to the longest of the
  568|       |             * two numbers
  569|       |             */
  570|  1.08k|            if (i >= 0) {
  ------------------
  |  Branch (570:17): [True: 618, False: 471]
  ------------------
  571|    618|                j = BN_num_bits_word((BN_ULONG)al);
  572|    618|            }
  573|  1.08k|            if (i == -1) {
  ------------------
  |  Branch (573:17): [True: 471, False: 618]
  ------------------
  574|    471|                j = BN_num_bits_word((BN_ULONG)bl);
  575|    471|            }
  576|  1.08k|            j = 1 << (j - 1);
  577|  1.08k|            assert(j <= al || j <= bl);
  578|  1.08k|            k = j + j;
  579|  1.08k|            t = BN_CTX_get(ctx);
  580|  1.08k|            if (t == NULL)
  ------------------
  |  Branch (580:17): [True: 0, False: 1.08k]
  ------------------
  581|      0|                goto err;
  582|  1.08k|            if (al > j || bl > j) {
  ------------------
  |  Branch (582:17): [True: 1.05k, False: 32]
  |  Branch (582:27): [True: 6, False: 26]
  ------------------
  583|  1.06k|                if (bn_wexpand(t, k * 4) == NULL)
  ------------------
  |  Branch (583:21): [True: 0, False: 1.06k]
  ------------------
  584|      0|                    goto err;
  585|  1.06k|                if (bn_wexpand(rr, k * 4) == NULL)
  ------------------
  |  Branch (585:21): [True: 0, False: 1.06k]
  ------------------
  586|      0|                    goto err;
  587|  1.06k|                bn_mul_part_recursive(rr->d, a->d, b->d,
  588|  1.06k|                                      j, al - j, bl - j, t->d);
  589|  1.06k|            } else {            /* al <= j || bl <= j */
  590|       |
  591|     26|                if (bn_wexpand(t, k * 2) == NULL)
  ------------------
  |  Branch (591:21): [True: 0, False: 26]
  ------------------
  592|      0|                    goto err;
  593|     26|                if (bn_wexpand(rr, k * 2) == NULL)
  ------------------
  |  Branch (593:21): [True: 0, False: 26]
  ------------------
  594|      0|                    goto err;
  595|     26|                bn_mul_recursive(rr->d, a->d, b->d, j, al - j, bl - j, t->d);
  596|     26|            }
  597|  1.08k|            rr->top = top;
  598|  1.08k|            goto end;
  599|  1.08k|        }
  600|  3.98k|    }
  601|   235k|#endif                          /* BN_RECURSION */
  602|   235k|    if (bn_wexpand(rr, top) == NULL)
  ------------------
  |  Branch (602:9): [True: 0, False: 235k]
  ------------------
  603|      0|        goto err;
  604|   235k|    rr->top = top;
  605|   235k|    bn_mul_normal(rr->d, a->d, al, b->d, bl);
  606|       |
  607|   235k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  608|   236k| end:
  609|   236k|#endif
  610|   236k|    rr->neg = a->neg ^ b->neg;
  611|   236k|    rr->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|   236k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  612|   236k|    if (r != rr && BN_copy(r, rr) == NULL)
  ------------------
  |  Branch (612:9): [True: 1.07k, False: 235k]
  |  Branch (612:20): [True: 0, False: 1.07k]
  ------------------
  613|      0|        goto err;
  614|       |
  615|   236k|    ret = 1;
  616|   236k| err:
  617|   236k|    bn_check_top(r);
  618|   236k|    BN_CTX_end(ctx);
  619|   236k|    return ret;
  620|   236k|}
bn_mul_normal:
  623|   236k|{
  624|   236k|    BN_ULONG *rr;
  ------------------
  |  |   37|   236k|#  define BN_ULONG        unsigned long
  ------------------
  625|       |
  626|   236k|    if (na < nb) {
  ------------------
  |  Branch (626:9): [True: 98.9k, False: 137k]
  ------------------
  627|  98.9k|        int itmp;
  628|  98.9k|        BN_ULONG *ltmp;
  ------------------
  |  |   37|  98.9k|#  define BN_ULONG        unsigned long
  ------------------
  629|       |
  630|  98.9k|        itmp = na;
  631|  98.9k|        na = nb;
  632|  98.9k|        nb = itmp;
  633|  98.9k|        ltmp = a;
  634|  98.9k|        a = b;
  635|  98.9k|        b = ltmp;
  636|       |
  637|  98.9k|    }
  638|   236k|    rr = &(r[na]);
  639|   236k|    if (nb <= 0) {
  ------------------
  |  Branch (639:9): [True: 46, False: 236k]
  ------------------
  640|     46|        (void)bn_mul_words(r, a, na, 0);
  641|     46|        return;
  642|     46|    } else
  643|   236k|        rr[0] = bn_mul_words(r, a, na, b[0]);
  644|       |
  645|   291k|    for (;;) {
  646|   291k|        if (--nb <= 0)
  ------------------
  |  Branch (646:13): [True: 150k, False: 140k]
  ------------------
  647|   150k|            return;
  648|   140k|        rr[1] = bn_mul_add_words(&(r[1]), a, na, b[1]);
  649|   140k|        if (--nb <= 0)
  ------------------
  |  Branch (649:13): [True: 43.0k, False: 97.8k]
  ------------------
  650|  43.0k|            return;
  651|  97.8k|        rr[2] = bn_mul_add_words(&(r[2]), a, na, b[2]);
  652|  97.8k|        if (--nb <= 0)
  ------------------
  |  Branch (652:13): [True: 1.41k, False: 96.4k]
  ------------------
  653|  1.41k|            return;
  654|  96.4k|        rr[3] = bn_mul_add_words(&(r[3]), a, na, b[3]);
  655|  96.4k|        if (--nb <= 0)
  ------------------
  |  Branch (655:13): [True: 40.7k, False: 55.6k]
  ------------------
  656|  40.7k|            return;
  657|  55.6k|        rr[4] = bn_mul_add_words(&(r[4]), a, na, b[4]);
  658|  55.6k|        rr += 4;
  659|  55.6k|        r += 4;
  660|  55.6k|        b += 4;
  661|  55.6k|    }
  662|   236k|}

BN_nist_mod_224:
  489|  2.55k|{
  490|  2.55k|    int top = a->top, i;
  491|  2.55k|    int carry;
  492|  2.55k|    BN_ULONG *r_d, *a_d = a->d;
  ------------------
  |  |   37|  2.55k|#  define BN_ULONG        unsigned long
  ------------------
  493|  2.55k|    union {
  494|  2.55k|        BN_ULONG bn[BN_NIST_224_TOP];
  495|  2.55k|        unsigned int ui[BN_NIST_224_TOP * sizeof(BN_ULONG) /
  496|  2.55k|                        sizeof(unsigned int)];
  497|  2.55k|    } buf;
  498|  2.55k|    BN_ULONG c_d[BN_NIST_224_TOP], *res;
  ------------------
  |  |   37|  2.55k|#  define BN_ULONG        unsigned long
  ------------------
  499|  2.55k|    bn_addsub_f adjust;
  500|  2.55k|    static const BIGNUM ossl_bignum_nist_p_224_sqr = {
  501|  2.55k|        (BN_ULONG *)_nist_p_224_sqr,
  502|  2.55k|        OSSL_NELEM(_nist_p_224_sqr),
  ------------------
  |  |   14|  2.55k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  503|  2.55k|        OSSL_NELEM(_nist_p_224_sqr),
  ------------------
  |  |   14|  2.55k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  504|  2.55k|        0, BN_FLG_STATIC_DATA
  ------------------
  |  |   59|  2.55k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  505|  2.55k|    };
  506|       |
  507|  2.55k|    field = &ossl_bignum_nist_p_224; /* just to make sure */
  508|       |
  509|  2.55k|    if (BN_is_negative(a) || BN_ucmp(a, &ossl_bignum_nist_p_224_sqr) >= 0)
  ------------------
  |  Branch (509:9): [True: 0, False: 2.55k]
  |  Branch (509:30): [True: 0, False: 2.55k]
  ------------------
  510|      0|        return BN_nnmod(r, a, field, ctx);
  511|       |
  512|  2.55k|    i = BN_ucmp(field, a);
  513|  2.55k|    if (i == 0) {
  ------------------
  |  Branch (513:9): [True: 0, False: 2.55k]
  ------------------
  514|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  515|      0|        return 1;
  516|  2.55k|    } else if (i > 0)
  ------------------
  |  Branch (516:16): [True: 70, False: 2.48k]
  ------------------
  517|     70|        return (r == a) ? 1 : (BN_copy(r, a) != NULL);
  ------------------
  |  Branch (517:16): [True: 70, False: 0]
  ------------------
  518|       |
  519|  2.48k|    if (r != a) {
  ------------------
  |  Branch (519:9): [True: 0, False: 2.48k]
  ------------------
  520|      0|        if (!bn_wexpand(r, BN_NIST_224_TOP))
  ------------------
  |  |   14|      0|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (520:13): [True: 0, False: 0]
  ------------------
  521|      0|            return 0;
  522|      0|        r_d = r->d;
  523|      0|        nist_cp_bn(r_d, a_d, BN_NIST_224_TOP);
  ------------------
  |  |   14|      0|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  524|      0|    } else
  525|  2.48k|        r_d = a_d;
  526|       |
  527|  2.48k|#if BN_BITS2==64
  528|       |    /* copy upper 256 bits of 448 bit number ... */
  529|  2.48k|    nist_cp_bn_0(c_d, a_d + (BN_NIST_224_TOP - 1),
  ------------------
  |  |  265|  2.48k|#define nist_cp_bn_0(dst, src_in, top, max) \
  |  |  266|  2.48k|{                                           \
  |  |  267|  2.48k|    int ii;                                 \
  |  |  268|  2.48k|    const BN_ULONG *src = src_in;           \
  |  |  269|  2.48k|                                            \
  |  |  270|  12.2k|    for (ii = 0; ii < top; ii++)            \
  |  |  ------------------
  |  |  |  Branch (270:18): [True: 9.72k, False: 2.48k]
  |  |  ------------------
  |  |  271|  9.72k|        (dst)[ii] = src[ii];                \
  |  |  272|  2.67k|    for (; ii < max; ii++)                  \
  |  |  ------------------
  |  |  |  Branch (272:12): [True: 197, False: 2.48k]
  |  |  ------------------
  |  |  273|  2.48k|        (dst)[ii] = 0;                      \
  |  |  274|  2.48k|}
  ------------------
  530|  2.48k|                 top - (BN_NIST_224_TOP - 1), BN_NIST_224_TOP);
  531|       |    /* ... and right shift by 32 to obtain upper 224 bits */
  532|  2.48k|    nist_set_224(buf.bn, c_d, 14, 13, 12, 11, 10, 9, 8);
  ------------------
  |  |  477|  2.48k|        { \
  |  |  478|  2.48k|        bn_cp_32(to, 0, from, (a7) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  479|  2.48k|        bn_cp_32(to, 1, from, (a6) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  480|  2.48k|        bn_cp_32(to, 2, from, (a5) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  481|  2.48k|        bn_cp_32(to, 3, from, (a4) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  482|  2.48k|        bn_cp_32(to, 4, from, (a3) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  483|  2.48k|        bn_cp_32(to, 5, from, (a2) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  484|  2.48k|        bn_cp_32(to, 6, from, (a1) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  485|  2.48k|        }
  ------------------
  533|       |    /* truncate lower part to 224 bits too */
  534|  2.48k|    r_d[BN_NIST_224_TOP - 1] &= BN_MASK2l;
  ------------------
  |  |   14|  2.48k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  r_d[BN_NIST_224_TOP - 1] &= BN_MASK2l;
  ------------------
  |  |   95|  2.48k|#  define BN_MASK2l       (0xffffffffL)
  ------------------
  535|       |#else
  536|       |    nist_cp_bn_0(buf.bn, a_d + BN_NIST_224_TOP, top - BN_NIST_224_TOP,
  537|       |                 BN_NIST_224_TOP);
  538|       |#endif
  539|       |
  540|       |#if defined(NIST_INT64) && BN_BITS2!=64
  541|       |    {
  542|       |        NIST_INT64 acc;         /* accumulator */
  543|       |        unsigned int *rp = (unsigned int *)r_d;
  544|       |        const unsigned int *bp = (const unsigned int *)buf.ui;
  545|       |
  546|       |        acc = rp[0];
  547|       |        acc -= bp[7 - 7];
  548|       |        acc -= bp[11 - 7];
  549|       |        rp[0] = (unsigned int)acc;
  550|       |        acc >>= 32;
  551|       |
  552|       |        acc += rp[1];
  553|       |        acc -= bp[8 - 7];
  554|       |        acc -= bp[12 - 7];
  555|       |        rp[1] = (unsigned int)acc;
  556|       |        acc >>= 32;
  557|       |
  558|       |        acc += rp[2];
  559|       |        acc -= bp[9 - 7];
  560|       |        acc -= bp[13 - 7];
  561|       |        rp[2] = (unsigned int)acc;
  562|       |        acc >>= 32;
  563|       |
  564|       |        acc += rp[3];
  565|       |        acc += bp[7 - 7];
  566|       |        acc += bp[11 - 7];
  567|       |        acc -= bp[10 - 7];
  568|       |        rp[3] = (unsigned int)acc;
  569|       |        acc >>= 32;
  570|       |
  571|       |        acc += rp[4];
  572|       |        acc += bp[8 - 7];
  573|       |        acc += bp[12 - 7];
  574|       |        acc -= bp[11 - 7];
  575|       |        rp[4] = (unsigned int)acc;
  576|       |        acc >>= 32;
  577|       |
  578|       |        acc += rp[5];
  579|       |        acc += bp[9 - 7];
  580|       |        acc += bp[13 - 7];
  581|       |        acc -= bp[12 - 7];
  582|       |        rp[5] = (unsigned int)acc;
  583|       |        acc >>= 32;
  584|       |
  585|       |        acc += rp[6];
  586|       |        acc += bp[10 - 7];
  587|       |        acc -= bp[13 - 7];
  588|       |        rp[6] = (unsigned int)acc;
  589|       |
  590|       |        carry = (int)(acc >> 32);
  591|       |# if BN_BITS2==64
  592|       |        rp[7] = carry;
  593|       |# endif
  594|       |    }
  595|       |#else
  596|  2.48k|    {
  597|  2.48k|        BN_ULONG t_d[BN_NIST_224_TOP];
  ------------------
  |  |   37|  2.48k|#  define BN_ULONG        unsigned long
  ------------------
  598|       |
  599|  2.48k|        nist_set_224(t_d, buf.bn, 10, 9, 8, 7, 0, 0, 0);
  ------------------
  |  |  477|  2.48k|        { \
  |  |  478|  2.48k|        bn_cp_32(to, 0, from, (a7) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.48k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  479|  2.48k|        bn_cp_32(to, 1, from, (a6) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.48k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  2.48k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  480|  2.48k|        bn_cp_32(to, 2, from, (a5) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.48k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  481|  2.48k|        bn_cp_32(to, 3, from, (a4) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  482|  2.48k|        bn_cp_32(to, 4, from, (a3) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  483|  2.48k|        bn_cp_32(to, 5, from, (a2) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  484|  2.48k|        bn_cp_32(to, 6, from, (a1) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  485|  2.48k|        }
  ------------------
  600|  2.48k|        carry = (int)bn_add_words(r_d, r_d, t_d, BN_NIST_224_TOP);
  ------------------
  |  |   14|  2.48k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  601|  2.48k|        nist_set_224(t_d, buf.bn, 0, 13, 12, 11, 0, 0, 0);
  ------------------
  |  |  477|  2.48k|        { \
  |  |  478|  2.48k|        bn_cp_32(to, 0, from, (a7) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.48k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  479|  2.48k|        bn_cp_32(to, 1, from, (a6) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.48k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  2.48k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  480|  2.48k|        bn_cp_32(to, 2, from, (a5) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.48k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  481|  2.48k|        bn_cp_32(to, 3, from, (a4) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  482|  2.48k|        bn_cp_32(to, 4, from, (a3) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  483|  2.48k|        bn_cp_32(to, 5, from, (a2) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  484|  2.48k|        bn_cp_32(to, 6, from, (a1) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.48k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  485|  2.48k|        }
  ------------------
  602|  2.48k|        carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_224_TOP);
  ------------------
  |  |   14|  2.48k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  603|  2.48k|        nist_set_224(t_d, buf.bn, 13, 12, 11, 10, 9, 8, 7);
  ------------------
  |  |  477|  2.48k|        { \
  |  |  478|  2.48k|        bn_cp_32(to, 0, from, (a7) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  2.48k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  479|  2.48k|        bn_cp_32(to, 1, from, (a6) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  2.48k|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  480|  2.48k|        bn_cp_32(to, 2, from, (a5) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  2.48k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  481|  2.48k|        bn_cp_32(to, 3, from, (a4) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  2.48k|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  482|  2.48k|        bn_cp_32(to, 4, from, (a3) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  2.48k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  483|  2.48k|        bn_cp_32(to, 5, from, (a2) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  2.48k|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  484|  2.48k|        bn_cp_32(to, 6, from, (a1) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  2.48k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  485|  2.48k|        }
  ------------------
  604|  2.48k|        carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_224_TOP);
  ------------------
  |  |   14|  2.48k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  605|  2.48k|        nist_set_224(t_d, buf.bn, 0, 0, 0, 0, 13, 12, 11);
  ------------------
  |  |  477|  2.48k|        { \
  |  |  478|  2.48k|        bn_cp_32(to, 0, from, (a7) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  2.48k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  479|  2.48k|        bn_cp_32(to, 1, from, (a6) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  2.48k|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  480|  2.48k|        bn_cp_32(to, 2, from, (a5) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.48k|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.48k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  2.48k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  481|  2.48k|        bn_cp_32(to, 3, from, (a4) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.48k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  2.48k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  482|  2.48k|        bn_cp_32(to, 4, from, (a3) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.48k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  483|  2.48k|        bn_cp_32(to, 5, from, (a2) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.48k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  2.48k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  484|  2.48k|        bn_cp_32(to, 6, from, (a1) - 7) \
  |  |  ------------------
  |  |  |  |  294|  2.48k|# define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|# define bn_cp_32_naked(to, n, from, m)  (((n)&1)?(to[(n)/2]|=((m)&1)?(from[(m)/2]&BN_MASK2h):(from[(m)/2]<<32))\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (292:62): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define bn_cp_32(to,n,from,m)           ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.48k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  485|  2.48k|        }
  ------------------
  606|  2.48k|        carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_224_TOP);
  ------------------
  |  |   14|  2.48k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  607|       |
  608|  2.48k|# if BN_BITS2==64
  609|  2.48k|        carry = (int)(r_d[BN_NIST_224_TOP - 1] >> 32);
  ------------------
  |  |   14|  2.48k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  610|  2.48k|# endif
  611|  2.48k|    }
  612|  2.48k|#endif
  613|  2.48k|    adjust = bn_sub_words;
  614|  2.48k|    if (carry > 0) {
  ------------------
  |  Branch (614:9): [True: 1.05k, False: 1.42k]
  ------------------
  615|  1.05k|        carry =
  616|  1.05k|            (int)bn_sub_words(r_d, r_d, _nist_p_224[carry - 1],
  617|  1.05k|                              BN_NIST_224_TOP);
  ------------------
  |  |   14|  1.05k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  1.05k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  1.05k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  1.05k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  1.05k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  618|  1.05k|#if BN_BITS2==64
  619|  1.05k|        carry = (int)(~(r_d[BN_NIST_224_TOP - 1] >> 32)) & 1;
  ------------------
  |  |   14|  1.05k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  1.05k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  1.05k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  1.05k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  1.05k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  620|  1.05k|#endif
  621|  1.42k|    } else if (carry < 0) {
  ------------------
  |  Branch (621:16): [True: 341, False: 1.08k]
  ------------------
  622|       |        /*
  623|       |         * it's a bit more complicated logic in this case. if bn_add_words
  624|       |         * yields no carry, then result has to be adjusted by unconditionally
  625|       |         * *adding* the modulus. but if it does, then result has to be
  626|       |         * compared to the modulus and conditionally adjusted by
  627|       |         * *subtracting* the latter.
  628|       |         */
  629|    341|        carry =
  630|    341|            (int)bn_add_words(r_d, r_d, _nist_p_224[-carry - 1],
  631|    341|                              BN_NIST_224_TOP);
  ------------------
  |  |   14|    341|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    341|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    341|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    341|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    341|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  632|    341|        adjust = carry ? bn_sub_words : bn_add_words;
  ------------------
  |  Branch (632:18): [True: 341, False: 0]
  ------------------
  633|    341|    } else
  634|  1.08k|        carry = 1;
  635|       |
  636|       |    /* otherwise it's effectively same as in BN_nist_mod_192... */
  637|  2.48k|    res = ((*adjust) (c_d, r_d, _nist_p_224[0], BN_NIST_224_TOP) && carry)
  ------------------
  |  |   14|  2.48k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (637:12): [True: 2.47k, False: 8]
  |  Branch (637:69): [True: 2.47k, False: 0]
  ------------------
  638|  2.48k|        ? r_d
  639|  2.48k|        : c_d;
  640|  2.48k|    nist_cp_bn(r_d, res, BN_NIST_224_TOP);
  ------------------
  |  |   14|  2.48k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  641|  2.48k|    r->top = BN_NIST_224_TOP;
  ------------------
  |  |   14|  2.48k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  642|  2.48k|    bn_correct_top(r);
  643|       |
  644|  2.48k|    return 1;
  645|  2.48k|}
BN_nist_mod_384:
  898|  1.24k|{
  899|  1.24k|    int i, top = a->top;
  900|  1.24k|    int carry = 0;
  901|  1.24k|    register BN_ULONG *r_d, *a_d = a->d;
  902|  1.24k|    union {
  903|  1.24k|        BN_ULONG bn[BN_NIST_384_TOP];
  904|  1.24k|        unsigned int ui[BN_NIST_384_TOP * sizeof(BN_ULONG) /
  905|  1.24k|                        sizeof(unsigned int)];
  906|  1.24k|    } buf;
  907|  1.24k|    BN_ULONG c_d[BN_NIST_384_TOP], *res;
  ------------------
  |  |   37|  1.24k|#  define BN_ULONG        unsigned long
  ------------------
  908|  1.24k|    bn_addsub_f adjust;
  909|  1.24k|    static const BIGNUM ossl_bignum_nist_p_384_sqr = {
  910|  1.24k|        (BN_ULONG *)_nist_p_384_sqr,
  911|  1.24k|        OSSL_NELEM(_nist_p_384_sqr),
  ------------------
  |  |   14|  1.24k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  912|  1.24k|        OSSL_NELEM(_nist_p_384_sqr),
  ------------------
  |  |   14|  1.24k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  913|  1.24k|        0, BN_FLG_STATIC_DATA
  ------------------
  |  |   59|  1.24k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  914|  1.24k|    };
  915|       |
  916|  1.24k|    field = &ossl_bignum_nist_p_384; /* just to make sure */
  917|       |
  918|  1.24k|    if (BN_is_negative(a) || BN_ucmp(a, &ossl_bignum_nist_p_384_sqr) >= 0)
  ------------------
  |  Branch (918:9): [True: 0, False: 1.24k]
  |  Branch (918:30): [True: 0, False: 1.24k]
  ------------------
  919|      0|        return BN_nnmod(r, a, field, ctx);
  920|       |
  921|  1.24k|    i = BN_ucmp(field, a);
  922|  1.24k|    if (i == 0) {
  ------------------
  |  Branch (922:9): [True: 0, False: 1.24k]
  ------------------
  923|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  924|      0|        return 1;
  925|  1.24k|    } else if (i > 0)
  ------------------
  |  Branch (925:16): [True: 23, False: 1.21k]
  ------------------
  926|     23|        return (r == a) ? 1 : (BN_copy(r, a) != NULL);
  ------------------
  |  Branch (926:16): [True: 23, False: 0]
  ------------------
  927|       |
  928|  1.21k|    if (r != a) {
  ------------------
  |  Branch (928:9): [True: 0, False: 1.21k]
  ------------------
  929|      0|        if (!bn_wexpand(r, BN_NIST_384_TOP))
  ------------------
  |  |   16|      0|#define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (929:13): [True: 0, False: 0]
  ------------------
  930|      0|            return 0;
  931|      0|        r_d = r->d;
  932|      0|        nist_cp_bn(r_d, a_d, BN_NIST_384_TOP);
  ------------------
  |  |   16|      0|#define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  933|      0|    } else
  934|  1.21k|        r_d = a_d;
  935|       |
  936|  1.21k|    nist_cp_bn_0(buf.bn, a_d + BN_NIST_384_TOP, top - BN_NIST_384_TOP,
  ------------------
  |  |  265|  1.21k|#define nist_cp_bn_0(dst, src_in, top, max) \
  |  |  266|  1.21k|{                                           \
  |  |  267|  1.21k|    int ii;                                 \
  |  |  268|  1.21k|    const BN_ULONG *src = src_in;           \
  |  |  269|  1.21k|                                            \
  |  |  270|  8.29k|    for (ii = 0; ii < top; ii++)            \
  |  |  ------------------
  |  |  |  Branch (270:18): [True: 7.07k, False: 1.21k]
  |  |  ------------------
  |  |  271|  7.07k|        (dst)[ii] = src[ii];                \
  |  |  272|  1.44k|    for (; ii < max; ii++)                  \
  |  |  ------------------
  |  |  |  Branch (272:12): [True: 227, False: 1.21k]
  |  |  ------------------
  |  |  273|  1.21k|        (dst)[ii] = 0;                      \
  |  |  274|  1.21k|}
  ------------------
  937|  1.21k|                 BN_NIST_384_TOP);
  938|       |
  939|  1.21k|#if defined(NIST_INT64)
  940|  1.21k|    {
  941|  1.21k|        NIST_INT64 acc;         /* accumulator */
  ------------------
  |  |  299|  1.21k|#   define NIST_INT64 long long
  ------------------
  942|  1.21k|        unsigned int *rp = (unsigned int *)r_d;
  943|  1.21k|        const unsigned int *bp = (const unsigned int *)buf.ui;
  944|       |
  945|  1.21k|        acc = load_u32(&rp[0]);
  946|  1.21k|        acc += bp[12 - 12];
  947|  1.21k|        acc += bp[21 - 12];
  948|  1.21k|        acc += bp[20 - 12];
  949|  1.21k|        acc -= bp[23 - 12];
  950|  1.21k|        store_lo32(&rp[0], acc);
  951|  1.21k|        acc >>= 32;
  952|       |
  953|  1.21k|        acc += load_u32(&rp[1]);
  954|  1.21k|        acc += bp[13 - 12];
  955|  1.21k|        acc += bp[22 - 12];
  956|  1.21k|        acc += bp[23 - 12];
  957|  1.21k|        acc -= bp[12 - 12];
  958|  1.21k|        acc -= bp[20 - 12];
  959|  1.21k|        store_lo32(&rp[1], acc);
  960|  1.21k|        acc >>= 32;
  961|       |
  962|  1.21k|        acc += load_u32(&rp[2]);
  963|  1.21k|        acc += bp[14 - 12];
  964|  1.21k|        acc += bp[23 - 12];
  965|  1.21k|        acc -= bp[13 - 12];
  966|  1.21k|        acc -= bp[21 - 12];
  967|  1.21k|        store_lo32(&rp[2], acc);
  968|  1.21k|        acc >>= 32;
  969|       |
  970|  1.21k|        acc += load_u32(&rp[3]);
  971|  1.21k|        acc += bp[15 - 12];
  972|  1.21k|        acc += bp[12 - 12];
  973|  1.21k|        acc += bp[20 - 12];
  974|  1.21k|        acc += bp[21 - 12];
  975|  1.21k|        acc -= bp[14 - 12];
  976|  1.21k|        acc -= bp[22 - 12];
  977|  1.21k|        acc -= bp[23 - 12];
  978|  1.21k|        store_lo32(&rp[3], acc);
  979|  1.21k|        acc >>= 32;
  980|       |
  981|  1.21k|        acc += load_u32(&rp[4]);
  982|  1.21k|        acc += bp[21 - 12];
  983|  1.21k|        acc += bp[21 - 12];
  984|  1.21k|        acc += bp[16 - 12];
  985|  1.21k|        acc += bp[13 - 12];
  986|  1.21k|        acc += bp[12 - 12];
  987|  1.21k|        acc += bp[20 - 12];
  988|  1.21k|        acc += bp[22 - 12];
  989|  1.21k|        acc -= bp[15 - 12];
  990|  1.21k|        acc -= bp[23 - 12];
  991|  1.21k|        acc -= bp[23 - 12];
  992|  1.21k|        store_lo32(&rp[4], acc);
  993|  1.21k|        acc >>= 32;
  994|       |
  995|  1.21k|        acc += load_u32(&rp[5]);
  996|  1.21k|        acc += bp[22 - 12];
  997|  1.21k|        acc += bp[22 - 12];
  998|  1.21k|        acc += bp[17 - 12];
  999|  1.21k|        acc += bp[14 - 12];
 1000|  1.21k|        acc += bp[13 - 12];
 1001|  1.21k|        acc += bp[21 - 12];
 1002|  1.21k|        acc += bp[23 - 12];
 1003|  1.21k|        acc -= bp[16 - 12];
 1004|  1.21k|        store_lo32(&rp[5], acc);
 1005|  1.21k|        acc >>= 32;
 1006|       |
 1007|  1.21k|        acc += load_u32(&rp[6]);
 1008|  1.21k|        acc += bp[23 - 12];
 1009|  1.21k|        acc += bp[23 - 12];
 1010|  1.21k|        acc += bp[18 - 12];
 1011|  1.21k|        acc += bp[15 - 12];
 1012|  1.21k|        acc += bp[14 - 12];
 1013|  1.21k|        acc += bp[22 - 12];
 1014|  1.21k|        acc -= bp[17 - 12];
 1015|  1.21k|        store_lo32(&rp[6], acc);
 1016|  1.21k|        acc >>= 32;
 1017|       |
 1018|  1.21k|        acc += load_u32(&rp[7]);
 1019|  1.21k|        acc += bp[19 - 12];
 1020|  1.21k|        acc += bp[16 - 12];
 1021|  1.21k|        acc += bp[15 - 12];
 1022|  1.21k|        acc += bp[23 - 12];
 1023|  1.21k|        acc -= bp[18 - 12];
 1024|  1.21k|        store_lo32(&rp[7], acc);
 1025|  1.21k|        acc >>= 32;
 1026|       |
 1027|  1.21k|        acc += load_u32(&rp[8]);
 1028|  1.21k|        acc += bp[20 - 12];
 1029|  1.21k|        acc += bp[17 - 12];
 1030|  1.21k|        acc += bp[16 - 12];
 1031|  1.21k|        acc -= bp[19 - 12];
 1032|  1.21k|        store_lo32(&rp[8], acc);
 1033|  1.21k|        acc >>= 32;
 1034|       |
 1035|  1.21k|        acc += load_u32(&rp[9]);
 1036|  1.21k|        acc += bp[21 - 12];
 1037|  1.21k|        acc += bp[18 - 12];
 1038|  1.21k|        acc += bp[17 - 12];
 1039|  1.21k|        acc -= bp[20 - 12];
 1040|  1.21k|        store_lo32(&rp[9], acc);
 1041|  1.21k|        acc >>= 32;
 1042|       |
 1043|  1.21k|        acc += load_u32(&rp[10]);
 1044|  1.21k|        acc += bp[22 - 12];
 1045|  1.21k|        acc += bp[19 - 12];
 1046|  1.21k|        acc += bp[18 - 12];
 1047|  1.21k|        acc -= bp[21 - 12];
 1048|  1.21k|        store_lo32(&rp[10], acc);
 1049|  1.21k|        acc >>= 32;
 1050|       |
 1051|  1.21k|        acc += load_u32(&rp[11]);
 1052|  1.21k|        acc += bp[23 - 12];
 1053|  1.21k|        acc += bp[20 - 12];
 1054|  1.21k|        acc += bp[19 - 12];
 1055|  1.21k|        acc -= bp[22 - 12];
 1056|  1.21k|        store_lo32(&rp[11], acc);
 1057|       |
 1058|  1.21k|        carry = (int)(acc >> 32);
 1059|  1.21k|    }
 1060|       |#else
 1061|       |    {
 1062|       |        BN_ULONG t_d[BN_NIST_384_TOP];
 1063|       |
 1064|       |        /*
 1065|       |         * S1
 1066|       |         */
 1067|       |        nist_set_256(t_d, buf.bn, 0, 0, 0, 0, 0, 23 - 4, 22 - 4, 21 - 4);
 1068|       |        /* left shift */
 1069|       |        {
 1070|       |            register BN_ULONG *ap, t, c;
 1071|       |            ap = t_d;
 1072|       |            c = 0;
 1073|       |            for (i = 3; i != 0; --i) {
 1074|       |                t = *ap;
 1075|       |                *(ap++) = ((t << 1) | c) & BN_MASK2;
 1076|       |                c = (t & BN_TBIT) ? 1 : 0;
 1077|       |            }
 1078|       |            *ap = c;
 1079|       |        }
 1080|       |        carry =
 1081|       |            (int)bn_add_words(r_d + (128 / BN_BITS2), r_d + (128 / BN_BITS2),
 1082|       |                              t_d, BN_NIST_256_TOP);
 1083|       |        /*
 1084|       |         * S2
 1085|       |         */
 1086|       |        carry += (int)bn_add_words(r_d, r_d, buf.bn, BN_NIST_384_TOP);
 1087|       |        /*
 1088|       |         * S3
 1089|       |         */
 1090|       |        nist_set_384(t_d, buf.bn, 20, 19, 18, 17, 16, 15, 14, 13, 12, 23, 22,
 1091|       |                     21);
 1092|       |        carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1093|       |        /*
 1094|       |         * S4
 1095|       |         */
 1096|       |        nist_set_384(t_d, buf.bn, 19, 18, 17, 16, 15, 14, 13, 12, 20, 0, 23,
 1097|       |                     0);
 1098|       |        carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1099|       |        /*
 1100|       |         * S5
 1101|       |         */
 1102|       |        nist_set_384(t_d, buf.bn, 0, 0, 0, 0, 23, 22, 21, 20, 0, 0, 0, 0);
 1103|       |        carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1104|       |        /*
 1105|       |         * S6
 1106|       |         */
 1107|       |        nist_set_384(t_d, buf.bn, 0, 0, 0, 0, 0, 0, 23, 22, 21, 0, 0, 20);
 1108|       |        carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1109|       |        /*
 1110|       |         * D1
 1111|       |         */
 1112|       |        nist_set_384(t_d, buf.bn, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12,
 1113|       |                     23);
 1114|       |        carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1115|       |        /*
 1116|       |         * D2
 1117|       |         */
 1118|       |        nist_set_384(t_d, buf.bn, 0, 0, 0, 0, 0, 0, 0, 23, 22, 21, 20, 0);
 1119|       |        carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1120|       |        /*
 1121|       |         * D3
 1122|       |         */
 1123|       |        nist_set_384(t_d, buf.bn, 0, 0, 0, 0, 0, 0, 0, 23, 23, 0, 0, 0);
 1124|       |        carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1125|       |
 1126|       |    }
 1127|       |#endif
 1128|       |    /* see BN_nist_mod_224 for explanation */
 1129|  1.21k|    adjust = bn_sub_words;
 1130|  1.21k|    if (carry > 0)
  ------------------
  |  Branch (1130:9): [True: 574, False: 643]
  ------------------
 1131|    574|        carry =
 1132|    574|            (int)bn_sub_words(r_d, r_d, _nist_p_384[carry - 1],
 1133|    574|                              BN_NIST_384_TOP);
  ------------------
  |  |   16|    574|#define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    574|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    574|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    574|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    574|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1134|    643|    else if (carry < 0) {
  ------------------
  |  Branch (1134:14): [True: 228, False: 415]
  ------------------
 1135|    228|        carry =
 1136|    228|            (int)bn_add_words(r_d, r_d, _nist_p_384[-carry - 1],
 1137|    228|                              BN_NIST_384_TOP);
  ------------------
  |  |   16|    228|#define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    228|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    228|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    228|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    228|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1138|    228|        adjust = carry ? bn_sub_words : bn_add_words;
  ------------------
  |  Branch (1138:18): [True: 228, False: 0]
  ------------------
 1139|    228|    } else
 1140|    415|        carry = 1;
 1141|       |
 1142|  1.21k|    res = ((*adjust) (c_d, r_d, _nist_p_384[0], BN_NIST_384_TOP) && carry)
  ------------------
  |  |   16|  1.21k|#define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  1.21k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  1.21k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  1.21k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  1.21k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1142:12): [True: 1.21k, False: 6]
  |  Branch (1142:69): [True: 1.20k, False: 3]
  ------------------
 1143|  1.21k|        ? r_d
 1144|  1.21k|        : c_d;
 1145|  1.21k|    nist_cp_bn(r_d, res, BN_NIST_384_TOP);
  ------------------
  |  |   16|  1.21k|#define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  1.21k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  1.21k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  1.21k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  1.21k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1146|  1.21k|    r->top = BN_NIST_384_TOP;
  ------------------
  |  |   16|  1.21k|#define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  1.21k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  1.21k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  1.21k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  1.21k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1147|  1.21k|    bn_correct_top(r);
 1148|       |
 1149|  1.21k|    return 1;
 1150|  1.21k|}
BN_nist_mod_521:
 1158|    394|{
 1159|    394|    int top = a->top, i;
 1160|    394|    BN_ULONG *r_d, *a_d = a->d, t_d[BN_NIST_521_TOP], val, tmp, *res;
  ------------------
  |  |   37|    394|#  define BN_ULONG        unsigned long
  ------------------
 1161|    394|    static const BIGNUM ossl_bignum_nist_p_521_sqr = {
 1162|    394|        (BN_ULONG *)_nist_p_521_sqr,
 1163|    394|        OSSL_NELEM(_nist_p_521_sqr),
  ------------------
  |  |   14|    394|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
 1164|    394|        OSSL_NELEM(_nist_p_521_sqr),
  ------------------
  |  |   14|    394|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
 1165|    394|        0, BN_FLG_STATIC_DATA
  ------------------
  |  |   59|    394|# define BN_FLG_STATIC_DATA      0x02
  ------------------
 1166|    394|    };
 1167|       |
 1168|    394|    field = &ossl_bignum_nist_p_521; /* just to make sure */
 1169|       |
 1170|    394|    if (BN_is_negative(a) || BN_ucmp(a, &ossl_bignum_nist_p_521_sqr) >= 0)
  ------------------
  |  Branch (1170:9): [True: 0, False: 394]
  |  Branch (1170:30): [True: 0, False: 394]
  ------------------
 1171|      0|        return BN_nnmod(r, a, field, ctx);
 1172|       |
 1173|    394|    i = BN_ucmp(field, a);
 1174|    394|    if (i == 0) {
  ------------------
  |  Branch (1174:9): [True: 0, False: 394]
  ------------------
 1175|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
 1176|      0|        return 1;
 1177|    394|    } else if (i > 0)
  ------------------
  |  Branch (1177:16): [True: 21, False: 373]
  ------------------
 1178|     21|        return (r == a) ? 1 : (BN_copy(r, a) != NULL);
  ------------------
  |  Branch (1178:16): [True: 21, False: 0]
  ------------------
 1179|       |
 1180|    373|    if (r != a) {
  ------------------
  |  Branch (1180:9): [True: 0, False: 373]
  ------------------
 1181|      0|        if (!bn_wexpand(r, BN_NIST_521_TOP))
  ------------------
  |  |   17|      0|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1181:13): [True: 0, False: 0]
  ------------------
 1182|      0|            return 0;
 1183|      0|        r_d = r->d;
 1184|      0|        nist_cp_bn(r_d, a_d, BN_NIST_521_TOP);
  ------------------
  |  |   17|      0|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1185|      0|    } else
 1186|    373|        r_d = a_d;
 1187|       |
 1188|       |    /* upper 521 bits, copy ... */
 1189|    373|    nist_cp_bn_0(t_d, a_d + (BN_NIST_521_TOP - 1),
  ------------------
  |  |  265|    373|#define nist_cp_bn_0(dst, src_in, top, max) \
  |  |  266|    373|{                                           \
  |  |  267|    373|    int ii;                                 \
  |  |  268|    373|    const BN_ULONG *src = src_in;           \
  |  |  269|    373|                                            \
  |  |  270|  3.57k|    for (ii = 0; ii < top; ii++)            \
  |  |  ------------------
  |  |  |  Branch (270:18): [True: 3.20k, False: 373]
  |  |  ------------------
  |  |  271|  3.20k|        (dst)[ii] = src[ii];                \
  |  |  272|    527|    for (; ii < max; ii++)                  \
  |  |  ------------------
  |  |  |  Branch (272:12): [True: 154, False: 373]
  |  |  ------------------
  |  |  273|    373|        (dst)[ii] = 0;                      \
  |  |  274|    373|}
  ------------------
 1190|    373|                 top - (BN_NIST_521_TOP - 1), BN_NIST_521_TOP);
 1191|       |    /* ... and right shift */
 1192|  3.35k|    for (val = t_d[0], i = 0; i < BN_NIST_521_TOP - 1; i++) {
  ------------------
  |  |   17|  3.35k|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.35k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.35k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.35k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.35k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1192:31): [True: 2.98k, False: 373]
  ------------------
 1193|       |#if 0
 1194|       |        /*
 1195|       |         * MSC ARM compiler [version 2013, presumably even earlier,
 1196|       |         * much earlier] miscompiles this code, but not one in
 1197|       |         * #else section. See RT#3541.
 1198|       |         */
 1199|       |        tmp = val >> BN_NIST_521_RSHIFT;
 1200|       |        val = t_d[i + 1];
 1201|       |        t_d[i] = (tmp | val << BN_NIST_521_LSHIFT) & BN_MASK2;
 1202|       |#else
 1203|  2.98k|        t_d[i] = (val >> BN_NIST_521_RSHIFT |
  ------------------
  |  | 1152|  2.98k|#define BN_NIST_521_RSHIFT      (521%BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|  2.98k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.98k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1204|  2.98k|                  (tmp = t_d[i + 1]) << BN_NIST_521_LSHIFT) & BN_MASK2;
  ------------------
  |  | 1153|  2.98k|#define BN_NIST_521_LSHIFT      (BN_BITS2-BN_NIST_521_RSHIFT)
  |  |  ------------------
  |  |  |  |   54|  2.98k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.98k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_LSHIFT      (BN_BITS2-BN_NIST_521_RSHIFT)
  |  |  ------------------
  |  |  |  | 1152|  2.98k|#define BN_NIST_521_RSHIFT      (521%BN_BITS2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|  2.98k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   38|  2.98k|#  define BN_BYTES        8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                (tmp = t_d[i + 1]) << BN_NIST_521_LSHIFT) & BN_MASK2;
  ------------------
  |  |   94|  2.98k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
 1205|  2.98k|        val = tmp;
 1206|  2.98k|#endif
 1207|  2.98k|    }
 1208|    373|    t_d[i] = val >> BN_NIST_521_RSHIFT;
  ------------------
  |  | 1152|    373|#define BN_NIST_521_RSHIFT      (521%BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|    373|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    373|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1209|       |    /* lower 521 bits */
 1210|    373|    r_d[i] &= BN_NIST_521_TOP_MASK;
  ------------------
  |  | 1154|    373|#define BN_NIST_521_TOP_MASK    ((BN_ULONG)BN_MASK2>>BN_NIST_521_LSHIFT)
  |  |  ------------------
  |  |  |  |   94|    373|#  define BN_MASK2        (0xffffffffffffffffL)
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP_MASK    ((BN_ULONG)BN_MASK2>>BN_NIST_521_LSHIFT)
  |  |  ------------------
  |  |  |  | 1153|    373|#define BN_NIST_521_LSHIFT      (BN_BITS2-BN_NIST_521_RSHIFT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|    373|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   38|    373|#  define BN_BYTES        8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define BN_NIST_521_LSHIFT      (BN_BITS2-BN_NIST_521_RSHIFT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1152|    373|#define BN_NIST_521_RSHIFT      (521%BN_BITS2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   54|    373|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   38|    373|#  define BN_BYTES        8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1211|       |
 1212|    373|    bn_add_words(r_d, r_d, t_d, BN_NIST_521_TOP);
  ------------------
  |  |   17|    373|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    373|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    373|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    373|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    373|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1213|    373|    res = bn_sub_words(t_d, r_d, _nist_p_521,
  ------------------
  |  Branch (1213:11): [True: 349, False: 24]
  ------------------
 1214|    373|                       BN_NIST_521_TOP)
  ------------------
  |  |   17|    373|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    373|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    373|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    373|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    373|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1215|    373|        ? r_d
 1216|    373|        : t_d;
 1217|    373|    nist_cp_bn(r_d, res, BN_NIST_521_TOP);
  ------------------
  |  |   17|    373|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    373|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    373|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    373|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    373|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1218|    373|    r->top = BN_NIST_521_TOP;
  ------------------
  |  |   17|    373|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    373|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    373|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    373|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    373|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1219|    373|    bn_correct_top(r);
 1220|       |
 1221|    373|    return 1;
 1222|    373|}
bn_nist.c:nist_cp_bn:
  277|  4.07k|{
  278|  4.07k|    int i;
  279|       |
  280|  24.6k|    for (i = 0; i < top; i++)
  ------------------
  |  Branch (280:17): [True: 20.5k, False: 4.07k]
  ------------------
  281|  20.5k|        dst[i] = src[i];
  282|  4.07k|}
bn_nist.c:load_u32:
  326|  14.6k|{
  327|  14.6k|    uint32_t tmp;
  328|       |
  329|  14.6k|    memcpy(&tmp, ptr, sizeof(tmp));
  330|  14.6k|    return tmp;
  331|  14.6k|}
bn_nist.c:store_lo32:
  334|  14.6k|{
  335|       |    /* A cast is needed for big-endian system: on a 32-bit BE system
  336|       |     * NIST_INT64 may be defined as well if the compiler supports 64-bit
  337|       |     * long long.  */
  338|  14.6k|    uint32_t tmp = (uint32_t)val;
  339|       |
  340|  14.6k|    memcpy(ptr, &tmp, sizeof(tmp));
  341|  14.6k|}

BN_print:
   32|  20.3k|{
   33|  20.3k|    int i, j, v, z = 0;
   34|  20.3k|    int ret = 0;
   35|       |
   36|  20.3k|    if ((a->neg) && BIO_write(bp, "-", 1) != 1)
  ------------------
  |  Branch (36:9): [True: 0, False: 20.3k]
  |  Branch (36:21): [True: 0, False: 0]
  ------------------
   37|      0|        goto end;
   38|  20.3k|    if (BN_is_zero(a) && BIO_write(bp, "0", 1) != 1)
  ------------------
  |  Branch (38:9): [True: 8.98k, False: 11.3k]
  |  Branch (38:26): [True: 0, False: 8.98k]
  ------------------
   39|      0|        goto end;
   40|  72.5k|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (40:26): [True: 52.1k, False: 20.3k]
  ------------------
   41|   886k|        for (j = BN_BITS2 - 4; j >= 0; j -= 4) {
  ------------------
  |  |   54|  52.1k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  52.1k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (41:32): [True: 834k, False: 52.1k]
  ------------------
   42|       |            /* strip leading zeros */
   43|   834k|            v = (int)((a->d[i] >> j) & 0x0f);
   44|   834k|            if (z || v != 0) {
  ------------------
  |  Branch (44:17): [True: 694k, False: 140k]
  |  Branch (44:22): [True: 11.3k, False: 128k]
  ------------------
   45|   705k|                if (BIO_write(bp, &Hex[v], 1) != 1)
  ------------------
  |  Branch (45:21): [True: 0, False: 705k]
  ------------------
   46|      0|                    goto end;
   47|   705k|                z = 1;
   48|   705k|            }
   49|   834k|        }
   50|  52.1k|    }
   51|  20.3k|    ret = 1;
   52|  20.3k| end:
   53|  20.3k|    return ret;
   54|  20.3k|}

BN_priv_rand_ex:
  119|  57.4k|{
  120|  57.4k|    return bnrand(PRIVATE, rnd, bits, top, bottom, strength, ctx);
  121|  57.4k|}
BN_priv_rand_range_ex:
  218|  1.30k|{
  219|  1.30k|    return bnrand_range(PRIVATE, r, range, strength, ctx);
  220|  1.30k|}
bn_rand.c:bnrand:
   25|  58.7k|{
   26|  58.7k|    unsigned char *buf = NULL;
   27|  58.7k|    int b, ret = 0, bit, bytes, mask;
   28|  58.7k|    OSSL_LIB_CTX *libctx = ossl_bn_get_libctx(ctx);
   29|       |
   30|  58.7k|    if (bits == 0) {
  ------------------
  |  Branch (30:9): [True: 0, False: 58.7k]
  ------------------
   31|      0|        if (top != BN_RAND_TOP_ANY || bottom != BN_RAND_BOTTOM_ANY)
  ------------------
  |  |   80|      0|#define BN_RAND_TOP_ANY    -1
  ------------------
                      if (top != BN_RAND_TOP_ANY || bottom != BN_RAND_BOTTOM_ANY)
  ------------------
  |  |   85|      0|#define BN_RAND_BOTTOM_ANY  0
  ------------------
  |  Branch (31:13): [True: 0, False: 0]
  |  Branch (31:39): [True: 0, False: 0]
  ------------------
   32|      0|            goto toosmall;
   33|      0|        BN_zero(rnd);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
   34|      0|        return 1;
   35|      0|    }
   36|  58.7k|    if (bits < 0 || (bits == 1 && top > 0))
  ------------------
  |  Branch (36:9): [True: 0, False: 58.7k]
  |  Branch (36:22): [True: 0, False: 58.7k]
  |  Branch (36:35): [True: 0, False: 0]
  ------------------
   37|      0|        goto toosmall;
   38|       |
   39|  58.7k|    bytes = (bits + 7) / 8;
   40|  58.7k|    bit = (bits - 1) % 8;
   41|  58.7k|    mask = 0xff << (bit + 1);
   42|       |
   43|  58.7k|    buf = OPENSSL_malloc(bytes);
  ------------------
  |  |  102|  58.7k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  58.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  58.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|  58.7k|    if (buf == NULL)
  ------------------
  |  Branch (44:9): [True: 0, False: 58.7k]
  ------------------
   45|      0|        goto err;
   46|       |
   47|       |    /* make a random number and set the top and bottom bits */
   48|  58.7k|    b = flag == NORMAL ? RAND_bytes_ex(libctx, buf, bytes, strength)
  ------------------
  |  Branch (48:9): [True: 0, False: 58.7k]
  ------------------
   49|  58.7k|                       : RAND_priv_bytes_ex(libctx, buf, bytes, strength);
   50|  58.7k|    if (b <= 0)
  ------------------
  |  Branch (50:9): [True: 0, False: 58.7k]
  ------------------
   51|      0|        goto err;
   52|       |
   53|  58.7k|    if (flag == TESTING) {
  ------------------
  |  Branch (53:9): [True: 0, False: 58.7k]
  ------------------
   54|       |        /*
   55|       |         * generate patterns that are more likely to trigger BN library bugs
   56|       |         */
   57|      0|        int i;
   58|      0|        unsigned char c;
   59|       |
   60|      0|        for (i = 0; i < bytes; i++) {
  ------------------
  |  Branch (60:21): [True: 0, False: 0]
  ------------------
   61|      0|            if (RAND_bytes_ex(libctx, &c, 1, strength) <= 0)
  ------------------
  |  Branch (61:17): [True: 0, False: 0]
  ------------------
   62|      0|                goto err;
   63|      0|            if (c >= 128 && i > 0)
  ------------------
  |  Branch (63:17): [True: 0, False: 0]
  |  Branch (63:29): [True: 0, False: 0]
  ------------------
   64|      0|                buf[i] = buf[i - 1];
   65|      0|            else if (c < 42)
  ------------------
  |  Branch (65:22): [True: 0, False: 0]
  ------------------
   66|      0|                buf[i] = 0;
   67|      0|            else if (c < 84)
  ------------------
  |  Branch (67:22): [True: 0, False: 0]
  ------------------
   68|      0|                buf[i] = 255;
   69|      0|        }
   70|      0|    }
   71|       |
   72|  58.7k|    if (top >= 0) {
  ------------------
  |  Branch (72:9): [True: 42.2k, False: 16.4k]
  ------------------
   73|  42.2k|        if (top) {
  ------------------
  |  Branch (73:13): [True: 0, False: 42.2k]
  ------------------
   74|      0|            if (bit == 0) {
  ------------------
  |  Branch (74:17): [True: 0, False: 0]
  ------------------
   75|      0|                buf[0] = 1;
   76|      0|                buf[1] |= 0x80;
   77|      0|            } else {
   78|      0|                buf[0] |= (3 << (bit - 1));
   79|      0|            }
   80|  42.2k|        } else {
   81|  42.2k|            buf[0] |= (1 << bit);
   82|  42.2k|        }
   83|  42.2k|    }
   84|  58.7k|    buf[0] &= ~mask;
   85|  58.7k|    if (bottom)                 /* set bottom bit if requested */
  ------------------
  |  Branch (85:9): [True: 0, False: 58.7k]
  ------------------
   86|      0|        buf[bytes - 1] |= 1;
   87|  58.7k|    if (!BN_bin2bn(buf, bytes, rnd))
  ------------------
  |  Branch (87:9): [True: 0, False: 58.7k]
  ------------------
   88|      0|        goto err;
   89|  58.7k|    ret = 1;
   90|  58.7k| err:
   91|  58.7k|    OPENSSL_clear_free(buf, bytes);
  ------------------
  |  |  113|  58.7k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  58.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  58.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|  58.7k|    bn_check_top(rnd);
   93|  58.7k|    return ret;
   94|       |
   95|      0|toosmall:
   96|      0|    ERR_raise(ERR_LIB_BN, BN_R_BITS_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   97|      0|    return 0;
   98|  58.7k|}
bn_rand.c:bnrand_range:
  133|  1.30k|{
  134|  1.30k|    int n;
  135|  1.30k|    int count = 100;
  136|       |
  137|  1.30k|    if (r == NULL) {
  ------------------
  |  Branch (137:9): [True: 0, False: 1.30k]
  ------------------
  138|      0|        ERR_raise(ERR_LIB_BN, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  139|      0|        return 0;
  140|      0|    }
  141|       |
  142|  1.30k|    if (range->neg || BN_is_zero(range)) {
  ------------------
  |  Branch (142:9): [True: 0, False: 1.30k]
  |  Branch (142:23): [True: 0, False: 1.30k]
  ------------------
  143|      0|        ERR_raise(ERR_LIB_BN, BN_R_INVALID_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  144|      0|        return 0;
  145|      0|    }
  146|       |
  147|  1.30k|    n = BN_num_bits(range);     /* n > 0 */
  148|       |
  149|       |    /* BN_is_bit_set(range, n - 1) always holds */
  150|       |
  151|  1.30k|    if (n == 1)
  ------------------
  |  Branch (151:9): [True: 0, False: 1.30k]
  ------------------
  152|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  153|  1.30k|    else if (!BN_is_bit_set(range, n - 2) && !BN_is_bit_set(range, n - 3)) {
  ------------------
  |  Branch (153:14): [True: 323, False: 980]
  |  Branch (153:46): [True: 162, False: 161]
  ------------------
  154|       |        /*
  155|       |         * range = 100..._2, so 3*range (= 11..._2) is exactly one bit longer
  156|       |         * than range
  157|       |         */
  158|    162|        do {
  159|    162|            if (!bnrand(flag, r, n + 1, BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   80|    162|#define BN_RAND_TOP_ANY    -1
  ------------------
                          if (!bnrand(flag, r, n + 1, BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   85|    162|#define BN_RAND_BOTTOM_ANY  0
  ------------------
  |  Branch (159:17): [True: 0, False: 162]
  ------------------
  160|    162|                        strength, ctx))
  161|      0|                return 0;
  162|       |
  163|       |            /*
  164|       |             * If r < 3*range, use r := r MOD range (which is either r, r -
  165|       |             * range, or r - 2*range). Otherwise, iterate once more. Since
  166|       |             * 3*range = 11..._2, each iteration succeeds with probability >=
  167|       |             * .75.
  168|       |             */
  169|    162|            if (BN_cmp(r, range) >= 0) {
  ------------------
  |  Branch (169:17): [True: 162, False: 0]
  ------------------
  170|    162|                if (!BN_sub(r, r, range))
  ------------------
  |  Branch (170:21): [True: 0, False: 162]
  ------------------
  171|      0|                    return 0;
  172|    162|                if (BN_cmp(r, range) >= 0)
  ------------------
  |  Branch (172:21): [True: 75, False: 87]
  ------------------
  173|     75|                    if (!BN_sub(r, r, range))
  ------------------
  |  Branch (173:25): [True: 0, False: 75]
  ------------------
  174|      0|                        return 0;
  175|    162|            }
  176|       |
  177|    162|            if (!--count) {
  ------------------
  |  Branch (177:17): [True: 0, False: 162]
  ------------------
  178|      0|                ERR_raise(ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  179|      0|                return 0;
  180|      0|            }
  181|       |
  182|    162|        }
  183|    162|        while (BN_cmp(r, range) >= 0);
  ------------------
  |  Branch (183:16): [True: 0, False: 162]
  ------------------
  184|  1.14k|    } else {
  185|  1.14k|        do {
  186|       |            /* range = 11..._2  or  range = 101..._2 */
  187|  1.14k|            if (!bnrand(flag, r, n, BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   80|  1.14k|#define BN_RAND_TOP_ANY    -1
  ------------------
                          if (!bnrand(flag, r, n, BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   85|  1.14k|#define BN_RAND_BOTTOM_ANY  0
  ------------------
  |  Branch (187:17): [True: 0, False: 1.14k]
  ------------------
  188|  1.14k|                        strength, ctx))
  189|      0|                return 0;
  190|       |
  191|  1.14k|            if (!--count) {
  ------------------
  |  Branch (191:17): [True: 0, False: 1.14k]
  ------------------
  192|      0|                ERR_raise(ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  193|      0|                return 0;
  194|      0|            }
  195|  1.14k|        }
  196|  1.14k|        while (BN_cmp(r, range) >= 0);
  ------------------
  |  Branch (196:16): [True: 0, False: 1.14k]
  ------------------
  197|  1.14k|    }
  198|       |
  199|  1.30k|    bn_check_top(r);
  200|  1.30k|    return 1;
  201|  1.30k|}

BN_lshift1:
   15|   505k|{
   16|   505k|    register BN_ULONG *ap, *rp, t, c;
   17|   505k|    int i;
   18|       |
   19|   505k|    bn_check_top(r);
   20|   505k|    bn_check_top(a);
   21|       |
   22|   505k|    if (r != a) {
  ------------------
  |  Branch (22:9): [True: 98.3k, False: 406k]
  ------------------
   23|  98.3k|        r->neg = a->neg;
   24|  98.3k|        if (bn_wexpand(r, a->top + 1) == NULL)
  ------------------
  |  Branch (24:13): [True: 0, False: 98.3k]
  ------------------
   25|      0|            return 0;
   26|  98.3k|        r->top = a->top;
   27|   406k|    } else {
   28|   406k|        if (bn_wexpand(r, a->top + 1) == NULL)
  ------------------
  |  Branch (28:13): [True: 0, False: 406k]
  ------------------
   29|      0|            return 0;
   30|   406k|    }
   31|   505k|    ap = a->d;
   32|   505k|    rp = r->d;
   33|   505k|    c = 0;
   34|  2.40M|    for (i = 0; i < a->top; i++) {
  ------------------
  |  Branch (34:17): [True: 1.89M, False: 505k]
  ------------------
   35|  1.89M|        t = *(ap++);
   36|  1.89M|        *(rp++) = ((t << 1) | c) & BN_MASK2;
  ------------------
  |  |   94|  1.89M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   37|  1.89M|        c = t >> (BN_BITS2 - 1);
  ------------------
  |  |   54|  1.89M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.89M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
   38|  1.89M|    }
   39|   505k|    *rp = c;
   40|   505k|    r->top += c;
   41|   505k|    bn_check_top(r);
   42|   505k|    return 1;
   43|   505k|}
BN_rshift1:
   46|  1.88M|{
   47|  1.88M|    BN_ULONG *ap, *rp, t, c;
  ------------------
  |  |   37|  1.88M|#  define BN_ULONG        unsigned long
  ------------------
   48|  1.88M|    int i;
   49|       |
   50|  1.88M|    bn_check_top(r);
   51|  1.88M|    bn_check_top(a);
   52|       |
   53|  1.88M|    if (BN_is_zero(a)) {
  ------------------
  |  Branch (53:9): [True: 0, False: 1.88M]
  ------------------
   54|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
   55|      0|        return 1;
   56|      0|    }
   57|  1.88M|    i = a->top;
   58|  1.88M|    ap = a->d;
   59|  1.88M|    if (a != r) {
  ------------------
  |  Branch (59:9): [True: 5.32k, False: 1.87M]
  ------------------
   60|  5.32k|        if (bn_wexpand(r, i) == NULL)
  ------------------
  |  Branch (60:13): [True: 0, False: 5.32k]
  ------------------
   61|      0|            return 0;
   62|  5.32k|        r->neg = a->neg;
   63|  5.32k|    }
   64|  1.88M|    rp = r->d;
   65|  1.88M|    r->top = i;
   66|  1.88M|    t = ap[--i];
   67|  1.88M|    rp[i] = t >> 1;
   68|  1.88M|    c = t << (BN_BITS2 - 1);
  ------------------
  |  |   54|  1.88M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.88M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
   69|  1.88M|    r->top -= (t == 1);
   70|  3.36M|    while (i > 0) {
  ------------------
  |  Branch (70:12): [True: 1.47M, False: 1.88M]
  ------------------
   71|  1.47M|        t = ap[--i];
   72|  1.47M|        rp[i] = ((t >> 1) & BN_MASK2) | c;
  ------------------
  |  |   94|  1.47M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   73|  1.47M|        c = t << (BN_BITS2 - 1);
  ------------------
  |  |   54|  1.47M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.47M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
   74|  1.47M|    }
   75|  1.88M|    if (!r->top)
  ------------------
  |  Branch (75:9): [True: 5, False: 1.88M]
  ------------------
   76|      5|        r->neg = 0; /* don't allow negative zero */
   77|  1.88M|    bn_check_top(r);
   78|  1.88M|    return 1;
   79|  1.88M|}
BN_lshift:
   82|   301k|{
   83|   301k|    int ret;
   84|       |
   85|   301k|    if (n < 0) {
  ------------------
  |  Branch (85:9): [True: 0, False: 301k]
  ------------------
   86|      0|        ERR_raise(ERR_LIB_BN, BN_R_INVALID_SHIFT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   87|      0|        return 0;
   88|      0|    }
   89|       |
   90|   301k|    ret = bn_lshift_fixed_top(r, a, n);
   91|       |
   92|   301k|    bn_correct_top(r);
   93|   301k|    bn_check_top(r);
   94|       |
   95|   301k|    return ret;
   96|   301k|}
bn_lshift_fixed_top:
  105|  1.47M|{
  106|  1.47M|    int i, nw;
  107|  1.47M|    unsigned int lb, rb;
  108|  1.47M|    BN_ULONG *t, *f;
  ------------------
  |  |   37|  1.47M|#  define BN_ULONG        unsigned long
  ------------------
  109|  1.47M|    BN_ULONG l, m, rmask = 0;
  ------------------
  |  |   37|  1.47M|#  define BN_ULONG        unsigned long
  ------------------
  110|       |
  111|  1.47M|    assert(n >= 0);
  112|       |
  113|  1.47M|    bn_check_top(r);
  114|  1.47M|    bn_check_top(a);
  115|       |
  116|  1.47M|    nw = n / BN_BITS2;
  ------------------
  |  |   54|  1.47M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.47M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  117|  1.47M|    if (bn_wexpand(r, a->top + nw + 1) == NULL)
  ------------------
  |  Branch (117:9): [True: 0, False: 1.47M]
  ------------------
  118|      0|        return 0;
  119|       |
  120|  1.47M|    if (a->top != 0) {
  ------------------
  |  Branch (120:9): [True: 1.46M, False: 7.81k]
  ------------------
  121|  1.46M|        lb = (unsigned int)n % BN_BITS2;
  ------------------
  |  |   54|  1.46M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.46M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  122|  1.46M|        rb = BN_BITS2 - lb;
  ------------------
  |  |   54|  1.46M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.46M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  123|  1.46M|        rb %= BN_BITS2;            /* say no to undefined behaviour */
  ------------------
  |  |   54|  1.46M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.46M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  124|  1.46M|        rmask = (BN_ULONG)0 - rb;  /* rmask = 0 - (rb != 0) */
  125|  1.46M|        rmask |= rmask >> 8;
  126|  1.46M|        f = &(a->d[0]);
  127|  1.46M|        t = &(r->d[nw]);
  128|  1.46M|        l = f[a->top - 1];
  129|  1.46M|        t[a->top] = (l >> rb) & rmask;
  130|  8.17M|        for (i = a->top - 1; i > 0; i--) {
  ------------------
  |  Branch (130:30): [True: 6.71M, False: 1.46M]
  ------------------
  131|  6.71M|            m = l << lb;
  132|  6.71M|            l = f[i - 1];
  133|  6.71M|            t[i] = (m | ((l >> rb) & rmask)) & BN_MASK2;
  ------------------
  |  |   94|  6.71M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  134|  6.71M|        }
  135|  1.46M|        t[0] = (l << lb) & BN_MASK2;
  ------------------
  |  |   94|  1.46M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  136|  1.46M|    } else {
  137|       |        /* shouldn't happen, but formally required */
  138|  7.81k|        r->d[nw] = 0;
  139|  7.81k|    }
  140|  1.47M|    if (nw != 0)
  ------------------
  |  Branch (140:9): [True: 31.6k, False: 1.44M]
  ------------------
  141|  31.6k|        memset(r->d, 0, sizeof(*t) * nw);
  142|       |
  143|  1.47M|    r->neg = a->neg;
  144|  1.47M|    r->top = a->top + nw + 1;
  145|  1.47M|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  1.47M|#  define BN_FLG_FIXED_TOP 0
  ------------------
  146|       |
  147|  1.47M|    return 1;
  148|  1.47M|}
BN_rshift:
  151|  1.97M|{
  152|  1.97M|    int ret = 0;
  153|       |
  154|  1.97M|    if (n < 0) {
  ------------------
  |  Branch (154:9): [True: 0, False: 1.97M]
  ------------------
  155|      0|        ERR_raise(ERR_LIB_BN, BN_R_INVALID_SHIFT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  156|      0|        return 0;
  157|      0|    }
  158|       |
  159|  1.97M|    bn_check_top(r);
  160|  1.97M|    bn_check_top(a);
  161|       |
  162|  1.97M|    ret = bn_rshift_fixed_top(r, a, n);
  163|       |
  164|  1.97M|    bn_correct_top(r);
  165|  1.97M|    bn_check_top(r);
  166|       |
  167|  1.97M|    return ret;
  168|  1.97M|}
bn_rshift_fixed_top:
  177|  3.10M|{
  178|  3.10M|    int i, top, nw;
  179|  3.10M|    unsigned int lb, rb;
  180|  3.10M|    BN_ULONG *t, *f;
  ------------------
  |  |   37|  3.10M|#  define BN_ULONG        unsigned long
  ------------------
  181|  3.10M|    BN_ULONG l, m, mask;
  ------------------
  |  |   37|  3.10M|#  define BN_ULONG        unsigned long
  ------------------
  182|       |
  183|  3.10M|    assert(n >= 0);
  184|       |
  185|  3.10M|    nw = n / BN_BITS2;
  ------------------
  |  |   54|  3.10M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.10M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  186|  3.10M|    if (nw >= a->top) {
  ------------------
  |  Branch (186:9): [True: 0, False: 3.10M]
  ------------------
  187|       |        /* shouldn't happen, but formally required */
  188|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  189|      0|        return 1;
  190|      0|    }
  191|       |
  192|  3.10M|    rb = (unsigned int)n % BN_BITS2;
  ------------------
  |  |   54|  3.10M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.10M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  193|  3.10M|    lb = BN_BITS2 - rb;
  ------------------
  |  |   54|  3.10M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.10M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  194|  3.10M|    lb %= BN_BITS2;            /* say no to undefined behaviour */
  ------------------
  |  |   54|  3.10M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.10M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  195|  3.10M|    mask = (BN_ULONG)0 - lb;   /* mask = 0 - (lb != 0) */
  196|  3.10M|    mask |= mask >> 8;
  197|  3.10M|    top = a->top - nw;
  198|  3.10M|    if (r != a && bn_wexpand(r, top) == NULL)
  ------------------
  |  Branch (198:9): [True: 1.13M, False: 1.97M]
  |  Branch (198:19): [True: 0, False: 1.13M]
  ------------------
  199|      0|        return 0;
  200|       |
  201|  3.10M|    t = &(r->d[0]);
  202|  3.10M|    f = &(a->d[nw]);
  203|  3.10M|    l = f[0];
  204|  6.25M|    for (i = 0; i < top - 1; i++) {
  ------------------
  |  Branch (204:17): [True: 3.14M, False: 3.10M]
  ------------------
  205|  3.14M|        m = f[i + 1];
  206|  3.14M|        t[i] = (l >> rb) | ((m << lb) & mask);
  207|  3.14M|        l = m;
  208|  3.14M|    }
  209|  3.10M|    t[i] = l >> rb;
  210|       |
  211|  3.10M|    r->neg = a->neg;
  212|  3.10M|    r->top = top;
  213|  3.10M|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  3.10M|#  define BN_FLG_FIXED_TOP 0
  ------------------
  214|       |
  215|  3.10M|    return 1;
  216|  3.10M|}

BN_sqr:
   18|   825k|{
   19|   825k|    int ret = bn_sqr_fixed_top(r, a, ctx);
   20|       |
   21|   825k|    bn_correct_top(r);
   22|   825k|    bn_check_top(r);
   23|       |
   24|   825k|    return ret;
   25|   825k|}
bn_sqr_fixed_top:
   28|   837k|{
   29|   837k|    int max, al;
   30|   837k|    int ret = 0;
   31|   837k|    BIGNUM *tmp, *rr;
   32|       |
   33|   837k|    bn_check_top(a);
   34|       |
   35|   837k|    al = a->top;
   36|   837k|    if (al <= 0) {
  ------------------
  |  Branch (36:9): [True: 8.60k, False: 829k]
  ------------------
   37|  8.60k|        r->top = 0;
   38|  8.60k|        r->neg = 0;
   39|  8.60k|        return 1;
   40|  8.60k|    }
   41|       |
   42|   829k|    BN_CTX_start(ctx);
   43|   829k|    rr = (a != r) ? r : BN_CTX_get(ctx);
  ------------------
  |  Branch (43:10): [True: 812k, False: 17.0k]
  ------------------
   44|   829k|    tmp = BN_CTX_get(ctx);
   45|   829k|    if (rr == NULL || tmp == NULL)
  ------------------
  |  Branch (45:9): [True: 0, False: 829k]
  |  Branch (45:23): [True: 0, False: 829k]
  ------------------
   46|      0|        goto err;
   47|       |
   48|   829k|    max = 2 * al;               /* Non-zero (from above) */
   49|   829k|    if (bn_wexpand(rr, max) == NULL)
  ------------------
  |  Branch (49:9): [True: 0, False: 829k]
  ------------------
   50|      0|        goto err;
   51|       |
   52|   829k|    if (al == 4) {
  ------------------
  |  Branch (52:9): [True: 822k, False: 6.70k]
  ------------------
   53|       |#ifndef BN_SQR_COMBA
   54|       |        BN_ULONG t[8];
   55|       |        bn_sqr_normal(rr->d, a->d, 4, t);
   56|       |#else
   57|   822k|        bn_sqr_comba4(rr->d, a->d);
   58|   822k|#endif
   59|   822k|    } else if (al == 8) {
  ------------------
  |  Branch (59:16): [True: 46, False: 6.66k]
  ------------------
   60|       |#ifndef BN_SQR_COMBA
   61|       |        BN_ULONG t[16];
   62|       |        bn_sqr_normal(rr->d, a->d, 8, t);
   63|       |#else
   64|     46|        bn_sqr_comba8(rr->d, a->d);
   65|     46|#endif
   66|  6.66k|    } else {
   67|  6.66k|#if defined(BN_RECURSION)
   68|  6.66k|        if (al < BN_SQR_RECURSIVE_SIZE_NORMAL) {
  ------------------
  |  |  366|  6.66k|# define BN_SQR_RECURSIVE_SIZE_NORMAL            (16)/* 32 */
  ------------------
  |  Branch (68:13): [True: 6.66k, False: 0]
  ------------------
   69|  6.66k|            BN_ULONG t[BN_SQR_RECURSIVE_SIZE_NORMAL * 2];
  ------------------
  |  |   37|  6.66k|#  define BN_ULONG        unsigned long
  ------------------
   70|  6.66k|            bn_sqr_normal(rr->d, a->d, al, t);
   71|  6.66k|        } else {
   72|      0|            int j, k;
   73|       |
   74|      0|            j = BN_num_bits_word((BN_ULONG)al);
   75|      0|            j = 1 << (j - 1);
   76|      0|            k = j + j;
   77|      0|            if (al == j) {
  ------------------
  |  Branch (77:17): [True: 0, False: 0]
  ------------------
   78|      0|                if (bn_wexpand(tmp, k * 2) == NULL)
  ------------------
  |  Branch (78:21): [True: 0, False: 0]
  ------------------
   79|      0|                    goto err;
   80|      0|                bn_sqr_recursive(rr->d, a->d, al, tmp->d);
   81|      0|            } else {
   82|      0|                if (bn_wexpand(tmp, max) == NULL)
  ------------------
  |  Branch (82:21): [True: 0, False: 0]
  ------------------
   83|      0|                    goto err;
   84|      0|                bn_sqr_normal(rr->d, a->d, al, tmp->d);
   85|      0|            }
   86|      0|        }
   87|       |#else
   88|       |        if (bn_wexpand(tmp, max) == NULL)
   89|       |            goto err;
   90|       |        bn_sqr_normal(rr->d, a->d, al, tmp->d);
   91|       |#endif
   92|  6.66k|    }
   93|       |
   94|   829k|    rr->neg = 0;
   95|   829k|    rr->top = max;
   96|   829k|    rr->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|   829k|#  define BN_FLG_FIXED_TOP 0
  ------------------
   97|   829k|    if (r != rr && BN_copy(r, rr) == NULL)
  ------------------
  |  Branch (97:9): [True: 17.0k, False: 812k]
  |  Branch (97:20): [True: 0, False: 17.0k]
  ------------------
   98|      0|        goto err;
   99|       |
  100|   829k|    ret = 1;
  101|   829k| err:
  102|   829k|    bn_check_top(rr);
  103|   829k|    bn_check_top(tmp);
  104|   829k|    BN_CTX_end(ctx);
  105|   829k|    return ret;
  106|   829k|}
bn_sqr_normal:
  110|  6.66k|{
  111|  6.66k|    int i, j, max;
  112|  6.66k|    const BN_ULONG *ap;
  113|  6.66k|    BN_ULONG *rp;
  ------------------
  |  |   37|  6.66k|#  define BN_ULONG        unsigned long
  ------------------
  114|       |
  115|  6.66k|    max = n * 2;
  116|  6.66k|    ap = a;
  117|  6.66k|    rp = r;
  118|  6.66k|    rp[0] = rp[max - 1] = 0;
  119|  6.66k|    rp++;
  120|  6.66k|    j = n;
  121|       |
  122|  6.66k|    if (--j > 0) {
  ------------------
  |  Branch (122:9): [True: 3.21k, False: 3.45k]
  ------------------
  123|  3.21k|        ap++;
  124|  3.21k|        rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
  125|  3.21k|        rp += 2;
  126|  3.21k|    }
  127|       |
  128|  12.9k|    for (i = n - 2; i > 0; i--) {
  ------------------
  |  Branch (128:21): [True: 6.33k, False: 6.66k]
  ------------------
  129|  6.33k|        j--;
  130|  6.33k|        ap++;
  131|  6.33k|        rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]);
  132|  6.33k|        rp += 2;
  133|  6.33k|    }
  134|       |
  135|  6.66k|    bn_add_words(r, r, r, max);
  136|       |
  137|       |    /* There will not be a carry */
  138|       |
  139|  6.66k|    bn_sqr_words(tmp, a, n);
  140|       |
  141|  6.66k|    bn_add_words(r, r, tmp, max);
  142|  6.66k|}

BN_mod_sqrt:
   20|  1.85k|{
   21|  1.85k|    BIGNUM *ret = in;
   22|  1.85k|    int err = 1;
   23|  1.85k|    int r;
   24|  1.85k|    BIGNUM *A, *b, *q, *t, *x, *y;
   25|  1.85k|    int e, i, j;
   26|  1.85k|    int used_ctx = 0;
   27|       |
   28|  1.85k|    if (!BN_is_odd(p) || BN_abs_is_word(p, 1)) {
  ------------------
  |  Branch (28:9): [True: 0, False: 1.85k]
  |  Branch (28:26): [True: 0, False: 1.85k]
  ------------------
   29|      0|        if (BN_abs_is_word(p, 2)) {
  ------------------
  |  Branch (29:13): [True: 0, False: 0]
  ------------------
   30|      0|            if (ret == NULL)
  ------------------
  |  Branch (30:17): [True: 0, False: 0]
  ------------------
   31|      0|                ret = BN_new();
   32|      0|            if (ret == NULL)
  ------------------
  |  Branch (32:17): [True: 0, False: 0]
  ------------------
   33|      0|                goto end;
   34|      0|            if (!BN_set_word(ret, BN_is_bit_set(a, 0))) {
  ------------------
  |  Branch (34:17): [True: 0, False: 0]
  ------------------
   35|      0|                if (ret != in)
  ------------------
  |  Branch (35:21): [True: 0, False: 0]
  ------------------
   36|      0|                    BN_free(ret);
   37|      0|                return NULL;
   38|      0|            }
   39|      0|            bn_check_top(ret);
   40|      0|            return ret;
   41|      0|        }
   42|       |
   43|      0|        ERR_raise(ERR_LIB_BN, BN_R_P_IS_NOT_PRIME);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   44|      0|        return NULL;
   45|      0|    }
   46|       |
   47|  1.85k|    if (BN_is_zero(a) || BN_is_one(a)) {
  ------------------
  |  Branch (47:9): [True: 72, False: 1.78k]
  |  Branch (47:26): [True: 11, False: 1.77k]
  ------------------
   48|     83|        if (ret == NULL)
  ------------------
  |  Branch (48:13): [True: 0, False: 83]
  ------------------
   49|      0|            ret = BN_new();
   50|     83|        if (ret == NULL)
  ------------------
  |  Branch (50:13): [True: 0, False: 83]
  ------------------
   51|      0|            goto end;
   52|     83|        if (!BN_set_word(ret, BN_is_one(a))) {
  ------------------
  |  Branch (52:13): [True: 0, False: 83]
  ------------------
   53|      0|            if (ret != in)
  ------------------
  |  Branch (53:17): [True: 0, False: 0]
  ------------------
   54|      0|                BN_free(ret);
   55|      0|            return NULL;
   56|      0|        }
   57|     83|        bn_check_top(ret);
   58|     83|        return ret;
   59|     83|    }
   60|       |
   61|  1.77k|    BN_CTX_start(ctx);
   62|  1.77k|    used_ctx = 1;
   63|  1.77k|    A = BN_CTX_get(ctx);
   64|  1.77k|    b = BN_CTX_get(ctx);
   65|  1.77k|    q = BN_CTX_get(ctx);
   66|  1.77k|    t = BN_CTX_get(ctx);
   67|  1.77k|    x = BN_CTX_get(ctx);
   68|  1.77k|    y = BN_CTX_get(ctx);
   69|  1.77k|    if (y == NULL)
  ------------------
  |  Branch (69:9): [True: 0, False: 1.77k]
  ------------------
   70|      0|        goto end;
   71|       |
   72|  1.77k|    if (ret == NULL)
  ------------------
  |  Branch (72:9): [True: 0, False: 1.77k]
  ------------------
   73|      0|        ret = BN_new();
   74|  1.77k|    if (ret == NULL)
  ------------------
  |  Branch (74:9): [True: 0, False: 1.77k]
  ------------------
   75|      0|        goto end;
   76|       |
   77|       |    /* A = a mod p */
   78|  1.77k|    if (!BN_nnmod(A, a, p, ctx))
  ------------------
  |  Branch (78:9): [True: 0, False: 1.77k]
  ------------------
   79|      0|        goto end;
   80|       |
   81|       |    /* now write  |p| - 1  as  2^e*q  where  q  is odd */
   82|  1.77k|    e = 1;
   83|  58.8k|    while (!BN_is_bit_set(p, e))
  ------------------
  |  Branch (83:12): [True: 57.0k, False: 1.77k]
  ------------------
   84|  57.0k|        e++;
   85|       |    /* we'll set  q  later (if needed) */
   86|       |
   87|  1.77k|    if (e == 1) {
  ------------------
  |  Branch (87:9): [True: 717, False: 1.05k]
  ------------------
   88|       |        /*-
   89|       |         * The easy case:  (|p|-1)/2  is odd, so 2 has an inverse
   90|       |         * modulo  (|p|-1)/2,  and square roots can be computed
   91|       |         * directly by modular exponentiation.
   92|       |         * We have
   93|       |         *     2 * (|p|+1)/4 == 1   (mod (|p|-1)/2),
   94|       |         * so we can use exponent  (|p|+1)/4,  i.e.  (|p|-3)/4 + 1.
   95|       |         */
   96|    717|        if (!BN_rshift(q, p, 2))
  ------------------
  |  Branch (96:13): [True: 0, False: 717]
  ------------------
   97|      0|            goto end;
   98|    717|        q->neg = 0;
   99|    717|        if (!BN_add_word(q, 1))
  ------------------
  |  Branch (99:13): [True: 0, False: 717]
  ------------------
  100|      0|            goto end;
  101|    717|        if (!BN_mod_exp(ret, A, q, p, ctx))
  ------------------
  |  Branch (101:13): [True: 0, False: 717]
  ------------------
  102|      0|            goto end;
  103|    717|        err = 0;
  104|    717|        goto vrfy;
  105|    717|    }
  106|       |
  107|  1.05k|    if (e == 2) {
  ------------------
  |  Branch (107:9): [True: 111, False: 943]
  ------------------
  108|       |        /*-
  109|       |         * |p| == 5  (mod 8)
  110|       |         *
  111|       |         * In this case  2  is always a non-square since
  112|       |         * Legendre(2,p) = (-1)^((p^2-1)/8)  for any odd prime.
  113|       |         * So if  a  really is a square, then  2*a  is a non-square.
  114|       |         * Thus for
  115|       |         *      b := (2*a)^((|p|-5)/8),
  116|       |         *      i := (2*a)*b^2
  117|       |         * we have
  118|       |         *     i^2 = (2*a)^((1 + (|p|-5)/4)*2)
  119|       |         *         = (2*a)^((p-1)/2)
  120|       |         *         = -1;
  121|       |         * so if we set
  122|       |         *      x := a*b*(i-1),
  123|       |         * then
  124|       |         *     x^2 = a^2 * b^2 * (i^2 - 2*i + 1)
  125|       |         *         = a^2 * b^2 * (-2*i)
  126|       |         *         = a*(-i)*(2*a*b^2)
  127|       |         *         = a*(-i)*i
  128|       |         *         = a.
  129|       |         *
  130|       |         * (This is due to A.O.L. Atkin,
  131|       |         * Subject: Square Roots and Cognate Matters modulo p=8n+5.
  132|       |         * URL: https://listserv.nodak.edu/cgi-bin/wa.exe?A2=ind9211&L=NMBRTHRY&P=4026
  133|       |         * November 1992.)
  134|       |         */
  135|       |
  136|       |        /* t := 2*a */
  137|    111|        if (!BN_mod_lshift1_quick(t, A, p))
  ------------------
  |  Branch (137:13): [True: 0, False: 111]
  ------------------
  138|      0|            goto end;
  139|       |
  140|       |        /* b := (2*a)^((|p|-5)/8) */
  141|    111|        if (!BN_rshift(q, p, 3))
  ------------------
  |  Branch (141:13): [True: 0, False: 111]
  ------------------
  142|      0|            goto end;
  143|    111|        q->neg = 0;
  144|    111|        if (!BN_mod_exp(b, t, q, p, ctx))
  ------------------
  |  Branch (144:13): [True: 0, False: 111]
  ------------------
  145|      0|            goto end;
  146|       |
  147|       |        /* y := b^2 */
  148|    111|        if (!BN_mod_sqr(y, b, p, ctx))
  ------------------
  |  Branch (148:13): [True: 0, False: 111]
  ------------------
  149|      0|            goto end;
  150|       |
  151|       |        /* t := (2*a)*b^2 - 1 */
  152|    111|        if (!BN_mod_mul(t, t, y, p, ctx))
  ------------------
  |  Branch (152:13): [True: 0, False: 111]
  ------------------
  153|      0|            goto end;
  154|    111|        if (!BN_sub_word(t, 1))
  ------------------
  |  Branch (154:13): [True: 0, False: 111]
  ------------------
  155|      0|            goto end;
  156|       |
  157|       |        /* x = a*b*t */
  158|    111|        if (!BN_mod_mul(x, A, b, p, ctx))
  ------------------
  |  Branch (158:13): [True: 0, False: 111]
  ------------------
  159|      0|            goto end;
  160|    111|        if (!BN_mod_mul(x, x, t, p, ctx))
  ------------------
  |  Branch (160:13): [True: 0, False: 111]
  ------------------
  161|      0|            goto end;
  162|       |
  163|    111|        if (!BN_copy(ret, x))
  ------------------
  |  Branch (163:13): [True: 0, False: 111]
  ------------------
  164|      0|            goto end;
  165|    111|        err = 0;
  166|    111|        goto vrfy;
  167|    111|    }
  168|       |
  169|       |    /*
  170|       |     * e > 2, so we really have to use the Tonelli/Shanks algorithm. First,
  171|       |     * find some y that is not a square.
  172|       |     */
  173|    943|    if (!BN_copy(q, p))
  ------------------
  |  Branch (173:9): [True: 0, False: 943]
  ------------------
  174|      0|        goto end;               /* use 'q' as temp */
  175|    943|    q->neg = 0;
  176|    943|    i = 2;
  177|  9.04k|    do {
  178|       |        /*
  179|       |         * For efficiency, try small numbers first; if this fails, try random
  180|       |         * numbers.
  181|       |         */
  182|  9.04k|        if (i < 22) {
  ------------------
  |  Branch (182:13): [True: 7.78k, False: 1.26k]
  ------------------
  183|  7.78k|            if (!BN_set_word(y, i))
  ------------------
  |  Branch (183:17): [True: 0, False: 7.78k]
  ------------------
  184|      0|                goto end;
  185|  7.78k|        } else {
  186|  1.26k|            if (!BN_priv_rand_ex(y, BN_num_bits(p), 0, 0, 0, ctx))
  ------------------
  |  Branch (186:17): [True: 0, False: 1.26k]
  ------------------
  187|      0|                goto end;
  188|  1.26k|            if (BN_ucmp(y, p) >= 0) {
  ------------------
  |  Branch (188:17): [True: 553, False: 711]
  ------------------
  189|    553|                if (!(p->neg ? BN_add : BN_sub) (y, y, p))
  ------------------
  |  Branch (189:21): [True: 0, False: 553]
  |  Branch (189:23): [True: 0, False: 553]
  ------------------
  190|      0|                    goto end;
  191|    553|            }
  192|       |            /* now 0 <= y < |p| */
  193|  1.26k|            if (BN_is_zero(y))
  ------------------
  |  Branch (193:17): [True: 0, False: 1.26k]
  ------------------
  194|      0|                if (!BN_set_word(y, i))
  ------------------
  |  Branch (194:21): [True: 0, False: 0]
  ------------------
  195|      0|                    goto end;
  196|  1.26k|        }
  197|       |
  198|  9.04k|        r = BN_kronecker(y, q, ctx); /* here 'q' is |p| */
  199|  9.04k|        if (r < -1)
  ------------------
  |  Branch (199:13): [True: 0, False: 9.04k]
  ------------------
  200|      0|            goto end;
  201|  9.04k|        if (r == 0) {
  ------------------
  |  Branch (201:13): [True: 25, False: 9.02k]
  ------------------
  202|       |            /* m divides p */
  203|     25|            ERR_raise(ERR_LIB_BN, BN_R_P_IS_NOT_PRIME);
  ------------------
  |  |  401|     25|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     25|    (ERR_new(),                                                 \
  |  |  |  |  404|     25|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     25|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     25|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     25|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     25|     ERR_set_error)
  |  |  ------------------
  ------------------
  204|     25|            goto end;
  205|     25|        }
  206|  9.04k|    }
  207|  9.02k|    while (r == 1 && ++i < 82);
  ------------------
  |  Branch (207:12): [True: 8.12k, False: 898]
  |  Branch (207:22): [True: 8.10k, False: 20]
  ------------------
  208|       |
  209|    918|    if (r != -1) {
  ------------------
  |  Branch (209:9): [True: 20, False: 898]
  ------------------
  210|       |        /*
  211|       |         * Many rounds and still no non-square -- this is more likely a bug
  212|       |         * than just bad luck. Even if p is not prime, we should have found
  213|       |         * some y such that r == -1.
  214|       |         */
  215|     20|        ERR_raise(ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS);
  ------------------
  |  |  401|     20|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     20|    (ERR_new(),                                                 \
  |  |  |  |  404|     20|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     20|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     20|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     20|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     20|     ERR_set_error)
  |  |  ------------------
  ------------------
  216|     20|        goto end;
  217|     20|    }
  218|       |
  219|       |    /* Here's our actual 'q': */
  220|    898|    if (!BN_rshift(q, q, e))
  ------------------
  |  Branch (220:9): [True: 0, False: 898]
  ------------------
  221|      0|        goto end;
  222|       |
  223|       |    /*
  224|       |     * Now that we have some non-square, we can find an element of order 2^e
  225|       |     * by computing its q'th power.
  226|       |     */
  227|    898|    if (!BN_mod_exp(y, y, q, p, ctx))
  ------------------
  |  Branch (227:9): [True: 0, False: 898]
  ------------------
  228|      0|        goto end;
  229|    898|    if (BN_is_one(y)) {
  ------------------
  |  Branch (229:9): [True: 0, False: 898]
  ------------------
  230|      0|        ERR_raise(ERR_LIB_BN, BN_R_P_IS_NOT_PRIME);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  231|      0|        goto end;
  232|      0|    }
  233|       |
  234|       |    /*-
  235|       |     * Now we know that (if  p  is indeed prime) there is an integer
  236|       |     * k,  0 <= k < 2^e,  such that
  237|       |     *
  238|       |     *      a^q * y^k == 1   (mod p).
  239|       |     *
  240|       |     * As  a^q  is a square and  y  is not,  k  must be even.
  241|       |     * q+1  is even, too, so there is an element
  242|       |     *
  243|       |     *     X := a^((q+1)/2) * y^(k/2),
  244|       |     *
  245|       |     * and it satisfies
  246|       |     *
  247|       |     *     X^2 = a^q * a     * y^k
  248|       |     *         = a,
  249|       |     *
  250|       |     * so it is the square root that we are looking for.
  251|       |     */
  252|       |
  253|       |    /* t := (q-1)/2  (note that  q  is odd) */
  254|    898|    if (!BN_rshift1(t, q))
  ------------------
  |  Branch (254:9): [True: 0, False: 898]
  ------------------
  255|      0|        goto end;
  256|       |
  257|       |    /* x := a^((q-1)/2) */
  258|    898|    if (BN_is_zero(t)) {        /* special case: p = 2^e + 1 */
  ------------------
  |  Branch (258:9): [True: 5, False: 893]
  ------------------
  259|      5|        if (!BN_nnmod(t, A, p, ctx))
  ------------------
  |  Branch (259:13): [True: 0, False: 5]
  ------------------
  260|      0|            goto end;
  261|      5|        if (BN_is_zero(t)) {
  ------------------
  |  Branch (261:13): [True: 0, False: 5]
  ------------------
  262|       |            /* special case: a == 0  (mod p) */
  263|      0|            BN_zero(ret);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  264|      0|            err = 0;
  265|      0|            goto end;
  266|      5|        } else if (!BN_one(x))
  ------------------
  |  |  197|      5|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (266:20): [True: 0, False: 5]
  ------------------
  267|      0|            goto end;
  268|    893|    } else {
  269|    893|        if (!BN_mod_exp(x, A, t, p, ctx))
  ------------------
  |  Branch (269:13): [True: 0, False: 893]
  ------------------
  270|      0|            goto end;
  271|    893|        if (BN_is_zero(x)) {
  ------------------
  |  Branch (271:13): [True: 0, False: 893]
  ------------------
  272|       |            /* special case: a == 0  (mod p) */
  273|      0|            BN_zero(ret);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  274|      0|            err = 0;
  275|      0|            goto end;
  276|      0|        }
  277|    893|    }
  278|       |
  279|       |    /* b := a*x^2  (= a^q) */
  280|    898|    if (!BN_mod_sqr(b, x, p, ctx))
  ------------------
  |  Branch (280:9): [True: 0, False: 898]
  ------------------
  281|      0|        goto end;
  282|    898|    if (!BN_mod_mul(b, b, A, p, ctx))
  ------------------
  |  Branch (282:9): [True: 0, False: 898]
  ------------------
  283|      0|        goto end;
  284|       |
  285|       |    /* x := a*x    (= a^((q+1)/2)) */
  286|    898|    if (!BN_mod_mul(x, x, A, p, ctx))
  ------------------
  |  Branch (286:9): [True: 0, False: 898]
  ------------------
  287|      0|        goto end;
  288|       |
  289|  17.8k|    while (1) {
  ------------------
  |  Branch (289:12): [Folded - Ignored]
  ------------------
  290|       |        /*-
  291|       |         * Now  b  is  a^q * y^k  for some even  k  (0 <= k < 2^E
  292|       |         * where  E  refers to the original value of  e,  which we
  293|       |         * don't keep in a variable),  and  x  is  a^((q+1)/2) * y^(k/2).
  294|       |         *
  295|       |         * We have  a*b = x^2,
  296|       |         *    y^2^(e-1) = -1,
  297|       |         *    b^2^(e-1) = 1.
  298|       |         */
  299|       |
  300|  17.8k|        if (BN_is_one(b)) {
  ------------------
  |  Branch (300:13): [True: 648, False: 17.1k]
  ------------------
  301|    648|            if (!BN_copy(ret, x))
  ------------------
  |  Branch (301:17): [True: 0, False: 648]
  ------------------
  302|      0|                goto end;
  303|    648|            err = 0;
  304|    648|            goto vrfy;
  305|    648|        }
  306|       |
  307|       |        /* Find the smallest i, 0 < i < e, such that b^(2^i) = 1. */
  308|   785k|        for (i = 1; i < e; i++) {
  ------------------
  |  Branch (308:21): [True: 785k, False: 250]
  ------------------
  309|   785k|            if (i == 1) {
  ------------------
  |  Branch (309:17): [True: 17.1k, False: 768k]
  ------------------
  310|  17.1k|                if (!BN_mod_sqr(t, b, p, ctx))
  ------------------
  |  Branch (310:21): [True: 0, False: 17.1k]
  ------------------
  311|      0|                    goto end;
  312|       |
  313|   768k|            } else {
  314|   768k|                if (!BN_mod_mul(t, t, t, p, ctx))
  ------------------
  |  Branch (314:21): [True: 0, False: 768k]
  ------------------
  315|      0|                    goto end;
  316|   768k|            }
  317|   785k|            if (BN_is_one(t))
  ------------------
  |  Branch (317:17): [True: 16.9k, False: 768k]
  ------------------
  318|  16.9k|                break;
  319|   785k|        }
  320|       |        /* If not found, a is not a square or p is not prime. */
  321|  17.1k|        if (i >= e) {
  ------------------
  |  Branch (321:13): [True: 250, False: 16.9k]
  ------------------
  322|    250|            ERR_raise(ERR_LIB_BN, BN_R_NOT_A_SQUARE);
  ------------------
  |  |  401|    250|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    250|    (ERR_new(),                                                 \
  |  |  |  |  404|    250|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    250|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    250|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    250|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    250|     ERR_set_error)
  |  |  ------------------
  ------------------
  323|    250|            goto end;
  324|    250|        }
  325|       |
  326|       |        /* t := y^2^(e - i - 1) */
  327|  16.9k|        if (!BN_copy(t, y))
  ------------------
  |  Branch (327:13): [True: 0, False: 16.9k]
  ------------------
  328|      0|            goto end;
  329|  33.9k|        for (j = e - i - 1; j > 0; j--) {
  ------------------
  |  Branch (329:29): [True: 17.0k, False: 16.9k]
  ------------------
  330|  17.0k|            if (!BN_mod_sqr(t, t, p, ctx))
  ------------------
  |  Branch (330:17): [True: 0, False: 17.0k]
  ------------------
  331|      0|                goto end;
  332|  17.0k|        }
  333|  16.9k|        if (!BN_mod_mul(y, t, t, p, ctx))
  ------------------
  |  Branch (333:13): [True: 0, False: 16.9k]
  ------------------
  334|      0|            goto end;
  335|  16.9k|        if (!BN_mod_mul(x, x, t, p, ctx))
  ------------------
  |  Branch (335:13): [True: 0, False: 16.9k]
  ------------------
  336|      0|            goto end;
  337|  16.9k|        if (!BN_mod_mul(b, b, y, p, ctx))
  ------------------
  |  Branch (337:13): [True: 0, False: 16.9k]
  ------------------
  338|      0|            goto end;
  339|  16.9k|        e = i;
  340|  16.9k|    }
  341|       |
  342|  1.47k| vrfy:
  343|  1.47k|    if (!err) {
  ------------------
  |  Branch (343:9): [True: 1.47k, False: 0]
  ------------------
  344|       |        /*
  345|       |         * verify the result -- the input might have been not a square (test
  346|       |         * added in 0.9.8)
  347|       |         */
  348|       |
  349|  1.47k|        if (!BN_mod_sqr(x, ret, p, ctx))
  ------------------
  |  Branch (349:13): [True: 0, False: 1.47k]
  ------------------
  350|      0|            err = 1;
  351|       |
  352|  1.47k|        if (!err && 0 != BN_cmp(x, A)) {
  ------------------
  |  Branch (352:13): [True: 1.47k, False: 0]
  |  Branch (352:21): [True: 393, False: 1.08k]
  ------------------
  353|    393|            ERR_raise(ERR_LIB_BN, BN_R_NOT_A_SQUARE);
  ------------------
  |  |  401|    393|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    393|    (ERR_new(),                                                 \
  |  |  |  |  404|    393|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    393|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    393|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    393|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    393|     ERR_set_error)
  |  |  ------------------
  ------------------
  354|    393|            err = 1;
  355|    393|        }
  356|  1.47k|    }
  357|       |
  358|  1.77k| end:
  359|  1.77k|    if (err) {
  ------------------
  |  Branch (359:9): [True: 688, False: 1.08k]
  ------------------
  360|    688|        if (ret != in)
  ------------------
  |  Branch (360:13): [True: 0, False: 688]
  ------------------
  361|      0|            BN_clear_free(ret);
  362|    688|        ret = NULL;
  363|    688|    }
  364|  1.77k|    if (used_ctx)
  ------------------
  |  Branch (364:9): [True: 1.77k, False: 0]
  ------------------
  365|  1.77k|        BN_CTX_end(ctx);
  366|  1.77k|    bn_check_top(ret);
  367|  1.77k|    return ret;
  368|  1.47k|}

BN_div_word:
   62|  24.2k|{
   63|  24.2k|    BN_ULONG ret = 0;
  ------------------
  |  |   37|  24.2k|#  define BN_ULONG        unsigned long
  ------------------
   64|  24.2k|    int i, j;
   65|       |
   66|  24.2k|    bn_check_top(a);
   67|  24.2k|    w &= BN_MASK2;
  ------------------
  |  |   94|  24.2k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   68|       |
   69|  24.2k|    if (!w)
  ------------------
  |  Branch (69:9): [True: 0, False: 24.2k]
  ------------------
   70|       |        /* actually this an error (division by zero) */
   71|      0|        return (BN_ULONG)-1;
   72|  24.2k|    if (a->top == 0)
  ------------------
  |  Branch (72:9): [True: 0, False: 24.2k]
  ------------------
   73|      0|        return 0;
   74|       |
   75|       |    /* normalize input (so bn_div_words doesn't complain) */
   76|  24.2k|    j = BN_BITS2 - BN_num_bits_word(w);
  ------------------
  |  |   54|  24.2k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  24.2k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
   77|  24.2k|    w <<= j;
   78|  24.2k|    if (!BN_lshift(a, a, j))
  ------------------
  |  Branch (78:9): [True: 0, False: 24.2k]
  ------------------
   79|      0|        return (BN_ULONG)-1;
   80|       |
   81|  89.7k|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (81:26): [True: 65.5k, False: 24.2k]
  ------------------
   82|  65.5k|        BN_ULONG l, d;
  ------------------
  |  |   37|  65.5k|#  define BN_ULONG        unsigned long
  ------------------
   83|       |
   84|  65.5k|        l = a->d[i];
   85|  65.5k|        d = bn_div_words(ret, l, w);
   86|  65.5k|        ret = (l - ((d * w) & BN_MASK2)) & BN_MASK2;
  ------------------
  |  |   94|  65.5k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
                      ret = (l - ((d * w) & BN_MASK2)) & BN_MASK2;
  ------------------
  |  |   94|  65.5k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   87|  65.5k|        a->d[i] = d;
   88|  65.5k|    }
   89|  24.2k|    if ((a->top > 0) && (a->d[a->top - 1] == 0))
  ------------------
  |  Branch (89:9): [True: 24.2k, False: 0]
  |  Branch (89:25): [True: 23.2k, False: 1.03k]
  ------------------
   90|  23.2k|        a->top--;
   91|  24.2k|    ret >>= j;
   92|  24.2k|    if (!a->top)
  ------------------
  |  Branch (92:9): [True: 17.0k, False: 7.24k]
  ------------------
   93|  17.0k|        a->neg = 0; /* don't allow negative zero */
   94|  24.2k|    bn_check_top(a);
   95|  24.2k|    return ret;
   96|  24.2k|}
BN_add_word:
   99|  36.5k|{
  100|  36.5k|    BN_ULONG l;
  ------------------
  |  |   37|  36.5k|#  define BN_ULONG        unsigned long
  ------------------
  101|  36.5k|    int i;
  102|       |
  103|  36.5k|    bn_check_top(a);
  104|  36.5k|    w &= BN_MASK2;
  ------------------
  |  |   94|  36.5k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  105|       |
  106|       |    /* degenerate case: w is zero */
  107|  36.5k|    if (!w)
  ------------------
  |  Branch (107:9): [True: 6.45k, False: 30.0k]
  ------------------
  108|  6.45k|        return 1;
  109|       |    /* degenerate case: a is zero */
  110|  30.0k|    if (BN_is_zero(a))
  ------------------
  |  Branch (110:9): [True: 898, False: 29.1k]
  ------------------
  111|    898|        return BN_set_word(a, w);
  112|       |    /* handle 'a' when negative */
  113|  29.1k|    if (a->neg) {
  ------------------
  |  Branch (113:9): [True: 0, False: 29.1k]
  ------------------
  114|      0|        a->neg = 0;
  115|      0|        i = BN_sub_word(a, w);
  116|      0|        if (!BN_is_zero(a))
  ------------------
  |  Branch (116:13): [True: 0, False: 0]
  ------------------
  117|      0|            a->neg = !(a->neg);
  118|      0|        return i;
  119|      0|    }
  120|  59.2k|    for (i = 0; w != 0 && i < a->top; i++) {
  ------------------
  |  Branch (120:17): [True: 30.0k, False: 29.1k]
  |  Branch (120:27): [True: 30.0k, False: 10]
  ------------------
  121|  30.0k|        a->d[i] = l = (a->d[i] + w) & BN_MASK2;
  ------------------
  |  |   94|  30.0k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  122|  30.0k|        w = (w > l) ? 1 : 0;
  ------------------
  |  Branch (122:13): [True: 891, False: 29.1k]
  ------------------
  123|  30.0k|    }
  124|  29.1k|    if (w && i == a->top) {
  ------------------
  |  Branch (124:9): [True: 10, False: 29.1k]
  |  Branch (124:14): [True: 10, False: 0]
  ------------------
  125|     10|        if (bn_wexpand(a, a->top + 1) == NULL)
  ------------------
  |  Branch (125:13): [True: 0, False: 10]
  ------------------
  126|      0|            return 0;
  127|     10|        a->top++;
  128|     10|        a->d[i] = w;
  129|     10|    }
  130|  29.1k|    bn_check_top(a);
  131|  29.1k|    return 1;
  132|  29.1k|}
BN_sub_word:
  135|  32.9k|{
  136|  32.9k|    int i;
  137|       |
  138|  32.9k|    bn_check_top(a);
  139|  32.9k|    w &= BN_MASK2;
  ------------------
  |  |   94|  32.9k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  140|       |
  141|       |    /* degenerate case: w is zero */
  142|  32.9k|    if (!w)
  ------------------
  |  Branch (142:9): [True: 0, False: 32.9k]
  ------------------
  143|      0|        return 1;
  144|       |    /* degenerate case: a is zero */
  145|  32.9k|    if (BN_is_zero(a)) {
  ------------------
  |  Branch (145:9): [True: 0, False: 32.9k]
  ------------------
  146|      0|        i = BN_set_word(a, w);
  147|      0|        if (i != 0)
  ------------------
  |  Branch (147:13): [True: 0, False: 0]
  ------------------
  148|      0|            BN_set_negative(a, 1);
  149|      0|        return i;
  150|      0|    }
  151|       |    /* handle 'a' when negative */
  152|  32.9k|    if (a->neg) {
  ------------------
  |  Branch (152:9): [True: 0, False: 32.9k]
  ------------------
  153|      0|        a->neg = 0;
  154|      0|        i = BN_add_word(a, w);
  155|      0|        a->neg = 1;
  156|      0|        return i;
  157|      0|    }
  158|       |
  159|  32.9k|    if ((a->top == 1) && (a->d[0] < w)) {
  ------------------
  |  Branch (159:9): [True: 28, False: 32.9k]
  |  Branch (159:26): [True: 0, False: 28]
  ------------------
  160|      0|        a->d[0] = w - a->d[0];
  161|      0|        a->neg = 1;
  162|      0|        return 1;
  163|      0|    }
  164|  32.9k|    i = 0;
  165|  63.9k|    for (;;) {
  166|  63.9k|        if (a->d[i] >= w) {
  ------------------
  |  Branch (166:13): [True: 32.9k, False: 31.0k]
  ------------------
  167|  32.9k|            a->d[i] -= w;
  168|  32.9k|            break;
  169|  32.9k|        } else {
  170|  31.0k|            a->d[i] = (a->d[i] - w) & BN_MASK2;
  ------------------
  |  |   94|  31.0k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  171|  31.0k|            i++;
  172|  31.0k|            w = 1;
  173|  31.0k|        }
  174|  63.9k|    }
  175|  32.9k|    if ((a->d[i] == 0) && (i == (a->top - 1)))
  ------------------
  |  Branch (175:9): [True: 1.47k, False: 31.4k]
  |  Branch (175:27): [True: 916, False: 562]
  ------------------
  176|    916|        a->top--;
  177|  32.9k|    bn_check_top(a);
  178|  32.9k|    return 1;
  179|  32.9k|}
BN_mul_word:
  182|  47.3k|{
  183|  47.3k|    BN_ULONG ll;
  ------------------
  |  |   37|  47.3k|#  define BN_ULONG        unsigned long
  ------------------
  184|       |
  185|  47.3k|    bn_check_top(a);
  186|  47.3k|    w &= BN_MASK2;
  ------------------
  |  |   94|  47.3k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  187|  47.3k|    if (a->top) {
  ------------------
  |  Branch (187:9): [True: 47.3k, False: 0]
  ------------------
  188|  47.3k|        if (w == 0)
  ------------------
  |  Branch (188:13): [True: 0, False: 47.3k]
  ------------------
  189|      0|            BN_zero(a);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  190|  47.3k|        else {
  191|  47.3k|            ll = bn_mul_words(a->d, a->d, a->top, w);
  192|  47.3k|            if (ll) {
  ------------------
  |  Branch (192:17): [True: 44.2k, False: 3.10k]
  ------------------
  193|  44.2k|                if (bn_wexpand(a, a->top + 1) == NULL)
  ------------------
  |  Branch (193:21): [True: 0, False: 44.2k]
  ------------------
  194|      0|                    return 0;
  195|  44.2k|                a->d[a->top++] = ll;
  196|  44.2k|            }
  197|  47.3k|        }
  198|  47.3k|    }
  199|  47.3k|    bn_check_top(a);
  200|  47.3k|    return 1;
  201|  47.3k|}

RSAZ_512_mod_exp:
  258|      1|{
  259|      1|    unsigned char storage[16 * 8 * 8 + 64 * 2 + 64]; /* 1.2KB */
  260|      1|    unsigned char *table = storage + (64 - ((size_t)storage % 64));
  261|      1|    BN_ULONG *a_inv = (BN_ULONG *)(table + 16 * 8 * 8);
  ------------------
  |  |   37|      1|#  define BN_ULONG        unsigned long
  ------------------
  262|      1|    BN_ULONG *temp = (BN_ULONG *)(table + 16 * 8 * 8 + 8 * 8);
  ------------------
  |  |   37|      1|#  define BN_ULONG        unsigned long
  ------------------
  263|      1|    unsigned char *p_str = (unsigned char *)exponent;
  264|      1|    int index;
  265|      1|    unsigned int wvalue;
  266|      1|    BN_ULONG tmp[8];
  ------------------
  |  |   37|      1|#  define BN_ULONG        unsigned long
  ------------------
  267|       |
  268|       |    /* table[0] = 1_inv */
  269|      1|    temp[0] = 0 - m[0];
  270|      1|    temp[1] = ~m[1];
  271|      1|    temp[2] = ~m[2];
  272|      1|    temp[3] = ~m[3];
  273|      1|    temp[4] = ~m[4];
  274|      1|    temp[5] = ~m[5];
  275|      1|    temp[6] = ~m[6];
  276|      1|    temp[7] = ~m[7];
  277|      1|    rsaz_512_scatter4(table, temp, 0);
  278|       |
  279|       |    /* table [1] = a_inv^1 */
  280|      1|    rsaz_512_mul(a_inv, base, RR, m, k0);
  281|      1|    rsaz_512_scatter4(table, a_inv, 1);
  282|       |
  283|       |    /* table [2] = a_inv^2 */
  284|      1|    rsaz_512_sqr(temp, a_inv, m, k0, 1);
  285|      1|    rsaz_512_scatter4(table, temp, 2);
  286|       |
  287|     14|    for (index = 3; index < 16; index++)
  ------------------
  |  Branch (287:21): [True: 13, False: 1]
  ------------------
  288|     13|        rsaz_512_mul_scatter4(temp, a_inv, m, k0, table, index);
  289|       |
  290|       |    /* load first window */
  291|      1|    wvalue = p_str[63];
  292|       |
  293|      1|    rsaz_512_gather4(temp, table, wvalue >> 4);
  294|      1|    rsaz_512_sqr(temp, temp, m, k0, 4);
  295|      1|    rsaz_512_mul_gather4(temp, temp, table, m, k0, wvalue & 0xf);
  296|       |
  297|     64|    for (index = 62; index >= 0; index--) {
  ------------------
  |  Branch (297:22): [True: 63, False: 1]
  ------------------
  298|     63|        wvalue = p_str[index];
  299|       |
  300|     63|        rsaz_512_sqr(temp, temp, m, k0, 4);
  301|     63|        rsaz_512_mul_gather4(temp, temp, table, m, k0, wvalue >> 4);
  302|       |
  303|     63|        rsaz_512_sqr(temp, temp, m, k0, 4);
  304|     63|        rsaz_512_mul_gather4(temp, temp, table, m, k0, wvalue & 0x0f);
  305|     63|    }
  306|       |
  307|       |    /* from Montgomery */
  308|      1|    rsaz_512_mul_by_one(result, temp, m, k0);
  309|       |
  310|      1|    bn_reduce_once_in_place(result, /*carry=*/0, m, tmp, 8);
  311|       |
  312|      1|    OPENSSL_cleanse(storage, sizeof(storage));
  313|      1|    OPENSSL_cleanse(tmp, sizeof(tmp));
  314|      1|}

rsaz_exp.c:bn_reduce_once_in_place:
   74|      1|{
   75|      1|    carry -= bn_sub_words(tmp, r, m, num);
   76|      1|    bn_select_words(r, carry, r /* tmp < 0 */, tmp /* tmp >= 0 */, num);
   77|      1|    return carry;
   78|      1|}
rsaz_exp.c:bn_select_words:
   62|      1|{
   63|      1|    size_t i;
   64|       |
   65|      9|    for (i = 0; i < num; i++) {
  ------------------
  |  Branch (65:17): [True: 8, False: 1]
  ------------------
   66|      8|        r[i] = constant_time_select_64(mask, a[i], b[i]);
   67|      8|    }
   68|      1|}

ossl_bsearch:
   16|  1.35M|{
   17|  1.35M|    const char *base_ = base;
   18|  1.35M|    int l, h, i = 0, c = 0;
   19|  1.35M|    const char *p = NULL;
   20|       |
   21|  1.35M|    if (num == 0)
  ------------------
  |  Branch (21:9): [True: 0, False: 1.35M]
  ------------------
   22|      0|        return NULL;
   23|  1.35M|    l = 0;
   24|  1.35M|    h = num;
   25|  12.7M|    while (l < h) {
  ------------------
  |  Branch (25:12): [True: 12.0M, False: 676k]
  ------------------
   26|  12.0M|        i = (l + h) / 2;
   27|  12.0M|        p = &(base_[i * size]);
   28|  12.0M|        c = (*cmp) (key, p);
   29|  12.0M|        if (c < 0)
  ------------------
  |  Branch (29:13): [True: 7.93M, False: 4.10M]
  ------------------
   30|  7.93M|            h = i;
   31|  4.10M|        else if (c > 0)
  ------------------
  |  Branch (31:18): [True: 3.42M, False: 680k]
  ------------------
   32|  3.42M|            l = i + 1;
   33|   680k|        else
   34|   680k|            break;
   35|  12.0M|    }
   36|  1.35M|    if (c != 0 && !(flags & OSSL_BSEARCH_VALUE_ON_NOMATCH))
  ------------------
  |  |  152|   676k|# define OSSL_BSEARCH_VALUE_ON_NOMATCH            0x01
  ------------------
  |  Branch (36:9): [True: 676k, False: 680k]
  |  Branch (36:19): [True: 676k, False: 0]
  ------------------
   37|   676k|        p = NULL;
   38|   680k|    else if (c == 0 && (flags & OSSL_BSEARCH_FIRST_VALUE_ON_MATCH)) {
  ------------------
  |  |  153|   680k|# define OSSL_BSEARCH_FIRST_VALUE_ON_MATCH        0x02
  ------------------
  |  Branch (38:14): [True: 680k, False: 0]
  |  Branch (38:24): [True: 0, False: 680k]
  ------------------
   39|      0|        while (i > 0 && (*cmp) (key, &(base_[(i - 1) * size])) == 0)
  ------------------
  |  Branch (39:16): [True: 0, False: 0]
  |  Branch (39:25): [True: 0, False: 0]
  ------------------
   40|      0|            i--;
   41|      0|        p = &(base_[i * size]);
   42|      0|    }
   43|  1.35M|    return p;
   44|  1.35M|}

ossl_err_load_BUF_strings:
   24|      2|{
   25|      2|#ifndef OPENSSL_NO_ERR
   26|      2|    if (ERR_reason_error_string(BUF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (26:9): [True: 2, False: 0]
  ------------------
   27|      2|        ERR_load_strings_const(BUF_str_reasons);
   28|      2|#endif
   29|      2|    return 1;
   30|      2|}

BUF_MEM_new_ex:
   22|  67.6k|{
   23|  67.6k|    BUF_MEM *ret;
   24|       |
   25|  67.6k|    ret = BUF_MEM_new();
   26|  67.6k|    if (ret != NULL)
  ------------------
  |  Branch (26:9): [True: 67.6k, False: 0]
  ------------------
   27|  67.6k|        ret->flags = flags;
   28|  67.6k|    return ret;
   29|  67.6k|}
BUF_MEM_new:
   32|   793k|{
   33|   793k|    BUF_MEM *ret;
   34|       |
   35|   793k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|   793k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   793k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   793k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   36|   793k|    if (ret == NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 793k]
  ------------------
   37|      0|        return NULL;
   38|   793k|    return ret;
   39|   793k|}
BUF_MEM_free:
   42|   417k|{
   43|   417k|    if (a == NULL)
  ------------------
  |  Branch (43:9): [True: 5, False: 417k]
  ------------------
   44|      5|        return;
   45|   417k|    if (a->data != NULL) {
  ------------------
  |  Branch (45:9): [True: 163k, False: 253k]
  ------------------
   46|   163k|        if (a->flags & BUF_MEM_FLAG_SECURE)
  ------------------
  |  |   49|   163k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (46:13): [True: 0, False: 163k]
  ------------------
   47|      0|            OPENSSL_secure_clear_free(a->data, a->max);
  ------------------
  |  |  129|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|   163k|        else
   49|   163k|            OPENSSL_clear_free(a->data, a->max);
  ------------------
  |  |  113|   163k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   163k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   163k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   50|   163k|    }
   51|   417k|    OPENSSL_free(a);
  ------------------
  |  |  115|   417k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   417k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   417k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   52|   417k|}
BUF_MEM_grow:
   72|  81.2k|{
   73|  81.2k|    char *ret;
   74|  81.2k|    size_t n;
   75|       |
   76|  81.2k|    if (str->length >= len) {
  ------------------
  |  Branch (76:9): [True: 635, False: 80.6k]
  ------------------
   77|    635|        str->length = len;
   78|    635|        return len;
   79|    635|    }
   80|  80.6k|    if (str->max >= len) {
  ------------------
  |  Branch (80:9): [True: 6.60k, False: 74.0k]
  ------------------
   81|  6.60k|        if (str->data != NULL)
  ------------------
  |  Branch (81:13): [True: 6.60k, False: 0]
  ------------------
   82|  6.60k|            memset(&str->data[str->length], 0, len - str->length);
   83|  6.60k|        str->length = len;
   84|  6.60k|        return len;
   85|  6.60k|    }
   86|       |    /* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
   87|  74.0k|    if (len > LIMIT_BEFORE_EXPANSION) {
  ------------------
  |  |   19|  74.0k|#define LIMIT_BEFORE_EXPANSION 0x5ffffffc
  ------------------
  |  Branch (87:9): [True: 0, False: 74.0k]
  ------------------
   88|      0|        ERR_raise(ERR_LIB_BUF, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   89|      0|        return 0;
   90|      0|    }
   91|  74.0k|    n = (len + 3) / 3 * 4;
   92|  74.0k|    if ((str->flags & BUF_MEM_FLAG_SECURE))
  ------------------
  |  |   49|  74.0k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (92:9): [True: 0, False: 74.0k]
  ------------------
   93|      0|        ret = sec_alloc_realloc(str, n);
   94|  74.0k|    else
   95|  74.0k|        ret = OPENSSL_realloc(str->data, n);
  ------------------
  |  |  109|  74.0k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  74.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  74.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   96|  74.0k|    if (ret == NULL) {
  ------------------
  |  Branch (96:9): [True: 0, False: 74.0k]
  ------------------
   97|      0|        len = 0;
   98|  74.0k|    } else {
   99|  74.0k|        str->data = ret;
  100|  74.0k|        str->max = n;
  101|  74.0k|        memset(&str->data[str->length], 0, len - str->length);
  102|  74.0k|        str->length = len;
  103|  74.0k|    }
  104|  74.0k|    return len;
  105|  74.0k|}
BUF_MEM_grow_clean:
  108|   193M|{
  109|   193M|    char *ret;
  110|   193M|    size_t n;
  111|       |
  112|   193M|    if (str->length >= len) {
  ------------------
  |  Branch (112:9): [True: 169k, False: 193M]
  ------------------
  113|   169k|        if (str->data != NULL)
  ------------------
  |  Branch (113:13): [True: 169k, False: 0]
  ------------------
  114|   169k|            memset(&str->data[len], 0, str->length - len);
  115|   169k|        str->length = len;
  116|   169k|        return len;
  117|   169k|    }
  118|   193M|    if (str->max >= len) {
  ------------------
  |  Branch (118:9): [True: 190M, False: 2.50M]
  ------------------
  119|   190M|        memset(&str->data[str->length], 0, len - str->length);
  120|   190M|        str->length = len;
  121|   190M|        return len;
  122|   190M|    }
  123|       |    /* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
  124|  2.50M|    if (len > LIMIT_BEFORE_EXPANSION) {
  ------------------
  |  |   19|  2.50M|#define LIMIT_BEFORE_EXPANSION 0x5ffffffc
  ------------------
  |  Branch (124:9): [True: 0, False: 2.50M]
  ------------------
  125|      0|        ERR_raise(ERR_LIB_BUF, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        return 0;
  127|      0|    }
  128|  2.50M|    n = (len + 3) / 3 * 4;
  129|  2.50M|    if ((str->flags & BUF_MEM_FLAG_SECURE))
  ------------------
  |  |   49|  2.50M|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (129:9): [True: 0, False: 2.50M]
  ------------------
  130|      0|        ret = sec_alloc_realloc(str, n);
  131|  2.50M|    else
  132|  2.50M|        ret = OPENSSL_clear_realloc(str->data, str->max, n);
  ------------------
  |  |  111|  2.50M|        CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.50M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.50M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  133|  2.50M|    if (ret == NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 2.50M]
  ------------------
  134|      0|        len = 0;
  135|  2.50M|    } else {
  136|  2.50M|        str->data = ret;
  137|  2.50M|        str->max = n;
  138|  2.50M|        memset(&str->data[str->length], 0, len - str->length);
  139|  2.50M|        str->length = len;
  140|  2.50M|    }
  141|  2.50M|    return len;
  142|  2.50M|}

ossl_err_load_CMP_strings:
  199|      2|{
  200|      2|# ifndef OPENSSL_NO_ERR
  201|      2|    if (ERR_reason_error_string(CMP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (201:9): [True: 2, False: 0]
  ------------------
  202|      2|        ERR_load_strings_const(CMP_str_reasons);
  203|      2|# endif
  204|      2|    return 1;
  205|      2|}

OSSL_CMP_log_close:
   41|      2|{
   42|      2|    (void)OSSL_trace_set_channel(OSSL_TRACE_CATEGORY_CMP, NULL);
  ------------------
  |  |   53|      2|# define OSSL_TRACE_CATEGORY_CMP                13
  ------------------
   43|      2|}

cms_asn1.c:cms_si_cb:
   48|  14.2k|{
   49|  14.2k|    if (operation == ASN1_OP_FREE_POST) {
  ------------------
  |  |  745|  14.2k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (49:9): [True: 1.96k, False: 12.3k]
  ------------------
   50|  1.96k|        CMS_SignerInfo *si = (CMS_SignerInfo *)*pval;
   51|  1.96k|        EVP_PKEY_free(si->pkey);
   52|  1.96k|        X509_free(si->signer);
   53|  1.96k|        EVP_MD_CTX_free(si->mctx);
   54|  1.96k|        EVP_PKEY_CTX_free(si->pctx);
   55|  1.96k|    }
   56|  14.2k|    return 1;
   57|  14.2k|}
cms_asn1.c:cms_ec_cb:
   96|    689|{
   97|    689|    CMS_EncryptedContentInfo *ec = (CMS_EncryptedContentInfo *)*pval;
   98|       |
   99|    689|    if (operation == ASN1_OP_FREE_POST)
  ------------------
  |  |  745|    689|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (99:9): [True: 84, False: 605]
  ------------------
  100|     84|        OPENSSL_clear_free(ec->key, ec->keylen);
  ------------------
  |  |  113|     84|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     84|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     84|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  101|    689|    return 1;
  102|    689|}
cms_asn1.c:cms_rek_cb:
  135|  6.48k|{
  136|  6.48k|    CMS_RecipientEncryptedKey *rek = (CMS_RecipientEncryptedKey *)*pval;
  137|  6.48k|    if (operation == ASN1_OP_FREE_POST) {
  ------------------
  |  |  745|  6.48k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (137:9): [True: 1.08k, False: 5.40k]
  ------------------
  138|  1.08k|        EVP_PKEY_free(rek->pkey);
  139|  1.08k|    }
  140|  6.48k|    return 1;
  141|  6.48k|}
cms_asn1.c:cms_kari_cb:
  161|  7.66k|{
  162|  7.66k|    CMS_KeyAgreeRecipientInfo *kari = (CMS_KeyAgreeRecipientInfo *)*pval;
  163|  7.66k|    if (operation == ASN1_OP_NEW_POST) {
  ------------------
  |  |  743|  7.66k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (163:9): [True: 762, False: 6.90k]
  ------------------
  164|    762|        kari->ctx = EVP_CIPHER_CTX_new();
  165|    762|        if (kari->ctx == NULL)
  ------------------
  |  Branch (165:13): [True: 0, False: 762]
  ------------------
  166|      0|            return 0;
  167|    762|        EVP_CIPHER_CTX_set_flags(kari->ctx, EVP_CIPHER_CTX_FLAG_WRAP_ALLOW);
  ------------------
  |  |  386|    762|# define         EVP_CIPHER_CTX_FLAG_WRAP_ALLOW  0x1
  ------------------
  168|    762|        kari->pctx = NULL;
  169|  6.90k|    } else if (operation == ASN1_OP_FREE_POST) {
  ------------------
  |  |  745|  6.90k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (169:16): [True: 762, False: 6.14k]
  ------------------
  170|    762|        EVP_PKEY_CTX_free(kari->pctx);
  171|    762|        EVP_CIPHER_CTX_free(kari->ctx);
  172|    762|    }
  173|  7.66k|    return 1;
  174|  7.66k|}
cms_asn1.c:cms_ri_cb:
  212|  70.1k|{
  213|  70.1k|    if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|  70.1k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (213:9): [True: 9.17k, False: 60.9k]
  ------------------
  214|  9.17k|        CMS_RecipientInfo *ri = (CMS_RecipientInfo *)*pval;
  215|  9.17k|        if (ri->type == CMS_RECIPINFO_TRANS) {
  ------------------
  |  |  166|  9.17k|# define CMS_RECIPINFO_TRANS             0
  ------------------
  |  Branch (215:13): [True: 322, False: 8.85k]
  ------------------
  216|    322|            CMS_KeyTransRecipientInfo *ktri = ri->d.ktri;
  217|    322|            EVP_PKEY_free(ktri->pkey);
  218|    322|            X509_free(ktri->recip);
  219|    322|            EVP_PKEY_CTX_free(ktri->pctx);
  220|  8.85k|        } else if (ri->type == CMS_RECIPINFO_KEK) {
  ------------------
  |  |  168|  8.85k|# define CMS_RECIPINFO_KEK               2
  ------------------
  |  Branch (220:20): [True: 398, False: 8.45k]
  ------------------
  221|    398|            CMS_KEKRecipientInfo *kekri = ri->d.kekri;
  222|    398|            OPENSSL_clear_free(kekri->key, kekri->keylen);
  ------------------
  |  |  113|    398|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    398|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    398|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  223|  8.45k|        } else if (ri->type == CMS_RECIPINFO_PASS) {
  ------------------
  |  |  169|  8.45k|# define CMS_RECIPINFO_PASS              3
  ------------------
  |  Branch (223:20): [True: 6.40k, False: 2.05k]
  ------------------
  224|  6.40k|            CMS_PasswordRecipientInfo *pwri = ri->d.pwri;
  225|  6.40k|            OPENSSL_clear_free(pwri->pass, pwri->passlen);
  ------------------
  |  |  113|  6.40k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  6.40k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  6.40k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  226|  6.40k|        }
  227|  9.17k|    }
  228|  70.1k|    return 1;
  229|  70.1k|}
cms_asn1.c:cms_cb:
  308|  52.8k|{
  309|  52.8k|    ASN1_STREAM_ARG *sarg = exarg;
  310|  52.8k|    CMS_ContentInfo *cms = NULL;
  311|  52.8k|    if (pval)
  ------------------
  |  Branch (311:9): [True: 52.8k, False: 0]
  ------------------
  312|  52.8k|        cms = (CMS_ContentInfo *)*pval;
  313|      0|    else
  314|      0|        return 1;
  315|  52.8k|    switch (operation) {
  ------------------
  |  Branch (315:13): [True: 42.7k, False: 10.1k]
  ------------------
  316|       |
  317|      0|    case ASN1_OP_STREAM_PRE:
  ------------------
  |  |  752|      0|# define ASN1_OP_STREAM_PRE      10
  ------------------
  |  Branch (317:5): [True: 0, False: 52.8k]
  ------------------
  318|      0|        if (CMS_stream(&sarg->boundary, cms) <= 0)
  ------------------
  |  Branch (318:13): [True: 0, False: 0]
  ------------------
  319|      0|            return 0;
  320|       |        /* fall through */
  321|      0|    case ASN1_OP_DETACHED_PRE:
  ------------------
  |  |  754|      0|# define ASN1_OP_DETACHED_PRE    12
  ------------------
  |  Branch (321:5): [True: 0, False: 52.8k]
  ------------------
  322|      0|        sarg->ndef_bio = CMS_dataInit(cms, sarg->out);
  323|      0|        if (!sarg->ndef_bio)
  ------------------
  |  Branch (323:13): [True: 0, False: 0]
  ------------------
  324|      0|            return 0;
  325|      0|        break;
  326|       |
  327|      0|    case ASN1_OP_STREAM_POST:
  ------------------
  |  |  753|      0|# define ASN1_OP_STREAM_POST     11
  ------------------
  |  Branch (327:5): [True: 0, False: 52.8k]
  ------------------
  328|      0|    case ASN1_OP_DETACHED_POST:
  ------------------
  |  |  755|      0|# define ASN1_OP_DETACHED_POST   13
  ------------------
  |  Branch (328:5): [True: 0, False: 52.8k]
  ------------------
  329|      0|        if (CMS_dataFinal(cms, sarg->ndef_bio) <= 0)
  ------------------
  |  Branch (329:13): [True: 0, False: 0]
  ------------------
  330|      0|            return 0;
  331|      0|        break;
  332|       |
  333|  10.1k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|  10.1k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (333:5): [True: 10.1k, False: 42.7k]
  ------------------
  334|  10.1k|        OPENSSL_free(cms->ctx.propq);
  ------------------
  |  |  115|  10.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  10.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  10.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  335|  10.1k|        break;
  336|       |
  337|  52.8k|    }
  338|  52.8k|    return 1;
  339|  52.8k|}

ossl_err_load_CMS_strings:
  175|      2|{
  176|      2|# ifndef OPENSSL_NO_ERR
  177|      2|    if (ERR_reason_error_string(CMS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (177:9): [True: 2, False: 0]
  ------------------
  178|      2|        ERR_load_strings_const(CMS_str_reasons);
  179|      2|# endif
  180|      2|    return 1;
  181|      2|}

ossl_comp_brotli_cleanup:
  353|      2|{
  354|       |#ifdef BROTLI_SHARED
  355|       |    DSO_free(brotli_encode_dso);
  356|       |    brotli_encode_dso = NULL;
  357|       |    DSO_free(brotli_decode_dso);
  358|       |    brotli_decode_dso = NULL;
  359|       |    p_encode_init = NULL;
  360|       |    p_encode_stream = NULL;
  361|       |    p_encode_has_more = NULL;
  362|       |    p_encode_end = NULL;
  363|       |    p_encode_oneshot = NULL;
  364|       |    p_decode_init = NULL;
  365|       |    p_decode_stream = NULL;
  366|       |    p_decode_has_more = NULL;
  367|       |    p_decode_end = NULL;
  368|       |    p_decode_error = NULL;
  369|       |    p_decode_error_string = NULL;
  370|       |    p_decode_is_finished = NULL;
  371|       |    p_decode_oneshot = NULL;
  372|       |#endif
  373|      2|}

COMP_zlib:
  311|      4|{
  312|      4|    COMP_METHOD *meth = NULL;
  313|       |
  314|       |#ifndef OPENSSL_NO_ZLIB
  315|       |    if (RUN_ONCE(&zlib_once, ossl_comp_zlib_init))
  316|       |        meth = &zlib_stateful_method;
  317|       |#endif
  318|       |
  319|      4|    return meth;
  320|      4|}
ossl_comp_zlib_cleanup:
  336|      2|{
  337|       |#ifdef ZLIB_SHARED
  338|       |    DSO_free(zlib_dso);
  339|       |    zlib_dso = NULL;
  340|       |#endif
  341|      2|}

ossl_comp_zstd_cleanup:
  428|      2|{
  429|       |#ifdef ZSTD_SHARED
  430|       |    DSO_free(zstd_dso);
  431|       |    zstd_dso = NULL;
  432|       |    p_createCStream = NULL;
  433|       |    p_initCStream = NULL;
  434|       |    p_freeCStream = NULL;
  435|       |    p_compressStream2 = NULL;
  436|       |    p_flushStream = NULL;
  437|       |    p_endStream = NULL;
  438|       |    p_compress = NULL;
  439|       |    p_createDStream = NULL;
  440|       |    p_initDStream = NULL;
  441|       |    p_freeDStream = NULL;
  442|       |    p_decompressStream = NULL;
  443|       |    p_decompress = NULL;
  444|       |    p_isError = NULL;
  445|       |    p_getErrorName = NULL;
  446|       |    p_DStreamInSize = NULL;
  447|       |    p_CStreamInSize = NULL;
  448|       |#endif
  449|      2|}

ossl_err_load_COMP_strings:
   45|      2|{
   46|      2|# ifndef OPENSSL_NO_ERR
   47|      2|    if (ERR_reason_error_string(COMP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (47:9): [True: 2, False: 0]
  ------------------
   48|      2|        ERR_load_strings_const(COMP_str_reasons);
   49|      2|# endif
   50|      2|    return 1;
   51|      2|}

COMP_get_type:
   41|      4|{
   42|      4|    if (meth == NULL)
  ------------------
  |  Branch (42:9): [True: 4, False: 0]
  ------------------
   43|      4|        return NID_undef;
  ------------------
  |  |   18|      4|#define NID_undef                       0
  ------------------
   44|      0|    return meth->type;
   45|      4|}

ossl_load_builtin_compressions:
   29|      4|{
   30|      4|    STACK_OF(SSL_COMP) *comp_methods = NULL;
  ------------------
  |  |   31|      4|# define STACK_OF(type) struct stack_st_##type
  ------------------
   31|      4|#ifndef OPENSSL_NO_COMP
   32|      4|    SSL_COMP *comp = NULL;
   33|      4|    COMP_METHOD *method = COMP_zlib();
   34|       |
   35|      4|    comp_methods = sk_SSL_COMP_new(sk_comp_cmp);
  ------------------
  |  |   69|      4|#define sk_SSL_COMP_new(cmp) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_new(ossl_check_SSL_COMP_compfunc_type(cmp)))
  ------------------
   36|       |
   37|      4|    if (COMP_get_type(method) != NID_undef && comp_methods != NULL) {
  ------------------
  |  |   18|      8|#define NID_undef                       0
  ------------------
  |  Branch (37:9): [True: 0, False: 4]
  |  Branch (37:47): [True: 0, False: 0]
  ------------------
   38|      0|        comp = OPENSSL_malloc(sizeof(*comp));
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|      0|        if (comp != NULL) {
  ------------------
  |  Branch (39:13): [True: 0, False: 0]
  ------------------
   40|      0|            comp->method = method;
   41|      0|            comp->id = SSL_COMP_ZLIB_IDX;
  ------------------
  |  |   18|      0|#define SSL_COMP_ZLIB_IDX       1
  ------------------
   42|      0|            comp->name = COMP_get_name(method);
   43|      0|            if (!sk_SSL_COMP_push(comp_methods, comp))
  ------------------
  |  |   77|      0|#define sk_SSL_COMP_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
  ------------------
  |  Branch (43:17): [True: 0, False: 0]
  ------------------
   44|      0|                OPENSSL_free(comp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|      0|        }
   46|      0|    }
   47|      4|#endif
   48|      4|    return comp_methods;
   49|      4|}
ossl_free_compression_methods_int:
   57|      2|{
   58|      2|    sk_SSL_COMP_pop_free(methods, cmeth_free);
  ------------------
  |  |   81|      2|#define sk_SSL_COMP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_freefunc_type(freefunc))
  ------------------
   59|      2|}

_CONF_free_data:
  137|      2|{
  138|      2|    if (conf == NULL)
  ------------------
  |  Branch (138:9): [True: 0, False: 2]
  ------------------
  139|      0|        return;
  140|       |
  141|      2|    OPENSSL_free(conf->includedir);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  142|      2|    if (conf->data == NULL)
  ------------------
  |  Branch (142:9): [True: 2, False: 0]
  ------------------
  143|      2|        return;
  144|       |
  145|       |    /* evil thing to make sure the 'OPENSSL_free()' works as expected */
  146|      0|    lh_CONF_VALUE_set_down_load(conf->data, 0);
  ------------------
  |  |   83|      0|#define lh_CONF_VALUE_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_CONF_VALUE_lh_type(lh), dl)
  ------------------
  147|      0|    lh_CONF_VALUE_doall_LH_CONF_VALUE(conf->data, value_free_hash, conf->data);
  148|       |
  149|       |    /*
  150|       |     * We now have only 'section' entries in the hash table. Due to problems
  151|       |     * with
  152|       |     */
  153|       |
  154|      0|    lh_CONF_VALUE_doall(conf->data, value_free_stack_doall);
  ------------------
  |  |   84|      0|#define lh_CONF_VALUE_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_doallfunc_type(dfn))
  ------------------
  155|      0|    lh_CONF_VALUE_free(conf->data);
  ------------------
  |  |   72|      0|#define lh_CONF_VALUE_free(lh) OPENSSL_LH_free(ossl_check_CONF_VALUE_lh_type(lh))
  ------------------
  156|      0|}

NCONF_default:
   87|      2|{
   88|      2|    return &default_method;
   89|      2|}
conf_def.c:def_create:
  112|      2|{
  113|      2|    CONF *ret;
  114|       |
  115|      2|    ret = OPENSSL_malloc(sizeof(*ret));
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  116|      2|    if (ret != NULL)
  ------------------
  |  Branch (116:9): [True: 2, False: 0]
  ------------------
  117|      2|        if (meth->init(ret) == 0) {
  ------------------
  |  Branch (117:13): [True: 0, False: 2]
  ------------------
  118|      0|            OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  119|      0|            ret = NULL;
  120|      0|        }
  121|      2|    return ret;
  122|      2|}
conf_def.c:def_init_default:
  125|      2|{
  126|      2|    if (conf == NULL)
  ------------------
  |  Branch (126:9): [True: 0, False: 2]
  ------------------
  127|      0|        return 0;
  128|       |
  129|      2|    memset(conf, 0, sizeof(*conf));
  130|      2|    conf->meth = &default_method;
  131|      2|    conf->meth_data = (void *)CONF_type_default;
  132|       |
  133|      2|    return 1;
  134|      2|}
conf_def.c:def_destroy:
  151|      2|{
  152|      2|    if (def_destroy_data(conf)) {
  ------------------
  |  Branch (152:9): [True: 2, False: 0]
  ------------------
  153|      2|        OPENSSL_free(conf);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|      2|        return 1;
  155|      2|    }
  156|      0|    return 0;
  157|      2|}
conf_def.c:def_destroy_data:
  160|      2|{
  161|      2|    if (conf == NULL)
  ------------------
  |  Branch (161:9): [True: 0, False: 2]
  ------------------
  162|      0|        return 0;
  163|      2|    _CONF_free_data(conf);
  164|      2|    return 1;
  165|      2|}
conf_def.c:def_load:
  168|      2|{
  169|      2|    int ret;
  170|      2|    BIO *in = NULL;
  171|       |
  172|       |#ifdef OPENSSL_SYS_VMS
  173|       |    in = BIO_new_file(name, "r");
  174|       |#else
  175|      2|    in = BIO_new_file(name, "rb");
  176|      2|#endif
  177|      2|    if (in == NULL) {
  ------------------
  |  Branch (177:9): [True: 2, False: 0]
  ------------------
  178|      2|        if (ERR_GET_REASON(ERR_peek_last_error()) == BIO_R_NO_SUCH_FILE)
  ------------------
  |  |   48|      2|# define BIO_R_NO_SUCH_FILE                               128
  ------------------
  |  Branch (178:13): [True: 2, False: 0]
  ------------------
  179|      2|            ERR_raise(ERR_LIB_CONF, CONF_R_NO_SUCH_FILE);
  ------------------
  |  |  401|      2|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      2|    (ERR_new(),                                                 \
  |  |  |  |  404|      2|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      2|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      2|     ERR_set_error)
  |  |  ------------------
  ------------------
  180|      0|        else
  181|      2|            ERR_raise(ERR_LIB_CONF, ERR_R_SYS_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  182|      2|        return 0;
  183|      2|    }
  184|       |
  185|      0|    ret = def_load_bio(conf, in, line);
  186|      0|    BIO_free(in);
  187|       |
  188|      0|    return ret;
  189|      2|}

ossl_err_load_CONF_strings:
   68|      2|{
   69|      2|#ifndef OPENSSL_NO_ERR
   70|      2|    if (ERR_reason_error_string(CONF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (70:9): [True: 2, False: 0]
  ------------------
   71|      2|        ERR_load_strings_const(CONF_str_reasons);
   72|      2|#endif
   73|      2|    return 1;
   74|      2|}

NCONF_new_ex:
  183|      2|{
  184|      2|    CONF *ret;
  185|       |
  186|      2|    if (meth == NULL)
  ------------------
  |  Branch (186:9): [True: 2, False: 0]
  ------------------
  187|      2|        meth = NCONF_default();
  188|       |
  189|      2|    ret = meth->create(meth);
  190|      2|    if (ret == NULL) {
  ------------------
  |  Branch (190:9): [True: 0, False: 2]
  ------------------
  191|      0|        ERR_raise(ERR_LIB_CONF, ERR_R_CONF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  192|      0|        return NULL;
  193|      0|    }
  194|      2|    ret->libctx = libctx;
  195|       |
  196|      2|    return ret;
  197|      2|}
NCONF_free:
  205|      2|{
  206|      2|    if (conf == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 2]
  ------------------
  207|      0|        return;
  208|      2|    conf->meth->destroy(conf);
  209|      2|}
NCONF_load:
  252|      2|{
  253|      2|    if (conf == NULL) {
  ------------------
  |  Branch (253:9): [True: 0, False: 2]
  ------------------
  254|      0|        ERR_raise(ERR_LIB_CONF, CONF_R_NO_CONF);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  255|      0|        return 0;
  256|      0|    }
  257|       |
  258|      2|    return conf->meth->load(conf, file, eline);
  259|      2|}

CONF_modules_load_file_ex:
  193|      2|{
  194|      2|    char *file = NULL;
  195|      2|    CONF *conf = NULL;
  196|      2|    int ret = 0, diagnostics = OSSL_LIB_CTX_get_conf_diagnostics(libctx);
  197|       |
  198|      2|    ERR_set_mark();
  199|       |
  200|      2|    if (filename == NULL) {
  ------------------
  |  Branch (200:9): [True: 2, False: 0]
  ------------------
  201|      2|        file = CONF_get1_default_config_file();
  202|      2|        if (file == NULL)
  ------------------
  |  Branch (202:13): [True: 0, False: 2]
  ------------------
  203|      0|            goto err;
  204|      2|        if (*file == '\0') {
  ------------------
  |  Branch (204:13): [True: 0, False: 2]
  ------------------
  205|       |            /* Do not try to load an empty file name but do not error out */
  206|      0|            ret = 1;
  207|      0|            goto err;
  208|      0|        }
  209|      2|    } else {
  210|      0|        file = (char *)filename;
  211|      0|    }
  212|       |
  213|      2|    conf = NCONF_new_ex(libctx, NULL);
  214|      2|    if (conf == NULL)
  ------------------
  |  Branch (214:9): [True: 0, False: 2]
  ------------------
  215|      0|        goto err;
  216|       |
  217|      2|    if (NCONF_load(conf, file, NULL) <= 0) {
  ------------------
  |  Branch (217:9): [True: 2, False: 0]
  ------------------
  218|      2|        if ((flags & CONF_MFLAGS_IGNORE_MISSING_FILE) &&
  ------------------
  |  |  110|      2|# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
  ------------------
  |  Branch (218:13): [True: 2, False: 0]
  ------------------
  219|      2|            (ERR_GET_REASON(ERR_peek_last_error()) == CONF_R_NO_SUCH_FILE)) {
  ------------------
  |  |   36|      2|# define CONF_R_NO_SUCH_FILE                              114
  ------------------
  |  Branch (219:13): [True: 2, False: 0]
  ------------------
  220|      2|            ret = 1;
  221|      2|        }
  222|      2|        goto err;
  223|      2|    }
  224|       |
  225|      0|    ret = CONF_modules_load(conf, appname, flags);
  226|       |    /* CONF_modules_load() might change the diagnostics setting, reread it. */
  227|      0|    diagnostics = OSSL_LIB_CTX_get_conf_diagnostics(libctx);
  228|       |
  229|      2| err:
  230|      2|    if (filename == NULL)
  ------------------
  |  Branch (230:9): [True: 2, False: 0]
  ------------------
  231|      2|        OPENSSL_free(file);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  232|      2|    NCONF_free(conf);
  233|       |
  234|      2|    if ((flags & CONF_MFLAGS_IGNORE_RETURN_CODES) != 0 && !diagnostics)
  ------------------
  |  |  107|      2|# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
  ------------------
  |  Branch (234:9): [True: 2, False: 0]
  |  Branch (234:59): [True: 2, False: 0]
  ------------------
  235|      2|        ret = 1;
  236|       |
  237|      2|    if (ret > 0)
  ------------------
  |  Branch (237:9): [True: 2, False: 0]
  ------------------
  238|      2|        ERR_pop_to_mark();
  239|      0|    else
  240|      0|        ERR_clear_last_mark();
  241|       |
  242|      2|    return ret;
  243|      0|}
CONF_modules_unload:
  517|      2|{
  518|      2|    int i;
  519|      2|    CONF_MODULE *md;
  520|      2|    STACK_OF(CONF_MODULE) *old_modules;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  521|      2|    STACK_OF(CONF_MODULE) *new_modules;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  522|      2|    STACK_OF(CONF_MODULE) *to_delete;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  523|       |
  524|      2|    if (!conf_modules_finish_int()) /* also inits module list lock */
  ------------------
  |  Branch (524:9): [True: 0, False: 2]
  ------------------
  525|      0|        return;
  526|       |
  527|      2|    ossl_rcu_write_lock(module_list_lock);
  528|       |
  529|      2|    old_modules = ossl_rcu_deref(&supported_modules);
  ------------------
  |  |   30|      2|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  530|      2|    new_modules = sk_CONF_MODULE_dup(old_modules);
  531|       |
  532|      2|    if (new_modules == NULL) {
  ------------------
  |  Branch (532:9): [True: 0, False: 2]
  ------------------
  533|      0|        ossl_rcu_write_unlock(module_list_lock);
  534|      0|        return;
  535|      0|    }
  536|       |
  537|      2|    to_delete = sk_CONF_MODULE_new_null();
  538|       |
  539|       |    /* unload modules in reverse order */
  540|      2|    for (i = sk_CONF_MODULE_num(new_modules) - 1; i >= 0; i--) {
  ------------------
  |  Branch (540:51): [True: 0, False: 2]
  ------------------
  541|      0|        md = sk_CONF_MODULE_value(new_modules, i);
  542|       |        /* If static or in use and 'all' not set ignore it */
  543|      0|        if (((md->links > 0) || !md->dso) && !all)
  ------------------
  |  Branch (543:14): [True: 0, False: 0]
  |  Branch (543:33): [True: 0, False: 0]
  |  Branch (543:46): [True: 0, False: 0]
  ------------------
  544|      0|            continue;
  545|       |        /* Since we're working in reverse this is OK */
  546|      0|        (void)sk_CONF_MODULE_delete(new_modules, i);
  547|      0|        sk_CONF_MODULE_push(to_delete, md);
  548|      0|    }
  549|       |
  550|      2|    if (sk_CONF_MODULE_num(new_modules) == 0) {
  ------------------
  |  Branch (550:9): [True: 2, False: 0]
  ------------------
  551|      2|        sk_CONF_MODULE_free(new_modules);
  552|      2|        new_modules = NULL;
  553|      2|    }
  554|       |
  555|      2|    ossl_rcu_assign_ptr(&supported_modules, &new_modules);
  ------------------
  |  |   31|      2|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  556|      2|    ossl_rcu_write_unlock(module_list_lock);
  557|      2|    ossl_synchronize_rcu(module_list_lock);
  558|      2|    sk_CONF_MODULE_free(old_modules);
  559|      2|    sk_CONF_MODULE_pop_free(to_delete, module_free);
  560|       |
  561|      2|}
ossl_config_modules_free:
  632|      2|{
  633|      2|    CONF_modules_unload(1); /* calls CONF_modules_finish */
  634|      2|    module_lists_free();
  635|      2|}
CONF_get1_default_config_file:
  686|      2|{
  687|      2|    const char *t;
  688|      2|    char *file, *sep = "";
  689|      2|    size_t size;
  690|       |
  691|      2|    if ((file = ossl_safe_getenv("OPENSSL_CONF")) != NULL)
  ------------------
  |  Branch (691:9): [True: 0, False: 2]
  ------------------
  692|      0|        return OPENSSL_strdup(file);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  693|       |
  694|      2|    t = X509_get_default_cert_area();
  695|       |    /*
  696|       |     * On windows systems with -DOSSL_WINCTX set, if the needed registry
  697|       |     * keys are not yet set, openssl applets will return, due to an inability
  698|       |     * to locate various directories, like the default cert area.  In that
  699|       |     * event, clone an empty string here, so that commands like openssl version
  700|       |     * continue to operate properly without needing to set OPENSSL_CONF.
  701|       |     * Applets like cms will fail gracefully later when they try to parse an
  702|       |     * empty config file
  703|       |     */
  704|      2|    if (t == NULL)
  ------------------
  |  Branch (704:9): [True: 0, False: 2]
  ------------------
  705|      0|        return OPENSSL_strdup("");
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  706|       |
  707|      2|#ifndef OPENSSL_SYS_VMS
  708|      2|    sep = "/";
  709|      2|#endif
  710|      2|    size = strlen(t) + strlen(sep) + strlen(OPENSSL_CONF) + 1;
  ------------------
  |  |   81|      2|# define OPENSSL_CONF             "openssl.cnf"
  ------------------
  711|      2|    file = OPENSSL_malloc(size);
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  712|       |
  713|      2|    if (file == NULL)
  ------------------
  |  Branch (713:9): [True: 0, False: 2]
  ------------------
  714|      0|        return NULL;
  715|      2|    BIO_snprintf(file, size, "%s%s%s", t, sep, OPENSSL_CONF);
  ------------------
  |  |   81|      2|# define OPENSSL_CONF             "openssl.cnf"
  ------------------
  716|       |
  717|      2|    return file;
  718|      2|}
conf_mod.c:do_init_module_list_lock:
  101|      2|{
  102|      2|    module_list_lock = ossl_rcu_lock_new(1, NULL);
  103|      2|    if (module_list_lock == NULL) {
  ------------------
  |  Branch (103:9): [True: 0, False: 2]
  ------------------
  104|      0|        ERR_raise(ERR_LIB_CONF, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  105|      0|        return 0;
  106|      0|    }
  107|       |
  108|      2|    return 1;
  109|      2|}
conf_mod.c:conf_modules_finish_int:
  574|      2|{
  575|      2|    CONF_IMODULE *imod;
  576|      2|    STACK_OF(CONF_IMODULE) *old_modules;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  577|      2|    STACK_OF(CONF_IMODULE) *new_modules = NULL;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  578|       |
  579|      2|    if (!RUN_ONCE(&init_module_list_lock, do_init_module_list_lock))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (579:9): [True: 0, False: 2]
  ------------------
  580|      0|        return 0;
  581|       |
  582|       |    /* If module_list_lock is NULL here it means we were already unloaded */
  583|      2|    if (module_list_lock == NULL)
  ------------------
  |  Branch (583:9): [True: 0, False: 2]
  ------------------
  584|      0|        return 0;
  585|       |
  586|      2|    ossl_rcu_write_lock(module_list_lock);
  587|      2|    old_modules = ossl_rcu_deref(&initialized_modules);
  ------------------
  |  |   30|      2|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  588|      2|    ossl_rcu_assign_ptr(&initialized_modules, &new_modules);
  ------------------
  |  |   31|      2|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  589|      2|    ossl_rcu_write_unlock(module_list_lock);
  590|      2|    ossl_synchronize_rcu(module_list_lock);
  591|       |
  592|      2|    while (sk_CONF_IMODULE_num(old_modules) > 0) {
  ------------------
  |  Branch (592:12): [True: 0, False: 2]
  ------------------
  593|      0|        imod = sk_CONF_IMODULE_pop(old_modules);
  594|      0|        module_finish(imod);
  595|      0|    }
  596|      2|    sk_CONF_IMODULE_free(old_modules);
  597|       |
  598|      2|    return 1;
  599|      2|}
conf_mod.c:module_lists_free:
   89|      2|{
   90|      2|    ossl_rcu_lock_free(module_list_lock);
   91|      2|    module_list_lock = NULL;
   92|       |
   93|      2|    sk_CONF_MODULE_free(supported_modules);
   94|      2|    supported_modules = NULL;
   95|       |
   96|      2|    sk_CONF_IMODULE_free(initialized_modules);
   97|      2|    initialized_modules = NULL;
   98|      2|}

ossl_config_int:
   47|      2|{
   48|      2|    int ret = 0;
   49|      2|#if defined(OPENSSL_INIT_DEBUG) || !defined(OPENSSL_SYS_UEFI)
   50|      2|    const char *filename;
   51|      2|    const char *appname;
   52|      2|    unsigned long flags;
   53|      2|#endif
   54|       |
   55|      2|    if (openssl_configured)
  ------------------
  |  Branch (55:9): [True: 0, False: 2]
  ------------------
   56|      0|        return 1;
   57|       |
   58|      2|#if defined(OPENSSL_INIT_DEBUG) || !defined(OPENSSL_SYS_UEFI)
   59|      2|    filename = settings ? settings->filename : NULL;
  ------------------
  |  Branch (59:16): [True: 0, False: 2]
  ------------------
   60|      2|    appname = settings ? settings->appname : NULL;
  ------------------
  |  Branch (60:15): [True: 0, False: 2]
  ------------------
   61|      2|    flags = settings ? settings->flags : DEFAULT_CONF_MFLAGS;
  ------------------
  |  |   17|      4|    (CONF_MFLAGS_DEFAULT_SECTION | \
  |  |  ------------------
  |  |  |  |  111|      2|# define CONF_MFLAGS_DEFAULT_SECTION     0x20
  |  |  ------------------
  |  |   18|      4|     CONF_MFLAGS_IGNORE_MISSING_FILE | \
  |  |  ------------------
  |  |  |  |  110|      2|# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
  |  |  ------------------
  |  |   19|      4|     CONF_MFLAGS_IGNORE_RETURN_CODES)
  |  |  ------------------
  |  |  |  |  107|      2|# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
  |  |  ------------------
  ------------------
  |  Branch (61:13): [True: 0, False: 2]
  ------------------
   62|      2|#endif
   63|       |
   64|       |#ifdef OPENSSL_INIT_DEBUG
   65|       |    fprintf(stderr, "OPENSSL_INIT: ossl_config_int(%s, %s, %lu)\n",
   66|       |            filename, appname, flags);
   67|       |#endif
   68|       |
   69|      2|#ifndef OPENSSL_SYS_UEFI
   70|      2|    ret = CONF_modules_load_file_ex(OSSL_LIB_CTX_get0_global_default(),
   71|      2|                                    filename, appname, flags);
   72|       |#else
   73|       |    ret = 1;
   74|       |#endif
   75|      2|    openssl_configured = 1;
   76|      2|    return ret;
   77|      2|}

ossl_lib_ctx_write_lock:
   60|     57|{
   61|     57|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 57]
  ------------------
   62|      0|        return 0;
   63|     57|    return CRYPTO_THREAD_write_lock(ctx->lock);
   64|     57|}
ossl_lib_ctx_read_lock:
   67|    399|{
   68|    399|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (68:9): [True: 0, False: 399]
  ------------------
   69|      0|        return 0;
   70|    399|    return CRYPTO_THREAD_read_lock(ctx->lock);
   71|    399|}
ossl_lib_ctx_unlock:
   74|    456|{
   75|    456|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (75:9): [True: 0, False: 456]
  ------------------
   76|      0|        return 0;
   77|    456|    return CRYPTO_THREAD_unlock(ctx->lock);
   78|    456|}
ossl_lib_ctx_default_deinit:
  412|      2|{
  413|      2|    if (!default_context_inited)
  ------------------
  |  Branch (413:9): [True: 0, False: 2]
  ------------------
  414|      0|        return;
  415|      2|    context_deinit(&default_context_int);
  416|      2|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  417|      2|    default_context_inited = 0;
  418|      2|}
OSSL_LIB_CTX_new:
  447|      2|{
  448|      2|    OSSL_LIB_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  449|       |
  450|      2|    if (ctx != NULL && !context_init(ctx)) {
  ------------------
  |  Branch (450:9): [True: 2, False: 0]
  |  Branch (450:24): [True: 0, False: 2]
  ------------------
  451|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  452|      0|        ctx = NULL;
  453|      0|    }
  454|      2|    return ctx;
  455|      2|}
OSSL_LIB_CTX_get0_global_default:
  512|      2|{
  513|      2|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (513:9): [True: 0, False: 2]
  ------------------
  514|      0|        return NULL;
  515|       |
  516|      2|    return &default_context_int;
  517|      2|}
ossl_release_default_drbg_ctx:
  533|      1|{
  534|       |    /* early release of the DRBG in global default libctx */
  535|      1|    if (default_context_int.drbg != NULL) {
  ------------------
  |  Branch (535:9): [True: 1, False: 0]
  ------------------
  536|      1|        ossl_rand_ctx_free(default_context_int.drbg);
  537|      1|        default_context_int.drbg = NULL;
  538|      1|    }
  539|      1|}
ossl_lib_ctx_get_concrete:
  543|  5.66M|{
  544|  5.66M|#ifndef FIPS_MODULE
  545|  5.66M|    if (ctx == NULL)
  ------------------
  |  Branch (545:9): [True: 5.28M, False: 376k]
  ------------------
  546|  5.28M|        return get_default_context();
  547|   376k|#endif
  548|   376k|    return ctx;
  549|  5.66M|}
ossl_lib_ctx_is_default:
  552|  6.61k|{
  553|  6.61k|#ifndef FIPS_MODULE
  554|  6.61k|    if (ctx == NULL || ctx == get_default_context())
  ------------------
  |  Branch (554:9): [True: 496, False: 6.11k]
  |  Branch (554:24): [True: 6.11k, False: 0]
  ------------------
  555|  6.61k|        return 1;
  556|      0|#endif
  557|      0|    return 0;
  558|  6.61k|}
ossl_lib_ctx_get_data:
  570|   498k|{
  571|   498k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  572|   498k|    if (ctx == NULL)
  ------------------
  |  Branch (572:9): [True: 0, False: 498k]
  ------------------
  573|      0|        return NULL;
  574|       |
  575|   498k|    switch (index) {
  576|   133k|    case OSSL_LIB_CTX_PROPERTY_STRING_INDEX:
  ------------------
  |  |  101|   133k|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  |  Branch (576:5): [True: 133k, False: 365k]
  ------------------
  577|   133k|        return ctx->property_string_data;
  578|  8.11k|    case OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX:
  ------------------
  |  |   98|  8.11k|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
  |  Branch (578:5): [True: 8.11k, False: 490k]
  ------------------
  579|  8.11k|        return ctx->evp_method_store;
  580|  6.62k|    case OSSL_LIB_CTX_PROVIDER_STORE_INDEX:
  ------------------
  |  |   99|  6.62k|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  |  Branch (580:5): [True: 6.62k, False: 491k]
  ------------------
  581|  6.62k|        return ctx->provider_store;
  582|   212k|    case OSSL_LIB_CTX_NAMEMAP_INDEX:
  ------------------
  |  |  102|   212k|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  |  Branch (582:5): [True: 212k, False: 286k]
  ------------------
  583|   212k|        return ctx->namemap;
  584|    456|    case OSSL_LIB_CTX_PROPERTY_DEFN_INDEX:
  ------------------
  |  |  100|    456|# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX            2
  ------------------
  |  Branch (584:5): [True: 456, False: 498k]
  ------------------
  585|    456|        return ctx->property_defns;
  586|      7|    case OSSL_LIB_CTX_GLOBAL_PROPERTIES:
  ------------------
  |  |  114|      7|# define OSSL_LIB_CTX_GLOBAL_PROPERTIES             14
  ------------------
  |  Branch (586:5): [True: 7, False: 498k]
  ------------------
  587|      7|        return ctx->global_properties;
  588|  58.7k|    case OSSL_LIB_CTX_DRBG_INDEX:
  ------------------
  |  |  103|  58.7k|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  |  Branch (588:5): [True: 58.7k, False: 439k]
  ------------------
  589|  58.7k|        return ctx->drbg;
  590|      0|    case OSSL_LIB_CTX_DRBG_NONCE_INDEX:
  ------------------
  |  |  104|      0|# define OSSL_LIB_CTX_DRBG_NONCE_INDEX               6
  ------------------
  |  Branch (590:5): [True: 0, False: 498k]
  ------------------
  591|      0|        return ctx->drbg_nonce;
  592|      0|#ifndef FIPS_MODULE
  593|      0|    case OSSL_LIB_CTX_PROVIDER_CONF_INDEX:
  ------------------
  |  |  116|      0|# define OSSL_LIB_CTX_PROVIDER_CONF_INDEX           16
  ------------------
  |  Branch (593:5): [True: 0, False: 498k]
  ------------------
  594|      0|        return ctx->provider_conf;
  595|      0|    case OSSL_LIB_CTX_BIO_CORE_INDEX:
  ------------------
  |  |  117|      0|# define OSSL_LIB_CTX_BIO_CORE_INDEX                17
  ------------------
  |  Branch (595:5): [True: 0, False: 498k]
  ------------------
  596|      0|        return ctx->bio_core;
  597|      0|    case OSSL_LIB_CTX_CHILD_PROVIDER_INDEX:
  ------------------
  |  |  118|      0|# define OSSL_LIB_CTX_CHILD_PROVIDER_INDEX          18
  ------------------
  |  Branch (597:5): [True: 0, False: 498k]
  ------------------
  598|      0|        return ctx->child_provider;
  599|  1.68k|    case OSSL_LIB_CTX_DECODER_STORE_INDEX:
  ------------------
  |  |  111|  1.68k|# define OSSL_LIB_CTX_DECODER_STORE_INDEX           11
  ------------------
  |  Branch (599:5): [True: 1.68k, False: 496k]
  ------------------
  600|  1.68k|        return ctx->decoder_store;
  601|  40.3k|    case OSSL_LIB_CTX_DECODER_CACHE_INDEX:
  ------------------
  |  |  120|  40.3k|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  |  Branch (601:5): [True: 40.3k, False: 458k]
  ------------------
  602|  40.3k|        return ctx->decoder_cache;
  603|  36.8k|    case OSSL_LIB_CTX_ENCODER_STORE_INDEX:
  ------------------
  |  |  110|  36.8k|# define OSSL_LIB_CTX_ENCODER_STORE_INDEX           10
  ------------------
  |  Branch (603:5): [True: 36.8k, False: 461k]
  ------------------
  604|  36.8k|        return ctx->encoder_store;
  605|      2|    case OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX:
  ------------------
  |  |  115|      2|# define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX      15
  ------------------
  |  Branch (605:5): [True: 2, False: 498k]
  ------------------
  606|      2|        return ctx->store_loader_store;
  607|      0|    case OSSL_LIB_CTX_SELF_TEST_CB_INDEX:
  ------------------
  |  |  112|      0|# define OSSL_LIB_CTX_SELF_TEST_CB_INDEX            12
  ------------------
  |  Branch (607:5): [True: 0, False: 498k]
  ------------------
  608|      0|        return ctx->self_test_cb;
  609|      0|    case OSSL_LIB_CTX_INDICATOR_CB_INDEX:
  ------------------
  |  |  122|      0|# define OSSL_LIB_CTX_INDICATOR_CB_INDEX            22
  ------------------
  |  Branch (609:5): [True: 0, False: 498k]
  ------------------
  610|      0|        return ctx->indicator_cb;
  611|      0|#endif
  612|      0|#ifndef OPENSSL_NO_THREAD_POOL
  613|      0|    case OSSL_LIB_CTX_THREAD_INDEX:
  ------------------
  |  |  119|      0|# define OSSL_LIB_CTX_THREAD_INDEX                  19
  ------------------
  |  Branch (613:5): [True: 0, False: 498k]
  ------------------
  614|      0|        return ctx->threads;
  615|      0|#endif
  616|       |
  617|       |#ifdef FIPS_MODULE
  618|       |    case OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX:
  619|       |        return ctx->thread_event_handler;
  620|       |
  621|       |    case OSSL_LIB_CTX_FIPS_PROV_INDEX:
  622|       |        return ctx->fips_prov;
  623|       |#endif
  624|       |
  625|      3|    case OSSL_LIB_CTX_COMP_METHODS:
  ------------------
  |  |  121|      3|# define OSSL_LIB_CTX_COMP_METHODS                  21
  ------------------
  |  Branch (625:5): [True: 3, False: 498k]
  ------------------
  626|      3|        return (void *)&ctx->comp_methods;
  627|       |
  628|      0|    default:
  ------------------
  |  Branch (628:5): [True: 0, False: 498k]
  ------------------
  629|      0|        return NULL;
  630|   498k|    }
  631|   498k|}
OSSL_LIB_CTX_get_data:
  634|      3|{
  635|      3|    return ossl_lib_ctx_get_data(ctx, index);
  636|      3|}
ossl_lib_ctx_get_ex_data_global:
  639|  5.16M|{
  640|  5.16M|    ctx = ossl_lib_ctx_get_concrete(ctx);
  641|  5.16M|    if (ctx == NULL)
  ------------------
  |  Branch (641:9): [True: 0, False: 5.16M]
  ------------------
  642|      0|        return NULL;
  643|  5.16M|    return &ctx->global;
  644|  5.16M|}
OSSL_LIB_CTX_get_conf_diagnostics:
  668|      2|{
  669|      2|    libctx = ossl_lib_ctx_get_concrete(libctx);
  670|      2|    if (libctx == NULL)
  ------------------
  |  Branch (670:9): [True: 0, False: 2]
  ------------------
  671|      0|        return 0;
  672|      2|    return libctx->conf_diagnostics;
  673|      2|}
context.c:context_deinit:
  370|      2|{
  371|      2|    if (ctx == NULL)
  ------------------
  |  Branch (371:9): [True: 0, False: 2]
  ------------------
  372|      0|        return 1;
  373|       |
  374|      2|    ossl_ctx_thread_stop(ctx);
  375|       |
  376|      2|    context_deinit_objs(ctx);
  377|       |
  378|      2|    ossl_crypto_cleanup_all_ex_data_int(ctx);
  379|       |
  380|      2|    CRYPTO_THREAD_lock_free(ctx->lock);
  381|      2|    ctx->lock = NULL;
  382|      2|    CRYPTO_THREAD_cleanup_local(&ctx->rcu_local_key);
  383|      2|    return 1;
  384|      2|}
context.c:context_deinit_objs:
  235|      2|{
  236|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  237|      2|    if (ctx->evp_method_store != NULL) {
  ------------------
  |  Branch (237:9): [True: 2, False: 0]
  ------------------
  238|      2|        ossl_method_store_free(ctx->evp_method_store);
  239|      2|        ctx->evp_method_store = NULL;
  240|      2|    }
  241|       |
  242|       |    /* P2. */
  243|      2|    if (ctx->drbg != NULL) {
  ------------------
  |  Branch (243:9): [True: 1, False: 1]
  ------------------
  244|      1|        ossl_rand_ctx_free(ctx->drbg);
  245|      1|        ctx->drbg = NULL;
  246|      1|    }
  247|       |
  248|      2|#ifndef FIPS_MODULE
  249|       |    /* P2. */
  250|      2|    if (ctx->provider_conf != NULL) {
  ------------------
  |  Branch (250:9): [True: 2, False: 0]
  ------------------
  251|      2|        ossl_prov_conf_ctx_free(ctx->provider_conf);
  252|      2|        ctx->provider_conf = NULL;
  253|      2|    }
  254|       |
  255|       |    /*
  256|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  257|       |     * provider store
  258|       |     */
  259|      2|    if (ctx->decoder_store != NULL) {
  ------------------
  |  Branch (259:9): [True: 2, False: 0]
  ------------------
  260|      2|        ossl_method_store_free(ctx->decoder_store);
  261|      2|        ctx->decoder_store = NULL;
  262|      2|    }
  263|      2|    if (ctx->decoder_cache != NULL) {
  ------------------
  |  Branch (263:9): [True: 2, False: 0]
  ------------------
  264|      2|        ossl_decoder_cache_free(ctx->decoder_cache);
  265|      2|        ctx->decoder_cache = NULL;
  266|      2|    }
  267|       |
  268|       |
  269|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  270|      2|    if (ctx->encoder_store != NULL) {
  ------------------
  |  Branch (270:9): [True: 2, False: 0]
  ------------------
  271|      2|        ossl_method_store_free(ctx->encoder_store);
  272|      2|        ctx->encoder_store = NULL;
  273|      2|    }
  274|       |
  275|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  276|      2|    if (ctx->store_loader_store != NULL) {
  ------------------
  |  Branch (276:9): [True: 2, False: 0]
  ------------------
  277|      2|        ossl_method_store_free(ctx->store_loader_store);
  278|      2|        ctx->store_loader_store = NULL;
  279|      2|    }
  280|      2|#endif
  281|       |
  282|       |    /* P1. Needs to be freed before the child provider data is freed */
  283|      2|    if (ctx->provider_store != NULL) {
  ------------------
  |  Branch (283:9): [True: 2, False: 0]
  ------------------
  284|      2|        ossl_provider_store_free(ctx->provider_store);
  285|      2|        ctx->provider_store = NULL;
  286|      2|    }
  287|       |
  288|       |    /* Default priority. */
  289|      2|    if (ctx->property_string_data != NULL) {
  ------------------
  |  Branch (289:9): [True: 2, False: 0]
  ------------------
  290|      2|        ossl_property_string_data_free(ctx->property_string_data);
  291|      2|        ctx->property_string_data = NULL;
  292|      2|    }
  293|       |
  294|      2|    if (ctx->namemap != NULL) {
  ------------------
  |  Branch (294:9): [True: 2, False: 0]
  ------------------
  295|      2|        ossl_stored_namemap_free(ctx->namemap);
  296|      2|        ctx->namemap = NULL;
  297|      2|    }
  298|       |
  299|      2|    if (ctx->property_defns != NULL) {
  ------------------
  |  Branch (299:9): [True: 2, False: 0]
  ------------------
  300|      2|        ossl_property_defns_free(ctx->property_defns);
  301|      2|        ctx->property_defns = NULL;
  302|      2|    }
  303|       |
  304|      2|    if (ctx->global_properties != NULL) {
  ------------------
  |  Branch (304:9): [True: 2, False: 0]
  ------------------
  305|      2|        ossl_ctx_global_properties_free(ctx->global_properties);
  306|      2|        ctx->global_properties = NULL;
  307|      2|    }
  308|       |
  309|      2|#ifndef FIPS_MODULE
  310|      2|    if (ctx->bio_core != NULL) {
  ------------------
  |  Branch (310:9): [True: 2, False: 0]
  ------------------
  311|      2|        ossl_bio_core_globals_free(ctx->bio_core);
  312|      2|        ctx->bio_core = NULL;
  313|      2|    }
  314|      2|#endif
  315|       |
  316|      2|    if (ctx->drbg_nonce != NULL) {
  ------------------
  |  Branch (316:9): [True: 2, False: 0]
  ------------------
  317|      2|        ossl_prov_drbg_nonce_ctx_free(ctx->drbg_nonce);
  318|      2|        ctx->drbg_nonce = NULL;
  319|      2|    }
  320|       |
  321|      2|#ifndef FIPS_MODULE
  322|      2|    if (ctx->indicator_cb != NULL) {
  ------------------
  |  Branch (322:9): [True: 2, False: 0]
  ------------------
  323|      2|        ossl_indicator_set_callback_free(ctx->indicator_cb);
  324|      2|        ctx->indicator_cb = NULL;
  325|      2|    }
  326|       |
  327|      2|    if (ctx->self_test_cb != NULL) {
  ------------------
  |  Branch (327:9): [True: 2, False: 0]
  ------------------
  328|      2|        ossl_self_test_set_callback_free(ctx->self_test_cb);
  329|      2|        ctx->self_test_cb = NULL;
  330|      2|    }
  331|      2|#endif
  332|       |
  333|       |#ifdef FIPS_MODULE
  334|       |    if (ctx->thread_event_handler != NULL) {
  335|       |        ossl_thread_event_ctx_free(ctx->thread_event_handler);
  336|       |        ctx->thread_event_handler = NULL;
  337|       |    }
  338|       |
  339|       |    if (ctx->fips_prov != NULL) {
  340|       |        ossl_fips_prov_ossl_ctx_free(ctx->fips_prov);
  341|       |        ctx->fips_prov = NULL;
  342|       |    }
  343|       |#endif
  344|       |
  345|      2|#ifndef OPENSSL_NO_THREAD_POOL
  346|      2|    if (ctx->threads != NULL) {
  ------------------
  |  Branch (346:9): [True: 2, False: 0]
  ------------------
  347|      2|        ossl_threads_ctx_free(ctx->threads);
  348|      2|        ctx->threads = NULL;
  349|      2|    }
  350|      2|#endif
  351|       |
  352|       |    /* Low priority. */
  353|      2|#ifndef FIPS_MODULE
  354|      2|    if (ctx->child_provider != NULL) {
  ------------------
  |  Branch (354:9): [True: 2, False: 0]
  ------------------
  355|      2|        ossl_child_prov_ctx_free(ctx->child_provider);
  356|      2|        ctx->child_provider = NULL;
  357|      2|    }
  358|      2|#endif
  359|       |
  360|      2|#ifndef FIPS_MODULE
  361|      2|    if (ctx->comp_methods != NULL) {
  ------------------
  |  Branch (361:9): [True: 2, False: 0]
  ------------------
  362|      2|        ossl_free_compression_methods_int(ctx->comp_methods);
  363|      2|        ctx->comp_methods = NULL;
  364|      2|    }
  365|      2|#endif
  366|       |
  367|      2|}
context.c:context_init:
   92|      4|{
   93|      4|    int exdata_done = 0;
   94|       |
   95|      4|    if (!CRYPTO_THREAD_init_local(&ctx->rcu_local_key, NULL))
  ------------------
  |  Branch (95:9): [True: 0, False: 4]
  ------------------
   96|      0|        return 0;
   97|       |
   98|      4|    ctx->lock = CRYPTO_THREAD_lock_new();
   99|      4|    if (ctx->lock == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 4]
  ------------------
  100|      0|        goto err;
  101|       |
  102|       |    /* Initialize ex_data. */
  103|      4|    if (!ossl_do_ex_data_init(ctx))
  ------------------
  |  Branch (103:9): [True: 0, False: 4]
  ------------------
  104|      0|        goto err;
  105|      4|    exdata_done = 1;
  106|       |
  107|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  108|      4|    ctx->evp_method_store = ossl_method_store_new(ctx);
  109|      4|    if (ctx->evp_method_store == NULL)
  ------------------
  |  Branch (109:9): [True: 0, False: 4]
  ------------------
  110|      0|        goto err;
  111|      4|    OSSL_TRACE1(QUERY, "context_init: allocating store %p\n", ctx->evp_method_store);
  ------------------
  |  |  291|      4|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  283|      4|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  112|       |
  113|      4|#ifndef FIPS_MODULE
  114|       |    /* P2. Must be freed before the provider store is freed */
  115|      4|    ctx->provider_conf = ossl_prov_conf_ctx_new(ctx);
  116|      4|    if (ctx->provider_conf == NULL)
  ------------------
  |  Branch (116:9): [True: 0, False: 4]
  ------------------
  117|      0|        goto err;
  118|      4|#endif
  119|       |
  120|       |    /* P2. */
  121|      4|    ctx->drbg = ossl_rand_ctx_new(ctx);
  122|      4|    if (ctx->drbg == NULL)
  ------------------
  |  Branch (122:9): [True: 0, False: 4]
  ------------------
  123|      0|        goto err;
  124|       |
  125|      4|#ifndef FIPS_MODULE
  126|       |    /*
  127|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  128|       |     * provider store
  129|       |     */
  130|      4|    ctx->decoder_store = ossl_method_store_new(ctx);
  131|      4|    if (ctx->decoder_store == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 4]
  ------------------
  132|      0|        goto err;
  133|      4|    ctx->decoder_cache = ossl_decoder_cache_new(ctx);
  134|      4|    if (ctx->decoder_cache == NULL)
  ------------------
  |  Branch (134:9): [True: 0, False: 4]
  ------------------
  135|      0|        goto err;
  136|       |
  137|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  138|      4|    ctx->encoder_store = ossl_method_store_new(ctx);
  139|      4|    if (ctx->encoder_store == NULL)
  ------------------
  |  Branch (139:9): [True: 0, False: 4]
  ------------------
  140|      0|        goto err;
  141|       |
  142|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  143|      4|    ctx->store_loader_store = ossl_method_store_new(ctx);
  144|      4|    if (ctx->store_loader_store == NULL)
  ------------------
  |  Branch (144:9): [True: 0, False: 4]
  ------------------
  145|      0|        goto err;
  146|      4|#endif
  147|       |
  148|       |    /* P1. Needs to be freed before the child provider data is freed */
  149|      4|    ctx->provider_store = ossl_provider_store_new(ctx);
  150|      4|    if (ctx->provider_store == NULL)
  ------------------
  |  Branch (150:9): [True: 0, False: 4]
  ------------------
  151|      0|        goto err;
  152|       |
  153|       |    /* Default priority. */
  154|      4|    ctx->property_string_data = ossl_property_string_data_new(ctx);
  155|      4|    if (ctx->property_string_data == NULL)
  ------------------
  |  Branch (155:9): [True: 0, False: 4]
  ------------------
  156|      0|        goto err;
  157|       |
  158|      4|    ctx->namemap = ossl_stored_namemap_new(ctx);
  159|      4|    if (ctx->namemap == NULL)
  ------------------
  |  Branch (159:9): [True: 0, False: 4]
  ------------------
  160|      0|        goto err;
  161|       |
  162|      4|    ctx->property_defns = ossl_property_defns_new(ctx);
  163|      4|    if (ctx->property_defns == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 4]
  ------------------
  164|      0|        goto err;
  165|       |
  166|      4|    ctx->global_properties = ossl_ctx_global_properties_new(ctx);
  167|      4|    if (ctx->global_properties == NULL)
  ------------------
  |  Branch (167:9): [True: 0, False: 4]
  ------------------
  168|      0|        goto err;
  169|       |
  170|      4|#ifndef FIPS_MODULE
  171|      4|    ctx->bio_core = ossl_bio_core_globals_new(ctx);
  172|      4|    if (ctx->bio_core == NULL)
  ------------------
  |  Branch (172:9): [True: 0, False: 4]
  ------------------
  173|      0|        goto err;
  174|      4|#endif
  175|       |
  176|      4|    ctx->drbg_nonce = ossl_prov_drbg_nonce_ctx_new(ctx);
  177|      4|    if (ctx->drbg_nonce == NULL)
  ------------------
  |  Branch (177:9): [True: 0, False: 4]
  ------------------
  178|      0|        goto err;
  179|       |
  180|      4|#ifndef FIPS_MODULE
  181|      4|    ctx->self_test_cb = ossl_self_test_set_callback_new(ctx);
  182|      4|    if (ctx->self_test_cb == NULL)
  ------------------
  |  Branch (182:9): [True: 0, False: 4]
  ------------------
  183|      0|        goto err;
  184|      4|    ctx->indicator_cb = ossl_indicator_set_callback_new(ctx);
  185|      4|    if (ctx->indicator_cb == NULL)
  ------------------
  |  Branch (185:9): [True: 0, False: 4]
  ------------------
  186|      0|        goto err;
  187|      4|#endif
  188|       |
  189|       |#ifdef FIPS_MODULE
  190|       |    ctx->thread_event_handler = ossl_thread_event_ctx_new(ctx);
  191|       |    if (ctx->thread_event_handler == NULL)
  192|       |        goto err;
  193|       |
  194|       |    ctx->fips_prov = ossl_fips_prov_ossl_ctx_new(ctx);
  195|       |    if (ctx->fips_prov == NULL)
  196|       |        goto err;
  197|       |#endif
  198|       |
  199|      4|#ifndef OPENSSL_NO_THREAD_POOL
  200|      4|    ctx->threads = ossl_threads_ctx_new(ctx);
  201|      4|    if (ctx->threads == NULL)
  ------------------
  |  Branch (201:9): [True: 0, False: 4]
  ------------------
  202|      0|        goto err;
  203|      4|#endif
  204|       |
  205|       |    /* Low priority. */
  206|      4|#ifndef FIPS_MODULE
  207|      4|    ctx->child_provider = ossl_child_prov_ctx_new(ctx);
  208|      4|    if (ctx->child_provider == NULL)
  ------------------
  |  Branch (208:9): [True: 0, False: 4]
  ------------------
  209|      0|        goto err;
  210|      4|#endif
  211|       |
  212|       |    /* Everything depends on properties, so we also pre-initialise that */
  213|      4|    if (!ossl_property_parse_init(ctx))
  ------------------
  |  Branch (213:9): [True: 0, False: 4]
  ------------------
  214|      0|        goto err;
  215|       |
  216|      4|#ifndef FIPS_MODULE
  217|      4|    ctx->comp_methods = ossl_load_builtin_compressions();
  218|      4|#endif
  219|       |
  220|      4|    return 1;
  221|       |
  222|      0| err:
  223|      0|    context_deinit_objs(ctx);
  224|       |
  225|      0|    if (exdata_done)
  ------------------
  |  Branch (225:9): [True: 0, False: 0]
  ------------------
  226|      0|        ossl_crypto_cleanup_all_ex_data_int(ctx);
  227|       |
  228|      0|    CRYPTO_THREAD_lock_free(ctx->lock);
  229|      0|    CRYPTO_THREAD_cleanup_local(&ctx->rcu_local_key);
  230|      0|    memset(ctx, '\0', sizeof(*ctx));
  231|      0|    return 0;
  232|      4|}
context.c:default_context_do_init:
  395|      2|{
  396|      2|    if (!CRYPTO_THREAD_init_local(&default_context_thread_local, NULL))
  ------------------
  |  Branch (396:9): [True: 0, False: 2]
  ------------------
  397|      0|        goto err;
  398|       |
  399|      2|    if (!context_init(&default_context_int))
  ------------------
  |  Branch (399:9): [True: 0, False: 2]
  ------------------
  400|      0|        goto deinit_thread;
  401|       |
  402|      2|    default_context_inited = 1;
  403|      2|    return 1;
  404|       |
  405|      0|deinit_thread:
  406|      0|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  407|      0|err:
  408|      0|    return 0;
  409|      0|}
context.c:get_default_context:
  429|  5.29M|{
  430|  5.29M|    OSSL_LIB_CTX *current_defctx = get_thread_default_context();
  431|       |
  432|  5.29M|    if (current_defctx == NULL && default_context_inited)
  ------------------
  |  Branch (432:9): [True: 5.29M, False: 0]
  |  Branch (432:35): [True: 5.29M, False: 0]
  ------------------
  433|  5.29M|        current_defctx = &default_context_int;
  434|  5.29M|    return current_defctx;
  435|  5.29M|}
context.c:get_thread_default_context:
  421|  5.29M|{
  422|  5.29M|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|  5.29M|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 5.29M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (422:9): [True: 0, False: 5.29M]
  ------------------
  423|      0|        return NULL;
  424|       |
  425|  5.29M|    return CRYPTO_THREAD_get_local(&default_context_thread_local);
  426|  5.29M|}

ossl_algorithm_do_all:
  149|  6.60k|{
  150|  6.60k|    struct algorithm_data_st cbdata = { 0, };
  151|       |
  152|  6.60k|    cbdata.libctx = libctx;
  153|  6.60k|    cbdata.operation_id = operation_id;
  154|  6.60k|    cbdata.pre = pre;
  155|  6.60k|    cbdata.reserve_store = reserve_store;
  156|  6.60k|    cbdata.fn = fn;
  157|  6.60k|    cbdata.unreserve_store = unreserve_store;
  158|  6.60k|    cbdata.post = post;
  159|  6.60k|    cbdata.data = data;
  160|       |
  161|  6.60k|    if (provider == NULL) {
  ------------------
  |  Branch (161:9): [True: 6.60k, False: 0]
  ------------------
  162|  6.60k|        ossl_provider_doall_activated(libctx, algorithm_do_this, &cbdata);
  163|  6.60k|    } else {
  164|      0|        OSSL_LIB_CTX *libctx2 = ossl_provider_libctx(provider);
  165|       |
  166|       |        /*
  167|       |         * If a provider is given, its library context MUST match the library
  168|       |         * context we're passed.  If this turns out not to be true, there is
  169|       |         * a programming error in the functions up the call stack.
  170|       |         */
  171|      0|        if (!ossl_assert(ossl_lib_ctx_get_concrete(libctx)
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (171:13): [True: 0, False: 0]
  ------------------
  172|      0|                         == ossl_lib_ctx_get_concrete(libctx2)))
  173|      0|            return;
  174|       |
  175|      0|        cbdata.libctx = libctx2;
  176|      0|        algorithm_do_this(provider, &cbdata);
  177|      0|    }
  178|  6.60k|}
ossl_algorithm_get1_first_name:
  181|    399|{
  182|    399|    const char *first_name_end = NULL;
  183|    399|    size_t first_name_len = 0;
  184|    399|    char *ret;
  185|       |
  186|    399|    if (algo->algorithm_names == NULL)
  ------------------
  |  Branch (186:9): [True: 0, False: 399]
  ------------------
  187|      0|        return NULL;
  188|       |
  189|    399|    first_name_end = strchr(algo->algorithm_names, ':');
  190|    399|    if (first_name_end == NULL)
  ------------------
  |  Branch (190:9): [True: 343, False: 56]
  ------------------
  191|    343|        first_name_len = strlen(algo->algorithm_names);
  192|     56|    else
  193|     56|        first_name_len = first_name_end - algo->algorithm_names;
  194|       |
  195|    399|    ret = OPENSSL_strndup(algo->algorithm_names, first_name_len);
  ------------------
  |  |  121|    399|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    399|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    399|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  196|    399|    return ret;
  197|    399|}
core_algorithm.c:algorithm_do_this:
  103|  13.2k|{
  104|  13.2k|    struct algorithm_data_st *data = cbdata;
  105|  13.2k|    int first_operation = 1;
  106|  13.2k|    int last_operation = OSSL_OP__HIGHEST;
  ------------------
  |  |  326|  13.2k|# define OSSL_OP__HIGHEST                           22
  ------------------
  107|  13.2k|    int cur_operation;
  108|  13.2k|    int ok = 1;
  109|       |
  110|  13.2k|    if (data->operation_id != 0)
  ------------------
  |  Branch (110:9): [True: 13.2k, False: 0]
  ------------------
  111|  13.2k|        first_operation = last_operation = data->operation_id;
  112|       |
  113|  13.2k|    for (cur_operation = first_operation;
  114|  26.4k|         cur_operation <= last_operation;
  ------------------
  |  Branch (114:10): [True: 13.2k, False: 13.2k]
  ------------------
  115|  13.2k|         cur_operation++) {
  116|  13.2k|        int no_store = 0;        /* Assume caching is ok */
  117|  13.2k|        const OSSL_ALGORITHM *map = NULL;
  118|  13.2k|        int ret = 0;
  119|       |
  120|  13.2k|        map = ossl_provider_query_operation(provider, cur_operation,
  121|  13.2k|                                            &no_store);
  122|  13.2k|        ret = algorithm_do_map(provider, map, cur_operation, no_store, data);
  123|  13.2k|        ossl_provider_unquery_operation(provider, cur_operation, map);
  124|       |
  125|  13.2k|        if (ret < 0)
  ------------------
  |  Branch (125:13): [True: 0, False: 13.2k]
  ------------------
  126|       |            /* Hard error, bail out immediately! */
  127|      0|            return 0;
  128|       |
  129|       |        /* If post-condition not fulfilled, set general failure */
  130|  13.2k|        if (!ret)
  ------------------
  |  Branch (130:13): [True: 0, False: 13.2k]
  ------------------
  131|      0|            ok = 0;
  132|  13.2k|    }
  133|       |
  134|  13.2k|    return ok;
  135|  13.2k|}
core_algorithm.c:algorithm_do_map:
   44|  13.2k|{
   45|  13.2k|    struct algorithm_data_st *data = cbdata;
   46|  13.2k|    int ret = 0;
   47|       |
   48|  13.2k|    if (!data->reserve_store(no_store, data->data))
  ------------------
  |  Branch (48:9): [True: 0, False: 13.2k]
  ------------------
   49|       |        /* Error, bail out! */
   50|      0|        return -1;
   51|       |
   52|       |    /* Do we fulfill pre-conditions? */
   53|  13.2k|    if (data->pre == NULL) {
  ------------------
  |  Branch (53:9): [True: 0, False: 13.2k]
  ------------------
   54|       |        /* If there is no pre-condition function, assume "yes" */
   55|      0|        ret = 1;
   56|  13.2k|    } else if (!data->pre(provider, cur_operation, no_store, data->data,
  ------------------
  |  Branch (56:16): [True: 0, False: 13.2k]
  ------------------
   57|  13.2k|                          &ret)) {
   58|       |        /* Error, bail out! */
   59|      0|        ret = -1;
   60|      0|        goto end;
   61|      0|    }
   62|       |
   63|       |    /*
   64|       |     * If pre-condition not fulfilled don't add this set of implementations,
   65|       |     * but do continue with the next.  This simply means that another thread
   66|       |     * got to it first.
   67|       |     */
   68|  13.2k|    if (ret == 0) {
  ------------------
  |  Branch (68:9): [True: 13.1k, False: 12]
  ------------------
   69|  13.1k|        ret = 1;
   70|  13.1k|        goto end;
   71|  13.1k|    }
   72|       |
   73|     12|    if (map != NULL) {
  ------------------
  |  Branch (73:9): [True: 7, False: 5]
  ------------------
   74|      7|        const OSSL_ALGORITHM *thismap;
   75|       |
   76|    406|        for (thismap = map; thismap->algorithm_names != NULL; thismap++)
  ------------------
  |  Branch (76:29): [True: 399, False: 7]
  ------------------
   77|    399|            data->fn(provider, thismap, no_store, data->data);
   78|      7|    }
   79|       |
   80|       |    /* Do we fulfill post-conditions? */
   81|     12|    if (data->post == NULL) {
  ------------------
  |  Branch (81:9): [True: 0, False: 12]
  ------------------
   82|       |        /* If there is no post-condition function, assume "yes" */
   83|      0|        ret = 1;
   84|     12|    } else if (!data->post(provider, cur_operation, no_store, data->data,
  ------------------
  |  Branch (84:16): [True: 0, False: 12]
  ------------------
   85|     12|                           &ret)) {
   86|       |        /* Error, bail out! */
   87|      0|        ret = -1;
   88|      0|    }
   89|       |
   90|  13.2k| end:
   91|  13.2k|    data->unreserve_store(data->data);
   92|       |
   93|  13.2k|    return ret;
   94|     12|}

ossl_method_construct:
  137|  6.60k|{
  138|  6.60k|    void *method = NULL;
  139|  6.60k|    OSSL_PROVIDER *provider = provider_rw != NULL ? *provider_rw : NULL;
  ------------------
  |  Branch (139:31): [True: 6.60k, False: 0]
  ------------------
  140|  6.60k|    struct construct_data_st cbdata;
  141|       |
  142|       |    /*
  143|       |     * We might be tempted to try to look into the method store without
  144|       |     * constructing to see if we can find our method there already.
  145|       |     * Unfortunately that does not work well if the query contains
  146|       |     * optional properties as newly loaded providers can match them better.
  147|       |     * We trust that ossl_method_construct_precondition() and
  148|       |     * ossl_method_construct_postcondition() make sure that the
  149|       |     * ossl_algorithm_do_all() does very little when methods from
  150|       |     * a provider have already been constructed.
  151|       |     */
  152|       |
  153|  6.60k|    cbdata.store = NULL;
  154|  6.60k|    cbdata.force_store = force_store;
  155|  6.60k|    cbdata.mcm = mcm;
  156|  6.60k|    cbdata.mcm_data = mcm_data;
  157|  6.60k|    ossl_algorithm_do_all(libctx, operation_id, provider,
  158|  6.60k|                          ossl_method_construct_precondition,
  159|  6.60k|                          ossl_method_construct_reserve_store,
  160|  6.60k|                          ossl_method_construct_this,
  161|  6.60k|                          ossl_method_construct_unreserve_store,
  162|  6.60k|                          ossl_method_construct_postcondition,
  163|  6.60k|                          &cbdata);
  164|       |
  165|       |    /* If there is a temporary store, try there first */
  166|  6.60k|    if (cbdata.store != NULL)
  ------------------
  |  Branch (166:9): [True: 0, False: 6.60k]
  ------------------
  167|      0|        method = mcm->get(cbdata.store, (const OSSL_PROVIDER **)provider_rw,
  168|      0|                          mcm_data);
  169|       |
  170|       |    /* If no method was found yet, try the global store */
  171|  6.60k|    if (method == NULL)
  ------------------
  |  Branch (171:9): [True: 6.60k, False: 0]
  ------------------
  172|  6.60k|        method = mcm->get(NULL, (const OSSL_PROVIDER **)provider_rw, mcm_data);
  173|       |
  174|  6.60k|    return method;
  175|  6.60k|}
core_fetch.c:ossl_method_construct_precondition:
   63|  13.2k|{
   64|  13.2k|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|  13.2k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  13.2k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (64:9): [True: 0, False: 13.2k]
  ------------------
   65|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   66|      0|        return 0;
   67|      0|    }
   68|       |
   69|       |    /* Assume that no bits are set */
   70|  13.2k|    *result = 0;
   71|       |
   72|       |    /* No flag bits for temporary stores */
   73|  13.2k|    if (!is_temporary_method_store(no_store, cbdata)
  ------------------
  |  Branch (73:9): [True: 13.2k, False: 0]
  ------------------
   74|  13.2k|        && !ossl_provider_test_operation_bit(provider, operation_id, result))
  ------------------
  |  Branch (74:12): [True: 0, False: 13.2k]
  ------------------
   75|      0|        return 0;
   76|       |
   77|       |    /*
   78|       |     * The result we get tells if methods have already been constructed.
   79|       |     * However, we want to tell whether construction should happen (true)
   80|       |     * or not (false), which is the opposite of what we got.
   81|       |     */
   82|  13.2k|    *result = !*result;
   83|       |
   84|  13.2k|    return 1;
   85|  13.2k|}
core_fetch.c:is_temporary_method_store:
   29|  26.4k|{
   30|  26.4k|    struct construct_data_st *data = cbdata;
   31|       |
   32|  26.4k|    return no_store && !data->force_store;
  ------------------
  |  Branch (32:12): [True: 0, False: 26.4k]
  |  Branch (32:24): [True: 0, False: 0]
  ------------------
   33|  26.4k|}
core_fetch.c:ossl_method_construct_reserve_store:
   36|  13.2k|{
   37|  13.2k|    struct construct_data_st *data = cbdata;
   38|       |
   39|  13.2k|    if (is_temporary_method_store(no_store, data) && data->store == NULL) {
  ------------------
  |  Branch (39:9): [True: 0, False: 13.2k]
  |  Branch (39:54): [True: 0, False: 0]
  ------------------
   40|       |        /*
   41|       |         * If we have been told not to store the method "permanently", we
   42|       |         * ask for a temporary store, and store the method there.
   43|       |         * The owner of |data->mcm| is completely responsible for managing
   44|       |         * that temporary store.
   45|       |         */
   46|      0|        if ((data->store = data->mcm->get_tmp_store(data->mcm_data)) == NULL)
  ------------------
  |  Branch (46:13): [True: 0, False: 0]
  ------------------
   47|      0|            return 0;
   48|      0|    }
   49|       |
   50|  13.2k|    return data->mcm->lock_store(data->store, data->mcm_data);
   51|  13.2k|}
core_fetch.c:ossl_method_construct_this:
  106|    399|{
  107|    399|    struct construct_data_st *data = cbdata;
  108|    399|    void *method = NULL;
  109|       |
  110|    399|    if ((method = data->mcm->construct(algo, provider, data->mcm_data))
  ------------------
  |  Branch (110:9): [True: 0, False: 399]
  ------------------
  111|    399|        == NULL)
  112|      0|        return;
  113|       |
  114|    399|    OSSL_TRACE2(QUERY,
  ------------------
  |  |  293|    399|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|    399|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  115|    399|                "ossl_method_construct_this: putting an algo to the store %p with no_store %d\n",
  116|    399|                (void *)data->store, no_store);
  117|       |    /*
  118|       |     * Note regarding putting the method in stores:
  119|       |     *
  120|       |     * we don't need to care if it actually got in or not here.
  121|       |     * If it didn't get in, it will simply not be available when
  122|       |     * ossl_method_construct() tries to get it from the store.
  123|       |     *
  124|       |     * It is *expected* that the put function increments the refcnt
  125|       |     * of the passed method.
  126|       |     */
  127|    399|    data->mcm->put(no_store ? data->store : NULL, method, provider, algo->algorithm_names,
  ------------------
  |  Branch (127:20): [True: 0, False: 399]
  ------------------
  128|    399|                   algo->property_definition, data->mcm_data);
  129|       |
  130|       |    /* refcnt-- because we're dropping the reference */
  131|    399|    data->mcm->destruct(method, data->mcm_data);
  132|    399|}
core_fetch.c:ossl_method_construct_unreserve_store:
   54|  13.2k|{
   55|  13.2k|    struct construct_data_st *data = cbdata;
   56|       |
   57|  13.2k|    return data->mcm->unlock_store(data->store, data->mcm_data);
   58|  13.2k|}
core_fetch.c:ossl_method_construct_postcondition:
   90|     12|{
   91|     12|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|     12|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     12|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (91:9): [True: 0, False: 12]
  ------------------
   92|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   93|      0|        return 0;
   94|      0|    }
   95|       |
   96|     12|    *result = 1;
   97|       |
   98|       |    /* No flag bits for temporary stores */
   99|     12|    return is_temporary_method_store(no_store, cbdata)
  ------------------
  |  Branch (99:12): [True: 0, False: 12]
  ------------------
  100|     12|        || ossl_provider_set_operation_bit(provider, operation_id);
  ------------------
  |  Branch (100:12): [True: 12, False: 0]
  ------------------
  101|     12|}

ossl_stored_namemap_new:
   56|      4|{
   57|      4|    OSSL_NAMEMAP *namemap = ossl_namemap_new(libctx);
   58|       |
   59|      4|    if (namemap != NULL)
  ------------------
  |  Branch (59:9): [True: 4, False: 0]
  ------------------
   60|      4|        namemap->stored = 1;
   61|       |
   62|      4|    return namemap;
   63|      4|}
ossl_stored_namemap_free:
   66|      2|{
   67|      2|    OSSL_NAMEMAP *namemap = vnamemap;
   68|       |
   69|      2|    if (namemap != NULL) {
  ------------------
  |  Branch (69:9): [True: 2, False: 0]
  ------------------
   70|       |        /* Pretend it isn't stored, or ossl_namemap_free() will do nothing */
   71|      2|        namemap->stored = 0;
   72|      2|        ossl_namemap_free(namemap);
   73|      2|    }
   74|      2|}
ossl_namemap_empty:
   82|   212k|{
   83|       |#ifdef TSAN_REQUIRES_LOCKING
   84|       |    /* No TSAN support */
   85|       |    int rv;
   86|       |
   87|       |    if (namemap == NULL)
   88|       |        return 1;
   89|       |
   90|       |    if (!CRYPTO_THREAD_read_lock(namemap->lock))
   91|       |        return -1;
   92|       |    rv = namemap->max_number == 0;
   93|       |    CRYPTO_THREAD_unlock(namemap->lock);
   94|       |    return rv;
   95|       |#else
   96|       |    /* Have TSAN support */
   97|   212k|    return namemap == NULL || tsan_load(&namemap->max_number) == 0;
  ------------------
  |  |   61|   212k|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  |  Branch (97:12): [True: 0, False: 212k]
  |  Branch (97:31): [True: 1, False: 212k]
  ------------------
   98|   212k|#endif
   99|   212k|}
ossl_namemap_doall_names:
  109|  11.4k|{
  110|  11.4k|    int i;
  111|  11.4k|    NAMES *names;
  112|       |
  113|  11.4k|    if (namemap == NULL || number <= 0)
  ------------------
  |  Branch (113:9): [True: 0, False: 11.4k]
  |  Branch (113:28): [True: 0, False: 11.4k]
  ------------------
  114|      0|        return 0;
  115|       |
  116|       |    /*
  117|       |     * We duplicate the NAMES stack under a read lock. Subsequently we call
  118|       |     * the user function, so that we're not holding the read lock when in user
  119|       |     * code. This could lead to deadlocks.
  120|       |     */
  121|  11.4k|    if (!CRYPTO_THREAD_read_lock(namemap->lock))
  ------------------
  |  Branch (121:9): [True: 0, False: 11.4k]
  ------------------
  122|      0|        return 0;
  123|       |
  124|  11.4k|    names = sk_NAMES_value(namemap->numnames, number - 1);
  125|  11.4k|    if (names != NULL)
  ------------------
  |  Branch (125:9): [True: 11.4k, False: 0]
  ------------------
  126|  11.4k|        names = sk_OPENSSL_STRING_dup(names);
  ------------------
  |  |  251|  11.4k|#define sk_OPENSSL_STRING_dup(sk) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_STRING_sk_type(sk)))
  ------------------
  127|       |
  128|  11.4k|    CRYPTO_THREAD_unlock(namemap->lock);
  129|       |
  130|  11.4k|    if (names == NULL)
  ------------------
  |  Branch (130:9): [True: 0, False: 11.4k]
  ------------------
  131|      0|        return 0;
  132|       |
  133|  50.8k|    for (i = 0; i < sk_OPENSSL_STRING_num(names); i++)
  ------------------
  |  |  229|  50.8k|#define sk_OPENSSL_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_STRING_sk_type(sk))
  ------------------
  |  Branch (133:17): [True: 39.4k, False: 11.4k]
  ------------------
  134|  39.4k|        fn(sk_OPENSSL_STRING_value(names, i), data);
  ------------------
  |  |  230|  39.4k|#define sk_OPENSSL_STRING_value(sk, idx) ((char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_STRING_sk_type(sk), (idx)))
  ------------------
  135|       |
  136|  11.4k|    sk_OPENSSL_STRING_free(names);
  ------------------
  |  |  235|  11.4k|#define sk_OPENSSL_STRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_STRING_sk_type(sk))
  ------------------
  137|  11.4k|    return i > 0;
  138|  11.4k|}
ossl_namemap_name2num:
  141|   211k|{
  142|   211k|    int number = 0;
  143|   211k|    HT_VALUE *val;
  144|   211k|    NAMENUM_KEY key;
  145|       |
  146|   211k|#ifndef FIPS_MODULE
  147|   211k|    if (namemap == NULL)
  ------------------
  |  Branch (147:9): [True: 0, False: 211k]
  ------------------
  148|      0|        namemap = ossl_namemap_stored(NULL);
  149|   211k|#endif
  150|       |
  151|   211k|    if (namemap == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 211k]
  ------------------
  152|      0|        return 0;
  153|       |
  154|   211k|    HT_INIT_KEY(&key);
  ------------------
  |  |  107|   211k|#define HT_INIT_KEY(key) do { \
  |  |  108|   211k|memset((key), 0, sizeof(*(key))); \
  |  |  109|   211k|(key)->key_header.keysize = (sizeof(*(key)) - sizeof(HT_KEY)); \
  |  |  110|   211k|(key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY)); \
  |  |  111|   211k|} while(0)
  |  |  ------------------
  |  |  |  Branch (111:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  155|   211k|    HT_SET_KEY_STRING_CASE(&key, name, name);
  ------------------
  |  |  138|   211k|#define HT_SET_KEY_STRING_CASE(key, member, value) do { \
  |  |  139|   211k|   ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) -1); \
  |  |  140|   211k|} while(0)
  |  |  ------------------
  |  |  |  Branch (140:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  156|       |
  157|   211k|    val = ossl_ht_get(namemap->namenum_ht, TO_HT_KEY(&key));
  ------------------
  |  |  173|   211k|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  158|       |
  159|   211k|    if (val != NULL)
  ------------------
  |  Branch (159:9): [True: 200k, False: 11.2k]
  ------------------
  160|       |        /* We store a (small) int directly instead of a pointer to it. */
  161|   200k|        number = (int)(intptr_t)val->value;
  162|       |
  163|   211k|    return number;
  164|   211k|}
ossl_namemap_name2num_n:
  168|    401|{
  169|    401|    int number = 0;
  170|    401|    HT_VALUE *val;
  171|    401|    NAMENUM_KEY key;
  172|       |
  173|    401|#ifndef FIPS_MODULE
  174|    401|    if (namemap == NULL)
  ------------------
  |  Branch (174:9): [True: 0, False: 401]
  ------------------
  175|      0|        namemap = ossl_namemap_stored(NULL);
  176|    401|#endif
  177|       |
  178|    401|    if (namemap == NULL)
  ------------------
  |  Branch (178:9): [True: 0, False: 401]
  ------------------
  179|      0|        return 0;
  180|       |
  181|    401|    HT_INIT_KEY(&key);
  ------------------
  |  |  107|    401|#define HT_INIT_KEY(key) do { \
  |  |  108|    401|memset((key), 0, sizeof(*(key))); \
  |  |  109|    401|(key)->key_header.keysize = (sizeof(*(key)) - sizeof(HT_KEY)); \
  |  |  110|    401|(key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY)); \
  |  |  111|    401|} while(0)
  |  |  ------------------
  |  |  |  Branch (111:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  182|    401|    HT_SET_KEY_STRING_CASE_N(&key, name, name, name_len);
  ------------------
  |  |  155|    401|#define HT_SET_KEY_STRING_CASE_N(key, member, value, len) do { \
  |  |  156|    401|    if (len < sizeof((key)->keyfields.member)) \
  |  |  ------------------
  |  |  |  Branch (156:9): [True: 401, False: 0]
  |  |  ------------------
  |  |  157|    401|        ossl_ht_strcase((key)->keyfields.member, value, len); \
  |  |  158|    401|    else \
  |  |  159|    401|        ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) - 1); \
  |  |  160|    401|} while(0)
  |  |  ------------------
  |  |  |  Branch (160:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  183|       |
  184|    401|    val = ossl_ht_get(namemap->namenum_ht, TO_HT_KEY(&key));
  ------------------
  |  |  173|    401|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  185|       |
  186|    401|    if (val != NULL)
  ------------------
  |  Branch (186:9): [True: 401, False: 0]
  ------------------
  187|       |        /* We store a (small) int directly instead of a pointer to it. */
  188|    401|        number = (int)(intptr_t)val->value;
  189|       |
  190|    401|    return number;
  191|    401|}
ossl_namemap_add_name:
  289|    648|{
  290|    648|    int tmp_number;
  291|       |
  292|    648|#ifndef FIPS_MODULE
  293|    648|    if (namemap == NULL)
  ------------------
  |  Branch (293:9): [True: 0, False: 648]
  ------------------
  294|      0|        namemap = ossl_namemap_stored(NULL);
  295|    648|#endif
  296|       |
  297|    648|    if (name == NULL || *name == 0 || namemap == NULL)
  ------------------
  |  Branch (297:9): [True: 0, False: 648]
  |  Branch (297:25): [True: 0, False: 648]
  |  Branch (297:39): [True: 0, False: 648]
  ------------------
  298|      0|        return 0;
  299|       |
  300|    648|    if (!CRYPTO_THREAD_write_lock(namemap->lock))
  ------------------
  |  Branch (300:9): [True: 0, False: 648]
  ------------------
  301|      0|        return 0;
  302|    648|    tmp_number = namemap_add_name(namemap, number, name);
  303|    648|    CRYPTO_THREAD_unlock(namemap->lock);
  304|    648|    return tmp_number;
  305|    648|}
ossl_namemap_add_names:
  309|    399|{
  310|    399|    char *tmp, *p, *q, *endp;
  311|       |
  312|       |    /* Check that we have a namemap */
  313|    399|    if (!ossl_assert(namemap != NULL)) {
  ------------------
  |  |   52|    399|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    399|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (313:9): [True: 0, False: 399]
  ------------------
  314|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  315|      0|        return 0;
  316|      0|    }
  317|       |
  318|    399|    if ((tmp = OPENSSL_strdup(names)) == NULL)
  ------------------
  |  |  119|    399|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    399|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    399|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (318:9): [True: 0, False: 399]
  ------------------
  319|      0|        return 0;
  320|       |
  321|    399|    if (!CRYPTO_THREAD_write_lock(namemap->lock)) {
  ------------------
  |  Branch (321:9): [True: 0, False: 399]
  ------------------
  322|      0|        OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  323|      0|        return 0;
  324|      0|    }
  325|       |    /*
  326|       |     * Check that no name is an empty string, and that all names have at
  327|       |     * most one numeric identity together.
  328|       |     */
  329|    911|    for (p = tmp; *p != '\0'; p = q) {
  ------------------
  |  Branch (329:19): [True: 512, False: 399]
  ------------------
  330|    512|        int this_number;
  331|    512|        size_t l;
  332|       |
  333|    512|        if ((q = strchr(p, separator)) == NULL) {
  ------------------
  |  Branch (333:13): [True: 399, False: 113]
  ------------------
  334|    399|            l = strlen(p);       /* offset to \0 */
  335|    399|            q = p + l;
  336|    399|        } else {
  337|    113|            l = q - p;           /* offset to the next separator */
  338|    113|            *q++ = '\0';
  339|    113|        }
  340|       |
  341|    512|        if (*p == '\0') {
  ------------------
  |  Branch (341:13): [True: 0, False: 512]
  ------------------
  342|      0|            ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_BAD_ALGORITHM_NAME);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  343|      0|            number = 0;
  344|      0|            goto end;
  345|      0|        }
  346|       |
  347|    512|        this_number = ossl_namemap_name2num(namemap, p);
  348|       |
  349|    512|        if (number == 0) {
  ------------------
  |  Branch (349:13): [True: 471, False: 41]
  ------------------
  350|    471|            number = this_number;
  351|    471|        } else if (this_number != 0 && this_number != number) {
  ------------------
  |  Branch (351:20): [True: 36, False: 5]
  |  Branch (351:40): [True: 0, False: 36]
  ------------------
  352|      0|            ERR_raise_data(ERR_LIB_CRYPTO, CRYPTO_R_CONFLICTING_NAMES,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, CRYPTO_R_CONFLICTING_NAMES,
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, CRYPTO_R_CONFLICTING_NAMES,
  ------------------
  |  |   25|      0|# define CRYPTO_R_CONFLICTING_NAMES                       118
  ------------------
  353|      0|                           "\"%s\" has an existing different identity %d (from \"%s\")",
  354|      0|                           p, this_number, names);
  355|      0|            number = 0;
  356|      0|            goto end;
  357|      0|        }
  358|    512|    }
  359|    399|    endp = p;
  360|       |
  361|       |    /* Now that we have checked, register all names */
  362|    911|    for (p = tmp; p < endp; p = q) {
  ------------------
  |  Branch (362:19): [True: 512, False: 399]
  ------------------
  363|    512|        int this_number;
  364|       |
  365|    512|        q = p + strlen(p) + 1;
  366|       |
  367|    512|        this_number = namemap_add_name(namemap, number, p);
  368|    512|        if (number == 0) {
  ------------------
  |  Branch (368:13): [True: 49, False: 463]
  ------------------
  369|     49|            number = this_number;
  370|    463|        } else if (this_number != number) {
  ------------------
  |  Branch (370:20): [True: 0, False: 463]
  ------------------
  371|      0|            ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  354|      0|# define ERR_R_INTERNAL_ERROR                    (259|ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  350|      0|# define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  236|      0|# define ERR_RFLAG_FATAL                (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  372|      0|                           "Got number %d when expecting %d",
  373|      0|                           this_number, number);
  374|      0|            number = 0;
  375|      0|            goto end;
  376|      0|        }
  377|    512|    }
  378|       |
  379|    399| end:
  380|    399|    CRYPTO_THREAD_unlock(namemap->lock);
  381|    399|    OPENSSL_free(tmp);
  ------------------
  |  |  115|    399|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    399|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    399|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  382|    399|    return number;
  383|    399|}
ossl_namemap_stored:
  481|   212k|{
  482|   212k|#ifndef FIPS_MODULE
  483|   212k|    int nms;
  484|   212k|#endif
  485|   212k|    OSSL_NAMEMAP *namemap =
  486|   212k|        ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_NAMEMAP_INDEX);
  ------------------
  |  |  102|   212k|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  487|       |
  488|   212k|    if (namemap == NULL)
  ------------------
  |  Branch (488:9): [True: 0, False: 212k]
  ------------------
  489|      0|        return NULL;
  490|       |
  491|   212k|#ifndef FIPS_MODULE
  492|   212k|    nms = ossl_namemap_empty(namemap);
  493|   212k|    if (nms < 0) {
  ------------------
  |  Branch (493:9): [True: 0, False: 212k]
  ------------------
  494|       |        /*
  495|       |         * Could not get lock to make the count, so maybe internal objects
  496|       |         * weren't added. This seems safest.
  497|       |         */
  498|      0|        return NULL;
  499|      0|    }
  500|   212k|    if (nms == 1) {
  ------------------
  |  Branch (500:9): [True: 1, False: 212k]
  ------------------
  501|      1|        int i, end;
  502|       |
  503|       |        /* Before pilfering, we make sure the legacy database is populated */
  504|      1|        OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS
  ------------------
  |  |  468|      1|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
  505|      1|                            | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL);
  ------------------
  |  |  469|      1|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
  506|       |
  507|      1|        OBJ_NAME_do_all(OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|      1|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
  508|      1|                        get_legacy_cipher_names, namemap);
  509|      1|        OBJ_NAME_do_all(OBJ_NAME_TYPE_MD_METH,
  ------------------
  |  |   25|      1|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  510|      1|                        get_legacy_md_names, namemap);
  511|       |
  512|       |        /* We also pilfer data from the legacy EVP_PKEY_ASN1_METHODs */
  513|     16|        for (i = 0, end = EVP_PKEY_asn1_get_count(); i < end; i++)
  ------------------
  |  Branch (513:54): [True: 15, False: 1]
  ------------------
  514|     15|            get_legacy_pkey_meth_names(EVP_PKEY_asn1_get0(i), namemap);
  515|      1|    }
  516|   212k|#endif
  517|       |
  518|   212k|    return namemap;
  519|   212k|}
ossl_namemap_new:
  522|      4|{
  523|      4|    OSSL_NAMEMAP *namemap;
  524|      4|    HT_CONFIG htconf = { NULL, NULL, NULL, NAMEMAP_HT_BUCKETS, 1, 1 };
  ------------------
  |  |   16|      4|#define NAMEMAP_HT_BUCKETS 2048
  ------------------
  525|       |
  526|      4|    htconf.ctx = libctx;
  527|       |
  528|      4|    if ((namemap = OPENSSL_zalloc(sizeof(*namemap))) == NULL)
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (528:9): [True: 0, False: 4]
  ------------------
  529|      0|        goto err;
  530|       |
  531|      4|    if ((namemap->lock = CRYPTO_THREAD_lock_new()) == NULL)
  ------------------
  |  Branch (531:9): [True: 0, False: 4]
  ------------------
  532|      0|        goto err;
  533|       |
  534|      4|    if ((namemap->namenum_ht = ossl_ht_new(&htconf)) == NULL)
  ------------------
  |  Branch (534:9): [True: 0, False: 4]
  ------------------
  535|      0|        goto err;
  536|       |
  537|      4|    if ((namemap->numnames = sk_NAMES_new_null()) == NULL)
  ------------------
  |  Branch (537:9): [True: 0, False: 4]
  ------------------
  538|      0|        goto err;
  539|       |
  540|      4|    return namemap;
  541|       |
  542|      0| err:
  543|      0|    ossl_namemap_free(namemap);
  544|      0|    return NULL;
  545|      4|}
ossl_namemap_free:
  548|      2|{
  549|      2|    if (namemap == NULL || namemap->stored)
  ------------------
  |  Branch (549:9): [True: 0, False: 2]
  |  Branch (549:28): [True: 0, False: 2]
  ------------------
  550|      0|        return;
  551|       |
  552|      2|    sk_NAMES_pop_free(namemap->numnames, names_free);
  553|       |
  554|      2|    ossl_ht_free(namemap->namenum_ht);
  555|       |
  556|      2|    CRYPTO_THREAD_lock_free(namemap->lock);
  557|      2|    OPENSSL_free(namemap);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  558|      2|}
core_namemap.c:namemap_add_name:
  258|  1.16k|{
  259|  1.16k|    int ret;
  260|  1.16k|    HT_VALUE val = { 0 };
  261|  1.16k|    NAMENUM_KEY key;
  262|       |
  263|       |    /* If it already exists, we don't add it */
  264|  1.16k|    if ((ret = ossl_namemap_name2num(namemap, name)) != 0)
  ------------------
  |  Branch (264:9): [True: 775, False: 385]
  ------------------
  265|    775|        return ret;
  266|       |
  267|    385|    if ((number = numname_insert(namemap, number, name)) == 0)
  ------------------
  |  Branch (267:9): [True: 0, False: 385]
  ------------------
  268|      0|        return 0;
  269|       |
  270|       |    /* Using tsan_store alone here is safe since we're under lock */
  271|    385|    tsan_store(&namemap->max_number, number);
  ------------------
  |  |   62|    385|#   define tsan_store(ptr, val) atomic_store_explicit((ptr), (val), memory_order_relaxed)
  ------------------
  272|       |
  273|    385|    HT_INIT_KEY(&key);
  ------------------
  |  |  107|    385|#define HT_INIT_KEY(key) do { \
  |  |  108|    385|memset((key), 0, sizeof(*(key))); \
  |  |  109|    385|(key)->key_header.keysize = (sizeof(*(key)) - sizeof(HT_KEY)); \
  |  |  110|    385|(key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY)); \
  |  |  111|    385|} while(0)
  |  |  ------------------
  |  |  |  Branch (111:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  274|    385|    HT_SET_KEY_STRING_CASE(&key, name, name);
  ------------------
  |  |  138|    385|#define HT_SET_KEY_STRING_CASE(key, member, value) do { \
  |  |  139|    385|   ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) -1); \
  |  |  140|    385|} while(0)
  |  |  ------------------
  |  |  |  Branch (140:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  275|    385|    val.value = (void *)(intptr_t)number;
  276|    385|    ret = ossl_ht_insert(namemap->namenum_ht, TO_HT_KEY(&key), &val, NULL);
  ------------------
  |  |  173|    385|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  277|    385|    if (!ossl_assert(ret != 0)) /* cannot happen as we are under write lock */
  ------------------
  |  |   52|    385|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    385|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (277:9): [True: 0, False: 385]
  ------------------
  278|      0|        return 0;
  279|    385|    if (ret < 1) {
  ------------------
  |  Branch (279:9): [True: 0, False: 385]
  ------------------
  280|       |        /* unable to insert due to too many collisions */
  281|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_NAMES);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  282|      0|        return 0;
  283|      0|    }
  284|    385|    return number;
  285|    385|}
core_namemap.c:numname_insert:
  217|    385|{
  218|    385|    NAMES *names;
  219|    385|    char *tmpname;
  220|       |
  221|    385|    if (number > 0) {
  ------------------
  |  Branch (221:9): [True: 218, False: 167]
  ------------------
  222|    218|        names = sk_NAMES_value(namemap->numnames, number - 1);
  223|    218|        if (!ossl_assert(names != NULL)) {
  ------------------
  |  |   52|    218|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    218|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (223:13): [True: 0, False: 218]
  ------------------
  224|       |            /* cannot happen */
  225|      0|            return 0;
  226|      0|        }
  227|    218|    } else {
  228|       |        /* a completely new entry */
  229|    167|        names = sk_OPENSSL_STRING_new_null();
  ------------------
  |  |  232|    167|#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_null())
  ------------------
  230|    167|        if (names == NULL)
  ------------------
  |  Branch (230:13): [True: 0, False: 167]
  ------------------
  231|      0|            return 0;
  232|    167|    }
  233|       |
  234|    385|    if ((tmpname = OPENSSL_strdup(name)) == NULL)
  ------------------
  |  |  119|    385|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    385|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    385|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (234:9): [True: 0, False: 385]
  ------------------
  235|      0|        goto err;
  236|       |
  237|    385|    if (!sk_OPENSSL_STRING_push(names, tmpname))
  ------------------
  |  |  239|    385|#define sk_OPENSSL_STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
  ------------------
  |  Branch (237:9): [True: 0, False: 385]
  ------------------
  238|      0|        goto err;
  239|    385|    tmpname = NULL;
  240|       |
  241|    385|    if (number <= 0) {
  ------------------
  |  Branch (241:9): [True: 167, False: 218]
  ------------------
  242|    167|        if (!sk_NAMES_push(namemap->numnames, names))
  ------------------
  |  Branch (242:13): [True: 0, False: 167]
  ------------------
  243|      0|            goto err;
  244|    167|        number = sk_NAMES_num(namemap->numnames);
  245|    167|    }
  246|    385|    return number;
  247|       |
  248|      0| err:
  249|      0|    if (number <= 0)
  ------------------
  |  Branch (249:9): [True: 0, False: 0]
  ------------------
  250|      0|        sk_OPENSSL_STRING_pop_free(names, name_string_free);
  ------------------
  |  |  243|      0|#define sk_OPENSSL_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_freefunc_type(freefunc))
  ------------------
  251|      0|    OPENSSL_free(tmpname);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  252|      0|    return 0;
  253|    385|}
core_namemap.c:name_string_free:
   44|    385|{
   45|    385|    OPENSSL_free(name);
  ------------------
  |  |  115|    385|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    385|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    385|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   46|    385|}
core_namemap.c:get_legacy_cipher_names:
  420|    183|{
  421|    183|    const EVP_CIPHER *cipher = (void *)OBJ_NAME_get(on->name, on->type);
  422|       |
  423|    183|    if (cipher != NULL)
  ------------------
  |  Branch (423:9): [True: 183, False: 0]
  ------------------
  424|    183|        get_legacy_evp_names(NID_undef, EVP_CIPHER_get_type(cipher), NULL, arg);
  ------------------
  |  |   18|    183|#define NID_undef                       0
  ------------------
  425|    183|}
core_namemap.c:get_legacy_evp_names:
  396|    258|{
  397|    258|    int num = 0;
  398|    258|    ASN1_OBJECT *obj;
  399|       |
  400|    258|    if (base_nid != NID_undef) {
  ------------------
  |  |   18|    258|#define NID_undef                       0
  ------------------
  |  Branch (400:9): [True: 4, False: 254]
  ------------------
  401|      4|        num = ossl_namemap_add_name(arg, num, OBJ_nid2sn(base_nid));
  402|      4|        num = ossl_namemap_add_name(arg, num, OBJ_nid2ln(base_nid));
  403|      4|    }
  404|       |
  405|    258|    if (nid != NID_undef) {
  ------------------
  |  |   18|    258|#define NID_undef                       0
  ------------------
  |  Branch (405:9): [True: 210, False: 48]
  ------------------
  406|    210|        num = ossl_namemap_add_name(arg, num, OBJ_nid2sn(nid));
  407|    210|        num = ossl_namemap_add_name(arg, num, OBJ_nid2ln(nid));
  408|    210|        if ((obj = OBJ_nid2obj(nid)) != NULL) {
  ------------------
  |  Branch (408:13): [True: 210, False: 0]
  ------------------
  409|    210|            char txtoid[OSSL_MAX_NAME_SIZE];
  410|       |
  411|    210|            if (OBJ_obj2txt(txtoid, sizeof(txtoid), obj, 1) > 0)
  ------------------
  |  Branch (411:17): [True: 209, False: 1]
  ------------------
  412|    209|                num = ossl_namemap_add_name(arg, num, txtoid);
  413|    210|        }
  414|    210|    }
  415|    258|    if (pem_name != NULL)
  ------------------
  |  Branch (415:9): [True: 11, False: 247]
  ------------------
  416|     11|        num = ossl_namemap_add_name(arg, num, pem_name);
  417|    258|}
core_namemap.c:get_legacy_md_names:
  428|     59|{
  429|     59|    const EVP_MD *md = (void *)OBJ_NAME_get(on->name, on->type);
  430|       |
  431|     59|    if (md != NULL)
  ------------------
  |  Branch (431:9): [True: 59, False: 0]
  ------------------
  432|     59|        get_legacy_evp_names(0, EVP_MD_get_type(md), NULL, arg);
  433|     59|}
core_namemap.c:get_legacy_pkey_meth_names:
  437|     15|{
  438|     15|    int nid = 0, base_nid = 0, flags = 0;
  439|     15|    const char *pem_name = NULL;
  440|       |
  441|     15|    EVP_PKEY_asn1_get0_info(&nid, &base_nid, &flags, NULL, &pem_name, ameth);
  442|     15|    if (nid != NID_undef) {
  ------------------
  |  |   18|     15|#define NID_undef                       0
  ------------------
  |  Branch (442:9): [True: 15, False: 0]
  ------------------
  443|     15|        if ((flags & ASN1_PKEY_ALIAS) == 0) {
  ------------------
  |  | 1606|     15|# define ASN1_PKEY_ALIAS         0x1
  ------------------
  |  Branch (443:13): [True: 10, False: 5]
  ------------------
  444|     10|            switch (nid) {
  445|      1|            case EVP_PKEY_DHX:
  ------------------
  |  |   72|      1|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5499|      1|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
  |  Branch (445:13): [True: 1, False: 9]
  ------------------
  446|       |                /* We know that the name "DHX" is used too */
  447|      1|                get_legacy_evp_names(0, nid, "DHX", arg);
  448|       |                /* FALLTHRU */
  449|     10|            default:
  ------------------
  |  Branch (449:13): [True: 9, False: 1]
  ------------------
  450|     10|                get_legacy_evp_names(0, nid, pem_name, arg);
  451|     10|            }
  452|     10|        } else {
  453|       |            /*
  454|       |             * Treat aliases carefully, some of them are undesirable, or
  455|       |             * should not be treated as such for providers.
  456|       |             */
  457|       |
  458|      5|            switch (nid) {
  459|      1|            case EVP_PKEY_SM2:
  ------------------
  |  |   74|      1|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|      1|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (459:13): [True: 1, False: 4]
  ------------------
  460|       |                /*
  461|       |                 * SM2 is a separate keytype with providers, not an alias for
  462|       |                 * EC.
  463|       |                 */
  464|      1|                get_legacy_evp_names(0, nid, pem_name, arg);
  465|      1|                break;
  466|      4|            default:
  ------------------
  |  Branch (466:13): [True: 4, False: 1]
  ------------------
  467|       |                /* Use the short name of the base nid as the common reference */
  468|      4|                get_legacy_evp_names(base_nid, nid, pem_name, arg);
  469|      5|            }
  470|      5|        }
  471|     15|    }
  472|     15|}
core_namemap.c:names_free:
   49|    167|{
   50|    167|    sk_OPENSSL_STRING_pop_free(n, name_string_free);
  ------------------
  |  |  243|    167|#define sk_OPENSSL_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_freefunc_type(freefunc))
  ------------------
   51|    167|}

ossl_err_load_CRYPTO_strings:
   83|      2|{
   84|      2|#ifndef OPENSSL_NO_ERR
   85|      2|    if (ERR_reason_error_string(CRYPTO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (85:9): [True: 2, False: 0]
  ------------------
   86|      2|        ERR_load_strings_const(CRYPTO_str_reasons);
   87|      2|#endif
   88|      2|    return 1;
   89|      2|}

OPENSSL_cpuid_setup:
   96|      2|{
   97|      2|    static int trigger = 0;
   98|      2|    IA32CAP OPENSSL_ia32_cpuid(unsigned int *);
   99|      2|    IA32CAP vec;
  100|      2|    const variant_char *env;
  101|      2|    int index = 2;
  102|       |
  103|      2|    if (trigger)
  ------------------
  |  Branch (103:9): [True: 0, False: 2]
  ------------------
  104|      0|        return;
  105|       |
  106|      2|    trigger = 1;
  107|      2|    if ((env = ossl_getenv("OPENSSL_ia32cap")) != NULL) {
  ------------------
  |  |   47|      2|#   define ossl_getenv getenv
  ------------------
  |  Branch (107:9): [True: 0, False: 2]
  ------------------
  108|      0|        int off = (env[0] == '~') ? 1 : 0;
  ------------------
  |  Branch (108:19): [True: 0, False: 0]
  ------------------
  109|       |
  110|      0|        vec = ossl_strtouint64(env + off);
  111|       |
  112|      0|        if (off) {
  ------------------
  |  Branch (112:13): [True: 0, False: 0]
  ------------------
  113|      0|            IA32CAP mask = vec;
  114|      0|            vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P) & ~mask;
  115|      0|            if (mask & (1<<24)) {
  ------------------
  |  Branch (115:17): [True: 0, False: 0]
  ------------------
  116|       |                /*
  117|       |                 * User disables FXSR bit, mask even other capabilities
  118|       |                 * that operate exclusively on XMM, so we don't have to
  119|       |                 * double-check all the time. We mask PCLMULQDQ, AMD XOP,
  120|       |                 * AES-NI and AVX. Formally speaking we don't have to
  121|       |                 * do it in x86_64 case, but we can safely assume that
  122|       |                 * x86_64 users won't actually flip this flag.
  123|       |                 */
  124|      0|                vec &= ~((IA32CAP)(1<<1|1<<11|1<<25|1<<28) << 32);
  125|      0|            }
  126|      0|        } else if (env[0] == ':') {
  ------------------
  |  Branch (126:20): [True: 0, False: 0]
  ------------------
  127|      0|            vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P);
  128|      0|        }
  129|       |
  130|       |        /* Processed indexes 0, 1 */
  131|      0|        if ((env = ossl_strchr(env, ':')) != NULL)
  ------------------
  |  Branch (131:13): [True: 0, False: 0]
  ------------------
  132|      0|            env++;
  133|      0|        for (; index < OPENSSL_IA32CAP_P_MAX_INDEXES; index += 2) {
  ------------------
  |  |   39|      0|#  define OPENSSL_IA32CAP_P_MAX_INDEXES 10
  ------------------
  |  Branch (133:16): [True: 0, False: 0]
  ------------------
  134|      0|            if ((env != NULL) && (env[0] != '\0')) {
  ------------------
  |  Branch (134:17): [True: 0, False: 0]
  |  Branch (134:34): [True: 0, False: 0]
  ------------------
  135|       |                /* if env[0] == ':' current index is skipped */
  136|      0|                if (env[0] != ':') {
  ------------------
  |  Branch (136:21): [True: 0, False: 0]
  ------------------
  137|      0|                    IA32CAP vecx;
  138|       |
  139|      0|                    off = (env[0] == '~') ? 1 : 0;
  ------------------
  |  Branch (139:27): [True: 0, False: 0]
  ------------------
  140|      0|                    vecx = ossl_strtouint64(env + off);
  141|      0|                    if (off) {
  ------------------
  |  Branch (141:25): [True: 0, False: 0]
  ------------------
  142|      0|                        OPENSSL_ia32cap_P[index] &= ~(unsigned int)vecx;
  143|      0|                        OPENSSL_ia32cap_P[index + 1] &= ~(unsigned int)(vecx >> 32);
  144|      0|                    } else {
  145|      0|                        OPENSSL_ia32cap_P[index] = (unsigned int)vecx;
  146|      0|                        OPENSSL_ia32cap_P[index + 1] = (unsigned int)(vecx >> 32);
  147|      0|                    }
  148|      0|                }
  149|       |                /* skip delimeter */
  150|      0|                if ((env = ossl_strchr(env, ':')) != NULL)
  ------------------
  |  Branch (150:21): [True: 0, False: 0]
  ------------------
  151|      0|                    env++;
  152|      0|            } else { /* zeroize the next two indexes */
  153|      0|                OPENSSL_ia32cap_P[index] = 0;
  154|      0|                OPENSSL_ia32cap_P[index + 1] = 0;
  155|      0|            }
  156|      0|        }
  157|       |
  158|       |        /* If AVX10 is disabled, zero out its detailed cap bits */
  159|      0|        if (!(OPENSSL_ia32cap_P[6] & (1 << 19)))
  ------------------
  |  Branch (159:13): [True: 0, False: 0]
  ------------------
  160|      0|            OPENSSL_ia32cap_P[9] = 0;
  161|      2|    } else {
  162|      2|        vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P);
  163|      2|    }
  164|       |
  165|       |    /*
  166|       |     * |(1<<10) sets a reserved bit to signal that variable
  167|       |     * was initialized already... This is to avoid interference
  168|       |     * with cpuid snippets in ELF .init segment.
  169|       |     */
  170|      2|    OPENSSL_ia32cap_P[0] = (unsigned int)vec | (1 << 10);
  171|      2|    OPENSSL_ia32cap_P[1] = (unsigned int)(vec >> 32);
  172|      2|}

ossl_err_load_CRMF_strings:
   78|      2|{
   79|      2|# ifndef OPENSSL_NO_ERR
   80|      2|    if (ERR_reason_error_string(CRMF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (80:9): [True: 2, False: 0]
  ------------------
   81|      2|        ERR_load_strings_const(CRMF_str_reasons);
   82|      2|# endif
   83|      2|    return 1;
   84|      2|}

ossl_err_load_CT_strings:
   52|      2|{
   53|      2|# ifndef OPENSSL_NO_ERR
   54|      2|    if (ERR_reason_error_string(CT_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (54:9): [True: 2, False: 0]
  ------------------
   55|      2|        ERR_load_strings_const(CT_str_reasons);
   56|      2|# endif
   57|      2|    return 1;
   58|      2|}

o2i_SCT_LIST:
  255|    193|{
  256|    193|    STACK_OF(SCT) *sk = NULL;
  ------------------
  |  |   31|    193|# define STACK_OF(type) struct stack_st_##type
  ------------------
  257|    193|    size_t list_len, sct_len;
  258|       |
  259|    193|    if (len < 2 || len > MAX_SCT_LIST_SIZE) {
  ------------------
  |  |   22|    161|# define MAX_SCT_LIST_SIZE       MAX_SCT_SIZE
  |  |  ------------------
  |  |  |  |   21|    161|# define MAX_SCT_SIZE            65535
  |  |  ------------------
  ------------------
  |  Branch (259:9): [True: 32, False: 161]
  |  Branch (259:20): [True: 0, False: 161]
  ------------------
  260|     32|        ERR_raise(ERR_LIB_CT, CT_R_SCT_LIST_INVALID);
  ------------------
  |  |  401|     32|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     32|    (ERR_new(),                                                 \
  |  |  |  |  404|     32|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     32|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     32|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     32|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     32|     ERR_set_error)
  |  |  ------------------
  ------------------
  261|     32|        return NULL;
  262|     32|    }
  263|       |
  264|    161|    n2s(*pp, list_len);
  ------------------
  |  |   28|    161|#define n2s(c,s)        ((s=(((unsigned int)((c)[0]))<< 8)| \
  |  |   29|    161|                            (((unsigned int)((c)[1]))    )),c+=2)
  ------------------
  265|    161|    if (list_len != len - 2) {
  ------------------
  |  Branch (265:9): [True: 149, False: 12]
  ------------------
  266|    149|        ERR_raise(ERR_LIB_CT, CT_R_SCT_LIST_INVALID);
  ------------------
  |  |  401|    149|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    149|    (ERR_new(),                                                 \
  |  |  |  |  404|    149|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    149|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    149|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    149|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    149|     ERR_set_error)
  |  |  ------------------
  ------------------
  267|    149|        return NULL;
  268|    149|    }
  269|       |
  270|     12|    if (a == NULL || *a == NULL) {
  ------------------
  |  Branch (270:9): [True: 12, False: 0]
  |  Branch (270:22): [True: 0, False: 0]
  ------------------
  271|     12|        sk = sk_SCT_new_null();
  ------------------
  |  |   46|     12|#define sk_SCT_new_null() ((STACK_OF(SCT) *)OPENSSL_sk_new_null())
  ------------------
  272|     12|        if (sk == NULL)
  ------------------
  |  Branch (272:13): [True: 0, False: 12]
  ------------------
  273|      0|            return NULL;
  274|     12|    } else {
  275|      0|        SCT *sct;
  276|       |
  277|       |        /* Use the given stack, but empty it first. */
  278|      0|        sk = *a;
  279|      0|        while ((sct = sk_SCT_pop(sk)) != NULL)
  ------------------
  |  |   55|      0|#define sk_SCT_pop(sk) ((SCT *)OPENSSL_sk_pop(ossl_check_SCT_sk_type(sk)))
  ------------------
  |  Branch (279:16): [True: 0, False: 0]
  ------------------
  280|      0|            SCT_free(sct);
  281|      0|    }
  282|       |
  283|     12|    while (list_len > 0) {
  ------------------
  |  Branch (283:12): [True: 1, False: 11]
  ------------------
  284|      1|        SCT *sct;
  285|       |
  286|      1|        if (list_len < 2) {
  ------------------
  |  Branch (286:13): [True: 1, False: 0]
  ------------------
  287|      1|            ERR_raise(ERR_LIB_CT, CT_R_SCT_LIST_INVALID);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
  288|      1|            goto err;
  289|      1|        }
  290|      0|        n2s(*pp, sct_len);
  ------------------
  |  |   28|      0|#define n2s(c,s)        ((s=(((unsigned int)((c)[0]))<< 8)| \
  |  |   29|      0|                            (((unsigned int)((c)[1]))    )),c+=2)
  ------------------
  291|      0|        list_len -= 2;
  292|       |
  293|      0|        if (sct_len == 0 || sct_len > list_len) {
  ------------------
  |  Branch (293:13): [True: 0, False: 0]
  |  Branch (293:29): [True: 0, False: 0]
  ------------------
  294|      0|            ERR_raise(ERR_LIB_CT, CT_R_SCT_LIST_INVALID);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  295|      0|            goto err;
  296|      0|        }
  297|      0|        list_len -= sct_len;
  298|       |
  299|      0|        if ((sct = o2i_SCT(NULL, pp, sct_len)) == NULL)
  ------------------
  |  Branch (299:13): [True: 0, False: 0]
  ------------------
  300|      0|            goto err;
  301|      0|        if (!sk_SCT_push(sk, sct)) {
  ------------------
  |  |   53|      0|#define sk_SCT_push(sk, ptr) OPENSSL_sk_push(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
  ------------------
  |  Branch (301:13): [True: 0, False: 0]
  ------------------
  302|      0|            SCT_free(sct);
  303|      0|            goto err;
  304|      0|        }
  305|      0|    }
  306|       |
  307|     11|    if (a != NULL && *a == NULL)
  ------------------
  |  Branch (307:9): [True: 0, False: 11]
  |  Branch (307:22): [True: 0, False: 0]
  ------------------
  308|      0|        *a = sk;
  309|     11|    return sk;
  310|       |
  311|      1| err:
  312|      1|    if (a == NULL || *a == NULL)
  ------------------
  |  Branch (312:9): [True: 1, False: 0]
  |  Branch (312:22): [True: 0, False: 0]
  ------------------
  313|      1|        SCT_LIST_free(sk);
  314|      1|    return NULL;
  315|     12|}
d2i_SCT_LIST:
  372|    315|{
  373|    315|    ASN1_OCTET_STRING *oct = NULL;
  374|    315|    STACK_OF(SCT) *sk = NULL;
  ------------------
  |  |   31|    315|# define STACK_OF(type) struct stack_st_##type
  ------------------
  375|    315|    const unsigned char *p;
  376|       |
  377|    315|    p = *pp;
  378|    315|    if (d2i_ASN1_OCTET_STRING(&oct, &p, len) == NULL)
  ------------------
  |  Branch (378:9): [True: 122, False: 193]
  ------------------
  379|    122|        return NULL;
  380|       |
  381|    193|    p = oct->data;
  382|    193|    if ((sk = o2i_SCT_LIST(a, &p, oct->length)) != NULL)
  ------------------
  |  Branch (382:9): [True: 11, False: 182]
  ------------------
  383|     11|        *pp += len;
  384|       |
  385|    193|    ASN1_OCTET_STRING_free(oct);
  386|    193|    return sk;
  387|    315|}

SCT_LIST_print:
  116|     11|{
  117|     11|    int sct_count = sk_SCT_num(sct_list);
  ------------------
  |  |   43|     11|#define sk_SCT_num(sk) OPENSSL_sk_num(ossl_check_const_SCT_sk_type(sk))
  ------------------
  118|     11|    int i;
  119|       |
  120|     11|    for (i = 0; i < sct_count; ++i) {
  ------------------
  |  Branch (120:17): [True: 0, False: 11]
  ------------------
  121|      0|        SCT *sct = sk_SCT_value(sct_list, i);
  ------------------
  |  |   44|      0|#define sk_SCT_value(sk, idx) ((SCT *)OPENSSL_sk_value(ossl_check_const_SCT_sk_type(sk), (idx)))
  ------------------
  122|       |
  123|      0|        SCT_print(sct, out, indent, log_store);
  124|      0|        if (i < sk_SCT_num(sct_list) - 1)
  ------------------
  |  |   43|      0|#define sk_SCT_num(sk) OPENSSL_sk_num(ossl_check_const_SCT_sk_type(sk))
  ------------------
  |  Branch (124:13): [True: 0, False: 0]
  ------------------
  125|      0|            BIO_printf(out, "%s", separator);
  126|      0|    }
  127|     11|}

SCT_LIST_free:
   47|     12|{
   48|     12|    sk_SCT_pop_free(a, SCT_free);
  ------------------
  |  |   57|     12|#define sk_SCT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SCT_sk_type(sk), ossl_check_SCT_freefunc_type(freefunc))
  ------------------
   49|     12|}

ct_x509v3.c:x509_ext_d2i_SCT_LIST:
   52|    308|{
   53|    308|     STACK_OF(SCT) *s = d2i_SCT_LIST(a, pp, len);
  ------------------
  |  |   31|    308|# define STACK_OF(type) struct stack_st_##type
  ------------------
   54|       |
   55|    308|     if (set_sct_list_source(s, SCT_SOURCE_X509V3_EXTENSION) != 1) {
  ------------------
  |  Branch (55:10): [True: 0, False: 308]
  ------------------
   56|      0|         SCT_LIST_free(s);
   57|      0|         *a = NULL;
   58|      0|         return NULL;
   59|      0|     }
   60|    308|     return s;
   61|    308|}
ct_x509v3.c:set_sct_list_source:
   34|    315|{
   35|    315|    if (s != NULL) {
  ------------------
  |  Branch (35:9): [True: 11, False: 304]
  ------------------
   36|     11|        int i;
   37|       |
   38|     11|        for (i = 0; i < sk_SCT_num(s); i++) {
  ------------------
  |  |   43|     11|#define sk_SCT_num(sk) OPENSSL_sk_num(ossl_check_const_SCT_sk_type(sk))
  ------------------
  |  Branch (38:21): [True: 0, False: 11]
  ------------------
   39|      0|            int res = SCT_set_source(sk_SCT_value(s, i), source);
  ------------------
  |  |   44|      0|#define sk_SCT_value(sk, idx) ((SCT *)OPENSSL_sk_value(ossl_check_const_SCT_sk_type(sk), (idx)))
  ------------------
   40|       |
   41|      0|            if (res != 1) {
  ------------------
  |  Branch (41:17): [True: 0, False: 0]
  ------------------
   42|      0|                return 0;
   43|      0|            }
   44|      0|        }
   45|     11|    }
   46|    315|    return 1;
   47|    315|}
ct_x509v3.c:i2r_SCT_LIST:
   28|     11|{
   29|     11|    SCT_LIST_print(sct_list, out, indent, "\n", NULL);
   30|     11|    return 1;
   31|     11|}
ct_x509v3.c:i2s_poison:
   17|     10|{
   18|     10|    return OPENSSL_strdup("NULL");
  ------------------
  |  |  119|     10|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   19|     10|}
ct_x509v3.c:ocsp_ext_d2i_SCT_LIST:
   66|      7|{
   67|      7|    STACK_OF(SCT) *s = d2i_SCT_LIST(a, pp, len);
  ------------------
  |  |   31|      7|# define STACK_OF(type) struct stack_st_##type
  ------------------
   68|       |
   69|      7|    if (set_sct_list_source(s, SCT_SOURCE_OCSP_STAPLED_RESPONSE) != 1) {
  ------------------
  |  Branch (69:9): [True: 0, False: 7]
  ------------------
   70|      0|        SCT_LIST_free(s);
   71|      0|        *a = NULL;
   72|      0|        return NULL;
   73|      0|    }
   74|      7|    return s;
   75|      7|}

ossl_ctype_check:
  253|   640k|{
  254|   640k|    const int max = sizeof(ctype_char_map) / sizeof(*ctype_char_map);
  255|   640k|    const int a = ossl_toascii(c);
  ------------------
  |  |   56|   640k|#  define ossl_toascii(c)       (c)
  ------------------
  256|       |
  257|   640k|    return a >= 0 && a < max && (ctype_char_map[a] & mask) != 0;
  ------------------
  |  Branch (257:12): [True: 640k, False: 0]
  |  Branch (257:22): [True: 635k, False: 5.22k]
  |  Branch (257:33): [True: 145k, False: 490k]
  ------------------
  258|   640k|}
ossl_isdigit:
  270|  37.6M|{
  271|  37.6M|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  37.6M|#  define ossl_toascii(c)       (c)
  ------------------
  272|       |
  273|  37.6M|    return ASCII_IS_DIGIT(a);
  ------------------
  |  |  265|  37.6M|#define ASCII_IS_DIGIT(c)   (c >= 0x30 && c <= 0x39)
  |  |  ------------------
  |  |  |  Branch (265:30): [True: 35.6M, False: 1.94M]
  |  |  |  Branch (265:43): [True: 14.3M, False: 21.2M]
  |  |  ------------------
  ------------------
  274|  37.6M|}
ossl_isupper:
  277|  2.93k|{
  278|  2.93k|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  2.93k|#  define ossl_toascii(c)       (c)
  ------------------
  279|       |
  280|  2.93k|    return ASCII_IS_UPPER(a);
  ------------------
  |  |  266|  2.93k|#define ASCII_IS_UPPER(c)   (c >= 0x41 && c <= 0x5A)
  |  |  ------------------
  |  |  |  Branch (266:30): [True: 2.27k, False: 666]
  |  |  |  Branch (266:43): [True: 1.36k, False: 906]
  |  |  ------------------
  ------------------
  281|  2.93k|}
ossl_tolower:
  297|  9.51M|{
  298|  9.51M|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  9.51M|#  define ossl_toascii(c)       (c)
  ------------------
  299|       |
  300|  9.51M|    return ASCII_IS_UPPER(a) ? c ^ case_change : c;
  ------------------
  |  |  266|  9.51M|#define ASCII_IS_UPPER(c)   (c >= 0x41 && c <= 0x5A)
  |  |  ------------------
  |  |  |  Branch (266:30): [True: 7.85M, False: 1.66M]
  |  |  |  Branch (266:43): [True: 2.57M, False: 5.27M]
  |  |  ------------------
  ------------------
  301|  9.51M|}
ossl_ascii_isdigit:
  311|   225k|{
  312|   225k|    return ASCII_IS_DIGIT(c);
  ------------------
  |  |  265|   225k|#define ASCII_IS_DIGIT(c)   (c >= 0x30 && c <= 0x39)
  |  |  ------------------
  |  |  |  Branch (265:30): [True: 214k, False: 11.2k]
  |  |  |  Branch (265:43): [True: 211k, False: 3.50k]
  |  |  ------------------
  ------------------
  313|   225k|}

ossl_DER_w_begin_sequence:
  172|      4|{
  173|      4|    return int_start_context(pkt, tag)
  ------------------
  |  Branch (173:12): [True: 4, False: 0]
  ------------------
  174|      4|        && WPACKET_start_sub_packet(pkt);
  ------------------
  |  Branch (174:12): [True: 4, False: 0]
  ------------------
  175|      4|}
ossl_DER_w_end_sequence:
  178|      4|{
  179|       |    /*
  180|       |     * If someone set the flag WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH on this
  181|       |     * sub-packet and this sub-packet has nothing written to it, the DER length
  182|       |     * will not be written, and the total written size will be unchanged before
  183|       |     * and after WPACKET_close().  We use size1 and size2 to determine if
  184|       |     * anything was written, and only write our tag if it has.
  185|       |     *
  186|       |     * Because we know that int_end_context() needs to do the same check,
  187|       |     * we reproduce this flag if the written length was unchanged, or we will
  188|       |     * have an erroneous context tag.
  189|       |     */
  190|      4|    size_t size1, size2;
  191|       |
  192|      4|    return WPACKET_get_total_written(pkt, &size1)
  ------------------
  |  Branch (192:12): [True: 4, False: 0]
  ------------------
  193|      4|        && WPACKET_close(pkt)
  ------------------
  |  Branch (193:12): [True: 4, False: 0]
  ------------------
  194|      4|        && WPACKET_get_total_written(pkt, &size2)
  ------------------
  |  Branch (194:12): [True: 4, False: 0]
  ------------------
  195|      4|        && (size1 == size2
  ------------------
  |  Branch (195:12): [True: 4, False: 0]
  |  Branch (195:13): [True: 0, False: 4]
  ------------------
  196|      4|            ? WPACKET_set_flags(pkt, WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH)
  ------------------
  |  |  692|      0|#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH    2
  ------------------
  197|      4|            : WPACKET_put_bytes_u8(pkt, DER_F_CONSTRUCTED | DER_P_SEQUENCE))
  ------------------
  |  |  878|      4|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  198|      4|        && int_end_context(pkt, tag);
  ------------------
  |  Branch (198:12): [True: 4, False: 0]
  ------------------
  199|      4|}
der_writer.c:int_start_context:
   17|      4|{
   18|      4|    if (tag < 0)
  ------------------
  |  Branch (18:9): [True: 4, False: 0]
  ------------------
   19|      4|        return 1;
   20|      0|    if (!ossl_assert(tag <= 30))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (20:9): [True: 0, False: 0]
  ------------------
   21|      0|        return 0;
   22|      0|    return WPACKET_start_sub_packet(pkt);
   23|      0|}
der_writer.c:int_end_context:
   26|      4|{
   27|       |    /*
   28|       |     * If someone set the flag WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH on this
   29|       |     * sub-packet and this sub-packet has nothing written to it, the DER length
   30|       |     * will not be written, and the total written size will be unchanged before
   31|       |     * and after WPACKET_close().  We use size1 and size2 to determine if
   32|       |     * anything was written, and only write our tag if it has.
   33|       |     *
   34|       |     */
   35|      4|    size_t size1, size2;
   36|       |
   37|      4|    if (tag < 0)
  ------------------
  |  Branch (37:9): [True: 4, False: 0]
  ------------------
   38|      4|        return 1;
   39|      0|    if (!ossl_assert(tag <= 30))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (39:9): [True: 0, False: 0]
  ------------------
   40|      0|        return 0;
   41|       |
   42|       |    /* Context specific are normally (?) constructed */
   43|      0|    tag |= DER_F_CONSTRUCTED | DER_C_CONTEXT;
  ------------------
  |  |   58|      0|# define DER_F_CONSTRUCTED            0x20
  ------------------
                  tag |= DER_F_CONSTRUCTED | DER_C_CONTEXT;
  ------------------
  |  |   63|      0|# define DER_C_CONTEXT                0x80
  ------------------
   44|       |
   45|      0|    return WPACKET_get_total_written(pkt, &size1)
  ------------------
  |  Branch (45:12): [True: 0, False: 0]
  ------------------
   46|      0|        && WPACKET_close(pkt)
  ------------------
  |  Branch (46:12): [True: 0, False: 0]
  ------------------
   47|      0|        && WPACKET_get_total_written(pkt, &size2)
  ------------------
  |  Branch (47:12): [True: 0, False: 0]
  ------------------
   48|      0|        && (size1 == size2 || WPACKET_put_bytes_u8(pkt, tag));
  ------------------
  |  |  878|      0|    WPACKET_put_bytes__((pkt), (val), 1)
  |  |  ------------------
  |  |  |  Branch (878:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (48:13): [True: 0, False: 0]
  ------------------
   49|      0|}

dh_ameth.c:dh_pub_decode:
   61|    114|{
   62|    114|    const unsigned char *p, *pm;
   63|    114|    int pklen, pmlen;
   64|    114|    int ptype;
   65|    114|    const void *pval;
   66|    114|    const ASN1_STRING *pstr;
   67|    114|    X509_ALGOR *palg;
   68|    114|    ASN1_INTEGER *public_key = NULL;
   69|       |
   70|    114|    DH *dh = NULL;
   71|       |
   72|    114|    if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey))
  ------------------
  |  Branch (72:9): [True: 0, False: 114]
  ------------------
   73|      0|        return 0;
   74|    114|    X509_ALGOR_get0(NULL, &ptype, &pval, palg);
   75|       |
   76|    114|    if (ptype != V_ASN1_SEQUENCE) {
  ------------------
  |  |   74|    114|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (76:9): [True: 38, False: 76]
  ------------------
   77|     38|        ERR_raise(ERR_LIB_DH, DH_R_PARAMETER_ENCODING_ERROR);
  ------------------
  |  |  401|     38|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     38|    (ERR_new(),                                                 \
  |  |  |  |  404|     38|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     38|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     38|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     38|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     38|     ERR_set_error)
  |  |  ------------------
  ------------------
   78|     38|        goto err;
   79|     38|    }
   80|       |
   81|     76|    pstr = pval;
   82|     76|    pm = pstr->data;
   83|     76|    pmlen = pstr->length;
   84|       |
   85|     76|    if ((dh = d2i_dhp(pkey, &pm, pmlen)) == NULL) {
  ------------------
  |  Branch (85:9): [True: 8, False: 68]
  ------------------
   86|      8|        ERR_raise(ERR_LIB_DH, DH_R_DECODE_ERROR);
  ------------------
  |  |  401|      8|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      8|    (ERR_new(),                                                 \
  |  |  |  |  404|      8|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      8|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      8|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      8|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      8|     ERR_set_error)
  |  |  ------------------
  ------------------
   87|      8|        goto err;
   88|      8|    }
   89|       |
   90|     68|    if ((public_key = d2i_ASN1_INTEGER(NULL, &p, pklen)) == NULL) {
  ------------------
  |  Branch (90:9): [True: 3, False: 65]
  ------------------
   91|      3|        ERR_raise(ERR_LIB_DH, DH_R_DECODE_ERROR);
  ------------------
  |  |  401|      3|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      3|    (ERR_new(),                                                 \
  |  |  |  |  404|      3|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      3|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      3|     ERR_set_error)
  |  |  ------------------
  ------------------
   92|      3|        goto err;
   93|      3|    }
   94|       |
   95|       |    /* We have parameters now set public key */
   96|     65|    if ((dh->pub_key = ASN1_INTEGER_to_BN(public_key, NULL)) == NULL) {
  ------------------
  |  Branch (96:9): [True: 0, False: 65]
  ------------------
   97|      0|        ERR_raise(ERR_LIB_DH, DH_R_BN_DECODE_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   98|      0|        goto err;
   99|      0|    }
  100|       |
  101|     65|    ASN1_INTEGER_free(public_key);
  102|     65|    EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, dh);
  103|     65|    return 1;
  104|       |
  105|     49| err:
  106|     49|    ASN1_INTEGER_free(public_key);
  107|     49|    DH_free(dh);
  108|     49|    return 0;
  109|     65|}
dh_ameth.c:d2i_dhp:
   36|     76|{
   37|     76|    DH *dh = NULL;
   38|     76|    int is_dhx = (pkey->ameth == &ossl_dhx_asn1_meth);
   39|       |
   40|     76|    if (is_dhx)
  ------------------
  |  Branch (40:9): [True: 9, False: 67]
  ------------------
   41|      9|        dh = d2i_DHxparams(NULL, pp, length);
   42|     67|    else
   43|     67|        dh = d2i_DHparams(NULL, pp, length);
   44|       |
   45|     76|    return dh;
   46|     76|}
dh_ameth.c:dh_priv_decode:
  165|     11|{
  166|     11|    int ret = 0;
  167|     11|    DH *dh = ossl_dh_key_from_pkcs8(p8, NULL, NULL);
  168|       |
  169|     11|    if (dh != NULL) {
  ------------------
  |  Branch (169:9): [True: 0, False: 11]
  ------------------
  170|      0|        ret = 1;
  171|      0|        EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, dh);
  172|      0|    }
  173|       |
  174|     11|    return ret;
  175|     11|}
dh_ameth.c:int_dh_free:
   56|    125|{
   57|    125|    DH_free(pkey->pkey.dh);
   58|    125|}

d2i_DHxparams:
   94|  12.7k|{
   95|  12.7k|    FFC_PARAMS *params;
   96|  12.7k|    int_dhx942_dh *dhx = NULL;
   97|  12.7k|    DH *dh = NULL;
   98|       |
   99|  12.7k|    dh = DH_new();
  100|  12.7k|    if (dh == NULL)
  ------------------
  |  Branch (100:9): [True: 0, False: 12.7k]
  ------------------
  101|      0|        return NULL;
  102|  12.7k|    dhx = d2i_int_dhx(NULL, pp, length);
  103|  12.7k|    if (dhx == NULL) {
  ------------------
  |  Branch (103:9): [True: 12.7k, False: 89]
  ------------------
  104|  12.7k|        DH_free(dh);
  105|  12.7k|        return NULL;
  106|  12.7k|    }
  107|       |
  108|     89|    if (a != NULL) {
  ------------------
  |  Branch (108:9): [True: 0, False: 89]
  ------------------
  109|      0|        DH_free(*a);
  110|      0|        *a = dh;
  111|      0|    }
  112|       |
  113|     89|    params = &dh->params;
  114|     89|    DH_set0_pqg(dh, dhx->p, dhx->q, dhx->g);
  115|     89|    ossl_ffc_params_set0_j(params, dhx->j);
  116|       |
  117|     89|    if (dhx->vparams != NULL) {
  ------------------
  |  Branch (117:9): [True: 41, False: 48]
  ------------------
  118|       |        /* The counter has a maximum value of 4 * numbits(p) - 1 */
  119|     41|        size_t counter = (size_t)BN_get_word(dhx->vparams->counter);
  120|     41|        ossl_ffc_params_set_validate_params(params, dhx->vparams->seed->data,
  121|     41|                                            dhx->vparams->seed->length,
  122|     41|                                            counter);
  123|     41|        ASN1_BIT_STRING_free(dhx->vparams->seed);
  124|     41|        BN_free(dhx->vparams->counter);
  125|     41|        OPENSSL_free(dhx->vparams);
  ------------------
  |  |  115|     41|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     41|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     41|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  126|     41|        dhx->vparams = NULL;
  127|     41|    }
  128|       |
  129|     89|    OPENSSL_free(dhx);
  ------------------
  |  |  115|     89|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     89|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     89|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  130|     89|    DH_clear_flags(dh, DH_FLAG_TYPE_MASK);
  ------------------
  |  |  110|     89|#  define DH_FLAG_TYPE_MASK             0xF000
  ------------------
  131|     89|    DH_set_flags(dh, DH_FLAG_TYPE_DHX);
  ------------------
  |  |  112|     89|#  define DH_FLAG_TYPE_DHX              0x1000
  ------------------
  132|     89|    return dh;
  133|  12.7k|}
i2d_DHxparams:
  136|     78|{
  137|     78|    int ret = 0;
  138|     78|    int_dhx942_dh dhx;
  139|     78|    int_dhvparams dhv = { NULL, NULL };
  140|     78|    ASN1_BIT_STRING seed;
  141|     78|    size_t seedlen = 0;
  142|     78|    const FFC_PARAMS *params = &dh->params;
  143|     78|    int counter;
  144|       |
  145|     78|    ossl_ffc_params_get0_pqg(params, (const BIGNUM **)&dhx.p,
  146|     78|                             (const BIGNUM **)&dhx.q, (const BIGNUM **)&dhx.g);
  147|     78|    dhx.j = params->j;
  148|     78|    ossl_ffc_params_get_validate_params(params, &seed.data, &seedlen, &counter);
  149|     78|    seed.length = (int)seedlen;
  150|       |
  151|     78|    if (counter != -1 && seed.data != NULL && seed.length > 0) {
  ------------------
  |  Branch (151:9): [True: 40, False: 38]
  |  Branch (151:26): [True: 34, False: 6]
  |  Branch (151:47): [True: 34, False: 0]
  ------------------
  152|     34|        seed.flags = ASN1_STRING_FLAG_BITS_LEFT;
  ------------------
  |  |  161|     34|# define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
  ------------------
  153|     34|        dhv.seed = &seed;
  154|     34|        dhv.counter = BN_new();
  155|     34|        if (dhv.counter == NULL)
  ------------------
  |  Branch (155:13): [True: 0, False: 34]
  ------------------
  156|      0|            return 0;
  157|     34|        if (!BN_set_word(dhv.counter, (BN_ULONG)counter))
  ------------------
  |  Branch (157:13): [True: 0, False: 34]
  ------------------
  158|      0|            goto err;
  159|     34|        dhx.vparams = &dhv;
  160|     44|    } else {
  161|     44|        dhx.vparams = NULL;
  162|     44|    }
  163|     78|    ret = i2d_int_dhx(&dhx, pp);
  164|     78|err:
  165|     78|    BN_free(dhv.counter);
  166|     78|    return ret;
  167|     78|}
dh_asn1.c:dh_cb:
   27|  61.5k|{
   28|  61.5k|    if (operation == ASN1_OP_NEW_PRE) {
  ------------------
  |  |  742|  61.5k|# define ASN1_OP_NEW_PRE         0
  ------------------
  |  Branch (28:9): [True: 20.2k, False: 41.2k]
  ------------------
   29|  20.2k|        *pval = (ASN1_VALUE *)DH_new();
   30|  20.2k|        if (*pval != NULL)
  ------------------
  |  Branch (30:13): [True: 20.2k, False: 0]
  ------------------
   31|  20.2k|            return 2;
   32|      0|        return 0;
   33|  41.2k|    } else if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|  41.2k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (33:16): [True: 20.1k, False: 21.0k]
  ------------------
   34|  20.1k|        DH_free((DH *)*pval);
   35|  20.1k|        *pval = NULL;
   36|  20.1k|        return 2;
   37|  21.0k|    } else if (operation == ASN1_OP_D2I_POST) {
  ------------------
  |  |  747|  21.0k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (37:16): [True: 207, False: 20.8k]
  ------------------
   38|    207|        DH *dh = (DH *)*pval;
   39|       |
   40|    207|        DH_clear_flags(dh, DH_FLAG_TYPE_MASK);
  ------------------
  |  |  110|    207|#  define DH_FLAG_TYPE_MASK             0xF000
  ------------------
   41|    207|        DH_set_flags(dh, DH_FLAG_TYPE_DH);
  ------------------
  |  |  111|    207|#  define DH_FLAG_TYPE_DH               0x0000
  ------------------
   42|    207|        ossl_dh_cache_named_group(dh);
   43|    207|        dh->dirty_cnt++;
   44|    207|    }
   45|  21.0k|    return 1;
   46|  61.5k|}

ossl_dh_params_todata:
   92|     83|{
   93|     83|    long l = DH_get_length(dh);
   94|       |
   95|     83|    if (!ossl_ffc_params_todata(ossl_dh_get0_params(dh), bld, params))
  ------------------
  |  Branch (95:9): [True: 0, False: 83]
  ------------------
   96|      0|        return 0;
   97|     83|    if (l > 0
  ------------------
  |  Branch (97:9): [True: 19, False: 64]
  ------------------
   98|     83|        && !ossl_param_build_set_long(bld, params, OSSL_PKEY_PARAM_DH_PRIV_LEN, l))
  ------------------
  |  |  365|     19|# define OSSL_PKEY_PARAM_DH_PRIV_LEN "priv_len"
  ------------------
  |  Branch (98:12): [True: 0, False: 19]
  ------------------
   99|      0|        return 0;
  100|     83|    return 1;
  101|     83|}
ossl_dh_key_todata:
  105|     83|{
  106|     83|    const BIGNUM *priv = NULL, *pub = NULL;
  107|       |
  108|     83|    if (dh == NULL)
  ------------------
  |  Branch (108:9): [True: 0, False: 83]
  ------------------
  109|      0|        return 0;
  110|       |
  111|     83|    DH_get0_key(dh, &pub, &priv);
  112|     83|    if (priv != NULL
  ------------------
  |  Branch (112:9): [True: 18, False: 65]
  ------------------
  113|     83|        && include_private
  ------------------
  |  Branch (113:12): [True: 18, False: 0]
  ------------------
  114|     83|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PRIV_KEY, priv))
  ------------------
  |  |  431|     18|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  |  Branch (114:12): [True: 0, False: 18]
  ------------------
  115|      0|        return 0;
  116|     83|    if (pub != NULL
  ------------------
  |  Branch (116:9): [True: 83, False: 0]
  ------------------
  117|     83|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PUB_KEY, pub))
  ------------------
  |  |  433|     83|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  |  Branch (117:12): [True: 0, False: 83]
  ------------------
  118|      0|        return 0;
  119|       |
  120|     83|    return 1;
  121|     83|}
ossl_dh_is_foreign:
  124|     64|{
  125|     64|#ifndef FIPS_MODULE
  126|     64|    if (dh->engine != NULL || ossl_dh_get_method(dh) != DH_OpenSSL())
  ------------------
  |  Branch (126:9): [True: 0, False: 64]
  |  Branch (126:31): [True: 0, False: 64]
  ------------------
  127|      0|        return 1;
  128|     64|#endif
  129|     64|    return 0;
  130|     64|}
ossl_dh_key_from_pkcs8:
  183|     41|{
  184|     41|    const unsigned char *p, *pm;
  185|     41|    int pklen, pmlen;
  186|     41|    int ptype;
  187|     41|    const void *pval;
  188|     41|    const ASN1_STRING *pstr;
  189|     41|    const X509_ALGOR *palg;
  190|     41|    BIGNUM *privkey_bn = NULL;
  191|     41|    ASN1_INTEGER *privkey = NULL;
  192|     41|    DH *dh = NULL;
  193|       |
  194|     41|    if (!PKCS8_pkey_get0(NULL, &p, &pklen, &palg, p8inf))
  ------------------
  |  Branch (194:9): [True: 0, False: 41]
  ------------------
  195|      0|        return 0;
  196|       |
  197|     41|    X509_ALGOR_get0(NULL, &ptype, &pval, palg);
  198|       |
  199|     41|    if (ptype != V_ASN1_SEQUENCE)
  ------------------
  |  |   74|     41|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (199:9): [True: 6, False: 35]
  ------------------
  200|      6|        goto decerr;
  201|     35|    if ((privkey = d2i_ASN1_INTEGER(NULL, &p, pklen)) == NULL)
  ------------------
  |  Branch (201:9): [True: 3, False: 32]
  ------------------
  202|      3|        goto decerr;
  203|       |
  204|     32|    pstr = pval;
  205|     32|    pm = pstr->data;
  206|     32|    pmlen = pstr->length;
  207|     32|    switch (OBJ_obj2nid(palg->algorithm)) {
  208|      2|    case NID_dhKeyAgreement:
  ------------------
  |  |  621|      2|#define NID_dhKeyAgreement              28
  ------------------
  |  Branch (208:5): [True: 2, False: 30]
  ------------------
  209|      2|        dh = d2i_DHparams(NULL, &pm, pmlen);
  210|      2|        break;
  211|     30|    case NID_dhpublicnumber:
  ------------------
  |  | 5499|     30|#define NID_dhpublicnumber              920
  ------------------
  |  Branch (211:5): [True: 30, False: 2]
  ------------------
  212|     30|        dh = d2i_DHxparams(NULL, &pm, pmlen);
  213|     30|        break;
  214|      0|    default:
  ------------------
  |  Branch (214:5): [True: 0, False: 32]
  ------------------
  215|      0|        goto decerr;
  216|     32|    }
  217|     32|    if (dh == NULL)
  ------------------
  |  Branch (217:9): [True: 6, False: 26]
  ------------------
  218|      6|        goto decerr;
  219|       |
  220|       |    /* We have parameters now set private key */
  221|     26|    if ((privkey_bn = BN_secure_new()) == NULL
  ------------------
  |  Branch (221:9): [True: 0, False: 26]
  ------------------
  222|     26|        || !ASN1_INTEGER_to_BN(privkey, privkey_bn)) {
  ------------------
  |  Branch (222:12): [True: 0, False: 26]
  ------------------
  223|      0|        ERR_raise(ERR_LIB_DH, DH_R_BN_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  224|      0|        BN_clear_free(privkey_bn);
  225|      0|        goto dherr;
  226|      0|    }
  227|     26|    if (!DH_set0_key(dh, NULL, privkey_bn))
  ------------------
  |  Branch (227:9): [True: 0, False: 26]
  ------------------
  228|      0|        goto dherr;
  229|       |    /* Calculate public key, increments dirty_cnt */
  230|     26|    if (!DH_generate_key(dh))
  ------------------
  |  Branch (230:9): [True: 8, False: 18]
  ------------------
  231|      8|        goto dherr;
  232|       |
  233|     18|    goto done;
  234|       |
  235|     18| decerr:
  236|     15|    ERR_raise(ERR_LIB_DH, EVP_R_DECODE_ERROR);
  ------------------
  |  |  401|     15|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     15|    (ERR_new(),                                                 \
  |  |  |  |  404|     15|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     15|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     15|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     15|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     15|     ERR_set_error)
  |  |  ------------------
  ------------------
  237|     23| dherr:
  238|     23|    DH_free(dh);
  239|     23|    dh = NULL;
  240|     41| done:
  241|     41|    ASN1_STRING_clear_free(privkey);
  242|     41|    return dh;
  243|     23|}

ossl_err_load_DH_strings:
   68|      2|{
   69|      2|# ifndef OPENSSL_NO_ERR
   70|      2|    if (ERR_reason_error_string(DH_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (70:9): [True: 2, False: 0]
  ------------------
   71|      2|        ERR_load_strings_const(DH_str_reasons);
   72|      2|# endif
   73|      2|    return 1;
   74|      2|}

ossl_dh_cache_named_group:
   57|    296|{
   58|    296|    const DH_NAMED_GROUP *group;
   59|       |
   60|    296|    if (dh == NULL)
  ------------------
  |  Branch (60:9): [True: 0, False: 296]
  ------------------
   61|      0|        return;
   62|       |
   63|    296|    dh->params.nid = NID_undef; /* flush cached value */
  ------------------
  |  |   18|    296|#define NID_undef                       0
  ------------------
   64|       |
   65|       |    /* Exit if p or g is not set */
   66|    296|    if (dh->params.p == NULL
  ------------------
  |  Branch (66:9): [True: 0, False: 296]
  ------------------
   67|    296|        || dh->params.g == NULL)
  ------------------
  |  Branch (67:12): [True: 0, False: 296]
  ------------------
   68|      0|        return;
   69|       |
   70|    296|    if ((group = ossl_ffc_numbers_to_dh_named_group(dh->params.p,
  ------------------
  |  Branch (70:9): [True: 0, False: 296]
  ------------------
   71|    296|                                                    dh->params.q,
   72|    296|                                                    dh->params.g)) != NULL) {
   73|      0|        if (dh->params.q == NULL)
  ------------------
  |  Branch (73:13): [True: 0, False: 0]
  ------------------
   74|      0|            dh->params.q = (BIGNUM *)ossl_ffc_named_group_get_q(group);
   75|       |        /* cache the nid and default key length */
   76|      0|        dh->params.nid = ossl_ffc_named_group_get_uid(group);
   77|      0|        dh->params.keylength = ossl_ffc_named_group_get_keylength(group);
   78|      0|        dh->dirty_cnt++;
   79|      0|    }
   80|    296|}

DH_OpenSSL:
  180|     64|{
  181|     64|    return &dh_ossl;
  182|     64|}
DH_get_default_method:
  185|  33.0k|{
  186|  33.0k|    return default_DH_method;
  187|  33.0k|}
DH_generate_key:
  221|     26|{
  222|       |#ifdef FIPS_MODULE
  223|       |    return generate_key(dh);
  224|       |#else
  225|     26|    return dh->meth->generate_key(dh);
  226|     26|#endif
  227|     26|}
ossl_dh_generate_public_key:
  231|     22|{
  232|     22|    int ret = 0;
  233|     22|    BIGNUM *prk = BN_new();
  234|     22|    BN_MONT_CTX *mont = NULL;
  235|       |
  236|     22|    if (prk == NULL)
  ------------------
  |  Branch (236:9): [True: 0, False: 22]
  ------------------
  237|      0|        return 0;
  238|       |
  239|     22|    if (dh->flags & DH_FLAG_CACHE_MONT_P) {
  ------------------
  |  |  108|     22|#  define DH_FLAG_CACHE_MONT_P     0x01
  ------------------
  |  Branch (239:9): [True: 22, False: 0]
  ------------------
  240|       |        /*
  241|       |         * We take the input DH as const, but we lie, because in some cases we
  242|       |         * want to get a hold of its Montgomery context.
  243|       |         *
  244|       |         * We cast to remove the const qualifier in this case, it should be
  245|       |         * fine...
  246|       |         */
  247|     22|        BN_MONT_CTX **pmont = (BN_MONT_CTX **)&dh->method_mont_p;
  248|       |
  249|     22|        mont = BN_MONT_CTX_set_locked(pmont, dh->lock, dh->params.p, ctx);
  250|     22|        if (mont == NULL)
  ------------------
  |  Branch (250:13): [True: 4, False: 18]
  ------------------
  251|      4|            goto err;
  252|     22|    }
  253|     18|    BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME);
  ------------------
  |  |   67|     18|# define BN_FLG_CONSTTIME        0x04
  ------------------
  254|       |
  255|       |    /* pub_key = g^priv_key mod p */
  256|     18|    if (!dh->meth->bn_mod_exp(dh, pub_key, dh->params.g, prk, dh->params.p,
  ------------------
  |  Branch (256:9): [True: 0, False: 18]
  ------------------
  257|     18|                              ctx, mont))
  258|      0|        goto err;
  259|     18|    ret = 1;
  260|     22|err:
  261|     22|    BN_clear_free(prk);
  262|     22|    return ret;
  263|     18|}
dh_key.c:generate_key:
  266|     26|{
  267|     26|    int ok = 0;
  268|     26|    int generate_new_key = 0;
  269|     26|#ifndef FIPS_MODULE
  270|     26|    unsigned l;
  271|     26|#endif
  272|     26|    BN_CTX *ctx = NULL;
  273|     26|    BIGNUM *pub_key = NULL, *priv_key = NULL;
  274|       |
  275|     26|    if (BN_num_bits(dh->params.p) > OPENSSL_DH_MAX_MODULUS_BITS) {
  ------------------
  |  |   99|     26|#   define OPENSSL_DH_MAX_MODULUS_BITS        10000
  ------------------
  |  Branch (275:9): [True: 0, False: 26]
  ------------------
  276|      0|        ERR_raise(ERR_LIB_DH, DH_R_MODULUS_TOO_LARGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  277|      0|        return 0;
  278|      0|    }
  279|       |
  280|     26|    if (dh->params.q != NULL
  ------------------
  |  Branch (280:9): [True: 26, False: 0]
  ------------------
  281|     26|        && BN_num_bits(dh->params.q) > OPENSSL_DH_MAX_MODULUS_BITS) {
  ------------------
  |  |   99|     26|#   define OPENSSL_DH_MAX_MODULUS_BITS        10000
  ------------------
  |  Branch (281:12): [True: 0, False: 26]
  ------------------
  282|      0|        ERR_raise(ERR_LIB_DH, DH_R_Q_TOO_LARGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  283|      0|        return 0;
  284|      0|    }
  285|       |
  286|     26|    if (BN_num_bits(dh->params.p) < DH_MIN_MODULUS_BITS) {
  ------------------
  |  |   14|     26|#define DH_MIN_MODULUS_BITS     512
  ------------------
  |  Branch (286:9): [True: 4, False: 22]
  ------------------
  287|      4|        ERR_raise(ERR_LIB_DH, DH_R_MODULUS_TOO_SMALL);
  ------------------
  |  |  401|      4|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      4|    (ERR_new(),                                                 \
  |  |  |  |  404|      4|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      4|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      4|     ERR_set_error)
  |  |  ------------------
  ------------------
  288|      4|        return 0;
  289|      4|    }
  290|       |
  291|     22|    ctx = BN_CTX_new_ex(dh->libctx);
  292|     22|    if (ctx == NULL)
  ------------------
  |  Branch (292:9): [True: 0, False: 22]
  ------------------
  293|      0|        goto err;
  294|       |
  295|     22|    if (dh->priv_key == NULL) {
  ------------------
  |  Branch (295:9): [True: 0, False: 22]
  ------------------
  296|      0|        priv_key = BN_secure_new();
  297|      0|        if (priv_key == NULL)
  ------------------
  |  Branch (297:13): [True: 0, False: 0]
  ------------------
  298|      0|            goto err;
  299|      0|        generate_new_key = 1;
  300|     22|    } else {
  301|     22|        priv_key = dh->priv_key;
  302|     22|    }
  303|       |
  304|     22|    if (dh->pub_key == NULL) {
  ------------------
  |  Branch (304:9): [True: 22, False: 0]
  ------------------
  305|     22|        pub_key = BN_new();
  306|     22|        if (pub_key == NULL)
  ------------------
  |  Branch (306:13): [True: 0, False: 22]
  ------------------
  307|      0|            goto err;
  308|     22|    } else {
  309|      0|        pub_key = dh->pub_key;
  310|      0|    }
  311|     22|    if (generate_new_key) {
  ------------------
  |  Branch (311:9): [True: 0, False: 22]
  ------------------
  312|       |        /* Is it an approved safe prime ?*/
  313|      0|        if (DH_get_nid(dh) != NID_undef) {
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (313:13): [True: 0, False: 0]
  ------------------
  314|      0|            int max_strength =
  315|      0|                    ossl_ifc_ffc_compute_security_bits(BN_num_bits(dh->params.p));
  316|       |
  317|      0|            if (dh->params.q == NULL
  ------------------
  |  Branch (317:17): [True: 0, False: 0]
  ------------------
  318|      0|                || dh->length > BN_num_bits(dh->params.q))
  ------------------
  |  Branch (318:20): [True: 0, False: 0]
  ------------------
  319|      0|                goto err;
  320|       |            /* dh->length = maximum bit length of generated private key */
  321|      0|            if (!ossl_ffc_generate_private_key(ctx, &dh->params, dh->length,
  ------------------
  |  Branch (321:17): [True: 0, False: 0]
  ------------------
  322|      0|                                               max_strength, priv_key))
  323|      0|                goto err;
  324|      0|        } else {
  325|       |#ifdef FIPS_MODULE
  326|       |            if (dh->params.q == NULL)
  327|       |                goto err;
  328|       |#else
  329|      0|            if (dh->params.q == NULL) {
  ------------------
  |  Branch (329:17): [True: 0, False: 0]
  ------------------
  330|       |                /* secret exponent length, must satisfy 2^(l-1) <= p */
  331|      0|                if (dh->length != 0
  ------------------
  |  Branch (331:21): [True: 0, False: 0]
  ------------------
  332|      0|                    && dh->length >= BN_num_bits(dh->params.p))
  ------------------
  |  Branch (332:24): [True: 0, False: 0]
  ------------------
  333|      0|                    goto err;
  334|      0|                l = dh->length ? dh->length : BN_num_bits(dh->params.p) - 1;
  ------------------
  |  Branch (334:21): [True: 0, False: 0]
  ------------------
  335|      0|                if (!BN_priv_rand_ex(priv_key, l, BN_RAND_TOP_ONE,
  ------------------
  |  |   81|      0|#define BN_RAND_TOP_ONE     0
  ------------------
  |  Branch (335:21): [True: 0, False: 0]
  ------------------
  336|      0|                                     BN_RAND_BOTTOM_ANY, 0, ctx))
  ------------------
  |  |   85|      0|#define BN_RAND_BOTTOM_ANY  0
  ------------------
  337|      0|                    goto err;
  338|       |                /*
  339|       |                 * We handle just one known case where g is a quadratic non-residue:
  340|       |                 * for g = 2: p % 8 == 3
  341|       |                 */
  342|      0|                if (BN_is_word(dh->params.g, DH_GENERATOR_2)
  ------------------
  |  |  147|      0|#   define DH_GENERATOR_2          2
  ------------------
  |  Branch (342:21): [True: 0, False: 0]
  ------------------
  343|      0|                    && !BN_is_bit_set(dh->params.p, 2)) {
  ------------------
  |  Branch (343:24): [True: 0, False: 0]
  ------------------
  344|       |                    /* clear bit 0, since it won't be a secret anyway */
  345|      0|                    if (!BN_clear_bit(priv_key, 0))
  ------------------
  |  Branch (345:25): [True: 0, False: 0]
  ------------------
  346|      0|                        goto err;
  347|      0|                }
  348|      0|            } else
  349|      0|#endif
  350|      0|            {
  351|       |                /* Do a partial check for invalid p, q, g */
  352|      0|                if (!ossl_ffc_params_simple_validate(dh->libctx, &dh->params,
  ------------------
  |  Branch (352:21): [True: 0, False: 0]
  ------------------
  353|      0|                                                     FFC_PARAM_TYPE_DH, NULL))
  ------------------
  |  |   27|      0|# define FFC_PARAM_TYPE_DH   1
  ------------------
  354|      0|                    goto err;
  355|       |                /*
  356|       |                 * For FFC FIPS 186-4 keygen
  357|       |                 * security strength s = 112,
  358|       |                 * Max Private key size N = len(q)
  359|       |                 */
  360|      0|                if (!ossl_ffc_generate_private_key(ctx, &dh->params,
  ------------------
  |  Branch (360:21): [True: 0, False: 0]
  ------------------
  361|      0|                                                   BN_num_bits(dh->params.q),
  362|      0|                                                   MIN_STRENGTH,
  ------------------
  |  |   26|      0|# define MIN_STRENGTH 80
  ------------------
  363|      0|                                                   priv_key))
  364|      0|                    goto err;
  365|      0|            }
  366|      0|        }
  367|      0|    }
  368|       |
  369|     22|    if (!ossl_dh_generate_public_key(ctx, dh, priv_key, pub_key))
  ------------------
  |  Branch (369:9): [True: 4, False: 18]
  ------------------
  370|      4|        goto err;
  371|       |
  372|     18|    dh->pub_key = pub_key;
  373|     18|    dh->priv_key = priv_key;
  374|     18|    dh->dirty_cnt++;
  375|     18|    ok = 1;
  376|     22| err:
  377|     22|    if (ok != 1)
  ------------------
  |  Branch (377:9): [True: 4, False: 18]
  ------------------
  378|     22|        ERR_raise(ERR_LIB_DH, ERR_R_BN_LIB);
  ------------------
  |  |  401|      4|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      4|    (ERR_new(),                                                 \
  |  |  |  |  404|      4|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      4|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      4|     ERR_set_error)
  |  |  ------------------
  ------------------
  379|       |
  380|     22|    if (pub_key != dh->pub_key)
  ------------------
  |  Branch (380:9): [True: 4, False: 18]
  ------------------
  381|      4|        BN_free(pub_key);
  382|     22|    if (priv_key != dh->priv_key)
  ------------------
  |  Branch (382:9): [True: 0, False: 22]
  ------------------
  383|      0|        BN_free(priv_key);
  384|     22|    BN_CTX_free(ctx);
  385|     22|    return ok;
  386|     18|}
dh_key.c:dh_bn_mod_exp:
  192|     18|{
  193|       |#ifdef S390X_MOD_EXP
  194|       |    return s390x_mod_exp(r, a, p, m, ctx, m_ctx);
  195|       |#else
  196|     18|    return BN_mod_exp_mont(r, a, p, m, ctx, m_ctx);
  197|     18|#endif
  198|     18|}
dh_key.c:dh_init:
  201|  33.0k|{
  202|  33.0k|    dh->flags |= DH_FLAG_CACHE_MONT_P;
  ------------------
  |  |  108|  33.0k|#  define DH_FLAG_CACHE_MONT_P     0x01
  ------------------
  203|  33.0k|    dh->dirty_cnt++;
  204|  33.0k|    return 1;
  205|  33.0k|}
dh_key.c:dh_finish:
  208|  33.0k|{
  209|  33.0k|    BN_MONT_CTX_free(dh->method_mont_p);
  210|  33.0k|    return 1;
  211|  33.0k|}

ossl_dh_get_method:
   53|     64|{
   54|     64|    return dh->meth;
   55|     64|}
DH_new:
   58|  33.0k|{
   59|  33.0k|    return dh_new_intern(NULL, NULL);
   60|  33.0k|}
DH_free:
  137|  55.3k|{
  138|  55.3k|    int i;
  139|       |
  140|  55.3k|    if (r == NULL)
  ------------------
  |  Branch (140:9): [True: 22.1k, False: 33.1k]
  ------------------
  141|  22.1k|        return;
  142|       |
  143|  33.1k|    CRYPTO_DOWN_REF(&r->references, &i);
  144|  33.1k|    REF_PRINT_COUNT("DH", i, r);
  ------------------
  |  |  301|  33.1k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  33.1k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  33.1k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  33.1k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|  33.1k|    if (i > 0)
  ------------------
  |  Branch (145:9): [True: 65, False: 33.0k]
  ------------------
  146|     65|        return;
  147|  33.0k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|  33.0k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 33.0k]
  |  |  ------------------
  ------------------
  148|       |
  149|  33.0k|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (149:9): [True: 33.0k, False: 0]
  |  Branch (149:28): [True: 33.0k, False: 0]
  ------------------
  150|  33.0k|        r->meth->finish(r);
  151|  33.0k|#if !defined(FIPS_MODULE)
  152|  33.0k|# if !defined(OPENSSL_NO_ENGINE)
  153|  33.0k|    ENGINE_finish(r->engine);
  154|  33.0k|# endif
  155|  33.0k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, r, &r->ex_data);
  ------------------
  |  |  235|  33.0k|# define CRYPTO_EX_INDEX_DH               6
  ------------------
  156|  33.0k|#endif
  157|       |
  158|  33.0k|    CRYPTO_THREAD_lock_free(r->lock);
  159|  33.0k|    CRYPTO_FREE_REF(&r->references);
  160|       |
  161|  33.0k|    ossl_ffc_params_cleanup(&r->params);
  162|  33.0k|    BN_clear_free(r->pub_key);
  163|  33.0k|    BN_clear_free(r->priv_key);
  164|  33.0k|    OPENSSL_free(r);
  ------------------
  |  |  115|  33.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  33.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  33.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  165|  33.0k|}
DH_up_ref:
  168|     65|{
  169|     65|    int i;
  170|       |
  171|     65|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (171:9): [True: 0, False: 65]
  ------------------
  172|      0|        return 0;
  173|       |
  174|     65|    REF_PRINT_COUNT("DH", i, r);
  ------------------
  |  |  301|     65|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|     65|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|     65|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|     65|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  175|     65|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|     65|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 65]
  |  |  ------------------
  ------------------
  176|     65|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (176:13): [True: 65, False: 0]
  ------------------
  177|     65|}
ossl_dh_set0_libctx:
  180|     83|{
  181|     83|    d->libctx = libctx;
  182|     83|}
DH_bits:
  197|     83|{
  198|     83|    if (dh->params.p != NULL)
  ------------------
  |  Branch (198:9): [True: 83, False: 0]
  ------------------
  199|     83|        return BN_num_bits(dh->params.p);
  200|      0|    return -1;
  201|     83|}
DH_size:
  204|     83|{
  205|     83|    if (dh->params.p != NULL)
  ------------------
  |  Branch (205:9): [True: 83, False: 0]
  ------------------
  206|     83|        return BN_num_bytes(dh->params.p);
  ------------------
  |  |  189|     83|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  207|      0|    return -1;
  208|     83|}
DH_security_bits:
  211|     83|{
  212|     83|    int N;
  213|       |
  214|     83|    if (dh->params.q != NULL)
  ------------------
  |  Branch (214:9): [True: 19, False: 64]
  ------------------
  215|     19|        N = BN_num_bits(dh->params.q);
  216|     64|    else if (dh->length)
  ------------------
  |  Branch (216:14): [True: 61, False: 3]
  ------------------
  217|     61|        N = dh->length;
  218|      3|    else
  219|      3|        N = -1;
  220|     83|    if (dh->params.p != NULL)
  ------------------
  |  Branch (220:9): [True: 83, False: 0]
  ------------------
  221|     83|        return BN_security_bits(BN_num_bits(dh->params.p), N);
  222|      0|    return -1;
  223|     83|}
DH_set0_pqg:
  232|     89|{
  233|       |    /*
  234|       |     * If the fields p and g in dh are NULL, the corresponding input
  235|       |     * parameters MUST be non-NULL.  q may remain NULL.
  236|       |     */
  237|     89|    if ((dh->params.p == NULL && p == NULL)
  ------------------
  |  Branch (237:10): [True: 89, False: 0]
  |  Branch (237:34): [True: 0, False: 89]
  ------------------
  238|     89|        || (dh->params.g == NULL && g == NULL))
  ------------------
  |  Branch (238:13): [True: 89, False: 0]
  |  Branch (238:37): [True: 0, False: 89]
  ------------------
  239|      0|        return 0;
  240|       |
  241|     89|    ossl_ffc_params_set0_pqg(&dh->params, p, q, g);
  242|     89|    ossl_dh_cache_named_group(dh);
  243|     89|    dh->dirty_cnt++;
  244|     89|    return 1;
  245|     89|}
DH_get_length:
  248|    101|{
  249|    101|    return dh->length;
  250|    101|}
DH_get0_key:
  260|     83|{
  261|     83|    if (pub_key != NULL)
  ------------------
  |  Branch (261:9): [True: 83, False: 0]
  ------------------
  262|     83|        *pub_key = dh->pub_key;
  263|     83|    if (priv_key != NULL)
  ------------------
  |  Branch (263:9): [True: 83, False: 0]
  ------------------
  264|     83|        *priv_key = dh->priv_key;
  265|     83|}
DH_set0_key:
  268|     26|{
  269|     26|    if (pub_key != NULL) {
  ------------------
  |  Branch (269:9): [True: 0, False: 26]
  ------------------
  270|      0|        BN_clear_free(dh->pub_key);
  271|      0|        dh->pub_key = pub_key;
  272|      0|    }
  273|     26|    if (priv_key != NULL) {
  ------------------
  |  Branch (273:9): [True: 26, False: 0]
  ------------------
  274|     26|        BN_clear_free(dh->priv_key);
  275|     26|        dh->priv_key = priv_key;
  276|     26|    }
  277|       |
  278|     26|    dh->dirty_cnt++;
  279|     26|    return 1;
  280|     26|}
DH_get0_p:
  283|     18|{
  284|     18|    return dh->params.p;
  285|     18|}
DH_get0_priv_key:
  298|     54|{
  299|     54|    return dh->priv_key;
  300|     54|}
DH_get0_pub_key:
  303|     18|{
  304|     18|    return dh->pub_key;
  305|     18|}
DH_clear_flags:
  308|    296|{
  309|    296|    dh->flags &= ~flags;
  310|    296|}
DH_test_flags:
  313|     18|{
  314|     18|    return dh->flags & flags;
  315|     18|}
DH_set_flags:
  318|    296|{
  319|    296|    dh->flags |= flags;
  320|    296|}
ossl_dh_get0_params:
  330|    101|{
  331|    101|    return &dh->params;
  332|    101|}
dh_lib.c:dh_new_intern:
   75|  33.0k|{
   76|  33.0k|    DH *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  33.0k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  33.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  33.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|       |
   78|  33.0k|    if (ret == NULL)
  ------------------
  |  Branch (78:9): [True: 0, False: 33.0k]
  ------------------
   79|      0|        return NULL;
   80|       |
   81|  33.0k|    ret->lock = CRYPTO_THREAD_lock_new();
   82|  33.0k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (82:9): [True: 0, False: 33.0k]
  ------------------
   83|      0|        ERR_raise(ERR_LIB_DH, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   84|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   85|      0|        return NULL;
   86|      0|    }
   87|       |
   88|  33.0k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (88:9): [True: 0, False: 33.0k]
  ------------------
   89|      0|        CRYPTO_THREAD_lock_free(ret->lock);
   90|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   91|      0|        return NULL;
   92|      0|    }
   93|       |
   94|  33.0k|    ret->libctx = libctx;
   95|  33.0k|    ret->meth = DH_get_default_method();
   96|  33.0k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
   97|  33.0k|    ret->flags = ret->meth->flags;  /* early default init */
   98|  33.0k|    if (engine) {
  ------------------
  |  Branch (98:9): [True: 0, False: 33.0k]
  ------------------
   99|      0|        if (!ENGINE_init(engine)) {
  ------------------
  |  Branch (99:13): [True: 0, False: 0]
  ------------------
  100|      0|            ERR_raise(ERR_LIB_DH, ERR_R_ENGINE_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  101|      0|            goto err;
  102|      0|        }
  103|      0|        ret->engine = engine;
  104|      0|    } else
  105|  33.0k|        ret->engine = ENGINE_get_default_DH();
  106|  33.0k|    if (ret->engine) {
  ------------------
  |  Branch (106:9): [True: 0, False: 33.0k]
  ------------------
  107|      0|        ret->meth = ENGINE_get_DH(ret->engine);
  108|      0|        if (ret->meth == NULL) {
  ------------------
  |  Branch (108:13): [True: 0, False: 0]
  ------------------
  109|      0|            ERR_raise(ERR_LIB_DH, ERR_R_ENGINE_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  110|      0|            goto err;
  111|      0|        }
  112|      0|    }
  113|  33.0k|#endif
  114|       |
  115|  33.0k|    ret->flags = ret->meth->flags;
  116|       |
  117|  33.0k|#ifndef FIPS_MODULE
  118|  33.0k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data))
  ------------------
  |  |  235|  33.0k|# define CRYPTO_EX_INDEX_DH               6
  ------------------
  |  Branch (118:9): [True: 0, False: 33.0k]
  ------------------
  119|      0|        goto err;
  120|  33.0k|#endif /* FIPS_MODULE */
  121|       |
  122|  33.0k|    ossl_ffc_params_init(&ret->params);
  123|       |
  124|  33.0k|    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
  ------------------
  |  Branch (124:9): [True: 33.0k, False: 0]
  |  Branch (124:38): [True: 0, False: 33.0k]
  ------------------
  125|      0|        ERR_raise(ERR_LIB_DH, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        goto err;
  127|      0|    }
  128|       |
  129|  33.0k|    return ret;
  130|       |
  131|      0| err:
  132|      0|    DH_free(ret);
  133|      0|    return NULL;
  134|  33.0k|}

dsa_ameth.c:dsa_pub_decode:
   30|  1.07k|{
   31|  1.07k|    const unsigned char *p, *pm;
   32|  1.07k|    int pklen, pmlen;
   33|  1.07k|    int ptype;
   34|  1.07k|    const void *pval;
   35|  1.07k|    const ASN1_STRING *pstr;
   36|  1.07k|    X509_ALGOR *palg;
   37|  1.07k|    ASN1_INTEGER *public_key = NULL;
   38|       |
   39|  1.07k|    DSA *dsa = NULL;
   40|       |
   41|  1.07k|    if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey))
  ------------------
  |  Branch (41:9): [True: 0, False: 1.07k]
  ------------------
   42|      0|        return 0;
   43|  1.07k|    X509_ALGOR_get0(NULL, &ptype, &pval, palg);
   44|       |
   45|  1.07k|    if (ptype == V_ASN1_SEQUENCE) {
  ------------------
  |  |   74|  1.07k|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (45:9): [True: 9, False: 1.06k]
  ------------------
   46|      9|        pstr = pval;
   47|      9|        pm = pstr->data;
   48|      9|        pmlen = pstr->length;
   49|       |
   50|      9|        if ((dsa = d2i_DSAparams(NULL, &pm, pmlen)) == NULL) {
  ------------------
  |  Branch (50:13): [True: 7, False: 2]
  ------------------
   51|      7|            ERR_raise(ERR_LIB_DSA, DSA_R_DECODE_ERROR);
  ------------------
  |  |  401|      7|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      7|    (ERR_new(),                                                 \
  |  |  |  |  404|      7|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      7|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      7|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      7|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      7|     ERR_set_error)
  |  |  ------------------
  ------------------
   52|      7|            goto err;
   53|      7|        }
   54|       |
   55|  1.06k|    } else if ((ptype == V_ASN1_NULL) || (ptype == V_ASN1_UNDEF)) {
  ------------------
  |  |   67|  1.06k|# define V_ASN1_NULL                     5
  ------------------
                  } else if ((ptype == V_ASN1_NULL) || (ptype == V_ASN1_UNDEF)) {
  ------------------
  |  |   60|  1.06k|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (55:16): [True: 1, False: 1.06k]
  |  Branch (55:42): [True: 9, False: 1.05k]
  ------------------
   56|     10|        if ((dsa = DSA_new()) == NULL) {
  ------------------
  |  Branch (56:13): [True: 0, False: 10]
  ------------------
   57|      0|            ERR_raise(ERR_LIB_DSA, ERR_R_DSA_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   58|      0|            goto err;
   59|      0|        }
   60|  1.05k|    } else {
   61|  1.05k|        ERR_raise(ERR_LIB_DSA, DSA_R_PARAMETER_ENCODING_ERROR);
  ------------------
  |  |  401|  1.05k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.05k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.05k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.05k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.05k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.05k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.05k|     ERR_set_error)
  |  |  ------------------
  ------------------
   62|  1.05k|        goto err;
   63|  1.05k|    }
   64|       |
   65|     12|    if ((public_key = d2i_ASN1_INTEGER(NULL, &p, pklen)) == NULL) {
  ------------------
  |  Branch (65:9): [True: 7, False: 5]
  ------------------
   66|      7|        ERR_raise(ERR_LIB_DSA, DSA_R_DECODE_ERROR);
  ------------------
  |  |  401|      7|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      7|    (ERR_new(),                                                 \
  |  |  |  |  404|      7|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      7|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      7|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      7|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      7|     ERR_set_error)
  |  |  ------------------
  ------------------
   67|      7|        goto err;
   68|      7|    }
   69|       |
   70|      5|    if ((dsa->pub_key = ASN1_INTEGER_to_BN(public_key, NULL)) == NULL) {
  ------------------
  |  Branch (70:9): [True: 0, False: 5]
  ------------------
   71|      0|        ERR_raise(ERR_LIB_DSA, DSA_R_BN_DECODE_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   72|      0|        goto err;
   73|      0|    }
   74|       |
   75|      5|    dsa->dirty_cnt++;
   76|      5|    ASN1_INTEGER_free(public_key);
   77|      5|    EVP_PKEY_assign_DSA(pkey, dsa);
  ------------------
  |  |  527|      5|#  define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\
  |  |  ------------------
  |  |  |  |   66|      5|# define EVP_PKEY_DSA    NID_dsa
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|      5|#define NID_dsa         116
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  528|      5|                                        (dsa))
  ------------------
   78|      5|    return 1;
   79|       |
   80|  1.07k| err:
   81|  1.07k|    ASN1_INTEGER_free(public_key);
   82|  1.07k|    DSA_free(dsa);
   83|  1.07k|    return 0;
   84|       |
   85|      5|}
dsa_ameth.c:do_dsa_print:
  273|      1|{
  274|      1|    int ret = 0;
  275|      1|    const char *ktype = NULL;
  276|      1|    const BIGNUM *priv_key, *pub_key;
  277|      1|    int mod_len = 0;
  278|       |
  279|      1|    if (x->params.p != NULL)
  ------------------
  |  Branch (279:9): [True: 1, False: 0]
  ------------------
  280|      1|        mod_len = DSA_bits(x);
  281|       |
  282|      1|    if (ptype == 2)
  ------------------
  |  Branch (282:9): [True: 1, False: 0]
  ------------------
  283|      1|        priv_key = x->priv_key;
  284|      0|    else
  285|      0|        priv_key = NULL;
  286|       |
  287|      1|    if (ptype > 0)
  ------------------
  |  Branch (287:9): [True: 1, False: 0]
  ------------------
  288|      1|        pub_key = x->pub_key;
  289|      0|    else
  290|      0|        pub_key = NULL;
  291|       |
  292|      1|    if (ptype == 2)
  ------------------
  |  Branch (292:9): [True: 1, False: 0]
  ------------------
  293|      1|        ktype = "Private-Key";
  294|      0|    else if (ptype == 1)
  ------------------
  |  Branch (294:14): [True: 0, False: 0]
  ------------------
  295|      0|        ktype = "Public-Key";
  296|      0|    else
  297|      0|        ktype = "DSA-Parameters";
  298|       |
  299|      1|    if (priv_key != NULL) {
  ------------------
  |  Branch (299:9): [True: 1, False: 0]
  ------------------
  300|      1|        if (!BIO_indent(bp, off, 128))
  ------------------
  |  Branch (300:13): [True: 0, False: 1]
  ------------------
  301|      0|            goto err;
  302|      1|        if (BIO_printf(bp, "%s: (%d bit)\n", ktype, mod_len) <= 0)
  ------------------
  |  Branch (302:13): [True: 0, False: 1]
  ------------------
  303|      0|            goto err;
  304|      1|    } else {
  305|      0|        if (BIO_printf(bp, "Public-Key: (%d bit)\n", mod_len) <= 0)
  ------------------
  |  Branch (305:13): [True: 0, False: 0]
  ------------------
  306|      0|            goto err;
  307|      0|    }
  308|       |
  309|      1|    if (!ASN1_bn_print(bp, "priv:", priv_key, NULL, off))
  ------------------
  |  Branch (309:9): [True: 0, False: 1]
  ------------------
  310|      0|        goto err;
  311|      1|    if (!ASN1_bn_print(bp, "pub: ", pub_key, NULL, off))
  ------------------
  |  Branch (311:9): [True: 0, False: 1]
  ------------------
  312|      0|        goto err;
  313|      1|    if (!ossl_ffc_params_print(bp, &x->params, off))
  ------------------
  |  Branch (313:9): [True: 0, False: 1]
  ------------------
  314|      0|        goto err;
  315|      1|    ret = 1;
  316|      1| err:
  317|      1|    return ret;
  318|      1|}
dsa_ameth.c:dsa_priv_decode:
  151|     11|{
  152|     11|    int ret = 0;
  153|     11|    DSA *dsa = ossl_dsa_key_from_pkcs8(p8, NULL, NULL);
  154|       |
  155|     11|    if (dsa != NULL) {
  ------------------
  |  Branch (155:9): [True: 0, False: 11]
  ------------------
  156|      0|        ret = 1;
  157|      0|        EVP_PKEY_assign_DSA(pkey, dsa);
  ------------------
  |  |  527|      0|#  define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\
  |  |  ------------------
  |  |  |  |   66|      0|# define EVP_PKEY_DSA    NID_dsa
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|      0|#define NID_dsa         116
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  528|      0|                                        (dsa))
  ------------------
  158|      0|    }
  159|       |
  160|     11|    return ret;
  161|     11|}
dsa_ameth.c:dsa_priv_print:
  352|      1|{
  353|      1|    return do_dsa_print(bp, pkey->pkey.dsa, indent, 2);
  354|      1|}
dsa_ameth.c:int_dsa_free:
  268|  1.35k|{
  269|  1.35k|    DSA_free(pkey->pkey.dsa);
  270|  1.35k|}
dsa_ameth.c:old_dsa_priv_decode:
  358|    262|{
  359|    262|    DSA *dsa;
  360|       |
  361|    262|    if ((dsa = d2i_DSAPrivateKey(NULL, pder, derlen)) == NULL) {
  ------------------
  |  Branch (361:9): [True: 261, False: 1]
  ------------------
  362|    261|        ERR_raise(ERR_LIB_DSA, ERR_R_DSA_LIB);
  ------------------
  |  |  401|    261|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    261|    (ERR_new(),                                                 \
  |  |  |  |  404|    261|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    261|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    261|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    261|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    261|     ERR_set_error)
  |  |  ------------------
  ------------------
  363|    261|        return 0;
  364|    261|    }
  365|      1|    dsa->dirty_cnt++;
  366|      1|    EVP_PKEY_assign_DSA(pkey, dsa);
  ------------------
  |  |  527|      1|#  define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\
  |  |  ------------------
  |  |  |  |   66|      1|# define EVP_PKEY_DSA    NID_dsa
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|      1|#define NID_dsa         116
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  528|      1|                                        (dsa))
  ------------------
  367|      1|    return 1;
  368|    262|}
dsa_ameth.c:old_dsa_priv_encode:
  371|      1|{
  372|      1|    return i2d_DSAPrivateKey(pkey->pkey.dsa, pder);
  373|      1|}

dsa_asn1.c:dsa_cb:
   27|   133k|{
   28|   133k|    if (operation == ASN1_OP_NEW_PRE) {
  ------------------
  |  |  742|   133k|# define ASN1_OP_NEW_PRE         0
  ------------------
  |  Branch (28:9): [True: 43.8k, False: 89.5k]
  ------------------
   29|  43.8k|        *pval = (ASN1_VALUE *)DSA_new();
   30|  43.8k|        if (*pval != NULL)
  ------------------
  |  Branch (30:13): [True: 43.8k, False: 0]
  ------------------
   31|  43.8k|            return 2;
   32|      0|        return 0;
   33|  89.5k|    } else if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|  89.5k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (33:16): [True: 43.2k, False: 46.3k]
  ------------------
   34|  43.2k|        DSA_free((DSA *)*pval);
   35|  43.2k|        *pval = NULL;
   36|  43.2k|        return 2;
   37|  43.2k|    }
   38|  46.3k|    return 1;
   39|   133k|}

ossl_dsa_is_foreign:
   67|      6|{
   68|      6|#ifndef FIPS_MODULE
   69|      6|    if (dsa->engine != NULL || DSA_get_method((DSA *)dsa) != DSA_OpenSSL())
  ------------------
  |  Branch (69:9): [True: 0, False: 6]
  |  Branch (69:32): [True: 0, False: 6]
  ------------------
   70|      0|        return 1;
   71|      6|#endif
   72|      6|    return 0;
   73|      6|}
ossl_dsa_key_from_pkcs8:
  125|    469|{
  126|    469|    const unsigned char *p, *pm;
  127|    469|    int pklen, pmlen;
  128|    469|    int ptype;
  129|    469|    const void *pval;
  130|    469|    const ASN1_STRING *pstr;
  131|    469|    const X509_ALGOR *palg;
  132|    469|    ASN1_INTEGER *privkey = NULL;
  133|    469|    const BIGNUM *dsa_p, *dsa_g;
  134|    469|    BIGNUM *dsa_pubkey = NULL, *dsa_privkey = NULL;
  135|    469|    BN_CTX *ctx = NULL;
  136|       |
  137|    469|    DSA *dsa = NULL;
  138|       |
  139|    469|    if (!PKCS8_pkey_get0(NULL, &p, &pklen, &palg, p8inf))
  ------------------
  |  Branch (139:9): [True: 0, False: 469]
  ------------------
  140|      0|        return 0;
  141|    469|    X509_ALGOR_get0(NULL, &ptype, &pval, palg);
  142|       |
  143|    469|    if ((privkey = d2i_ASN1_INTEGER(NULL, &p, pklen)) == NULL)
  ------------------
  |  Branch (143:9): [True: 8, False: 461]
  ------------------
  144|      8|        goto decerr;
  145|    461|    if (privkey->type == V_ASN1_NEG_INTEGER || ptype != V_ASN1_SEQUENCE)
  ------------------
  |  |   98|    922|# define V_ASN1_NEG_INTEGER              (2 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|    461|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
                  if (privkey->type == V_ASN1_NEG_INTEGER || ptype != V_ASN1_SEQUENCE)
  ------------------
  |  |   74|    458|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (145:9): [True: 3, False: 458]
  |  Branch (145:48): [True: 7, False: 451]
  ------------------
  146|     10|        goto decerr;
  147|       |
  148|    451|    pstr = pval;
  149|    451|    pm = pstr->data;
  150|    451|    pmlen = pstr->length;
  151|    451|    if ((dsa = d2i_DSAparams(NULL, &pm, pmlen)) == NULL)
  ------------------
  |  Branch (151:9): [True: 3, False: 448]
  ------------------
  152|      3|        goto decerr;
  153|       |    /* We have parameters now set private key */
  154|    448|    if ((dsa_privkey = BN_secure_new()) == NULL
  ------------------
  |  Branch (154:9): [True: 0, False: 448]
  ------------------
  155|    448|        || !ASN1_INTEGER_to_BN(privkey, dsa_privkey)) {
  ------------------
  |  Branch (155:12): [True: 0, False: 448]
  ------------------
  156|      0|        ERR_raise(ERR_LIB_DSA, DSA_R_BN_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  157|      0|        goto dsaerr;
  158|      0|    }
  159|       |    /* Calculate public key */
  160|    448|    if ((dsa_pubkey = BN_new()) == NULL) {
  ------------------
  |  Branch (160:9): [True: 0, False: 448]
  ------------------
  161|      0|        ERR_raise(ERR_LIB_DSA, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  162|      0|        goto dsaerr;
  163|      0|    }
  164|    448|    if ((ctx = BN_CTX_new()) == NULL) {
  ------------------
  |  Branch (164:9): [True: 0, False: 448]
  ------------------
  165|      0|        ERR_raise(ERR_LIB_DSA, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  166|      0|        goto dsaerr;
  167|      0|    }
  168|       |
  169|    448|    dsa_p = DSA_get0_p(dsa);
  170|    448|    dsa_g = DSA_get0_g(dsa);
  171|    448|    BN_set_flags(dsa_privkey, BN_FLG_CONSTTIME);
  ------------------
  |  |   67|    448|# define BN_FLG_CONSTTIME        0x04
  ------------------
  172|    448|    if (!BN_mod_exp(dsa_pubkey, dsa_g, dsa_privkey, dsa_p, ctx)) {
  ------------------
  |  Branch (172:9): [True: 4, False: 444]
  ------------------
  173|      4|        ERR_raise(ERR_LIB_DSA, DSA_R_BN_ERROR);
  ------------------
  |  |  401|      4|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      4|    (ERR_new(),                                                 \
  |  |  |  |  404|      4|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      4|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      4|     ERR_set_error)
  |  |  ------------------
  ------------------
  174|      4|        goto dsaerr;
  175|      4|    }
  176|    444|    if (!DSA_set0_key(dsa, dsa_pubkey, dsa_privkey)) {
  ------------------
  |  Branch (176:9): [True: 0, False: 444]
  ------------------
  177|      0|        ERR_raise(ERR_LIB_DSA, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  178|      0|        goto dsaerr;
  179|      0|    }
  180|       |
  181|    444|    goto done;
  182|       |
  183|    444| decerr:
  184|     21|    ERR_raise(ERR_LIB_DSA, DSA_R_DECODE_ERROR);
  ------------------
  |  |  401|     21|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     21|    (ERR_new(),                                                 \
  |  |  |  |  404|     21|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     21|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     21|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     21|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     21|     ERR_set_error)
  |  |  ------------------
  ------------------
  185|     25| dsaerr:
  186|     25|    BN_free(dsa_privkey);
  187|     25|    BN_free(dsa_pubkey);
  188|     25|    DSA_free(dsa);
  189|     25|    dsa = NULL;
  190|    469| done:
  191|    469|    BN_CTX_free(ctx);
  192|    469|    ASN1_STRING_clear_free(privkey);
  193|    469|    return dsa;
  194|     25|}

ossl_err_load_DSA_strings:
   46|      2|{
   47|      2|# ifndef OPENSSL_NO_ERR
   48|      2|    if (ERR_reason_error_string(DSA_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (48:9): [True: 2, False: 0]
  ------------------
   49|      2|        ERR_load_strings_const(DSA_str_reasons);
   50|      2|# endif
   51|      2|    return 1;
   52|      2|}

DSA_get_method:
  129|      6|{
  130|      6|    return d->meth;
  131|      6|}
DSA_new:
  208|  43.8k|{
  209|  43.8k|    return dsa_new_intern(NULL, NULL);
  210|  43.8k|}
DSA_free:
  214|  80.6k|{
  215|  80.6k|    int i;
  216|       |
  217|  80.6k|    if (r == NULL)
  ------------------
  |  Branch (217:9): [True: 36.7k, False: 43.8k]
  ------------------
  218|  36.7k|        return;
  219|       |
  220|  43.8k|    CRYPTO_DOWN_REF(&r->references, &i);
  221|  43.8k|    REF_PRINT_COUNT("DSA", i, r);
  ------------------
  |  |  301|  43.8k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  43.8k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  43.8k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  43.8k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  222|  43.8k|    if (i > 0)
  ------------------
  |  Branch (222:9): [True: 5, False: 43.8k]
  ------------------
  223|      5|        return;
  224|  43.8k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|  43.8k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 43.8k]
  |  |  ------------------
  ------------------
  225|       |
  226|  43.8k|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (226:9): [True: 43.8k, False: 0]
  |  Branch (226:28): [True: 43.8k, False: 0]
  ------------------
  227|  43.8k|        r->meth->finish(r);
  228|  43.8k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
  229|  43.8k|    ENGINE_finish(r->engine);
  230|  43.8k|#endif
  231|       |
  232|  43.8k|#ifndef FIPS_MODULE
  233|  43.8k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data);
  ------------------
  |  |  236|  43.8k|# define CRYPTO_EX_INDEX_DSA              7
  ------------------
  234|  43.8k|#endif
  235|       |
  236|  43.8k|    CRYPTO_THREAD_lock_free(r->lock);
  237|  43.8k|    CRYPTO_FREE_REF(&r->references);
  238|       |
  239|  43.8k|    ossl_ffc_params_cleanup(&r->params);
  240|  43.8k|    BN_clear_free(r->pub_key);
  241|  43.8k|    BN_clear_free(r->priv_key);
  242|  43.8k|    OPENSSL_free(r);
  ------------------
  |  |  115|  43.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  43.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  43.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  243|  43.8k|}
DSA_up_ref:
  246|      5|{
  247|      5|    int i;
  248|       |
  249|      5|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (249:9): [True: 0, False: 5]
  ------------------
  250|      0|        return 0;
  251|       |
  252|      5|    REF_PRINT_COUNT("DSA", i, r);
  ------------------
  |  |  301|      5|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|      5|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|      5|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|      5|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|      5|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|      5|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 5]
  |  |  ------------------
  ------------------
  254|      5|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (254:13): [True: 5, False: 0]
  ------------------
  255|      5|}
ossl_dsa_set0_libctx:
  258|    519|{
  259|    519|    d->libctx = libctx;
  260|    519|}
DSA_get0_pqg:
  264|      5|{
  265|      5|    ossl_ffc_params_get0_pqg(&d->params, p, q, g);
  266|      5|}
DSA_get0_p:
  285|    965|{
  286|    965|    return d->params.p;
  287|    965|}
DSA_get0_g:
  295|    448|{
  296|    448|    return d->params.g;
  297|    448|}
DSA_get0_pub_key:
  300|    517|{
  301|    517|    return d->pub_key;
  302|    517|}
DSA_get0_priv_key:
  305|  1.03k|{
  306|  1.03k|    return d->priv_key;
  307|  1.03k|}
DSA_get0_key:
  311|    519|{
  312|    519|    if (pub_key != NULL)
  ------------------
  |  Branch (312:9): [True: 519, False: 0]
  ------------------
  313|    519|        *pub_key = d->pub_key;
  314|    519|    if (priv_key != NULL)
  ------------------
  |  Branch (314:9): [True: 519, False: 0]
  ------------------
  315|    519|        *priv_key = d->priv_key;
  316|    519|}
DSA_set0_key:
  319|    444|{
  320|    444|    if (pub_key != NULL) {
  ------------------
  |  Branch (320:9): [True: 444, False: 0]
  ------------------
  321|    444|        BN_free(d->pub_key);
  322|    444|        d->pub_key = pub_key;
  323|    444|    }
  324|    444|    if (priv_key != NULL) {
  ------------------
  |  Branch (324:9): [True: 444, False: 0]
  ------------------
  325|    444|        BN_free(d->priv_key);
  326|    444|        d->priv_key = priv_key;
  327|    444|    }
  328|    444|    d->dirty_cnt++;
  329|       |
  330|    444|    return 1;
  331|    444|}
DSA_security_bits:
  334|    519|{
  335|    519|    if (d->params.p != NULL && d->params.q != NULL)
  ------------------
  |  Branch (335:9): [True: 519, False: 0]
  |  Branch (335:32): [True: 519, False: 0]
  ------------------
  336|    519|        return BN_security_bits(BN_num_bits(d->params.p),
  337|    519|                                BN_num_bits(d->params.q));
  338|      0|    return -1;
  339|    519|}
DSA_bits:
  342|    520|{
  343|    520|    if (dsa->params.p != NULL)
  ------------------
  |  Branch (343:9): [True: 520, False: 0]
  ------------------
  344|    520|        return BN_num_bits(dsa->params.p);
  345|      0|    return -1;
  346|    520|}
ossl_dsa_get0_params:
  349|  1.03k|{
  350|  1.03k|    return &dsa->params;
  351|  1.03k|}
dsa_lib.c:dsa_new_intern:
  134|  43.8k|{
  135|  43.8k|    DSA *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  43.8k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  43.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  43.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  136|       |
  137|  43.8k|    if (ret == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 43.8k]
  ------------------
  138|      0|        return NULL;
  139|       |
  140|  43.8k|    ret->lock = CRYPTO_THREAD_lock_new();
  141|  43.8k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (141:9): [True: 0, False: 43.8k]
  ------------------
  142|      0|        ERR_raise(ERR_LIB_DSA, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  143|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  144|      0|        return NULL;
  145|      0|    }
  146|       |
  147|  43.8k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 43.8k]
  ------------------
  148|      0|        CRYPTO_THREAD_lock_free(ret->lock);
  149|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  150|      0|        return NULL;
  151|      0|    }
  152|       |
  153|  43.8k|    ret->libctx = libctx;
  154|  43.8k|    ret->meth = DSA_get_default_method();
  155|  43.8k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
  156|  43.8k|    ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW; /* early default init */
  ------------------
  |  |   99|  43.8k|#   define DSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
  157|  43.8k|    if (engine) {
  ------------------
  |  Branch (157:9): [True: 0, False: 43.8k]
  ------------------
  158|      0|        if (!ENGINE_init(engine)) {
  ------------------
  |  Branch (158:13): [True: 0, False: 0]
  ------------------
  159|      0|            ERR_raise(ERR_LIB_DSA, ERR_R_ENGINE_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  160|      0|            goto err;
  161|      0|        }
  162|      0|        ret->engine = engine;
  163|      0|    } else
  164|  43.8k|        ret->engine = ENGINE_get_default_DSA();
  165|  43.8k|    if (ret->engine) {
  ------------------
  |  Branch (165:9): [True: 0, False: 43.8k]
  ------------------
  166|      0|        ret->meth = ENGINE_get_DSA(ret->engine);
  167|      0|        if (ret->meth == NULL) {
  ------------------
  |  Branch (167:13): [True: 0, False: 0]
  ------------------
  168|      0|            ERR_raise(ERR_LIB_DSA, ERR_R_ENGINE_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  169|      0|            goto err;
  170|      0|        }
  171|      0|    }
  172|  43.8k|#endif
  173|       |
  174|  43.8k|    ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW;
  ------------------
  |  |   99|  43.8k|#   define DSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
  175|       |
  176|  43.8k|#ifndef FIPS_MODULE
  177|  43.8k|    if (!ossl_crypto_new_ex_data_ex(libctx, CRYPTO_EX_INDEX_DSA, ret,
  ------------------
  |  |  236|  43.8k|# define CRYPTO_EX_INDEX_DSA              7
  ------------------
  |  Branch (177:9): [True: 0, False: 43.8k]
  ------------------
  178|  43.8k|                                    &ret->ex_data))
  179|      0|        goto err;
  180|  43.8k|#endif
  181|       |
  182|  43.8k|    ossl_ffc_params_init(&ret->params);
  183|       |
  184|  43.8k|    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
  ------------------
  |  Branch (184:9): [True: 43.8k, False: 0]
  |  Branch (184:38): [True: 0, False: 43.8k]
  ------------------
  185|      0|        ERR_raise(ERR_LIB_DSA, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  186|      0|        goto err;
  187|      0|    }
  188|       |
  189|  43.8k|    return ret;
  190|       |
  191|      0| err:
  192|      0|    DSA_free(ret);
  193|      0|    return NULL;
  194|  43.8k|}

DSA_get_default_method:
   67|  43.8k|{
   68|  43.8k|    return default_DSA_method;
   69|  43.8k|}
DSA_OpenSSL:
   72|      6|{
   73|      6|    return &openssl_dsa_meth;
   74|      6|}
dsa_ossl.c:dsa_init:
  464|  43.8k|{
  465|  43.8k|    dsa->flags |= DSA_FLAG_CACHE_MONT_P;
  ------------------
  |  |   82|  43.8k|#   define DSA_FLAG_CACHE_MONT_P   0x01
  ------------------
  466|  43.8k|    dsa->dirty_cnt++;
  467|  43.8k|    return 1;
  468|  43.8k|}
dsa_ossl.c:dsa_finish:
  471|  43.8k|{
  472|  43.8k|    BN_MONT_CTX_free(dsa->method_mont_p);
  473|  43.8k|    return 1;
  474|  43.8k|}

DSA_SIG_new:
   35|  12.7k|{
   36|  12.7k|    DSA_SIG *sig = OPENSSL_zalloc(sizeof(*sig));
  ------------------
  |  |  104|  12.7k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  12.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  12.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   37|       |
   38|  12.7k|    return sig;
   39|  12.7k|}
DSA_SIG_free:
   42|  12.7k|{
   43|  12.7k|    if (sig == NULL)
  ------------------
  |  Branch (43:9): [True: 0, False: 12.7k]
  ------------------
   44|      0|        return;
   45|  12.7k|    BN_clear_free(sig->r);
   46|  12.7k|    BN_clear_free(sig->s);
   47|  12.7k|    OPENSSL_free(sig);
  ------------------
  |  |  115|  12.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  12.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  12.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|  12.7k|}
d2i_DSA_SIG:
   51|  12.7k|{
   52|  12.7k|    DSA_SIG *sig;
   53|       |
   54|  12.7k|    if (len < 0)
  ------------------
  |  Branch (54:9): [True: 0, False: 12.7k]
  ------------------
   55|      0|        return NULL;
   56|  12.7k|    if (psig != NULL && *psig != NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 12.7k]
  |  Branch (56:25): [True: 0, False: 0]
  ------------------
   57|      0|        sig = *psig;
   58|  12.7k|    } else {
   59|  12.7k|        sig = DSA_SIG_new();
   60|  12.7k|        if (sig == NULL)
  ------------------
  |  Branch (60:13): [True: 0, False: 12.7k]
  ------------------
   61|      0|            return NULL;
   62|  12.7k|    }
   63|  12.7k|    if (sig->r == NULL)
  ------------------
  |  Branch (63:9): [True: 12.7k, False: 0]
  ------------------
   64|  12.7k|        sig->r = BN_new();
   65|  12.7k|    if (sig->s == NULL)
  ------------------
  |  Branch (65:9): [True: 12.7k, False: 0]
  ------------------
   66|  12.7k|        sig->s = BN_new();
   67|  12.7k|    if (sig->r == NULL || sig->s == NULL
  ------------------
  |  Branch (67:9): [True: 0, False: 12.7k]
  |  Branch (67:27): [True: 0, False: 12.7k]
  ------------------
   68|  12.7k|        || ossl_decode_der_dsa_sig(sig->r, sig->s, ppin, (size_t)len) == 0) {
  ------------------
  |  Branch (68:12): [True: 12.7k, False: 35]
  ------------------
   69|  12.7k|        if (psig == NULL || *psig == NULL)
  ------------------
  |  Branch (69:13): [True: 12.7k, False: 0]
  |  Branch (69:29): [True: 0, False: 0]
  ------------------
   70|  12.7k|            DSA_SIG_free(sig);
   71|  12.7k|        return NULL;
   72|  12.7k|    }
   73|     35|    if (psig != NULL && *psig == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 35]
  |  Branch (73:25): [True: 0, False: 0]
  ------------------
   74|      0|        *psig = sig;
   75|     35|    return sig;
   76|  12.7k|}
i2d_DSA_SIG:
   79|    554|{
   80|    554|    BUF_MEM *buf = NULL;
   81|    554|    size_t encoded_len;
   82|    554|    WPACKET pkt;
   83|       |
   84|    554|    if (ppout == NULL) {
  ------------------
  |  Branch (84:9): [True: 519, False: 35]
  ------------------
   85|    519|        if (!WPACKET_init_null(&pkt, 0))
  ------------------
  |  Branch (85:13): [True: 0, False: 519]
  ------------------
   86|      0|            return -1;
   87|    519|    } else if (*ppout == NULL) {
  ------------------
  |  Branch (87:16): [True: 35, False: 0]
  ------------------
   88|     35|        if ((buf = BUF_MEM_new()) == NULL
  ------------------
  |  Branch (88:13): [True: 0, False: 35]
  ------------------
   89|     35|                || !WPACKET_init_len(&pkt, buf, 0)) {
  ------------------
  |  Branch (89:20): [True: 0, False: 35]
  ------------------
   90|      0|            BUF_MEM_free(buf);
   91|      0|            return -1;
   92|      0|        }
   93|     35|    } else {
   94|      0|        if (!WPACKET_init_static_len(&pkt, *ppout, SIZE_MAX, 0))
  ------------------
  |  Branch (94:13): [True: 0, False: 0]
  ------------------
   95|      0|            return -1;
   96|      0|    }
   97|       |
   98|    554|    if (!ossl_encode_der_dsa_sig(&pkt, sig->r, sig->s)
  ------------------
  |  Branch (98:9): [True: 5, False: 549]
  ------------------
   99|    554|            || !WPACKET_get_total_written(&pkt, &encoded_len)
  ------------------
  |  Branch (99:16): [True: 0, False: 549]
  ------------------
  100|    554|            || !WPACKET_finish(&pkt)) {
  ------------------
  |  Branch (100:16): [True: 0, False: 549]
  ------------------
  101|      5|        BUF_MEM_free(buf);
  102|      5|        WPACKET_cleanup(&pkt);
  103|      5|        return -1;
  104|      5|    }
  105|       |
  106|    549|    if (ppout != NULL) {
  ------------------
  |  Branch (106:9): [True: 35, False: 514]
  ------------------
  107|     35|        if (*ppout == NULL) {
  ------------------
  |  Branch (107:13): [True: 35, False: 0]
  ------------------
  108|     35|            *ppout = (unsigned char *)buf->data;
  109|     35|            buf->data = NULL;
  110|     35|            BUF_MEM_free(buf);
  111|     35|        } else {
  112|      0|            *ppout += encoded_len;
  113|      0|        }
  114|     35|    }
  115|       |
  116|    549|    return (int)encoded_len;
  117|    554|}
DSA_size:
  120|    519|{
  121|    519|    int ret = -1;
  122|    519|    DSA_SIG sig;
  123|       |
  124|    519|    if (dsa->params.q != NULL) {
  ------------------
  |  Branch (124:9): [True: 519, False: 0]
  ------------------
  125|    519|        sig.r = sig.s = dsa->params.q;
  126|    519|        ret = i2d_DSA_SIG(&sig, NULL);
  127|       |
  128|    519|        if (ret < 0)
  ------------------
  |  Branch (128:13): [True: 5, False: 514]
  ------------------
  129|      5|            ret = 0;
  130|    519|    }
  131|    519|    return ret;
  132|    519|}

ossl_err_load_DSO_strings:
   50|      2|{
   51|      2|#ifndef OPENSSL_NO_ERR
   52|      2|    if (ERR_reason_error_string(DSO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (52:9): [True: 2, False: 0]
  ------------------
   53|      2|        ERR_load_strings_const(DSO_str_reasons);
   54|      2|#endif
   55|      2|    return 1;
   56|      2|}

DSO_free:
   48|      1|{
   49|      1|    int i;
   50|       |
   51|      1|    if (dso == NULL)
  ------------------
  |  Branch (51:9): [True: 1, False: 0]
  ------------------
   52|      1|        return 1;
   53|       |
   54|      0|    if (CRYPTO_DOWN_REF(&dso->references, &i) <= 0)
  ------------------
  |  Branch (54:9): [True: 0, False: 0]
  ------------------
   55|      0|        return 0;
   56|       |
   57|      0|    REF_PRINT_COUNT("DSO", i, dso);
  ------------------
  |  |  301|      0|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|      0|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   58|      0|    if (i > 0)
  ------------------
  |  Branch (58:9): [True: 0, False: 0]
  ------------------
   59|      0|        return 1;
   60|      0|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|      0|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   61|       |
   62|      0|    if ((dso->flags & DSO_FLAG_NO_UNLOAD_ON_FREE) == 0) {
  ------------------
  |  |   46|      0|# define DSO_FLAG_NO_UNLOAD_ON_FREE              0x04
  ------------------
  |  Branch (62:9): [True: 0, False: 0]
  ------------------
   63|      0|        if ((dso->meth->dso_unload != NULL) && !dso->meth->dso_unload(dso)) {
  ------------------
  |  Branch (63:13): [True: 0, False: 0]
  |  Branch (63:48): [True: 0, False: 0]
  ------------------
   64|      0|            ERR_raise(ERR_LIB_DSO, DSO_R_UNLOAD_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   65|      0|            return 0;
   66|      0|        }
   67|      0|    }
   68|       |
   69|      0|    if ((dso->meth->finish != NULL) && !dso->meth->finish(dso)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 0]
  |  Branch (69:40): [True: 0, False: 0]
  ------------------
   70|      0|        ERR_raise(ERR_LIB_DSO, DSO_R_FINISH_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   71|      0|        return 0;
   72|      0|    }
   73|       |
   74|      0|    sk_void_free(dso->meth_data);
  ------------------
  |  |  204|      0|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
   75|      0|    OPENSSL_free(dso->filename);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|      0|    OPENSSL_free(dso->loaded_filename);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|      0|    CRYPTO_FREE_REF(&dso->references);
   78|      0|    OPENSSL_free(dso);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|      0|    return 1;
   80|      0|}

ossl_ed25519_public_from_private:
 5668|      4|{
 5669|      4|    uint8_t az[SHA512_DIGEST_LENGTH];
 5670|      4|    ge_p3 A;
 5671|      4|    int r;
 5672|      4|    EVP_MD *sha512 = NULL;
 5673|       |
 5674|      4|    sha512 = EVP_MD_fetch(ctx, SN_sha512, propq);
  ------------------
  |  | 3272|      4|#define SN_sha512               "SHA512"
  ------------------
 5675|      4|    if (sha512 == NULL)
  ------------------
  |  Branch (5675:9): [True: 0, False: 4]
  ------------------
 5676|      0|        return 0;
 5677|      4|    r = EVP_Digest(private_key, 32, az, NULL, sha512, NULL);
 5678|      4|    EVP_MD_free(sha512);
 5679|      4|    if (!r) {
  ------------------
  |  Branch (5679:9): [True: 0, False: 4]
  ------------------
 5680|      0|        OPENSSL_cleanse(az, sizeof(az));
 5681|      0|        return 0;
 5682|      0|    }
 5683|       |
 5684|      4|    az[0] &= 248;
 5685|      4|    az[31] &= 63;
 5686|      4|    az[31] |= 64;
 5687|       |
 5688|      4|    ge_scalarmult_base(&A, az);
 5689|      4|    ge_p3_tobytes(out_public_key, &A);
 5690|       |
 5691|      4|    OPENSSL_cleanse(az, sizeof(az));
 5692|      4|    return 1;
 5693|      4|}
ossl_x25519_public_from_private:
 5708|      2|{
 5709|      2|    uint8_t e[32];
 5710|      2|    ge_p3 A;
 5711|      2|    fe zplusy, zminusy, zminusy_inv;
 5712|       |
 5713|      2|    memcpy(e, private_key, 32);
 5714|      2|    e[0] &= 248;
 5715|      2|    e[31] &= 127;
 5716|      2|    e[31] |= 64;
 5717|       |
 5718|      2|    ge_scalarmult_base(&A, e);
 5719|       |
 5720|       |    /*
 5721|       |     * We only need the u-coordinate of the curve25519 point.
 5722|       |     * The map is u=(y+1)/(1-y). Since y=Y/Z, this gives
 5723|       |     * u=(Z+Y)/(Z-Y).
 5724|       |     */
 5725|      2|    fe_add(zplusy, A.Z, A.Y);
 5726|      2|    fe_sub(zminusy, A.Z, A.Y);
 5727|      2|    fe_invert(zminusy_inv, zminusy);
 5728|      2|    fe_mul(zplusy, zplusy, zminusy_inv);
 5729|      2|    fe_tobytes(out_public_value, zplusy);
 5730|       |
 5731|      2|    OPENSSL_cleanse(e, sizeof(e));
 5732|      2|}
curve25519.c:ge_scalarmult_base:
 4234|      6|{
 4235|      6|    signed char e[64];
 4236|      6|    signed char carry;
 4237|      6|    ge_p1p1 r;
 4238|      6|    ge_p2 s;
 4239|      6|    ge_precomp t;
 4240|      6|    int i;
 4241|       |
 4242|    198|    for (i = 0; i < 32; ++i) {
  ------------------
  |  Branch (4242:17): [True: 192, False: 6]
  ------------------
 4243|    192|        e[2 * i + 0] = (a[i] >> 0) & 15;
 4244|    192|        e[2 * i + 1] = (a[i] >> 4) & 15;
 4245|    192|    }
 4246|       |    /* each e[i] is between 0 and 15 */
 4247|       |    /* e[63] is between 0 and 7 */
 4248|       |
 4249|      6|    carry = 0;
 4250|    384|    for (i = 0; i < 63; ++i) {
  ------------------
  |  Branch (4250:17): [True: 378, False: 6]
  ------------------
 4251|    378|        e[i] += carry;
 4252|    378|        carry = e[i] + 8;
 4253|    378|        carry >>= 4;
 4254|    378|        e[i] -= carry << 4;
 4255|    378|    }
 4256|      6|    e[63] += carry;
 4257|       |    /* each e[i] is between -8 and 8 */
 4258|       |
 4259|      6|    ge_p3_0(h);
 4260|    198|    for (i = 1; i < 64; i += 2) {
  ------------------
  |  Branch (4260:17): [True: 192, False: 6]
  ------------------
 4261|    192|        table_select(&t, i / 2, e[i]);
 4262|    192|        ge_madd(&r, h, &t);
 4263|    192|        ge_p1p1_to_p3(h, &r);
 4264|    192|    }
 4265|       |
 4266|      6|    ge_p3_dbl(&r, h);
 4267|      6|    ge_p1p1_to_p2(&s, &r);
 4268|      6|    ge_p2_dbl(&r, &s);
 4269|      6|    ge_p1p1_to_p2(&s, &r);
 4270|      6|    ge_p2_dbl(&r, &s);
 4271|      6|    ge_p1p1_to_p2(&s, &r);
 4272|      6|    ge_p2_dbl(&r, &s);
 4273|      6|    ge_p1p1_to_p3(h, &r);
 4274|       |
 4275|    198|    for (i = 0; i < 64; i += 2) {
  ------------------
  |  Branch (4275:17): [True: 192, False: 6]
  ------------------
 4276|    192|        table_select(&t, i / 2, e[i]);
 4277|    192|        ge_madd(&r, h, &t);
 4278|    192|        ge_p1p1_to_p3(h, &r);
 4279|    192|    }
 4280|       |
 4281|      6|    OPENSSL_cleanse(e, sizeof(e));
 4282|      6|}
curve25519.c:ge_p3_0:
 1914|      6|{
 1915|      6|    fe_0(h->X);
 1916|      6|    fe_1(h->Y);
 1917|      6|    fe_1(h->Z);
 1918|      6|    fe_0(h->T);
 1919|      6|}
curve25519.c:fe_0:
  962|    396|{
  963|    396|    memset(h, 0, sizeof(int32_t) * 10);
  964|    396|}
curve25519.c:fe_1:
  968|    780|{
  969|    780|    memset(h, 0, sizeof(int32_t) * 10);
  970|    780|    h[0] = 1;
  971|    780|}
curve25519.c:table_select:
 4204|    384|{
 4205|    384|    ge_precomp minust;
 4206|    384|    uint8_t bnegative = negative(b);
 4207|    384|    uint8_t babs = b - ((uint8_t)((-bnegative) & b) << 1);
 4208|       |
 4209|    384|    ge_precomp_0(t);
 4210|    384|    cmov(t, &k25519Precomp[pos][0], equal(babs, 1));
 4211|    384|    cmov(t, &k25519Precomp[pos][1], equal(babs, 2));
 4212|    384|    cmov(t, &k25519Precomp[pos][2], equal(babs, 3));
 4213|    384|    cmov(t, &k25519Precomp[pos][3], equal(babs, 4));
 4214|    384|    cmov(t, &k25519Precomp[pos][4], equal(babs, 5));
 4215|    384|    cmov(t, &k25519Precomp[pos][5], equal(babs, 6));
 4216|    384|    cmov(t, &k25519Precomp[pos][6], equal(babs, 7));
 4217|    384|    cmov(t, &k25519Precomp[pos][7], equal(babs, 8));
 4218|    384|    fe_copy(minust.yplusx, t->yminusx);
 4219|    384|    fe_copy(minust.yminusx, t->yplusx);
 4220|    384|    fe_neg(minust.xy2d, t->xy2d);
 4221|    384|    cmov(t, &minust, bnegative);
 4222|    384|}
curve25519.c:negative:
 4196|    384|{
 4197|    384|    uint32_t x = b;
 4198|       |
 4199|    384|    x >>= 31; /* 1: yes; 0: no */
 4200|    384|    return x;
 4201|    384|}
curve25519.c:ge_precomp_0:
 1922|    384|{
 1923|    384|    fe_1(h->yplusx);
 1924|    384|    fe_1(h->yminusx);
 1925|    384|    fe_0(h->xy2d);
 1926|    384|}
curve25519.c:cmov:
 2073|  3.45k|{
 2074|  3.45k|    fe_cmov(t->yplusx, u->yplusx, b);
 2075|  3.45k|    fe_cmov(t->yminusx, u->yminusx, b);
 2076|  3.45k|    fe_cmov(t->xy2d, u->xy2d, b);
 2077|  3.45k|}
curve25519.c:fe_cmov:
 1528|  10.3k|{
 1529|  10.3k|    size_t i;
 1530|       |
 1531|  10.3k|    b = 0-b;
 1532|   114k|    for (i = 0; i < 10; i++) {
  ------------------
  |  Branch (1532:17): [True: 103k, False: 10.3k]
  ------------------
 1533|   103k|        int32_t x = f[i] ^ g[i];
 1534|   103k|        x &= b;
 1535|   103k|        f[i] ^= x;
 1536|   103k|    }
 1537|  10.3k|}
curve25519.c:equal:
 2062|  3.07k|{
 2063|  3.07k|    uint8_t ub = b;
 2064|  3.07k|    uint8_t uc = c;
 2065|  3.07k|    uint8_t x = ub ^ uc; /* 0: yes; 1..255: no */
 2066|  3.07k|    uint32_t y = x;      /* 0: yes; 1..255: no */
 2067|  3.07k|    y -= 1;              /* 4294967295: yes; 0..254: no */
 2068|  3.07k|    y >>= 31;            /* 1: yes; 0: no */
 2069|  3.07k|    return y;
 2070|  3.07k|}
curve25519.c:fe_copy:
  956|    786|{
  957|    786|    memmove(h, f, sizeof(int32_t) * 10);
  958|    786|}
curve25519.c:ge_madd:
 1993|    384|{
 1994|    384|    fe t0;
 1995|       |
 1996|    384|    fe_add(r->X, p->Y, p->X);
 1997|    384|    fe_sub(r->Y, p->Y, p->X);
 1998|    384|    fe_mul(r->Z, r->X, q->yplusx);
 1999|    384|    fe_mul(r->Y, r->Y, q->yminusx);
 2000|    384|    fe_mul(r->T, q->xy2d, p->T);
 2001|    384|    fe_add(t0, p->Z, p->Z);
 2002|    384|    fe_sub(r->X, r->Z, r->Y);
 2003|    384|    fe_add(r->Y, r->Z, r->Y);
 2004|    384|    fe_add(r->Z, t0, r->T);
 2005|    384|    fe_sub(r->T, t0, r->T);
 2006|    384|}
curve25519.c:ge_p1p1_to_p3:
 1960|    390|{
 1961|    390|    fe_mul(r->X, p->X, p->T);
 1962|    390|    fe_mul(r->Y, p->Y, p->Z);
 1963|    390|    fe_mul(r->Z, p->Z, p->T);
 1964|    390|    fe_mul(r->T, p->X, p->Y);
 1965|    390|}
curve25519.c:ge_p3_dbl:
 1985|      6|{
 1986|      6|    ge_p2 q;
 1987|      6|    ge_p3_to_p2(&q, p);
 1988|      6|    ge_p2_dbl(r, &q);
 1989|      6|}
curve25519.c:ge_p3_to_p2:
 1930|      6|{
 1931|      6|    fe_copy(r->X, p->X);
 1932|      6|    fe_copy(r->Y, p->Y);
 1933|      6|    fe_copy(r->Z, p->Z);
 1934|      6|}
curve25519.c:ge_p1p1_to_p2:
 1952|     18|{
 1953|     18|    fe_mul(r->X, p->X, p->T);
 1954|     18|    fe_mul(r->Y, p->Y, p->Z);
 1955|     18|    fe_mul(r->Z, p->Z, p->T);
 1956|     18|}
curve25519.c:ge_p2_dbl:
 1969|     24|{
 1970|     24|    fe t0;
 1971|       |
 1972|     24|    fe_sq(r->X, p->X);
 1973|     24|    fe_sq(r->Z, p->Y);
 1974|     24|    fe_sq2(r->T, p->Z);
 1975|     24|    fe_add(r->Y, p->X, p->Y);
 1976|     24|    fe_sq(t0, r->Y);
 1977|     24|    fe_add(r->Y, r->Z, r->X);
 1978|     24|    fe_sub(r->Z, r->Z, r->X);
 1979|     24|    fe_sub(r->X, t0, r->Y);
 1980|     24|    fe_sub(r->T, r->T, r->Z);
 1981|     24|}
curve25519.c:fe_sq:
 1276|  1.59k|{
 1277|  1.59k|    int32_t f0 = f[0];
 1278|  1.59k|    int32_t f1 = f[1];
 1279|  1.59k|    int32_t f2 = f[2];
 1280|  1.59k|    int32_t f3 = f[3];
 1281|  1.59k|    int32_t f4 = f[4];
 1282|  1.59k|    int32_t f5 = f[5];
 1283|  1.59k|    int32_t f6 = f[6];
 1284|  1.59k|    int32_t f7 = f[7];
 1285|  1.59k|    int32_t f8 = f[8];
 1286|  1.59k|    int32_t f9 = f[9];
 1287|  1.59k|    int32_t f0_2 = 2 * f0;
 1288|  1.59k|    int32_t f1_2 = 2 * f1;
 1289|  1.59k|    int32_t f2_2 = 2 * f2;
 1290|  1.59k|    int32_t f3_2 = 2 * f3;
 1291|  1.59k|    int32_t f4_2 = 2 * f4;
 1292|  1.59k|    int32_t f5_2 = 2 * f5;
 1293|  1.59k|    int32_t f6_2 = 2 * f6;
 1294|  1.59k|    int32_t f7_2 = 2 * f7;
 1295|  1.59k|    int32_t f5_38 = 38 * f5; /* 1.959375*2^30 */
 1296|  1.59k|    int32_t f6_19 = 19 * f6; /* 1.959375*2^30 */
 1297|  1.59k|    int32_t f7_38 = 38 * f7; /* 1.959375*2^30 */
 1298|  1.59k|    int32_t f8_19 = 19 * f8; /* 1.959375*2^30 */
 1299|  1.59k|    int32_t f9_38 = 38 * f9; /* 1.959375*2^30 */
 1300|  1.59k|    int64_t f0f0    = f0   * (int64_t) f0;
 1301|  1.59k|    int64_t f0f1_2  = f0_2 * (int64_t) f1;
 1302|  1.59k|    int64_t f0f2_2  = f0_2 * (int64_t) f2;
 1303|  1.59k|    int64_t f0f3_2  = f0_2 * (int64_t) f3;
 1304|  1.59k|    int64_t f0f4_2  = f0_2 * (int64_t) f4;
 1305|  1.59k|    int64_t f0f5_2  = f0_2 * (int64_t) f5;
 1306|  1.59k|    int64_t f0f6_2  = f0_2 * (int64_t) f6;
 1307|  1.59k|    int64_t f0f7_2  = f0_2 * (int64_t) f7;
 1308|  1.59k|    int64_t f0f8_2  = f0_2 * (int64_t) f8;
 1309|  1.59k|    int64_t f0f9_2  = f0_2 * (int64_t) f9;
 1310|  1.59k|    int64_t f1f1_2  = f1_2 * (int64_t) f1;
 1311|  1.59k|    int64_t f1f2_2  = f1_2 * (int64_t) f2;
 1312|  1.59k|    int64_t f1f3_4  = f1_2 * (int64_t) f3_2;
 1313|  1.59k|    int64_t f1f4_2  = f1_2 * (int64_t) f4;
 1314|  1.59k|    int64_t f1f5_4  = f1_2 * (int64_t) f5_2;
 1315|  1.59k|    int64_t f1f6_2  = f1_2 * (int64_t) f6;
 1316|  1.59k|    int64_t f1f7_4  = f1_2 * (int64_t) f7_2;
 1317|  1.59k|    int64_t f1f8_2  = f1_2 * (int64_t) f8;
 1318|  1.59k|    int64_t f1f9_76 = f1_2 * (int64_t) f9_38;
 1319|  1.59k|    int64_t f2f2    = f2   * (int64_t) f2;
 1320|  1.59k|    int64_t f2f3_2  = f2_2 * (int64_t) f3;
 1321|  1.59k|    int64_t f2f4_2  = f2_2 * (int64_t) f4;
 1322|  1.59k|    int64_t f2f5_2  = f2_2 * (int64_t) f5;
 1323|  1.59k|    int64_t f2f6_2  = f2_2 * (int64_t) f6;
 1324|  1.59k|    int64_t f2f7_2  = f2_2 * (int64_t) f7;
 1325|  1.59k|    int64_t f2f8_38 = f2_2 * (int64_t) f8_19;
 1326|  1.59k|    int64_t f2f9_38 = f2   * (int64_t) f9_38;
 1327|  1.59k|    int64_t f3f3_2  = f3_2 * (int64_t) f3;
 1328|  1.59k|    int64_t f3f4_2  = f3_2 * (int64_t) f4;
 1329|  1.59k|    int64_t f3f5_4  = f3_2 * (int64_t) f5_2;
 1330|  1.59k|    int64_t f3f6_2  = f3_2 * (int64_t) f6;
 1331|  1.59k|    int64_t f3f7_76 = f3_2 * (int64_t) f7_38;
 1332|  1.59k|    int64_t f3f8_38 = f3_2 * (int64_t) f8_19;
 1333|  1.59k|    int64_t f3f9_76 = f3_2 * (int64_t) f9_38;
 1334|  1.59k|    int64_t f4f4    = f4   * (int64_t) f4;
 1335|  1.59k|    int64_t f4f5_2  = f4_2 * (int64_t) f5;
 1336|  1.59k|    int64_t f4f6_38 = f4_2 * (int64_t) f6_19;
 1337|  1.59k|    int64_t f4f7_38 = f4   * (int64_t) f7_38;
 1338|  1.59k|    int64_t f4f8_38 = f4_2 * (int64_t) f8_19;
 1339|  1.59k|    int64_t f4f9_38 = f4   * (int64_t) f9_38;
 1340|  1.59k|    int64_t f5f5_38 = f5   * (int64_t) f5_38;
 1341|  1.59k|    int64_t f5f6_38 = f5_2 * (int64_t) f6_19;
 1342|  1.59k|    int64_t f5f7_76 = f5_2 * (int64_t) f7_38;
 1343|  1.59k|    int64_t f5f8_38 = f5_2 * (int64_t) f8_19;
 1344|  1.59k|    int64_t f5f9_76 = f5_2 * (int64_t) f9_38;
 1345|  1.59k|    int64_t f6f6_19 = f6   * (int64_t) f6_19;
 1346|  1.59k|    int64_t f6f7_38 = f6   * (int64_t) f7_38;
 1347|  1.59k|    int64_t f6f8_38 = f6_2 * (int64_t) f8_19;
 1348|  1.59k|    int64_t f6f9_38 = f6   * (int64_t) f9_38;
 1349|  1.59k|    int64_t f7f7_38 = f7   * (int64_t) f7_38;
 1350|  1.59k|    int64_t f7f8_38 = f7_2 * (int64_t) f8_19;
 1351|  1.59k|    int64_t f7f9_76 = f7_2 * (int64_t) f9_38;
 1352|  1.59k|    int64_t f8f8_19 = f8   * (int64_t) f8_19;
 1353|  1.59k|    int64_t f8f9_38 = f8   * (int64_t) f9_38;
 1354|  1.59k|    int64_t f9f9_38 = f9   * (int64_t) f9_38;
 1355|  1.59k|    int64_t h0 = f0f0   + f1f9_76 + f2f8_38 + f3f7_76 + f4f6_38 + f5f5_38;
 1356|  1.59k|    int64_t h1 = f0f1_2 + f2f9_38 + f3f8_38 + f4f7_38 + f5f6_38;
 1357|  1.59k|    int64_t h2 = f0f2_2 + f1f1_2  + f3f9_76 + f4f8_38 + f5f7_76 + f6f6_19;
 1358|  1.59k|    int64_t h3 = f0f3_2 + f1f2_2  + f4f9_38 + f5f8_38 + f6f7_38;
 1359|  1.59k|    int64_t h4 = f0f4_2 + f1f3_4  + f2f2    + f5f9_76 + f6f8_38 + f7f7_38;
 1360|  1.59k|    int64_t h5 = f0f5_2 + f1f4_2  + f2f3_2  + f6f9_38 + f7f8_38;
 1361|  1.59k|    int64_t h6 = f0f6_2 + f1f5_4  + f2f4_2  + f3f3_2  + f7f9_76 + f8f8_19;
 1362|  1.59k|    int64_t h7 = f0f7_2 + f1f6_2  + f2f5_2  + f3f4_2  + f8f9_38;
 1363|  1.59k|    int64_t h8 = f0f8_2 + f1f7_4  + f2f6_2  + f3f5_4  + f4f4    + f9f9_38;
 1364|  1.59k|    int64_t h9 = f0f9_2 + f1f8_2  + f2f7_2  + f3f6_2  + f4f5_2;
 1365|  1.59k|    int64_t carry0;
 1366|  1.59k|    int64_t carry1;
 1367|  1.59k|    int64_t carry2;
 1368|  1.59k|    int64_t carry3;
 1369|  1.59k|    int64_t carry4;
 1370|  1.59k|    int64_t carry5;
 1371|  1.59k|    int64_t carry6;
 1372|  1.59k|    int64_t carry7;
 1373|  1.59k|    int64_t carry8;
 1374|  1.59k|    int64_t carry9;
 1375|       |
 1376|  1.59k|    carry0 = h0 + (1 << 25); h1 += carry0 >> 26; h0 -= carry0 & kTop38Bits;
 1377|  1.59k|    carry4 = h4 + (1 << 25); h5 += carry4 >> 26; h4 -= carry4 & kTop38Bits;
 1378|       |
 1379|  1.59k|    carry1 = h1 + (1 << 24); h2 += carry1 >> 25; h1 -= carry1 & kTop39Bits;
 1380|  1.59k|    carry5 = h5 + (1 << 24); h6 += carry5 >> 25; h5 -= carry5 & kTop39Bits;
 1381|       |
 1382|  1.59k|    carry2 = h2 + (1 << 25); h3 += carry2 >> 26; h2 -= carry2 & kTop38Bits;
 1383|  1.59k|    carry6 = h6 + (1 << 25); h7 += carry6 >> 26; h6 -= carry6 & kTop38Bits;
 1384|       |
 1385|  1.59k|    carry3 = h3 + (1 << 24); h4 += carry3 >> 25; h3 -= carry3 & kTop39Bits;
 1386|  1.59k|    carry7 = h7 + (1 << 24); h8 += carry7 >> 25; h7 -= carry7 & kTop39Bits;
 1387|       |
 1388|  1.59k|    carry4 = h4 + (1 << 25); h5 += carry4 >> 26; h4 -= carry4 & kTop38Bits;
 1389|  1.59k|    carry8 = h8 + (1 << 25); h9 += carry8 >> 26; h8 -= carry8 & kTop38Bits;
 1390|       |
 1391|  1.59k|    carry9 = h9 + (1 << 24); h0 += (carry9 >> 25) * 19; h9 -= carry9 & kTop39Bits;
 1392|       |
 1393|  1.59k|    carry0 = h0 + (1 << 25); h1 += carry0 >> 26; h0 -= carry0 & kTop38Bits;
 1394|       |
 1395|  1.59k|    h[0] = (int32_t)h0;
 1396|  1.59k|    h[1] = (int32_t)h1;
 1397|  1.59k|    h[2] = (int32_t)h2;
 1398|  1.59k|    h[3] = (int32_t)h3;
 1399|  1.59k|    h[4] = (int32_t)h4;
 1400|  1.59k|    h[5] = (int32_t)h5;
 1401|  1.59k|    h[6] = (int32_t)h6;
 1402|  1.59k|    h[7] = (int32_t)h7;
 1403|  1.59k|    h[8] = (int32_t)h8;
 1404|  1.59k|    h[9] = (int32_t)h9;
 1405|  1.59k|}
curve25519.c:fe_sq2:
 1585|     24|{
 1586|     24|    int32_t f0 = f[0];
 1587|     24|    int32_t f1 = f[1];
 1588|     24|    int32_t f2 = f[2];
 1589|     24|    int32_t f3 = f[3];
 1590|     24|    int32_t f4 = f[4];
 1591|     24|    int32_t f5 = f[5];
 1592|     24|    int32_t f6 = f[6];
 1593|     24|    int32_t f7 = f[7];
 1594|     24|    int32_t f8 = f[8];
 1595|     24|    int32_t f9 = f[9];
 1596|     24|    int32_t f0_2 = 2 * f0;
 1597|     24|    int32_t f1_2 = 2 * f1;
 1598|     24|    int32_t f2_2 = 2 * f2;
 1599|     24|    int32_t f3_2 = 2 * f3;
 1600|     24|    int32_t f4_2 = 2 * f4;
 1601|     24|    int32_t f5_2 = 2 * f5;
 1602|     24|    int32_t f6_2 = 2 * f6;
 1603|     24|    int32_t f7_2 = 2 * f7;
 1604|     24|    int32_t f5_38 = 38 * f5; /* 1.959375*2^30 */
 1605|     24|    int32_t f6_19 = 19 * f6; /* 1.959375*2^30 */
 1606|     24|    int32_t f7_38 = 38 * f7; /* 1.959375*2^30 */
 1607|     24|    int32_t f8_19 = 19 * f8; /* 1.959375*2^30 */
 1608|     24|    int32_t f9_38 = 38 * f9; /* 1.959375*2^30 */
 1609|     24|    int64_t f0f0    = f0   * (int64_t) f0;
 1610|     24|    int64_t f0f1_2  = f0_2 * (int64_t) f1;
 1611|     24|    int64_t f0f2_2  = f0_2 * (int64_t) f2;
 1612|     24|    int64_t f0f3_2  = f0_2 * (int64_t) f3;
 1613|     24|    int64_t f0f4_2  = f0_2 * (int64_t) f4;
 1614|     24|    int64_t f0f5_2  = f0_2 * (int64_t) f5;
 1615|     24|    int64_t f0f6_2  = f0_2 * (int64_t) f6;
 1616|     24|    int64_t f0f7_2  = f0_2 * (int64_t) f7;
 1617|     24|    int64_t f0f8_2  = f0_2 * (int64_t) f8;
 1618|     24|    int64_t f0f9_2  = f0_2 * (int64_t) f9;
 1619|     24|    int64_t f1f1_2  = f1_2 * (int64_t) f1;
 1620|     24|    int64_t f1f2_2  = f1_2 * (int64_t) f2;
 1621|     24|    int64_t f1f3_4  = f1_2 * (int64_t) f3_2;
 1622|     24|    int64_t f1f4_2  = f1_2 * (int64_t) f4;
 1623|     24|    int64_t f1f5_4  = f1_2 * (int64_t) f5_2;
 1624|     24|    int64_t f1f6_2  = f1_2 * (int64_t) f6;
 1625|     24|    int64_t f1f7_4  = f1_2 * (int64_t) f7_2;
 1626|     24|    int64_t f1f8_2  = f1_2 * (int64_t) f8;
 1627|     24|    int64_t f1f9_76 = f1_2 * (int64_t) f9_38;
 1628|     24|    int64_t f2f2    = f2   * (int64_t) f2;
 1629|     24|    int64_t f2f3_2  = f2_2 * (int64_t) f3;
 1630|     24|    int64_t f2f4_2  = f2_2 * (int64_t) f4;
 1631|     24|    int64_t f2f5_2  = f2_2 * (int64_t) f5;
 1632|     24|    int64_t f2f6_2  = f2_2 * (int64_t) f6;
 1633|     24|    int64_t f2f7_2  = f2_2 * (int64_t) f7;
 1634|     24|    int64_t f2f8_38 = f2_2 * (int64_t) f8_19;
 1635|     24|    int64_t f2f9_38 = f2   * (int64_t) f9_38;
 1636|     24|    int64_t f3f3_2  = f3_2 * (int64_t) f3;
 1637|     24|    int64_t f3f4_2  = f3_2 * (int64_t) f4;
 1638|     24|    int64_t f3f5_4  = f3_2 * (int64_t) f5_2;
 1639|     24|    int64_t f3f6_2  = f3_2 * (int64_t) f6;
 1640|     24|    int64_t f3f7_76 = f3_2 * (int64_t) f7_38;
 1641|     24|    int64_t f3f8_38 = f3_2 * (int64_t) f8_19;
 1642|     24|    int64_t f3f9_76 = f3_2 * (int64_t) f9_38;
 1643|     24|    int64_t f4f4    = f4   * (int64_t) f4;
 1644|     24|    int64_t f4f5_2  = f4_2 * (int64_t) f5;
 1645|     24|    int64_t f4f6_38 = f4_2 * (int64_t) f6_19;
 1646|     24|    int64_t f4f7_38 = f4   * (int64_t) f7_38;
 1647|     24|    int64_t f4f8_38 = f4_2 * (int64_t) f8_19;
 1648|     24|    int64_t f4f9_38 = f4   * (int64_t) f9_38;
 1649|     24|    int64_t f5f5_38 = f5   * (int64_t) f5_38;
 1650|     24|    int64_t f5f6_38 = f5_2 * (int64_t) f6_19;
 1651|     24|    int64_t f5f7_76 = f5_2 * (int64_t) f7_38;
 1652|     24|    int64_t f5f8_38 = f5_2 * (int64_t) f8_19;
 1653|     24|    int64_t f5f9_76 = f5_2 * (int64_t) f9_38;
 1654|     24|    int64_t f6f6_19 = f6   * (int64_t) f6_19;
 1655|     24|    int64_t f6f7_38 = f6   * (int64_t) f7_38;
 1656|     24|    int64_t f6f8_38 = f6_2 * (int64_t) f8_19;
 1657|     24|    int64_t f6f9_38 = f6   * (int64_t) f9_38;
 1658|     24|    int64_t f7f7_38 = f7   * (int64_t) f7_38;
 1659|     24|    int64_t f7f8_38 = f7_2 * (int64_t) f8_19;
 1660|     24|    int64_t f7f9_76 = f7_2 * (int64_t) f9_38;
 1661|     24|    int64_t f8f8_19 = f8   * (int64_t) f8_19;
 1662|     24|    int64_t f8f9_38 = f8   * (int64_t) f9_38;
 1663|     24|    int64_t f9f9_38 = f9   * (int64_t) f9_38;
 1664|     24|    int64_t h0 = f0f0   + f1f9_76 + f2f8_38 + f3f7_76 + f4f6_38 + f5f5_38;
 1665|     24|    int64_t h1 = f0f1_2 + f2f9_38 + f3f8_38 + f4f7_38 + f5f6_38;
 1666|     24|    int64_t h2 = f0f2_2 + f1f1_2  + f3f9_76 + f4f8_38 + f5f7_76 + f6f6_19;
 1667|     24|    int64_t h3 = f0f3_2 + f1f2_2  + f4f9_38 + f5f8_38 + f6f7_38;
 1668|     24|    int64_t h4 = f0f4_2 + f1f3_4  + f2f2    + f5f9_76 + f6f8_38 + f7f7_38;
 1669|     24|    int64_t h5 = f0f5_2 + f1f4_2  + f2f3_2  + f6f9_38 + f7f8_38;
 1670|     24|    int64_t h6 = f0f6_2 + f1f5_4  + f2f4_2  + f3f3_2  + f7f9_76 + f8f8_19;
 1671|     24|    int64_t h7 = f0f7_2 + f1f6_2  + f2f5_2  + f3f4_2  + f8f9_38;
 1672|     24|    int64_t h8 = f0f8_2 + f1f7_4  + f2f6_2  + f3f5_4  + f4f4    + f9f9_38;
 1673|     24|    int64_t h9 = f0f9_2 + f1f8_2  + f2f7_2  + f3f6_2  + f4f5_2;
 1674|     24|    int64_t carry0;
 1675|     24|    int64_t carry1;
 1676|     24|    int64_t carry2;
 1677|     24|    int64_t carry3;
 1678|     24|    int64_t carry4;
 1679|     24|    int64_t carry5;
 1680|     24|    int64_t carry6;
 1681|     24|    int64_t carry7;
 1682|     24|    int64_t carry8;
 1683|     24|    int64_t carry9;
 1684|       |
 1685|     24|    h0 += h0;
 1686|     24|    h1 += h1;
 1687|     24|    h2 += h2;
 1688|     24|    h3 += h3;
 1689|     24|    h4 += h4;
 1690|     24|    h5 += h5;
 1691|     24|    h6 += h6;
 1692|     24|    h7 += h7;
 1693|     24|    h8 += h8;
 1694|     24|    h9 += h9;
 1695|       |
 1696|     24|    carry0 = h0 + (1 << 25); h1 += carry0 >> 26; h0 -= carry0 & kTop38Bits;
 1697|     24|    carry4 = h4 + (1 << 25); h5 += carry4 >> 26; h4 -= carry4 & kTop38Bits;
 1698|       |
 1699|     24|    carry1 = h1 + (1 << 24); h2 += carry1 >> 25; h1 -= carry1 & kTop39Bits;
 1700|     24|    carry5 = h5 + (1 << 24); h6 += carry5 >> 25; h5 -= carry5 & kTop39Bits;
 1701|       |
 1702|     24|    carry2 = h2 + (1 << 25); h3 += carry2 >> 26; h2 -= carry2 & kTop38Bits;
 1703|     24|    carry6 = h6 + (1 << 25); h7 += carry6 >> 26; h6 -= carry6 & kTop38Bits;
 1704|       |
 1705|     24|    carry3 = h3 + (1 << 24); h4 += carry3 >> 25; h3 -= carry3 & kTop39Bits;
 1706|     24|    carry7 = h7 + (1 << 24); h8 += carry7 >> 25; h7 -= carry7 & kTop39Bits;
 1707|       |
 1708|     24|    carry4 = h4 + (1 << 25); h5 += carry4 >> 26; h4 -= carry4 & kTop38Bits;
 1709|     24|    carry8 = h8 + (1 << 25); h9 += carry8 >> 26; h8 -= carry8 & kTop38Bits;
 1710|       |
 1711|     24|    carry9 = h9 + (1 << 24); h0 += (carry9 >> 25) * 19; h9 -= carry9 & kTop39Bits;
 1712|       |
 1713|     24|    carry0 = h0 + (1 << 25); h1 += carry0 >> 26; h0 -= carry0 & kTop38Bits;
 1714|       |
 1715|     24|    h[0] = (int32_t)h0;
 1716|     24|    h[1] = (int32_t)h1;
 1717|     24|    h[2] = (int32_t)h2;
 1718|     24|    h[3] = (int32_t)h3;
 1719|     24|    h[4] = (int32_t)h4;
 1720|     24|    h[5] = (int32_t)h5;
 1721|     24|    h[6] = (int32_t)h6;
 1722|     24|    h[7] = (int32_t)h7;
 1723|     24|    h[8] = (int32_t)h8;
 1724|     24|    h[9] = (int32_t)h9;
 1725|     24|}
curve25519.c:ge_p3_tobytes:
 1845|      4|{
 1846|      4|    fe recip;
 1847|      4|    fe x;
 1848|      4|    fe y;
 1849|       |
 1850|      4|    fe_invert(recip, h->Z);
 1851|      4|    fe_mul(x, h->X, recip);
 1852|      4|    fe_mul(y, h->Y, recip);
 1853|      4|    fe_tobytes(s, y);
 1854|      4|    s[31] ^= fe_isnegative(x) << 7;
 1855|      4|}
curve25519.c:fe_isnegative:
 1564|      4|{
 1565|      4|    uint8_t s[32];
 1566|       |
 1567|      4|    fe_tobytes(s, f);
 1568|      4|    return s[0] & 1;
 1569|      4|}
curve25519.c:fe_neg:
 1513|    384|{
 1514|    384|    unsigned i;
 1515|       |
 1516|  4.22k|    for (i = 0; i < 10; i++) {
  ------------------
  |  Branch (1516:17): [True: 3.84k, False: 384]
  ------------------
 1517|  3.84k|        h[i] = -f[i];
 1518|  3.84k|    }
 1519|    384|}
curve25519.c:fe_add:
  986|  1.58k|{
  987|  1.58k|    unsigned i;
  988|       |
  989|  17.4k|    for (i = 0; i < 10; i++) {
  ------------------
  |  Branch (989:17): [True: 15.8k, False: 1.58k]
  ------------------
  990|  15.8k|        h[i] = f[i] + g[i];
  991|  15.8k|    }
  992|  1.58k|}
curve25519.c:fe_sub:
 1007|  1.22k|{
 1008|  1.22k|    unsigned i;
 1009|       |
 1010|  13.4k|    for (i = 0; i < 10; i++) {
  ------------------
  |  Branch (1010:17): [True: 12.2k, False: 1.22k]
  ------------------
 1011|  12.2k|        h[i] = f[i] - g[i];
 1012|  12.2k|    }
 1013|  1.22k|}
curve25519.c:fe_invert:
 1408|      6|{
 1409|      6|    fe t0;
 1410|      6|    fe t1;
 1411|      6|    fe t2;
 1412|      6|    fe t3;
 1413|      6|    int i;
 1414|       |
 1415|       |    /*
 1416|       |     * Compute z ** -1 = z ** (2 ** 255 - 19 - 2) with the exponent as
 1417|       |     * 2 ** 255 - 21 = (2 ** 5) * (2 ** 250 - 1) + 11.
 1418|       |     */
 1419|       |
 1420|       |    /* t0 = z ** 2 */
 1421|      6|    fe_sq(t0, z);
 1422|       |
 1423|       |    /* t1 = t0 ** (2 ** 2) = z ** 8 */
 1424|      6|    fe_sq(t1, t0);
 1425|      6|    fe_sq(t1, t1);
 1426|       |
 1427|       |    /* t1 = z * t1 = z ** 9 */
 1428|      6|    fe_mul(t1, z, t1);
 1429|       |    /* t0 = t0 * t1 = z ** 11 -- stash t0 away for the end. */
 1430|      6|    fe_mul(t0, t0, t1);
 1431|       |
 1432|       |    /* t2 = t0 ** 2 = z ** 22 */
 1433|      6|    fe_sq(t2, t0);
 1434|       |
 1435|       |    /* t1 = t1 * t2 = z ** (2 ** 5 - 1) */
 1436|      6|    fe_mul(t1, t1, t2);
 1437|       |
 1438|       |    /* t2 = t1 ** (2 ** 5) = z ** ((2 ** 5) * (2 ** 5 - 1)) */
 1439|      6|    fe_sq(t2, t1);
 1440|     30|    for (i = 1; i < 5; ++i) {
  ------------------
  |  Branch (1440:17): [True: 24, False: 6]
  ------------------
 1441|     24|        fe_sq(t2, t2);
 1442|     24|    }
 1443|       |
 1444|       |    /* t1 = t1 * t2 = z ** ((2 ** 5 + 1) * (2 ** 5 - 1)) = z ** (2 ** 10 - 1) */
 1445|      6|    fe_mul(t1, t2, t1);
 1446|       |
 1447|       |    /* Continuing similarly... */
 1448|       |
 1449|       |    /* t2 = z ** (2 ** 20 - 1) */
 1450|      6|    fe_sq(t2, t1);
 1451|     60|    for (i = 1; i < 10; ++i) {
  ------------------
  |  Branch (1451:17): [True: 54, False: 6]
  ------------------
 1452|     54|        fe_sq(t2, t2);
 1453|     54|    }
 1454|      6|    fe_mul(t2, t2, t1);
 1455|       |
 1456|       |    /* t2 = z ** (2 ** 40 - 1) */
 1457|      6|    fe_sq(t3, t2);
 1458|    120|    for (i = 1; i < 20; ++i) {
  ------------------
  |  Branch (1458:17): [True: 114, False: 6]
  ------------------
 1459|    114|        fe_sq(t3, t3);
 1460|    114|    }
 1461|      6|    fe_mul(t2, t3, t2);
 1462|       |
 1463|       |    /* t2 = z ** (2 ** 10) * (2 ** 40 - 1) */
 1464|     66|    for (i = 0; i < 10; ++i) {
  ------------------
  |  Branch (1464:17): [True: 60, False: 6]
  ------------------
 1465|     60|        fe_sq(t2, t2);
 1466|     60|    }
 1467|       |    /* t1 = z ** (2 ** 50 - 1) */
 1468|      6|    fe_mul(t1, t2, t1);
 1469|       |
 1470|       |    /* t2 = z ** (2 ** 100 - 1) */
 1471|      6|    fe_sq(t2, t1);
 1472|    300|    for (i = 1; i < 50; ++i) {
  ------------------
  |  Branch (1472:17): [True: 294, False: 6]
  ------------------
 1473|    294|        fe_sq(t2, t2);
 1474|    294|    }
 1475|      6|    fe_mul(t2, t2, t1);
 1476|       |
 1477|       |    /* t2 = z ** (2 ** 200 - 1) */
 1478|      6|    fe_sq(t3, t2);
 1479|    600|    for (i = 1; i < 100; ++i) {
  ------------------
  |  Branch (1479:17): [True: 594, False: 6]
  ------------------
 1480|    594|        fe_sq(t3, t3);
 1481|    594|    }
 1482|      6|    fe_mul(t2, t3, t2);
 1483|       |
 1484|       |    /* t2 = z ** ((2 ** 50) * (2 ** 200 - 1) */
 1485|      6|    fe_sq(t2, t2);
 1486|    300|    for (i = 1; i < 50; ++i) {
  ------------------
  |  Branch (1486:17): [True: 294, False: 6]
  ------------------
 1487|    294|        fe_sq(t2, t2);
 1488|    294|    }
 1489|       |
 1490|       |    /* t1 = z ** (2 ** 250 - 1) */
 1491|      6|    fe_mul(t1, t2, t1);
 1492|       |
 1493|       |    /* t1 = z ** ((2 ** 5) * (2 ** 250 - 1)) */
 1494|      6|    fe_sq(t1, t1);
 1495|     30|    for (i = 1; i < 5; ++i) {
  ------------------
  |  Branch (1495:17): [True: 24, False: 6]
  ------------------
 1496|     24|        fe_sq(t1, t1);
 1497|     24|    }
 1498|       |
 1499|       |    /* Recall t0 = z ** 11; out = z ** (2 ** 255 - 21) */
 1500|      6|    fe_mul(out, t1, t0);
 1501|      6|}
curve25519.c:fe_mul:
 1046|  2.84k|{
 1047|  2.84k|    int32_t f0 = f[0];
 1048|  2.84k|    int32_t f1 = f[1];
 1049|  2.84k|    int32_t f2 = f[2];
 1050|  2.84k|    int32_t f3 = f[3];
 1051|  2.84k|    int32_t f4 = f[4];
 1052|  2.84k|    int32_t f5 = f[5];
 1053|  2.84k|    int32_t f6 = f[6];
 1054|  2.84k|    int32_t f7 = f[7];
 1055|  2.84k|    int32_t f8 = f[8];
 1056|  2.84k|    int32_t f9 = f[9];
 1057|  2.84k|    int32_t g0 = g[0];
 1058|  2.84k|    int32_t g1 = g[1];
 1059|  2.84k|    int32_t g2 = g[2];
 1060|  2.84k|    int32_t g3 = g[3];
 1061|  2.84k|    int32_t g4 = g[4];
 1062|  2.84k|    int32_t g5 = g[5];
 1063|  2.84k|    int32_t g6 = g[6];
 1064|  2.84k|    int32_t g7 = g[7];
 1065|  2.84k|    int32_t g8 = g[8];
 1066|  2.84k|    int32_t g9 = g[9];
 1067|  2.84k|    int32_t g1_19 = 19 * g1; /* 1.959375*2^29 */
 1068|  2.84k|    int32_t g2_19 = 19 * g2; /* 1.959375*2^30; still ok */
 1069|  2.84k|    int32_t g3_19 = 19 * g3;
 1070|  2.84k|    int32_t g4_19 = 19 * g4;
 1071|  2.84k|    int32_t g5_19 = 19 * g5;
 1072|  2.84k|    int32_t g6_19 = 19 * g6;
 1073|  2.84k|    int32_t g7_19 = 19 * g7;
 1074|  2.84k|    int32_t g8_19 = 19 * g8;
 1075|  2.84k|    int32_t g9_19 = 19 * g9;
 1076|  2.84k|    int32_t f1_2 = 2 * f1;
 1077|  2.84k|    int32_t f3_2 = 2 * f3;
 1078|  2.84k|    int32_t f5_2 = 2 * f5;
 1079|  2.84k|    int32_t f7_2 = 2 * f7;
 1080|  2.84k|    int32_t f9_2 = 2 * f9;
 1081|  2.84k|    int64_t f0g0    = f0   * (int64_t) g0;
 1082|  2.84k|    int64_t f0g1    = f0   * (int64_t) g1;
 1083|  2.84k|    int64_t f0g2    = f0   * (int64_t) g2;
 1084|  2.84k|    int64_t f0g3    = f0   * (int64_t) g3;
 1085|  2.84k|    int64_t f0g4    = f0   * (int64_t) g4;
 1086|  2.84k|    int64_t f0g5    = f0   * (int64_t) g5;
 1087|  2.84k|    int64_t f0g6    = f0   * (int64_t) g6;
 1088|  2.84k|    int64_t f0g7    = f0   * (int64_t) g7;
 1089|  2.84k|    int64_t f0g8    = f0   * (int64_t) g8;
 1090|  2.84k|    int64_t f0g9    = f0   * (int64_t) g9;
 1091|  2.84k|    int64_t f1g0    = f1   * (int64_t) g0;
 1092|  2.84k|    int64_t f1g1_2  = f1_2 * (int64_t) g1;
 1093|  2.84k|    int64_t f1g2    = f1   * (int64_t) g2;
 1094|  2.84k|    int64_t f1g3_2  = f1_2 * (int64_t) g3;
 1095|  2.84k|    int64_t f1g4    = f1   * (int64_t) g4;
 1096|  2.84k|    int64_t f1g5_2  = f1_2 * (int64_t) g5;
 1097|  2.84k|    int64_t f1g6    = f1   * (int64_t) g6;
 1098|  2.84k|    int64_t f1g7_2  = f1_2 * (int64_t) g7;
 1099|  2.84k|    int64_t f1g8    = f1   * (int64_t) g8;
 1100|  2.84k|    int64_t f1g9_38 = f1_2 * (int64_t) g9_19;
 1101|  2.84k|    int64_t f2g0    = f2   * (int64_t) g0;
 1102|  2.84k|    int64_t f2g1    = f2   * (int64_t) g1;
 1103|  2.84k|    int64_t f2g2    = f2   * (int64_t) g2;
 1104|  2.84k|    int64_t f2g3    = f2   * (int64_t) g3;
 1105|  2.84k|    int64_t f2g4    = f2   * (int64_t) g4;
 1106|  2.84k|    int64_t f2g5    = f2   * (int64_t) g5;
 1107|  2.84k|    int64_t f2g6    = f2   * (int64_t) g6;
 1108|  2.84k|    int64_t f2g7    = f2   * (int64_t) g7;
 1109|  2.84k|    int64_t f2g8_19 = f2   * (int64_t) g8_19;
 1110|  2.84k|    int64_t f2g9_19 = f2   * (int64_t) g9_19;
 1111|  2.84k|    int64_t f3g0    = f3   * (int64_t) g0;
 1112|  2.84k|    int64_t f3g1_2  = f3_2 * (int64_t) g1;
 1113|  2.84k|    int64_t f3g2    = f3   * (int64_t) g2;
 1114|  2.84k|    int64_t f3g3_2  = f3_2 * (int64_t) g3;
 1115|  2.84k|    int64_t f3g4    = f3   * (int64_t) g4;
 1116|  2.84k|    int64_t f3g5_2  = f3_2 * (int64_t) g5;
 1117|  2.84k|    int64_t f3g6    = f3   * (int64_t) g6;
 1118|  2.84k|    int64_t f3g7_38 = f3_2 * (int64_t) g7_19;
 1119|  2.84k|    int64_t f3g8_19 = f3   * (int64_t) g8_19;
 1120|  2.84k|    int64_t f3g9_38 = f3_2 * (int64_t) g9_19;
 1121|  2.84k|    int64_t f4g0    = f4   * (int64_t) g0;
 1122|  2.84k|    int64_t f4g1    = f4   * (int64_t) g1;
 1123|  2.84k|    int64_t f4g2    = f4   * (int64_t) g2;
 1124|  2.84k|    int64_t f4g3    = f4   * (int64_t) g3;
 1125|  2.84k|    int64_t f4g4    = f4   * (int64_t) g4;
 1126|  2.84k|    int64_t f4g5    = f4   * (int64_t) g5;
 1127|  2.84k|    int64_t f4g6_19 = f4   * (int64_t) g6_19;
 1128|  2.84k|    int64_t f4g7_19 = f4   * (int64_t) g7_19;
 1129|  2.84k|    int64_t f4g8_19 = f4   * (int64_t) g8_19;
 1130|  2.84k|    int64_t f4g9_19 = f4   * (int64_t) g9_19;
 1131|  2.84k|    int64_t f5g0    = f5   * (int64_t) g0;
 1132|  2.84k|    int64_t f5g1_2  = f5_2 * (int64_t) g1;
 1133|  2.84k|    int64_t f5g2    = f5   * (int64_t) g2;
 1134|  2.84k|    int64_t f5g3_2  = f5_2 * (int64_t) g3;
 1135|  2.84k|    int64_t f5g4    = f5   * (int64_t) g4;
 1136|  2.84k|    int64_t f5g5_38 = f5_2 * (int64_t) g5_19;
 1137|  2.84k|    int64_t f5g6_19 = f5   * (int64_t) g6_19;
 1138|  2.84k|    int64_t f5g7_38 = f5_2 * (int64_t) g7_19;
 1139|  2.84k|    int64_t f5g8_19 = f5   * (int64_t) g8_19;
 1140|  2.84k|    int64_t f5g9_38 = f5_2 * (int64_t) g9_19;
 1141|  2.84k|    int64_t f6g0    = f6   * (int64_t) g0;
 1142|  2.84k|    int64_t f6g1    = f6   * (int64_t) g1;
 1143|  2.84k|    int64_t f6g2    = f6   * (int64_t) g2;
 1144|  2.84k|    int64_t f6g3    = f6   * (int64_t) g3;
 1145|  2.84k|    int64_t f6g4_19 = f6   * (int64_t) g4_19;
 1146|  2.84k|    int64_t f6g5_19 = f6   * (int64_t) g5_19;
 1147|  2.84k|    int64_t f6g6_19 = f6   * (int64_t) g6_19;
 1148|  2.84k|    int64_t f6g7_19 = f6   * (int64_t) g7_19;
 1149|  2.84k|    int64_t f6g8_19 = f6   * (int64_t) g8_19;
 1150|  2.84k|    int64_t f6g9_19 = f6   * (int64_t) g9_19;
 1151|  2.84k|    int64_t f7g0    = f7   * (int64_t) g0;
 1152|  2.84k|    int64_t f7g1_2  = f7_2 * (int64_t) g1;
 1153|  2.84k|    int64_t f7g2    = f7   * (int64_t) g2;
 1154|  2.84k|    int64_t f7g3_38 = f7_2 * (int64_t) g3_19;
 1155|  2.84k|    int64_t f7g4_19 = f7   * (int64_t) g4_19;
 1156|  2.84k|    int64_t f7g5_38 = f7_2 * (int64_t) g5_19;
 1157|  2.84k|    int64_t f7g6_19 = f7   * (int64_t) g6_19;
 1158|  2.84k|    int64_t f7g7_38 = f7_2 * (int64_t) g7_19;
 1159|  2.84k|    int64_t f7g8_19 = f7   * (int64_t) g8_19;
 1160|  2.84k|    int64_t f7g9_38 = f7_2 * (int64_t) g9_19;
 1161|  2.84k|    int64_t f8g0    = f8   * (int64_t) g0;
 1162|  2.84k|    int64_t f8g1    = f8   * (int64_t) g1;
 1163|  2.84k|    int64_t f8g2_19 = f8   * (int64_t) g2_19;
 1164|  2.84k|    int64_t f8g3_19 = f8   * (int64_t) g3_19;
 1165|  2.84k|    int64_t f8g4_19 = f8   * (int64_t) g4_19;
 1166|  2.84k|    int64_t f8g5_19 = f8   * (int64_t) g5_19;
 1167|  2.84k|    int64_t f8g6_19 = f8   * (int64_t) g6_19;
 1168|  2.84k|    int64_t f8g7_19 = f8   * (int64_t) g7_19;
 1169|  2.84k|    int64_t f8g8_19 = f8   * (int64_t) g8_19;
 1170|  2.84k|    int64_t f8g9_19 = f8   * (int64_t) g9_19;
 1171|  2.84k|    int64_t f9g0    = f9   * (int64_t) g0;
 1172|  2.84k|    int64_t f9g1_38 = f9_2 * (int64_t) g1_19;
 1173|  2.84k|    int64_t f9g2_19 = f9   * (int64_t) g2_19;
 1174|  2.84k|    int64_t f9g3_38 = f9_2 * (int64_t) g3_19;
 1175|  2.84k|    int64_t f9g4_19 = f9   * (int64_t) g4_19;
 1176|  2.84k|    int64_t f9g5_38 = f9_2 * (int64_t) g5_19;
 1177|  2.84k|    int64_t f9g6_19 = f9   * (int64_t) g6_19;
 1178|  2.84k|    int64_t f9g7_38 = f9_2 * (int64_t) g7_19;
 1179|  2.84k|    int64_t f9g8_19 = f9   * (int64_t) g8_19;
 1180|  2.84k|    int64_t f9g9_38 = f9_2 * (int64_t) g9_19;
 1181|  2.84k|    int64_t h0 = f0g0 + f1g9_38 + f2g8_19 + f3g7_38 + f4g6_19 + f5g5_38 + f6g4_19 + f7g3_38 + f8g2_19 + f9g1_38;
 1182|  2.84k|    int64_t h1 = f0g1 + f1g0    + f2g9_19 + f3g8_19 + f4g7_19 + f5g6_19 + f6g5_19 + f7g4_19 + f8g3_19 + f9g2_19;
 1183|  2.84k|    int64_t h2 = f0g2 + f1g1_2  + f2g0    + f3g9_38 + f4g8_19 + f5g7_38 + f6g6_19 + f7g5_38 + f8g4_19 + f9g3_38;
 1184|  2.84k|    int64_t h3 = f0g3 + f1g2    + f2g1    + f3g0    + f4g9_19 + f5g8_19 + f6g7_19 + f7g6_19 + f8g5_19 + f9g4_19;
 1185|  2.84k|    int64_t h4 = f0g4 + f1g3_2  + f2g2    + f3g1_2  + f4g0    + f5g9_38 + f6g8_19 + f7g7_38 + f8g6_19 + f9g5_38;
 1186|  2.84k|    int64_t h5 = f0g5 + f1g4    + f2g3    + f3g2    + f4g1    + f5g0    + f6g9_19 + f7g8_19 + f8g7_19 + f9g6_19;
 1187|  2.84k|    int64_t h6 = f0g6 + f1g5_2  + f2g4    + f3g3_2  + f4g2    + f5g1_2  + f6g0    + f7g9_38 + f8g8_19 + f9g7_38;
 1188|  2.84k|    int64_t h7 = f0g7 + f1g6    + f2g5    + f3g4    + f4g3    + f5g2    + f6g1    + f7g0    + f8g9_19 + f9g8_19;
 1189|  2.84k|    int64_t h8 = f0g8 + f1g7_2  + f2g6    + f3g5_2  + f4g4    + f5g3_2  + f6g2    + f7g1_2  + f8g0    + f9g9_38;
 1190|  2.84k|    int64_t h9 = f0g9 + f1g8    + f2g7    + f3g6    + f4g5    + f5g4    + f6g3    + f7g2    + f8g1    + f9g0   ;
 1191|  2.84k|    int64_t carry0;
 1192|  2.84k|    int64_t carry1;
 1193|  2.84k|    int64_t carry2;
 1194|  2.84k|    int64_t carry3;
 1195|  2.84k|    int64_t carry4;
 1196|  2.84k|    int64_t carry5;
 1197|  2.84k|    int64_t carry6;
 1198|  2.84k|    int64_t carry7;
 1199|  2.84k|    int64_t carry8;
 1200|  2.84k|    int64_t carry9;
 1201|       |
 1202|       |    /* |h0| <= (1.65*1.65*2^52*(1+19+19+19+19)+1.65*1.65*2^50*(38+38+38+38+38))
 1203|       |     *   i.e. |h0| <= 1.4*2^60; narrower ranges for h2, h4, h6, h8
 1204|       |     * |h1| <= (1.65*1.65*2^51*(1+1+19+19+19+19+19+19+19+19))
 1205|       |     *   i.e. |h1| <= 1.7*2^59; narrower ranges for h3, h5, h7, h9 */
 1206|       |
 1207|  2.84k|    carry0 = h0 + (1 << 25); h1 += carry0 >> 26; h0 -= carry0 & kTop38Bits;
 1208|  2.84k|    carry4 = h4 + (1 << 25); h5 += carry4 >> 26; h4 -= carry4 & kTop38Bits;
 1209|       |    /* |h0| <= 2^25 */
 1210|       |    /* |h4| <= 2^25 */
 1211|       |    /* |h1| <= 1.71*2^59 */
 1212|       |    /* |h5| <= 1.71*2^59 */
 1213|       |
 1214|  2.84k|    carry1 = h1 + (1 << 24); h2 += carry1 >> 25; h1 -= carry1 & kTop39Bits;
 1215|  2.84k|    carry5 = h5 + (1 << 24); h6 += carry5 >> 25; h5 -= carry5 & kTop39Bits;
 1216|       |    /* |h1| <= 2^24; from now on fits into int32 */
 1217|       |    /* |h5| <= 2^24; from now on fits into int32 */
 1218|       |    /* |h2| <= 1.41*2^60 */
 1219|       |    /* |h6| <= 1.41*2^60 */
 1220|       |
 1221|  2.84k|    carry2 = h2 + (1 << 25); h3 += carry2 >> 26; h2 -= carry2 & kTop38Bits;
 1222|  2.84k|    carry6 = h6 + (1 << 25); h7 += carry6 >> 26; h6 -= carry6 & kTop38Bits;
 1223|       |    /* |h2| <= 2^25; from now on fits into int32 unchanged */
 1224|       |    /* |h6| <= 2^25; from now on fits into int32 unchanged */
 1225|       |    /* |h3| <= 1.71*2^59 */
 1226|       |    /* |h7| <= 1.71*2^59 */
 1227|       |
 1228|  2.84k|    carry3 = h3 + (1 << 24); h4 += carry3 >> 25; h3 -= carry3 & kTop39Bits;
 1229|  2.84k|    carry7 = h7 + (1 << 24); h8 += carry7 >> 25; h7 -= carry7 & kTop39Bits;
 1230|       |    /* |h3| <= 2^24; from now on fits into int32 unchanged */
 1231|       |    /* |h7| <= 2^24; from now on fits into int32 unchanged */
 1232|       |    /* |h4| <= 1.72*2^34 */
 1233|       |    /* |h8| <= 1.41*2^60 */
 1234|       |
 1235|  2.84k|    carry4 = h4 + (1 << 25); h5 += carry4 >> 26; h4 -= carry4 & kTop38Bits;
 1236|  2.84k|    carry8 = h8 + (1 << 25); h9 += carry8 >> 26; h8 -= carry8 & kTop38Bits;
 1237|       |    /* |h4| <= 2^25; from now on fits into int32 unchanged */
 1238|       |    /* |h8| <= 2^25; from now on fits into int32 unchanged */
 1239|       |    /* |h5| <= 1.01*2^24 */
 1240|       |    /* |h9| <= 1.71*2^59 */
 1241|       |
 1242|  2.84k|    carry9 = h9 + (1 << 24); h0 += (carry9 >> 25) * 19; h9 -= carry9 & kTop39Bits;
 1243|       |    /* |h9| <= 2^24; from now on fits into int32 unchanged */
 1244|       |    /* |h0| <= 1.1*2^39 */
 1245|       |
 1246|  2.84k|    carry0 = h0 + (1 << 25); h1 += carry0 >> 26; h0 -= carry0 & kTop38Bits;
 1247|       |    /* |h0| <= 2^25; from now on fits into int32 unchanged */
 1248|       |    /* |h1| <= 1.01*2^24 */
 1249|       |
 1250|  2.84k|    h[0] = (int32_t)h0;
 1251|  2.84k|    h[1] = (int32_t)h1;
 1252|  2.84k|    h[2] = (int32_t)h2;
 1253|  2.84k|    h[3] = (int32_t)h3;
 1254|  2.84k|    h[4] = (int32_t)h4;
 1255|  2.84k|    h[5] = (int32_t)h5;
 1256|  2.84k|    h[6] = (int32_t)h6;
 1257|  2.84k|    h[7] = (int32_t)h7;
 1258|  2.84k|    h[8] = (int32_t)h8;
 1259|  2.84k|    h[9] = (int32_t)h9;
 1260|  2.84k|}
curve25519.c:fe_tobytes:
  873|     10|{
  874|     10|    int32_t h0 = h[0];
  875|     10|    int32_t h1 = h[1];
  876|     10|    int32_t h2 = h[2];
  877|     10|    int32_t h3 = h[3];
  878|     10|    int32_t h4 = h[4];
  879|     10|    int32_t h5 = h[5];
  880|     10|    int32_t h6 = h[6];
  881|     10|    int32_t h7 = h[7];
  882|     10|    int32_t h8 = h[8];
  883|     10|    int32_t h9 = h[9];
  884|     10|    int32_t q;
  885|       |
  886|     10|    q = (19 * h9 + (((int32_t) 1) << 24)) >> 25;
  887|     10|    q = (h0 + q) >> 26;
  888|     10|    q = (h1 + q) >> 25;
  889|     10|    q = (h2 + q) >> 26;
  890|     10|    q = (h3 + q) >> 25;
  891|     10|    q = (h4 + q) >> 26;
  892|     10|    q = (h5 + q) >> 25;
  893|     10|    q = (h6 + q) >> 26;
  894|     10|    q = (h7 + q) >> 25;
  895|     10|    q = (h8 + q) >> 26;
  896|     10|    q = (h9 + q) >> 25;
  897|       |
  898|       |    /* Goal: Output h-(2^255-19)q, which is between 0 and 2^255-20. */
  899|     10|    h0 += 19 * q;
  900|       |    /* Goal: Output h-2^255 q, which is between 0 and 2^255-20. */
  901|       |
  902|     10|    h1 += h0 >> 26; h0 &= kBottom26Bits;
  903|     10|    h2 += h1 >> 25; h1 &= kBottom25Bits;
  904|     10|    h3 += h2 >> 26; h2 &= kBottom26Bits;
  905|     10|    h4 += h3 >> 25; h3 &= kBottom25Bits;
  906|     10|    h5 += h4 >> 26; h4 &= kBottom26Bits;
  907|     10|    h6 += h5 >> 25; h5 &= kBottom25Bits;
  908|     10|    h7 += h6 >> 26; h6 &= kBottom26Bits;
  909|     10|    h8 += h7 >> 25; h7 &= kBottom25Bits;
  910|     10|    h9 += h8 >> 26; h8 &= kBottom26Bits;
  911|     10|                    h9 &= kBottom25Bits;
  912|       |    /* h10 = carry9 */
  913|       |
  914|       |    /*
  915|       |     * Goal: Output h0+...+2^255 h10-2^255 q, which is between 0 and 2^255-20.
  916|       |     * Have h0+...+2^230 h9 between 0 and 2^255-1;
  917|       |     * evidently 2^255 h10-2^255 q = 0.
  918|       |     * Goal: Output h0+...+2^230 h9.
  919|       |     */
  920|     10|    s[ 0] = (uint8_t) (h0 >>  0);
  921|     10|    s[ 1] = (uint8_t) (h0 >>  8);
  922|     10|    s[ 2] = (uint8_t) (h0 >> 16);
  923|     10|    s[ 3] = (uint8_t)((h0 >> 24) | ((uint32_t)(h1) << 2));
  924|     10|    s[ 4] = (uint8_t) (h1 >>  6);
  925|     10|    s[ 5] = (uint8_t) (h1 >> 14);
  926|     10|    s[ 6] = (uint8_t)((h1 >> 22) | ((uint32_t)(h2) << 3));
  927|     10|    s[ 7] = (uint8_t) (h2 >>  5);
  928|     10|    s[ 8] = (uint8_t) (h2 >> 13);
  929|     10|    s[ 9] = (uint8_t)((h2 >> 21) | ((uint32_t)(h3) << 5));
  930|     10|    s[10] = (uint8_t) (h3 >>  3);
  931|     10|    s[11] = (uint8_t) (h3 >> 11);
  932|     10|    s[12] = (uint8_t)((h3 >> 19) | ((uint32_t)(h4) << 6));
  933|     10|    s[13] = (uint8_t) (h4 >>  2);
  934|     10|    s[14] = (uint8_t) (h4 >> 10);
  935|     10|    s[15] = (uint8_t) (h4 >> 18);
  936|     10|    s[16] = (uint8_t) (h5 >>  0);
  937|     10|    s[17] = (uint8_t) (h5 >>  8);
  938|     10|    s[18] = (uint8_t) (h5 >> 16);
  939|     10|    s[19] = (uint8_t)((h5 >> 24) | ((uint32_t)(h6) << 1));
  940|     10|    s[20] = (uint8_t) (h6 >>  7);
  941|     10|    s[21] = (uint8_t) (h6 >> 15);
  942|     10|    s[22] = (uint8_t)((h6 >> 23) | ((uint32_t)(h7) << 3));
  943|     10|    s[23] = (uint8_t) (h7 >>  5);
  944|     10|    s[24] = (uint8_t) (h7 >> 13);
  945|     10|    s[25] = (uint8_t)((h7 >> 21) | ((uint32_t)(h8) << 4));
  946|     10|    s[26] = (uint8_t) (h8 >>  4);
  947|     10|    s[27] = (uint8_t) (h8 >> 12);
  948|     10|    s[28] = (uint8_t)((h8 >> 20) | ((uint32_t)(h9) << 6));
  949|     10|    s[29] = (uint8_t) (h9 >>  2);
  950|     10|    s[30] = (uint8_t) (h9 >> 10);
  951|     10|    s[31] = (uint8_t) (h9 >> 18);
  952|     10|}

ossl_ec_GF2m_simple_set_compressed_coordinates:
   43|  11.2k|{
   44|  11.2k|    BIGNUM *tmp, *x, *y, *z;
   45|  11.2k|    int ret = 0, z0;
   46|  11.2k|#ifndef FIPS_MODULE
   47|  11.2k|    BN_CTX *new_ctx = NULL;
   48|       |
   49|  11.2k|    if (ctx == NULL) {
  ------------------
  |  Branch (49:9): [True: 0, False: 11.2k]
  ------------------
   50|      0|        ctx = new_ctx = BN_CTX_new();
   51|      0|        if (ctx == NULL)
  ------------------
  |  Branch (51:13): [True: 0, False: 0]
  ------------------
   52|      0|            return 0;
   53|      0|    }
   54|  11.2k|#endif
   55|       |
   56|  11.2k|    y_bit = (y_bit != 0) ? 1 : 0;
  ------------------
  |  Branch (56:13): [True: 11.1k, False: 65]
  ------------------
   57|       |
   58|  11.2k|    BN_CTX_start(ctx);
   59|  11.2k|    tmp = BN_CTX_get(ctx);
   60|  11.2k|    x = BN_CTX_get(ctx);
   61|  11.2k|    y = BN_CTX_get(ctx);
   62|  11.2k|    z = BN_CTX_get(ctx);
   63|  11.2k|    if (z == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 11.2k]
  ------------------
   64|      0|        goto err;
   65|       |
   66|  11.2k|    if (!BN_GF2m_mod_arr(x, x_, group->poly))
  ------------------
  |  Branch (66:9): [True: 0, False: 11.2k]
  ------------------
   67|      0|        goto err;
   68|  11.2k|    if (BN_is_zero(x)) {
  ------------------
  |  Branch (68:9): [True: 3.97k, False: 7.25k]
  ------------------
   69|  3.97k|        if (!BN_GF2m_mod_sqrt_arr(y, group->b, group->poly, ctx))
  ------------------
  |  Branch (69:13): [True: 0, False: 3.97k]
  ------------------
   70|      0|            goto err;
   71|  7.25k|    } else {
   72|  7.25k|        if (!group->meth->field_sqr(group, tmp, x, ctx))
  ------------------
  |  Branch (72:13): [True: 0, False: 7.25k]
  ------------------
   73|      0|            goto err;
   74|  7.25k|        if (!group->meth->field_div(group, tmp, group->b, tmp, ctx))
  ------------------
  |  Branch (74:13): [True: 0, False: 7.25k]
  ------------------
   75|      0|            goto err;
   76|  7.25k|        if (!BN_GF2m_add(tmp, group->a, tmp))
  ------------------
  |  Branch (76:13): [True: 0, False: 7.25k]
  ------------------
   77|      0|            goto err;
   78|  7.25k|        if (!BN_GF2m_add(tmp, x, tmp))
  ------------------
  |  Branch (78:13): [True: 0, False: 7.25k]
  ------------------
   79|      0|            goto err;
   80|  7.25k|        ERR_set_mark();
   81|  7.25k|        if (!BN_GF2m_mod_solve_quad_arr(z, tmp, group->poly, ctx)) {
  ------------------
  |  Branch (81:13): [True: 4.65k, False: 2.60k]
  ------------------
   82|  4.65k|#ifndef FIPS_MODULE
   83|  4.65k|            unsigned long err = ERR_peek_last_error();
   84|       |
   85|  4.65k|            if (ERR_GET_LIB(err) == ERR_LIB_BN
  ------------------
  |  |   73|  9.31k|# define ERR_LIB_BN              3
  ------------------
  |  Branch (85:17): [True: 4.65k, False: 0]
  ------------------
   86|  4.65k|                && ERR_GET_REASON(err) == BN_R_NO_SOLUTION) {
  ------------------
  |  |   40|  4.65k|# define BN_R_NO_SOLUTION                                 116
  ------------------
  |  Branch (86:20): [True: 3.83k, False: 820]
  ------------------
   87|  3.83k|                ERR_pop_to_mark();
   88|  3.83k|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT);
  ------------------
  |  |  401|  3.83k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  3.83k|    (ERR_new(),                                                 \
  |  |  |  |  404|  3.83k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  3.83k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  3.83k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.83k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  3.83k|     ERR_set_error)
  |  |  ------------------
  ------------------
   89|  3.83k|            } else
   90|    820|#endif
   91|    820|            {
   92|    820|                ERR_clear_last_mark();
   93|    820|                ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|    820|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    820|    (ERR_new(),                                                 \
  |  |  |  |  404|    820|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    820|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    820|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    820|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    820|     ERR_set_error)
  |  |  ------------------
  ------------------
   94|    820|            }
   95|  4.65k|            goto err;
   96|  4.65k|        }
   97|  2.60k|        ERR_clear_last_mark();
   98|  2.60k|        z0 = (BN_is_odd(z)) ? 1 : 0;
  ------------------
  |  Branch (98:14): [True: 400, False: 2.20k]
  ------------------
   99|  2.60k|        if (!group->meth->field_mul(group, y, x, z, ctx))
  ------------------
  |  Branch (99:13): [True: 0, False: 2.60k]
  ------------------
  100|      0|            goto err;
  101|  2.60k|        if (z0 != y_bit) {
  ------------------
  |  Branch (101:13): [True: 2.16k, False: 439]
  ------------------
  102|  2.16k|            if (!BN_GF2m_add(y, y, x))
  ------------------
  |  Branch (102:17): [True: 0, False: 2.16k]
  ------------------
  103|      0|                goto err;
  104|  2.16k|        }
  105|  2.60k|    }
  106|       |
  107|  6.57k|    if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (107:9): [True: 0, False: 6.57k]
  ------------------
  108|      0|        goto err;
  109|       |
  110|  6.57k|    ret = 1;
  111|       |
  112|  11.2k| err:
  113|  11.2k|    BN_CTX_end(ctx);
  114|  11.2k|#ifndef FIPS_MODULE
  115|  11.2k|    BN_CTX_free(new_ctx);
  116|  11.2k|#endif
  117|  11.2k|    return ret;
  118|  6.57k|}
ossl_ec_GF2m_simple_point2oct:
  129|    828|{
  130|    828|    size_t ret;
  131|    828|    int used_ctx = 0;
  132|    828|    BIGNUM *x, *y, *yxi;
  133|    828|    size_t field_len, i, skip;
  134|    828|#ifndef FIPS_MODULE
  135|    828|    BN_CTX *new_ctx = NULL;
  136|    828|#endif
  137|       |
  138|    828|    if ((form != POINT_CONVERSION_COMPRESSED)
  ------------------
  |  Branch (138:9): [True: 780, False: 48]
  ------------------
  139|    828|        && (form != POINT_CONVERSION_UNCOMPRESSED)
  ------------------
  |  Branch (139:12): [True: 20, False: 760]
  ------------------
  140|    828|        && (form != POINT_CONVERSION_HYBRID)) {
  ------------------
  |  Branch (140:12): [True: 20, False: 0]
  ------------------
  141|     20|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_FORM);
  ------------------
  |  |  401|     20|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     20|    (ERR_new(),                                                 \
  |  |  |  |  404|     20|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     20|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     20|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     20|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     20|     ERR_set_error)
  |  |  ------------------
  ------------------
  142|     20|        goto err;
  143|     20|    }
  144|       |
  145|    808|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (145:9): [True: 112, False: 696]
  ------------------
  146|       |        /* encodes to a single 0 octet */
  147|    112|        if (buf != NULL) {
  ------------------
  |  Branch (147:13): [True: 56, False: 56]
  ------------------
  148|     56|            if (len < 1) {
  ------------------
  |  Branch (148:17): [True: 0, False: 56]
  ------------------
  149|      0|                ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  150|      0|                return 0;
  151|      0|            }
  152|     56|            buf[0] = 0;
  153|     56|        }
  154|    112|        return 1;
  155|    112|    }
  156|       |
  157|       |    /* ret := required output buffer length */
  158|    696|    field_len = (EC_GROUP_get_degree(group) + 7) / 8;
  159|    696|    ret =
  160|    696|        (form ==
  ------------------
  |  Branch (160:9): [True: 48, False: 648]
  ------------------
  161|    696|         POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2 * field_len;
  162|       |
  163|       |    /* if 'buf' is NULL, just return required length */
  164|    696|    if (buf != NULL) {
  ------------------
  |  Branch (164:9): [True: 348, False: 348]
  ------------------
  165|    348|        if (len < ret) {
  ------------------
  |  Branch (165:13): [True: 0, False: 348]
  ------------------
  166|      0|            ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  167|      0|            goto err;
  168|      0|        }
  169|       |
  170|    348|#ifndef FIPS_MODULE
  171|    348|        if (ctx == NULL) {
  ------------------
  |  Branch (171:13): [True: 348, False: 0]
  ------------------
  172|    348|            ctx = new_ctx = BN_CTX_new();
  173|    348|            if (ctx == NULL)
  ------------------
  |  Branch (173:17): [True: 0, False: 348]
  ------------------
  174|      0|                return 0;
  175|    348|        }
  176|    348|#endif
  177|       |
  178|    348|        BN_CTX_start(ctx);
  179|    348|        used_ctx = 1;
  180|    348|        x = BN_CTX_get(ctx);
  181|    348|        y = BN_CTX_get(ctx);
  182|    348|        yxi = BN_CTX_get(ctx);
  183|    348|        if (yxi == NULL)
  ------------------
  |  Branch (183:13): [True: 0, False: 348]
  ------------------
  184|      0|            goto err;
  185|       |
  186|    348|        if (!EC_POINT_get_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (186:13): [True: 0, False: 348]
  ------------------
  187|      0|            goto err;
  188|       |
  189|    348|        buf[0] = form;
  190|    348|        if ((form != POINT_CONVERSION_UNCOMPRESSED) && !BN_is_zero(x)) {
  ------------------
  |  Branch (190:13): [True: 24, False: 324]
  |  Branch (190:56): [True: 20, False: 4]
  ------------------
  191|     20|            if (!group->meth->field_div(group, yxi, y, x, ctx))
  ------------------
  |  Branch (191:17): [True: 0, False: 20]
  ------------------
  192|      0|                goto err;
  193|     20|            if (BN_is_odd(yxi))
  ------------------
  |  Branch (193:17): [True: 12, False: 8]
  ------------------
  194|     12|                buf[0]++;
  195|     20|        }
  196|       |
  197|    348|        i = 1;
  198|       |
  199|    348|        skip = field_len - BN_num_bytes(x);
  ------------------
  |  |  189|    348|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  200|    348|        if (skip > field_len) {
  ------------------
  |  Branch (200:13): [True: 0, False: 348]
  ------------------
  201|      0|            ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  202|      0|            goto err;
  203|      0|        }
  204|    585|        while (skip > 0) {
  ------------------
  |  Branch (204:16): [True: 237, False: 348]
  ------------------
  205|    237|            buf[i++] = 0;
  206|    237|            skip--;
  207|    237|        }
  208|    348|        skip = BN_bn2bin(x, buf + i);
  209|    348|        i += skip;
  210|    348|        if (i != 1 + field_len) {
  ------------------
  |  Branch (210:13): [True: 0, False: 348]
  ------------------
  211|      0|            ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  212|      0|            goto err;
  213|      0|        }
  214|       |
  215|    348|        if (form == POINT_CONVERSION_UNCOMPRESSED
  ------------------
  |  Branch (215:13): [True: 324, False: 24]
  ------------------
  216|    348|            || form == POINT_CONVERSION_HYBRID) {
  ------------------
  |  Branch (216:16): [True: 0, False: 24]
  ------------------
  217|    324|            skip = field_len - BN_num_bytes(y);
  ------------------
  |  |  189|    324|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  218|    324|            if (skip > field_len) {
  ------------------
  |  Branch (218:17): [True: 0, False: 324]
  ------------------
  219|      0|                ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  220|      0|                goto err;
  221|      0|            }
  222|    430|            while (skip > 0) {
  ------------------
  |  Branch (222:20): [True: 106, False: 324]
  ------------------
  223|    106|                buf[i++] = 0;
  224|    106|                skip--;
  225|    106|            }
  226|    324|            skip = BN_bn2bin(y, buf + i);
  227|    324|            i += skip;
  228|    324|        }
  229|       |
  230|    348|        if (i != ret) {
  ------------------
  |  Branch (230:13): [True: 0, False: 348]
  ------------------
  231|      0|            ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  232|      0|            goto err;
  233|      0|        }
  234|    348|    }
  235|       |
  236|    696|    if (used_ctx)
  ------------------
  |  Branch (236:9): [True: 348, False: 348]
  ------------------
  237|    348|        BN_CTX_end(ctx);
  238|    696|#ifndef FIPS_MODULE
  239|    696|    BN_CTX_free(new_ctx);
  240|    696|#endif
  241|    696|    return ret;
  242|       |
  243|     20| err:
  244|     20|    if (used_ctx)
  ------------------
  |  Branch (244:9): [True: 0, False: 20]
  ------------------
  245|      0|        BN_CTX_end(ctx);
  246|     20|#ifndef FIPS_MODULE
  247|     20|    BN_CTX_free(new_ctx);
  248|     20|#endif
  249|     20|    return 0;
  250|    696|}
ossl_ec_GF2m_simple_oct2point:
  259|  22.4k|{
  260|  22.4k|    point_conversion_form_t form;
  261|  22.4k|    int y_bit, m;
  262|  22.4k|    BIGNUM *x, *y, *yxi;
  263|  22.4k|    size_t field_len, enc_len;
  264|  22.4k|    int ret = 0;
  265|  22.4k|#ifndef FIPS_MODULE
  266|  22.4k|    BN_CTX *new_ctx = NULL;
  267|  22.4k|#endif
  268|       |
  269|  22.4k|    if (len == 0) {
  ------------------
  |  Branch (269:9): [True: 12, False: 22.4k]
  ------------------
  270|     12|        ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|     12|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     12|    (ERR_new(),                                                 \
  |  |  |  |  404|     12|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     12|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     12|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     12|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     12|     ERR_set_error)
  |  |  ------------------
  ------------------
  271|     12|        return 0;
  272|     12|    }
  273|       |
  274|       |    /*
  275|       |     * The first octet is the point conversion octet PC, see X9.62, page 4
  276|       |     * and section 4.4.2.  It must be:
  277|       |     *     0x00          for the point at infinity
  278|       |     *     0x02 or 0x03  for compressed form
  279|       |     *     0x04          for uncompressed form
  280|       |     *     0x06 or 0x07  for hybrid form.
  281|       |     * For compressed or hybrid forms, we store the last bit of buf[0] as
  282|       |     * y_bit and clear it from buf[0] so as to obtain a POINT_CONVERSION_*.
  283|       |     * We error if buf[0] contains any but the above values.
  284|       |     */
  285|  22.4k|    y_bit = buf[0] & 1;
  286|  22.4k|    form = buf[0] & ~1U;
  287|       |
  288|  22.4k|    if ((form != 0) && (form != POINT_CONVERSION_COMPRESSED)
  ------------------
  |  Branch (288:9): [True: 22.3k, False: 56]
  |  Branch (288:24): [True: 8.33k, False: 14.0k]
  ------------------
  289|  22.4k|        && (form != POINT_CONVERSION_UNCOMPRESSED)
  ------------------
  |  Branch (289:12): [True: 8.31k, False: 18]
  ------------------
  290|  22.4k|        && (form != POINT_CONVERSION_HYBRID)) {
  ------------------
  |  Branch (290:12): [True: 161, False: 8.15k]
  ------------------
  291|    161|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|    161|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    161|    (ERR_new(),                                                 \
  |  |  |  |  404|    161|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    161|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    161|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    161|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    161|     ERR_set_error)
  |  |  ------------------
  ------------------
  292|    161|        return 0;
  293|    161|    }
  294|  22.2k|    if ((form == 0 || form == POINT_CONVERSION_UNCOMPRESSED) && y_bit) {
  ------------------
  |  Branch (294:10): [True: 56, False: 22.1k]
  |  Branch (294:23): [True: 18, False: 22.1k]
  |  Branch (294:65): [True: 19, False: 55]
  ------------------
  295|     19|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     19|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     19|    (ERR_new(),                                                 \
  |  |  |  |  404|     19|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     19|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     19|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     19|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     19|     ERR_set_error)
  |  |  ------------------
  ------------------
  296|     19|        return 0;
  297|     19|    }
  298|       |
  299|       |    /* The point at infinity is represented by a single zero octet. */
  300|  22.2k|    if (form == 0) {
  ------------------
  |  Branch (300:9): [True: 39, False: 22.1k]
  ------------------
  301|     39|        if (len != 1) {
  ------------------
  |  Branch (301:13): [True: 19, False: 20]
  ------------------
  302|     19|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     19|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     19|    (ERR_new(),                                                 \
  |  |  |  |  404|     19|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     19|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     19|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     19|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     19|     ERR_set_error)
  |  |  ------------------
  ------------------
  303|     19|            return 0;
  304|     19|        }
  305|       |
  306|     20|        return EC_POINT_set_to_infinity(group, point);
  307|     39|    }
  308|       |
  309|  22.1k|    m = EC_GROUP_get_degree(group);
  310|  22.1k|    field_len = (m + 7) / 8;
  311|  22.1k|    enc_len =
  312|  22.1k|        (form ==
  ------------------
  |  Branch (312:9): [True: 14.0k, False: 8.17k]
  ------------------
  313|  22.1k|         POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2 * field_len;
  314|       |
  315|  22.1k|    if (len != enc_len) {
  ------------------
  |  Branch (315:9): [True: 2.13k, False: 20.0k]
  ------------------
  316|  2.13k|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|  2.13k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.13k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.13k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  2.13k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  2.13k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.13k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.13k|     ERR_set_error)
  |  |  ------------------
  ------------------
  317|  2.13k|        return 0;
  318|  2.13k|    }
  319|       |
  320|  20.0k|#ifndef FIPS_MODULE
  321|  20.0k|    if (ctx == NULL) {
  ------------------
  |  Branch (321:9): [True: 20.0k, False: 0]
  ------------------
  322|  20.0k|        ctx = new_ctx = BN_CTX_new();
  323|  20.0k|        if (ctx == NULL)
  ------------------
  |  Branch (323:13): [True: 0, False: 20.0k]
  ------------------
  324|      0|            return 0;
  325|  20.0k|    }
  326|  20.0k|#endif
  327|       |
  328|  20.0k|    BN_CTX_start(ctx);
  329|  20.0k|    x = BN_CTX_get(ctx);
  330|  20.0k|    y = BN_CTX_get(ctx);
  331|  20.0k|    yxi = BN_CTX_get(ctx);
  332|  20.0k|    if (yxi == NULL)
  ------------------
  |  Branch (332:9): [True: 0, False: 20.0k]
  ------------------
  333|      0|        goto err;
  334|       |
  335|  20.0k|    if (!BN_bin2bn(buf + 1, field_len, x))
  ------------------
  |  Branch (335:9): [True: 0, False: 20.0k]
  ------------------
  336|      0|        goto err;
  337|  20.0k|    if (BN_num_bits(x) > m) {
  ------------------
  |  Branch (337:9): [True: 3.01k, False: 17.0k]
  ------------------
  338|  3.01k|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|  3.01k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  3.01k|    (ERR_new(),                                                 \
  |  |  |  |  404|  3.01k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  3.01k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  3.01k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.01k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  3.01k|     ERR_set_error)
  |  |  ------------------
  ------------------
  339|  3.01k|        goto err;
  340|  3.01k|    }
  341|       |
  342|  17.0k|    if (form == POINT_CONVERSION_COMPRESSED) {
  ------------------
  |  Branch (342:9): [True: 11.2k, False: 5.80k]
  ------------------
  343|  11.2k|        if (!EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx))
  ------------------
  |  Branch (343:13): [True: 4.65k, False: 6.57k]
  ------------------
  344|  4.65k|            goto err;
  345|  11.2k|    } else {
  346|  5.80k|        if (!BN_bin2bn(buf + 1 + field_len, field_len, y))
  ------------------
  |  Branch (346:13): [True: 0, False: 5.80k]
  ------------------
  347|      0|            goto err;
  348|  5.80k|        if (BN_num_bits(y) > m) {
  ------------------
  |  Branch (348:13): [True: 74, False: 5.72k]
  ------------------
  349|     74|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     74|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     74|    (ERR_new(),                                                 \
  |  |  |  |  404|     74|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     74|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     74|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     74|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     74|     ERR_set_error)
  |  |  ------------------
  ------------------
  350|     74|            goto err;
  351|     74|        }
  352|  5.72k|        if (form == POINT_CONVERSION_HYBRID) {
  ------------------
  |  Branch (352:13): [True: 5.72k, False: 4]
  ------------------
  353|       |            /*
  354|       |             * Check that the form in the encoding was set correctly
  355|       |             * according to X9.62 4.4.2.a, 4(c), see also first paragraph
  356|       |             * of X9.62, 4.4.1.b.
  357|       |             */
  358|  5.72k|            if (BN_is_zero(x)) {
  ------------------
  |  Branch (358:17): [True: 6, False: 5.71k]
  ------------------
  359|      6|                if (y_bit != 0) {
  ------------------
  |  Branch (359:21): [True: 3, False: 3]
  ------------------
  360|      3|                    ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|      3|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      3|    (ERR_new(),                                                 \
  |  |  |  |  404|      3|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      3|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      3|     ERR_set_error)
  |  |  ------------------
  ------------------
  361|      3|                    goto err;
  362|      3|                }
  363|  5.71k|            } else {
  364|  5.71k|                if (!group->meth->field_div(group, yxi, y, x, ctx))
  ------------------
  |  Branch (364:21): [True: 0, False: 5.71k]
  ------------------
  365|      0|                    goto err;
  366|  5.71k|                if (y_bit != BN_is_odd(yxi)) {
  ------------------
  |  Branch (366:21): [True: 3.26k, False: 2.45k]
  ------------------
  367|  3.26k|                    ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|  3.26k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  3.26k|    (ERR_new(),                                                 \
  |  |  |  |  404|  3.26k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  3.26k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  3.26k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.26k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  3.26k|     ERR_set_error)
  |  |  ------------------
  ------------------
  368|  3.26k|                    goto err;
  369|  3.26k|                }
  370|  5.71k|            }
  371|  5.72k|        }
  372|       |
  373|       |        /*
  374|       |         * EC_POINT_set_affine_coordinates is responsible for checking that
  375|       |         * the point is on the curve.
  376|       |         */
  377|  2.46k|        if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (377:13): [True: 2.46k, False: 1]
  ------------------
  378|  2.46k|            goto err;
  379|  2.46k|    }
  380|       |
  381|  6.57k|    ret = 1;
  382|       |
  383|  20.0k| err:
  384|  20.0k|    BN_CTX_end(ctx);
  385|  20.0k|#ifndef FIPS_MODULE
  386|  20.0k|    BN_CTX_free(new_ctx);
  387|  20.0k|#endif
  388|  20.0k|    return ret;
  389|  6.57k|}

ossl_ec_GF2m_simple_group_init:
   29|  45.6k|{
   30|  45.6k|    group->field = BN_new();
   31|  45.6k|    group->a = BN_new();
   32|  45.6k|    group->b = BN_new();
   33|       |
   34|  45.6k|    if (group->field == NULL || group->a == NULL || group->b == NULL) {
  ------------------
  |  Branch (34:9): [True: 0, False: 45.6k]
  |  Branch (34:33): [True: 0, False: 45.6k]
  |  Branch (34:53): [True: 0, False: 45.6k]
  ------------------
   35|      0|        BN_free(group->field);
   36|      0|        BN_free(group->a);
   37|      0|        BN_free(group->b);
   38|      0|        return 0;
   39|      0|    }
   40|  45.6k|    return 1;
   41|  45.6k|}
ossl_ec_GF2m_simple_group_finish:
   48|  45.6k|{
   49|  45.6k|    BN_free(group->field);
   50|  45.6k|    BN_free(group->a);
   51|  45.6k|    BN_free(group->b);
   52|  45.6k|}
ossl_ec_GF2m_simple_group_copy:
   76|  22.3k|{
   77|  22.3k|    if (!BN_copy(dest->field, src->field))
  ------------------
  |  Branch (77:9): [True: 0, False: 22.3k]
  ------------------
   78|      0|        return 0;
   79|  22.3k|    if (!BN_copy(dest->a, src->a))
  ------------------
  |  Branch (79:9): [True: 0, False: 22.3k]
  ------------------
   80|      0|        return 0;
   81|  22.3k|    if (!BN_copy(dest->b, src->b))
  ------------------
  |  Branch (81:9): [True: 0, False: 22.3k]
  ------------------
   82|      0|        return 0;
   83|  22.3k|    dest->poly[0] = src->poly[0];
   84|  22.3k|    dest->poly[1] = src->poly[1];
   85|  22.3k|    dest->poly[2] = src->poly[2];
   86|  22.3k|    dest->poly[3] = src->poly[3];
   87|  22.3k|    dest->poly[4] = src->poly[4];
   88|  22.3k|    dest->poly[5] = src->poly[5];
   89|  22.3k|    if (bn_wexpand(dest->a, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) ==
  ------------------
  |  |   54|  22.3k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  22.3k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                  if (bn_wexpand(dest->a, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) ==
  ------------------
  |  |   54|  22.3k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  22.3k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (89:9): [True: 0, False: 22.3k]
  ------------------
   90|  22.3k|        NULL)
   91|      0|        return 0;
   92|  22.3k|    if (bn_wexpand(dest->b, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) ==
  ------------------
  |  |   54|  22.3k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  22.3k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                  if (bn_wexpand(dest->b, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) ==
  ------------------
  |  |   54|  22.3k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  22.3k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (92:9): [True: 0, False: 22.3k]
  ------------------
   93|  22.3k|        NULL)
   94|      0|        return 0;
   95|  22.3k|    bn_set_all_zero(dest->a);
   96|  22.3k|    bn_set_all_zero(dest->b);
   97|  22.3k|    return 1;
   98|  22.3k|}
ossl_ec_GF2m_simple_group_set_curve:
  104|  23.2k|{
  105|  23.2k|    int ret = 0, i;
  106|       |
  107|       |    /* group->field */
  108|  23.2k|    if (!BN_copy(group->field, p))
  ------------------
  |  Branch (108:9): [True: 0, False: 23.2k]
  ------------------
  109|      0|        goto err;
  110|  23.2k|    i = BN_GF2m_poly2arr(group->field, group->poly, 6) - 1;
  111|  23.2k|    if ((i != 5) && (i != 3)) {
  ------------------
  |  Branch (111:9): [True: 2.53k, False: 20.7k]
  |  Branch (111:21): [True: 0, False: 2.53k]
  ------------------
  112|      0|        ERR_raise(ERR_LIB_EC, EC_R_UNSUPPORTED_FIELD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  113|      0|        goto err;
  114|      0|    }
  115|       |
  116|       |    /* group->a */
  117|  23.2k|    if (!BN_GF2m_mod_arr(group->a, a, group->poly))
  ------------------
  |  Branch (117:9): [True: 0, False: 23.2k]
  ------------------
  118|      0|        goto err;
  119|  23.2k|    if (bn_wexpand(group->a, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2)
  ------------------
  |  |   54|  23.2k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  23.2k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                  if (bn_wexpand(group->a, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2)
  ------------------
  |  |   54|  23.2k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  23.2k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (119:9): [True: 0, False: 23.2k]
  ------------------
  120|  23.2k|        == NULL)
  121|      0|        goto err;
  122|  23.2k|    bn_set_all_zero(group->a);
  123|       |
  124|       |    /* group->b */
  125|  23.2k|    if (!BN_GF2m_mod_arr(group->b, b, group->poly))
  ------------------
  |  Branch (125:9): [True: 0, False: 23.2k]
  ------------------
  126|      0|        goto err;
  127|  23.2k|    if (bn_wexpand(group->b, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2)
  ------------------
  |  |   54|  23.2k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  23.2k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                  if (bn_wexpand(group->b, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2)
  ------------------
  |  |   54|  23.2k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  23.2k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (127:9): [True: 0, False: 23.2k]
  ------------------
  128|  23.2k|        == NULL)
  129|      0|        goto err;
  130|  23.2k|    bn_set_all_zero(group->b);
  131|       |
  132|  23.2k|    ret = 1;
  133|  23.2k| err:
  134|  23.2k|    return ret;
  135|  23.2k|}
ossl_ec_GF2m_simple_group_get_degree:
  172|  29.7k|{
  173|  29.7k|    return BN_num_bits(group->field) - 1;
  174|  29.7k|}
ossl_ec_GF2m_simple_point_init:
  223|  93.5k|{
  224|  93.5k|    point->X = BN_new();
  225|  93.5k|    point->Y = BN_new();
  226|  93.5k|    point->Z = BN_new();
  227|       |
  228|  93.5k|    if (point->X == NULL || point->Y == NULL || point->Z == NULL) {
  ------------------
  |  Branch (228:9): [True: 0, False: 93.5k]
  |  Branch (228:29): [True: 0, False: 93.5k]
  |  Branch (228:49): [True: 0, False: 93.5k]
  ------------------
  229|      0|        BN_free(point->X);
  230|      0|        BN_free(point->Y);
  231|      0|        BN_free(point->Z);
  232|      0|        return 0;
  233|      0|    }
  234|  93.5k|    return 1;
  235|  93.5k|}
ossl_ec_GF2m_simple_point_finish:
  239|  92.7k|{
  240|  92.7k|    BN_free(point->X);
  241|  92.7k|    BN_free(point->Y);
  242|  92.7k|    BN_free(point->Z);
  243|  92.7k|}
ossl_ec_GF2m_simple_point_clear_finish:
  247|    755|{
  248|    755|    BN_clear_free(point->X);
  249|    755|    BN_clear_free(point->Y);
  250|    755|    BN_clear_free(point->Z);
  251|    755|    point->Z_is_one = 0;
  252|    755|}
ossl_ec_GF2m_simple_point_copy:
  259|  46.3k|{
  260|  46.3k|    if (!BN_copy(dest->X, src->X))
  ------------------
  |  Branch (260:9): [True: 0, False: 46.3k]
  ------------------
  261|      0|        return 0;
  262|  46.3k|    if (!BN_copy(dest->Y, src->Y))
  ------------------
  |  Branch (262:9): [True: 0, False: 46.3k]
  ------------------
  263|      0|        return 0;
  264|  46.3k|    if (!BN_copy(dest->Z, src->Z))
  ------------------
  |  Branch (264:9): [True: 0, False: 46.3k]
  ------------------
  265|      0|        return 0;
  266|  46.3k|    dest->Z_is_one = src->Z_is_one;
  267|  46.3k|    dest->curve_name = src->curve_name;
  268|       |
  269|  46.3k|    return 1;
  270|  46.3k|}
ossl_ec_GF2m_simple_point_set_to_infinity:
  278|    101|{
  279|    101|    point->Z_is_one = 0;
  280|    101|    BN_zero(point->Z);
  ------------------
  |  |  202|    101|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  281|    101|    return 1;
  282|    101|}
ossl_ec_GF2m_simple_point_set_affine_coordinates:
  293|  32.2k|{
  294|  32.2k|    int ret = 0;
  295|  32.2k|    if (x == NULL || y == NULL) {
  ------------------
  |  Branch (295:9): [True: 0, False: 32.2k]
  |  Branch (295:22): [True: 0, False: 32.2k]
  ------------------
  296|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  297|      0|        return 0;
  298|      0|    }
  299|       |
  300|  32.2k|    if (!BN_copy(point->X, x))
  ------------------
  |  Branch (300:9): [True: 0, False: 32.2k]
  ------------------
  301|      0|        goto err;
  302|  32.2k|    BN_set_negative(point->X, 0);
  303|  32.2k|    if (!BN_copy(point->Y, y))
  ------------------
  |  Branch (303:9): [True: 0, False: 32.2k]
  ------------------
  304|      0|        goto err;
  305|  32.2k|    BN_set_negative(point->Y, 0);
  306|  32.2k|    if (!BN_copy(point->Z, BN_value_one()))
  ------------------
  |  Branch (306:9): [True: 0, False: 32.2k]
  ------------------
  307|      0|        goto err;
  308|  32.2k|    BN_set_negative(point->Z, 0);
  309|  32.2k|    point->Z_is_one = 1;
  310|  32.2k|    ret = 1;
  311|       |
  312|  32.2k| err:
  313|  32.2k|    return ret;
  314|  32.2k|}
ossl_ec_GF2m_simple_point_get_affine_coordinates:
  324|    348|{
  325|    348|    int ret = 0;
  326|       |
  327|    348|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 348]
  ------------------
  328|      0|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  329|      0|        return 0;
  330|      0|    }
  331|       |
  332|    348|    if (BN_cmp(point->Z, BN_value_one())) {
  ------------------
  |  Branch (332:9): [True: 0, False: 348]
  ------------------
  333|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  334|      0|        return 0;
  335|      0|    }
  336|    348|    if (x != NULL) {
  ------------------
  |  Branch (336:9): [True: 348, False: 0]
  ------------------
  337|    348|        if (!BN_copy(x, point->X))
  ------------------
  |  Branch (337:13): [True: 0, False: 348]
  ------------------
  338|      0|            goto err;
  339|    348|        BN_set_negative(x, 0);
  340|    348|    }
  341|    348|    if (y != NULL) {
  ------------------
  |  Branch (341:9): [True: 348, False: 0]
  ------------------
  342|    348|        if (!BN_copy(y, point->Y))
  ------------------
  |  Branch (342:13): [True: 0, False: 348]
  ------------------
  343|      0|            goto err;
  344|    348|        BN_set_negative(y, 0);
  345|    348|    }
  346|    348|    ret = 1;
  347|       |
  348|    348| err:
  349|    348|    return ret;
  350|    348|}
ossl_ec_GF2m_simple_is_at_infinity:
  499|  33.7k|{
  500|  33.7k|    return BN_is_zero(point->Z);
  501|  33.7k|}
ossl_ec_GF2m_simple_is_on_curve:
  510|  32.2k|{
  511|  32.2k|    int ret = -1;
  512|  32.2k|    BIGNUM *lh, *y2;
  513|  32.2k|    int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *,
  514|  32.2k|                      const BIGNUM *, BN_CTX *);
  515|  32.2k|    int (*field_sqr) (const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);
  516|  32.2k|#ifndef FIPS_MODULE
  517|  32.2k|    BN_CTX *new_ctx = NULL;
  518|  32.2k|#endif
  519|       |
  520|  32.2k|    if (EC_POINT_is_at_infinity(group, point))
  ------------------
  |  Branch (520:9): [True: 0, False: 32.2k]
  ------------------
  521|      0|        return 1;
  522|       |
  523|  32.2k|    field_mul = group->meth->field_mul;
  524|  32.2k|    field_sqr = group->meth->field_sqr;
  525|       |
  526|       |    /* only support affine coordinates */
  527|  32.2k|    if (!point->Z_is_one)
  ------------------
  |  Branch (527:9): [True: 0, False: 32.2k]
  ------------------
  528|      0|        return -1;
  529|       |
  530|  32.2k|#ifndef FIPS_MODULE
  531|  32.2k|    if (ctx == NULL) {
  ------------------
  |  Branch (531:9): [True: 0, False: 32.2k]
  ------------------
  532|      0|        ctx = new_ctx = BN_CTX_new();
  533|      0|        if (ctx == NULL)
  ------------------
  |  Branch (533:13): [True: 0, False: 0]
  ------------------
  534|      0|            return -1;
  535|      0|    }
  536|  32.2k|#endif
  537|       |
  538|  32.2k|    BN_CTX_start(ctx);
  539|  32.2k|    y2 = BN_CTX_get(ctx);
  540|  32.2k|    lh = BN_CTX_get(ctx);
  541|  32.2k|    if (lh == NULL)
  ------------------
  |  Branch (541:9): [True: 0, False: 32.2k]
  ------------------
  542|      0|        goto err;
  543|       |
  544|       |    /*-
  545|       |     * We have a curve defined by a Weierstrass equation
  546|       |     *      y^2 + x*y = x^3 + a*x^2 + b.
  547|       |     *  <=> x^3 + a*x^2 + x*y + b + y^2 = 0
  548|       |     *  <=> ((x + a) * x + y) * x + b + y^2 = 0
  549|       |     */
  550|  32.2k|    if (!BN_GF2m_add(lh, point->X, group->a))
  ------------------
  |  Branch (550:9): [True: 0, False: 32.2k]
  ------------------
  551|      0|        goto err;
  552|  32.2k|    if (!field_mul(group, lh, lh, point->X, ctx))
  ------------------
  |  Branch (552:9): [True: 0, False: 32.2k]
  ------------------
  553|      0|        goto err;
  554|  32.2k|    if (!BN_GF2m_add(lh, lh, point->Y))
  ------------------
  |  Branch (554:9): [True: 0, False: 32.2k]
  ------------------
  555|      0|        goto err;
  556|  32.2k|    if (!field_mul(group, lh, lh, point->X, ctx))
  ------------------
  |  Branch (556:9): [True: 0, False: 32.2k]
  ------------------
  557|      0|        goto err;
  558|  32.2k|    if (!BN_GF2m_add(lh, lh, group->b))
  ------------------
  |  Branch (558:9): [True: 0, False: 32.2k]
  ------------------
  559|      0|        goto err;
  560|  32.2k|    if (!field_sqr(group, y2, point->Y, ctx))
  ------------------
  |  Branch (560:9): [True: 0, False: 32.2k]
  ------------------
  561|      0|        goto err;
  562|  32.2k|    if (!BN_GF2m_add(lh, lh, y2))
  ------------------
  |  Branch (562:9): [True: 0, False: 32.2k]
  ------------------
  563|      0|        goto err;
  564|  32.2k|    ret = BN_is_zero(lh);
  565|       |
  566|  32.2k| err:
  567|  32.2k|    BN_CTX_end(ctx);
  568|  32.2k|#ifndef FIPS_MODULE
  569|  32.2k|    BN_CTX_free(new_ctx);
  570|  32.2k|#endif
  571|  32.2k|    return ret;
  572|  32.2k|}
ossl_ec_GF2m_simple_field_mul:
  697|  1.03M|{
  698|  1.03M|    return BN_GF2m_mod_mul_arr(r, a, b, group->poly, ctx);
  699|  1.03M|}
ossl_ec_GF2m_simple_field_sqr:
  704|   838k|{
  705|   838k|    return BN_GF2m_mod_sqr_arr(r, a, group->poly, ctx);
  706|   838k|}
ossl_ec_GF2m_simple_field_div:
  711|  12.9k|{
  712|  12.9k|    return BN_GF2m_mod_div(r, a, b, group->field, ctx);
  713|  12.9k|}
EC_GF2m_simple_method:
  940|  23.2k|{
  941|  23.2k|    static const EC_METHOD ret = {
  942|  23.2k|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|  23.2k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  943|  23.2k|        NID_X9_62_characteristic_two_field,
  ------------------
  |  |  156|  23.2k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  944|  23.2k|        ossl_ec_GF2m_simple_group_init,
  945|  23.2k|        ossl_ec_GF2m_simple_group_finish,
  946|  23.2k|        ossl_ec_GF2m_simple_group_clear_finish,
  947|  23.2k|        ossl_ec_GF2m_simple_group_copy,
  948|  23.2k|        ossl_ec_GF2m_simple_group_set_curve,
  949|  23.2k|        ossl_ec_GF2m_simple_group_get_curve,
  950|  23.2k|        ossl_ec_GF2m_simple_group_get_degree,
  951|  23.2k|        ossl_ec_group_simple_order_bits,
  952|  23.2k|        ossl_ec_GF2m_simple_group_check_discriminant,
  953|  23.2k|        ossl_ec_GF2m_simple_point_init,
  954|  23.2k|        ossl_ec_GF2m_simple_point_finish,
  955|  23.2k|        ossl_ec_GF2m_simple_point_clear_finish,
  956|  23.2k|        ossl_ec_GF2m_simple_point_copy,
  957|  23.2k|        ossl_ec_GF2m_simple_point_set_to_infinity,
  958|  23.2k|        ossl_ec_GF2m_simple_point_set_affine_coordinates,
  959|  23.2k|        ossl_ec_GF2m_simple_point_get_affine_coordinates,
  960|  23.2k|        0, /* point_set_compressed_coordinates */
  961|  23.2k|        0, /* point2oct */
  962|  23.2k|        0, /* oct2point */
  963|  23.2k|        ossl_ec_GF2m_simple_add,
  964|  23.2k|        ossl_ec_GF2m_simple_dbl,
  965|  23.2k|        ossl_ec_GF2m_simple_invert,
  966|  23.2k|        ossl_ec_GF2m_simple_is_at_infinity,
  967|  23.2k|        ossl_ec_GF2m_simple_is_on_curve,
  968|  23.2k|        ossl_ec_GF2m_simple_cmp,
  969|  23.2k|        ossl_ec_GF2m_simple_make_affine,
  970|  23.2k|        ossl_ec_GF2m_simple_points_make_affine,
  971|  23.2k|        ec_GF2m_simple_points_mul,
  972|  23.2k|        0, /* precompute_mult */
  973|  23.2k|        0, /* have_precompute_mult */
  974|  23.2k|        ossl_ec_GF2m_simple_field_mul,
  975|  23.2k|        ossl_ec_GF2m_simple_field_sqr,
  976|  23.2k|        ossl_ec_GF2m_simple_field_div,
  977|  23.2k|        ec_GF2m_simple_field_inv,
  978|  23.2k|        0, /* field_encode */
  979|  23.2k|        0, /* field_decode */
  980|  23.2k|        0, /* field_set_to_one */
  981|  23.2k|        ossl_ec_key_simple_priv2oct,
  982|  23.2k|        ossl_ec_key_simple_oct2priv,
  983|  23.2k|        0, /* set private */
  984|  23.2k|        ossl_ec_key_simple_generate_key,
  985|  23.2k|        ossl_ec_key_simple_check_key,
  986|  23.2k|        ossl_ec_key_simple_generate_public_key,
  987|  23.2k|        0, /* keycopy */
  988|  23.2k|        0, /* keyfinish */
  989|  23.2k|        ossl_ecdh_simple_compute_key,
  990|  23.2k|        ossl_ecdsa_simple_sign_setup,
  991|  23.2k|        ossl_ecdsa_simple_sign_sig,
  992|  23.2k|        ossl_ecdsa_simple_verify_sig,
  993|  23.2k|        0, /* field_inverse_mod_ord */
  994|  23.2k|        0, /* blind_coordinates */
  995|  23.2k|        ec_GF2m_simple_ladder_pre,
  996|  23.2k|        ec_GF2m_simple_ladder_step,
  997|  23.2k|        ec_GF2m_simple_ladder_post
  998|  23.2k|    };
  999|       |
 1000|  23.2k|    return &ret;
 1001|  23.2k|}
ec2_smpl.c:ec_GF2m_simple_points_mul:
  873|    755|{
  874|    755|    int ret = 0;
  875|    755|    EC_POINT *t = NULL;
  876|       |
  877|       |    /*-
  878|       |     * We limit use of the ladder only to the following cases:
  879|       |     * - r := scalar * G
  880|       |     *   Fixed point mul: scalar != NULL && num == 0;
  881|       |     * - r := scalars[0] * points[0]
  882|       |     *   Variable point mul: scalar == NULL && num == 1;
  883|       |     * - r := scalar * G + scalars[0] * points[0]
  884|       |     *   used, e.g., in ECDSA verification: scalar != NULL && num == 1
  885|       |     *
  886|       |     * In any other case (num > 1) we use the default wNAF implementation.
  887|       |     *
  888|       |     * We also let the default implementation handle degenerate cases like group
  889|       |     * order or cofactor set to 0.
  890|       |     */
  891|    755|    if (num > 1 || BN_is_zero(group->order) || BN_is_zero(group->cofactor))
  ------------------
  |  Branch (891:9): [True: 0, False: 755]
  |  Branch (891:20): [True: 0, False: 755]
  |  Branch (891:48): [True: 0, False: 755]
  ------------------
  892|      0|        return ossl_ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
  893|       |
  894|    755|    if (scalar != NULL && num == 0)
  ------------------
  |  Branch (894:9): [True: 755, False: 0]
  |  Branch (894:27): [True: 755, False: 0]
  ------------------
  895|       |        /* Fixed point multiplication */
  896|    755|        return ossl_ec_scalar_mul_ladder(group, r, scalar, NULL, ctx);
  897|       |
  898|      0|    if (scalar == NULL && num == 1)
  ------------------
  |  Branch (898:9): [True: 0, False: 0]
  |  Branch (898:27): [True: 0, False: 0]
  ------------------
  899|       |        /* Variable point multiplication */
  900|      0|        return ossl_ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx);
  901|       |
  902|       |    /*-
  903|       |     * Double point multiplication:
  904|       |     *  r := scalar * G + scalars[0] * points[0]
  905|       |     */
  906|       |
  907|      0|    if ((t = EC_POINT_new(group)) == NULL) {
  ------------------
  |  Branch (907:9): [True: 0, False: 0]
  ------------------
  908|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  909|      0|        return 0;
  910|      0|    }
  911|       |
  912|      0|    if (!ossl_ec_scalar_mul_ladder(group, t, scalar, NULL, ctx)
  ------------------
  |  Branch (912:9): [True: 0, False: 0]
  ------------------
  913|      0|        || !ossl_ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx)
  ------------------
  |  Branch (913:12): [True: 0, False: 0]
  ------------------
  914|      0|        || !EC_POINT_add(group, r, t, r, ctx))
  ------------------
  |  Branch (914:12): [True: 0, False: 0]
  ------------------
  915|      0|        goto err;
  916|       |
  917|      0|    ret = 1;
  918|       |
  919|      0| err:
  920|      0|    EC_POINT_free(t);
  921|      0|    return ret;
  922|      0|}
ec2_smpl.c:ec_GF2m_simple_field_inv:
  931|    674|{
  932|    674|    int ret;
  933|       |
  934|    674|    if (!(ret = BN_GF2m_mod_inv(r, a, group->field, ctx)))
  ------------------
  |  Branch (934:9): [True: 0, False: 674]
  ------------------
  935|    674|        ERR_raise(ERR_LIB_EC, EC_R_CANNOT_INVERT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  936|    674|    return ret;
  937|    674|}
ec2_smpl.c:ec_GF2m_simple_ladder_pre:
  725|    755|{
  726|       |    /* if p is not affine, something is wrong */
  727|    755|    if (p->Z_is_one == 0)
  ------------------
  |  Branch (727:9): [True: 0, False: 755]
  ------------------
  728|      0|        return 0;
  729|       |
  730|       |    /* s blinding: make sure lambda (s->Z here) is not zero */
  731|    755|    do {
  732|    755|        if (!BN_priv_rand_ex(s->Z, BN_num_bits(group->field) - 1,
  ------------------
  |  Branch (732:13): [True: 0, False: 755]
  ------------------
  733|    755|                             BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY, 0, ctx)) {
  ------------------
  |  |   80|    755|#define BN_RAND_TOP_ANY    -1
  ------------------
                                           BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY, 0, ctx)) {
  ------------------
  |  |   85|    755|#define BN_RAND_BOTTOM_ANY  0
  ------------------
  734|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  735|      0|            return 0;
  736|      0|        }
  737|    755|    } while (BN_is_zero(s->Z));
  ------------------
  |  Branch (737:14): [True: 0, False: 755]
  ------------------
  738|       |
  739|       |    /* if field_encode defined convert between representations */
  740|    755|    if ((group->meth->field_encode != NULL
  ------------------
  |  Branch (740:10): [True: 0, False: 755]
  ------------------
  741|    755|         && !group->meth->field_encode(group, s->Z, s->Z, ctx))
  ------------------
  |  Branch (741:13): [True: 0, False: 0]
  ------------------
  742|    755|        || !group->meth->field_mul(group, s->X, p->X, s->Z, ctx))
  ------------------
  |  Branch (742:12): [True: 0, False: 755]
  ------------------
  743|      0|        return 0;
  744|       |
  745|       |    /* r blinding: make sure lambda (r->Y here for storage) is not zero */
  746|    755|    do {
  747|    755|        if (!BN_priv_rand_ex(r->Y, BN_num_bits(group->field) - 1,
  ------------------
  |  Branch (747:13): [True: 0, False: 755]
  ------------------
  748|    755|                             BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY, 0, ctx)) {
  ------------------
  |  |   80|    755|#define BN_RAND_TOP_ANY    -1
  ------------------
                                           BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY, 0, ctx)) {
  ------------------
  |  |   85|    755|#define BN_RAND_BOTTOM_ANY  0
  ------------------
  749|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  750|      0|            return 0;
  751|      0|        }
  752|    755|    } while (BN_is_zero(r->Y));
  ------------------
  |  Branch (752:14): [True: 0, False: 755]
  ------------------
  753|       |
  754|    755|    if ((group->meth->field_encode != NULL
  ------------------
  |  Branch (754:10): [True: 0, False: 755]
  ------------------
  755|    755|         && !group->meth->field_encode(group, r->Y, r->Y, ctx))
  ------------------
  |  Branch (755:13): [True: 0, False: 0]
  ------------------
  756|    755|        || !group->meth->field_sqr(group, r->Z, p->X, ctx)
  ------------------
  |  Branch (756:12): [True: 0, False: 755]
  ------------------
  757|    755|        || !group->meth->field_sqr(group, r->X, r->Z, ctx)
  ------------------
  |  Branch (757:12): [True: 0, False: 755]
  ------------------
  758|    755|        || !BN_GF2m_add(r->X, r->X, group->b)
  ------------------
  |  Branch (758:12): [True: 0, False: 755]
  ------------------
  759|    755|        || !group->meth->field_mul(group, r->Z, r->Z, r->Y, ctx)
  ------------------
  |  Branch (759:12): [True: 0, False: 755]
  ------------------
  760|    755|        || !group->meth->field_mul(group, r->X, r->X, r->Y, ctx))
  ------------------
  |  Branch (760:12): [True: 0, False: 755]
  ------------------
  761|      0|        return 0;
  762|       |
  763|    755|    s->Z_is_one = 0;
  764|    755|    r->Z_is_one = 0;
  765|       |
  766|    755|    return 1;
  767|    755|}
ec2_smpl.c:ec_GF2m_simple_ladder_step:
  778|   159k|{
  779|   159k|    if (!group->meth->field_mul(group, r->Y, r->Z, s->X, ctx)
  ------------------
  |  Branch (779:9): [True: 0, False: 159k]
  ------------------
  780|   159k|        || !group->meth->field_mul(group, s->X, r->X, s->Z, ctx)
  ------------------
  |  Branch (780:12): [True: 0, False: 159k]
  ------------------
  781|   159k|        || !group->meth->field_sqr(group, s->Y, r->Z, ctx)
  ------------------
  |  Branch (781:12): [True: 0, False: 159k]
  ------------------
  782|   159k|        || !group->meth->field_sqr(group, r->Z, r->X, ctx)
  ------------------
  |  Branch (782:12): [True: 0, False: 159k]
  ------------------
  783|   159k|        || !BN_GF2m_add(s->Z, r->Y, s->X)
  ------------------
  |  Branch (783:12): [True: 0, False: 159k]
  ------------------
  784|   159k|        || !group->meth->field_sqr(group, s->Z, s->Z, ctx)
  ------------------
  |  Branch (784:12): [True: 0, False: 159k]
  ------------------
  785|   159k|        || !group->meth->field_mul(group, s->X, r->Y, s->X, ctx)
  ------------------
  |  Branch (785:12): [True: 0, False: 159k]
  ------------------
  786|   159k|        || !group->meth->field_mul(group, r->Y, s->Z, p->X, ctx)
  ------------------
  |  Branch (786:12): [True: 0, False: 159k]
  ------------------
  787|   159k|        || !BN_GF2m_add(s->X, s->X, r->Y)
  ------------------
  |  Branch (787:12): [True: 0, False: 159k]
  ------------------
  788|   159k|        || !group->meth->field_sqr(group, r->Y, r->Z, ctx)
  ------------------
  |  Branch (788:12): [True: 0, False: 159k]
  ------------------
  789|   159k|        || !group->meth->field_mul(group, r->Z, r->Z, s->Y, ctx)
  ------------------
  |  Branch (789:12): [True: 0, False: 159k]
  ------------------
  790|   159k|        || !group->meth->field_sqr(group, s->Y, s->Y, ctx)
  ------------------
  |  Branch (790:12): [True: 0, False: 159k]
  ------------------
  791|   159k|        || !group->meth->field_mul(group, s->Y, s->Y, group->b, ctx)
  ------------------
  |  Branch (791:12): [True: 0, False: 159k]
  ------------------
  792|   159k|        || !BN_GF2m_add(r->X, r->Y, s->Y))
  ------------------
  |  Branch (792:12): [True: 0, False: 159k]
  ------------------
  793|      0|        return 0;
  794|       |
  795|   159k|    return 1;
  796|   159k|}
ec2_smpl.c:ec_GF2m_simple_ladder_post:
  808|    755|{
  809|    755|    int ret = 0;
  810|    755|    BIGNUM *t0, *t1, *t2 = NULL;
  811|       |
  812|    755|    if (BN_is_zero(r->Z))
  ------------------
  |  Branch (812:9): [True: 81, False: 674]
  ------------------
  813|     81|        return EC_POINT_set_to_infinity(group, r);
  814|       |
  815|    674|    if (BN_is_zero(s->Z)) {
  ------------------
  |  Branch (815:9): [True: 0, False: 674]
  ------------------
  816|      0|        if (!EC_POINT_copy(r, p)
  ------------------
  |  Branch (816:13): [True: 0, False: 0]
  ------------------
  817|      0|            || !EC_POINT_invert(group, r, ctx)) {
  ------------------
  |  Branch (817:16): [True: 0, False: 0]
  ------------------
  818|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  819|      0|            return 0;
  820|      0|        }
  821|      0|        return 1;
  822|      0|    }
  823|       |
  824|    674|    BN_CTX_start(ctx);
  825|    674|    t0 = BN_CTX_get(ctx);
  826|    674|    t1 = BN_CTX_get(ctx);
  827|    674|    t2 = BN_CTX_get(ctx);
  828|    674|    if (t2 == NULL) {
  ------------------
  |  Branch (828:9): [True: 0, False: 674]
  ------------------
  829|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  830|      0|        goto err;
  831|      0|    }
  832|       |
  833|    674|    if (!group->meth->field_mul(group, t0, r->Z, s->Z, ctx)
  ------------------
  |  Branch (833:9): [True: 0, False: 674]
  ------------------
  834|    674|        || !group->meth->field_mul(group, t1, p->X, r->Z, ctx)
  ------------------
  |  Branch (834:12): [True: 0, False: 674]
  ------------------
  835|    674|        || !BN_GF2m_add(t1, r->X, t1)
  ------------------
  |  Branch (835:12): [True: 0, False: 674]
  ------------------
  836|    674|        || !group->meth->field_mul(group, t2, p->X, s->Z, ctx)
  ------------------
  |  Branch (836:12): [True: 0, False: 674]
  ------------------
  837|    674|        || !group->meth->field_mul(group, r->Z, r->X, t2, ctx)
  ------------------
  |  Branch (837:12): [True: 0, False: 674]
  ------------------
  838|    674|        || !BN_GF2m_add(t2, t2, s->X)
  ------------------
  |  Branch (838:12): [True: 0, False: 674]
  ------------------
  839|    674|        || !group->meth->field_mul(group, t1, t1, t2, ctx)
  ------------------
  |  Branch (839:12): [True: 0, False: 674]
  ------------------
  840|    674|        || !group->meth->field_sqr(group, t2, p->X, ctx)
  ------------------
  |  Branch (840:12): [True: 0, False: 674]
  ------------------
  841|    674|        || !BN_GF2m_add(t2, p->Y, t2)
  ------------------
  |  Branch (841:12): [True: 0, False: 674]
  ------------------
  842|    674|        || !group->meth->field_mul(group, t2, t2, t0, ctx)
  ------------------
  |  Branch (842:12): [True: 0, False: 674]
  ------------------
  843|    674|        || !BN_GF2m_add(t1, t2, t1)
  ------------------
  |  Branch (843:12): [True: 0, False: 674]
  ------------------
  844|    674|        || !group->meth->field_mul(group, t2, p->X, t0, ctx)
  ------------------
  |  Branch (844:12): [True: 0, False: 674]
  ------------------
  845|    674|        || !group->meth->field_inv(group, t2, t2, ctx)
  ------------------
  |  Branch (845:12): [True: 0, False: 674]
  ------------------
  846|    674|        || !group->meth->field_mul(group, t1, t1, t2, ctx)
  ------------------
  |  Branch (846:12): [True: 0, False: 674]
  ------------------
  847|    674|        || !group->meth->field_mul(group, r->X, r->Z, t2, ctx)
  ------------------
  |  Branch (847:12): [True: 0, False: 674]
  ------------------
  848|    674|        || !BN_GF2m_add(t2, p->X, r->X)
  ------------------
  |  Branch (848:12): [True: 0, False: 674]
  ------------------
  849|    674|        || !group->meth->field_mul(group, t2, t2, t1, ctx)
  ------------------
  |  Branch (849:12): [True: 0, False: 674]
  ------------------
  850|    674|        || !BN_GF2m_add(r->Y, p->Y, t2)
  ------------------
  |  Branch (850:12): [True: 0, False: 674]
  ------------------
  851|    674|        || !BN_one(r->Z))
  ------------------
  |  |  197|    674|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (851:12): [True: 0, False: 674]
  ------------------
  852|      0|        goto err;
  853|       |
  854|    674|    r->Z_is_one = 1;
  855|       |
  856|       |    /* GF(2^m) field elements should always have BIGNUM::neg = 0 */
  857|    674|    BN_set_negative(r->X, 0);
  858|    674|    BN_set_negative(r->Y, 0);
  859|       |
  860|    674|    ret = 1;
  861|       |
  862|    674| err:
  863|    674|    BN_CTX_end(ctx);
  864|    674|    return ret;
  865|    674|}

EC_KEY_print:
  711|    777|{
  712|    777|    int private = EC_KEY_get0_private_key(x) != NULL;
  713|       |
  714|    777|    return do_EC_KEY_print(bp, x, off,
  715|    777|                private ? EC_KEY_PRINT_PRIVATE : EC_KEY_PRINT_PUBLIC);
  ------------------
  |  Branch (715:17): [True: 777, False: 0]
  ------------------
  716|    777|}
ECParameters_print:
  719|     99|{
  720|     99|    return do_EC_KEY_print(bp, x, 4, EC_KEY_PRINT_PARAM);
  721|     99|}
ec_ameth.c:eckey_pub_decode:
  101|  23.5k|{
  102|  23.5k|    const unsigned char *p = NULL;
  103|  23.5k|    int pklen;
  104|  23.5k|    EC_KEY *eckey = NULL;
  105|  23.5k|    X509_ALGOR *palg;
  106|  23.5k|    OSSL_LIB_CTX *libctx = NULL;
  107|  23.5k|    const char *propq = NULL;
  108|       |
  109|  23.5k|    if (!ossl_x509_PUBKEY_get0_libctx(&libctx, &propq, pubkey)
  ------------------
  |  Branch (109:9): [True: 0, False: 23.5k]
  ------------------
  110|  23.5k|        || !X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey))
  ------------------
  |  Branch (110:12): [True: 0, False: 23.5k]
  ------------------
  111|      0|        return 0;
  112|  23.5k|    eckey = ossl_ec_key_param_from_x509_algor(palg, libctx, propq);
  113|       |
  114|  23.5k|    if (!eckey)
  ------------------
  |  Branch (114:9): [True: 619, False: 22.9k]
  ------------------
  115|    619|        return 0;
  116|       |
  117|       |    /* We have parameters now set public key */
  118|  22.9k|    if (!o2i_ECPublicKey(&eckey, &p, pklen)) {
  ------------------
  |  Branch (118:9): [True: 16.1k, False: 6.77k]
  ------------------
  119|  16.1k|        ERR_raise(ERR_LIB_EC, EC_R_DECODE_ERROR);
  ------------------
  |  |  401|  16.1k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  16.1k|    (ERR_new(),                                                 \
  |  |  |  |  404|  16.1k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  16.1k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  16.1k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  16.1k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  16.1k|     ERR_set_error)
  |  |  ------------------
  ------------------
  120|  16.1k|        goto ecerr;
  121|  16.1k|    }
  122|       |
  123|  6.77k|    EVP_PKEY_assign_EC_KEY(pkey, eckey);
  ------------------
  |  |  538|  6.77k|        EVP_PKEY_assign((pkey), EVP_PKEY_EC, (eckey))
  |  |  ------------------
  |  |  |  |   73|  6.77k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  6.77k|#define NID_X9_62_id_ecPublicKey                408
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  124|  6.77k|    return 1;
  125|       |
  126|  16.1k| ecerr:
  127|  16.1k|    EC_KEY_free(eckey);
  128|  16.1k|    return 0;
  129|  22.9k|}
ec_ameth.c:eckey_priv_print:
  376|      9|{
  377|      9|    return do_EC_KEY_print(bp, pkey->pkey.ec, indent, EC_KEY_PRINT_PRIVATE);
  378|      9|}
ec_ameth.c:int_ec_free:
  273|  24.0k|{
  274|  24.0k|    EC_KEY_free(pkey->pkey.ec);
  275|  24.0k|}
ec_ameth.c:old_ec_priv_decode:
  382|    467|{
  383|    467|    EC_KEY *ec;
  384|       |
  385|    467|    if ((ec = d2i_ECPrivateKey(NULL, pder, derlen)) == NULL)
  ------------------
  |  Branch (385:9): [True: 460, False: 7]
  ------------------
  386|    460|        return 0;
  387|      7|    EVP_PKEY_assign_EC_KEY(pkey, ec);
  ------------------
  |  |  538|      7|        EVP_PKEY_assign((pkey), EVP_PKEY_EC, (eckey))
  |  |  ------------------
  |  |  |  |   73|      7|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|      7|#define NID_X9_62_id_ecPublicKey                408
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  388|      7|    return 1;
  389|    467|}
ec_ameth.c:old_ec_priv_encode:
  392|      9|{
  393|      9|    return i2d_ECPrivateKey(pkey->pkey.ec, pder);
  394|      9|}
ec_ameth.c:eckey_priv_decode_ex:
  150|     33|{
  151|     33|    int ret = 0;
  152|     33|    EC_KEY *eckey = ossl_ec_key_from_pkcs8(p8, libctx, propq);
  153|       |
  154|     33|    if (eckey != NULL) {
  ------------------
  |  Branch (154:9): [True: 2, False: 31]
  ------------------
  155|      2|        ret = 1;
  156|      2|        EVP_PKEY_assign_EC_KEY(pkey, eckey);
  ------------------
  |  |  538|      2|        EVP_PKEY_assign((pkey), EVP_PKEY_EC, (eckey))
  |  |  ------------------
  |  |  |  |   73|      2|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|      2|#define NID_X9_62_id_ecPublicKey                408
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  157|      2|    }
  158|       |
  159|     33|    return ret;
  160|     33|}
ec_ameth.c:do_EC_KEY_print:
  284|    885|{
  285|    885|    const char *ecstr;
  286|    885|    unsigned char *priv = NULL, *pub = NULL;
  287|    885|    size_t privlen = 0, publen = 0;
  288|    885|    int ret = 0;
  289|    885|    const EC_GROUP *group;
  290|       |
  291|    885|    if (x == NULL || (group = EC_KEY_get0_group(x)) == NULL) {
  ------------------
  |  Branch (291:9): [True: 0, False: 885]
  |  Branch (291:22): [True: 0, False: 885]
  ------------------
  292|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  293|      0|        return 0;
  294|      0|    }
  295|       |
  296|    885|    if (ktype != EC_KEY_PRINT_PARAM && EC_KEY_get0_public_key(x) != NULL) {
  ------------------
  |  Branch (296:9): [True: 786, False: 99]
  |  Branch (296:40): [True: 786, False: 0]
  ------------------
  297|    786|        publen = EC_KEY_key2buf(x, EC_KEY_get_conv_form(x), &pub, NULL);
  298|    786|        if (publen == 0)
  ------------------
  |  Branch (298:13): [True: 14, False: 772]
  ------------------
  299|     14|            goto err;
  300|    786|    }
  301|       |
  302|    871|    if (ktype == EC_KEY_PRINT_PRIVATE && EC_KEY_get0_private_key(x) != NULL) {
  ------------------
  |  Branch (302:9): [True: 772, False: 99]
  |  Branch (302:42): [True: 772, False: 0]
  ------------------
  303|    772|        privlen = EC_KEY_priv2buf(x, &priv);
  304|    772|        if (privlen == 0)
  ------------------
  |  Branch (304:13): [True: 188, False: 584]
  ------------------
  305|    188|            goto err;
  306|    772|    }
  307|       |
  308|    683|    if (ktype == EC_KEY_PRINT_PRIVATE)
  ------------------
  |  Branch (308:9): [True: 584, False: 99]
  ------------------
  309|    584|        ecstr = "Private-Key";
  310|     99|    else if (ktype == EC_KEY_PRINT_PUBLIC)
  ------------------
  |  Branch (310:14): [True: 0, False: 99]
  ------------------
  311|      0|        ecstr = "Public-Key";
  312|     99|    else
  313|     99|        ecstr = "ECDSA-Parameters";
  314|       |
  315|    683|    if (!BIO_indent(bp, off, 128))
  ------------------
  |  Branch (315:9): [True: 0, False: 683]
  ------------------
  316|      0|        goto err;
  317|    683|    if (BIO_printf(bp, "%s: (%d bit)\n", ecstr,
  ------------------
  |  Branch (317:9): [True: 0, False: 683]
  ------------------
  318|    683|                   EC_GROUP_order_bits(group)) <= 0)
  319|      0|        goto err;
  320|       |
  321|    683|    if (privlen != 0) {
  ------------------
  |  Branch (321:9): [True: 584, False: 99]
  ------------------
  322|    584|        if (BIO_printf(bp, "%*spriv:\n", off, "") <= 0)
  ------------------
  |  Branch (322:13): [True: 0, False: 584]
  ------------------
  323|      0|            goto err;
  324|    584|        if (ASN1_buf_print(bp, priv, privlen, off + 4) == 0)
  ------------------
  |  Branch (324:13): [True: 0, False: 584]
  ------------------
  325|      0|            goto err;
  326|    584|    }
  327|       |
  328|    683|    if (publen != 0) {
  ------------------
  |  Branch (328:9): [True: 584, False: 99]
  ------------------
  329|    584|        if (BIO_printf(bp, "%*spub:\n", off, "") <= 0)
  ------------------
  |  Branch (329:13): [True: 0, False: 584]
  ------------------
  330|      0|            goto err;
  331|    584|        if (ASN1_buf_print(bp, pub, publen, off + 4) == 0)
  ------------------
  |  Branch (331:13): [True: 0, False: 584]
  ------------------
  332|      0|            goto err;
  333|    584|    }
  334|       |
  335|    683|    if (!ECPKParameters_print(bp, group, off))
  ------------------
  |  Branch (335:9): [True: 0, False: 683]
  ------------------
  336|      0|        goto err;
  337|    683|    ret = 1;
  338|    885| err:
  339|    885|    if (!ret)
  ------------------
  |  Branch (339:9): [True: 202, False: 683]
  ------------------
  340|    885|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|    202|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    202|    (ERR_new(),                                                 \
  |  |  |  |  404|    202|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    202|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    202|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    202|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    202|     ERR_set_error)
  |  |  ------------------
  ------------------
  341|    885|    OPENSSL_clear_free(priv, privlen);
  ------------------
  |  |  113|    885|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    885|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    885|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  342|    885|    OPENSSL_free(pub);
  ------------------
  |  |  115|    885|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    885|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    885|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  343|    885|    return ret;
  344|    683|}

EC_GROUP_get_ecparameters:
  383|    269|{
  384|    269|    size_t len = 0;
  385|    269|    ECPARAMETERS *ret = NULL;
  386|    269|    const BIGNUM *tmp;
  387|    269|    unsigned char *buffer = NULL;
  388|    269|    const EC_POINT *point = NULL;
  389|    269|    point_conversion_form_t form;
  390|    269|    ASN1_INTEGER *orig;
  391|       |
  392|    269|    if (params == NULL) {
  ------------------
  |  Branch (392:9): [True: 269, False: 0]
  ------------------
  393|    269|        if ((ret = ECPARAMETERS_new()) == NULL) {
  ------------------
  |  Branch (393:13): [True: 0, False: 269]
  ------------------
  394|      0|            ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  395|      0|            goto err;
  396|      0|        }
  397|    269|    } else
  398|      0|        ret = params;
  399|       |
  400|       |    /* set the version (always one) */
  401|    269|    ret->version = (long)0x1;
  402|       |
  403|       |    /* set the fieldID */
  404|    269|    if (!ec_asn1_group2fieldid(group, ret->fieldID)) {
  ------------------
  |  Branch (404:9): [True: 0, False: 269]
  ------------------
  405|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  406|      0|        goto err;
  407|      0|    }
  408|       |
  409|       |    /* set the curve */
  410|    269|    if (!ec_asn1_group2curve(group, ret->curve)) {
  ------------------
  |  Branch (410:9): [True: 0, False: 269]
  ------------------
  411|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  412|      0|        goto err;
  413|      0|    }
  414|       |
  415|       |    /* set the base point */
  416|    269|    if ((point = EC_GROUP_get0_generator(group)) == NULL) {
  ------------------
  |  Branch (416:9): [True: 0, False: 269]
  ------------------
  417|      0|        ERR_raise(ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  418|      0|        goto err;
  419|      0|    }
  420|       |
  421|    269|    form = EC_GROUP_get_point_conversion_form(group);
  422|       |
  423|    269|    len = EC_POINT_point2buf(group, point, form, &buffer, NULL);
  424|    269|    if (len == 0) {
  ------------------
  |  Branch (424:9): [True: 0, False: 269]
  ------------------
  425|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  426|      0|        goto err;
  427|      0|    }
  428|    269|    if (ret->base == NULL && (ret->base = ASN1_OCTET_STRING_new()) == NULL) {
  ------------------
  |  Branch (428:9): [True: 0, False: 269]
  |  Branch (428:30): [True: 0, False: 0]
  ------------------
  429|      0|        OPENSSL_free(buffer);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  430|      0|        ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  431|      0|        goto err;
  432|      0|    }
  433|    269|    ASN1_STRING_set0(ret->base, buffer, len);
  434|       |
  435|       |    /* set the order */
  436|    269|    tmp = EC_GROUP_get0_order(group);
  437|    269|    if (tmp == NULL) {
  ------------------
  |  Branch (437:9): [True: 0, False: 269]
  ------------------
  438|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  439|      0|        goto err;
  440|      0|    }
  441|    269|    ret->order = BN_to_ASN1_INTEGER(tmp, orig = ret->order);
  442|    269|    if (ret->order == NULL) {
  ------------------
  |  Branch (442:9): [True: 0, False: 269]
  ------------------
  443|      0|        ret->order = orig;
  444|      0|        ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  445|      0|        goto err;
  446|      0|    }
  447|       |
  448|       |    /* set the cofactor (optional) */
  449|    269|    tmp = EC_GROUP_get0_cofactor(group);
  450|    269|    if (tmp != NULL) {
  ------------------
  |  Branch (450:9): [True: 269, False: 0]
  ------------------
  451|    269|        ret->cofactor = BN_to_ASN1_INTEGER(tmp, orig = ret->cofactor);
  452|    269|        if (ret->cofactor == NULL) {
  ------------------
  |  Branch (452:13): [True: 0, False: 269]
  ------------------
  453|      0|            ret->cofactor = orig;
  454|      0|            ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  455|      0|            goto err;
  456|      0|        }
  457|    269|    }
  458|       |
  459|    269|    return ret;
  460|       |
  461|      0| err:
  462|      0|    if (params == NULL)
  ------------------
  |  Branch (462:9): [True: 0, False: 0]
  ------------------
  463|      0|        ECPARAMETERS_free(ret);
  464|      0|    return NULL;
  465|    269|}
EC_GROUP_get_ecpkparameters:
  469|  1.36k|{
  470|  1.36k|    int ok = 1, tmp;
  471|  1.36k|    ECPKPARAMETERS *ret = params;
  472|       |
  473|  1.36k|    if (ret == NULL) {
  ------------------
  |  Branch (473:9): [True: 1.36k, False: 0]
  ------------------
  474|  1.36k|        if ((ret = ECPKPARAMETERS_new()) == NULL) {
  ------------------
  |  Branch (474:13): [True: 0, False: 1.36k]
  ------------------
  475|      0|            ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  476|      0|            return NULL;
  477|      0|        }
  478|  1.36k|    } else {
  479|      0|        if (ret->type == ECPKPARAMETERS_TYPE_NAMED)
  ------------------
  |  Branch (479:13): [True: 0, False: 0]
  ------------------
  480|      0|            ASN1_OBJECT_free(ret->value.named_curve);
  481|      0|        else if (ret->type == ECPKPARAMETERS_TYPE_EXPLICIT
  ------------------
  |  Branch (481:18): [True: 0, False: 0]
  ------------------
  482|      0|                 && ret->value.parameters != NULL)
  ------------------
  |  Branch (482:21): [True: 0, False: 0]
  ------------------
  483|      0|            ECPARAMETERS_free(ret->value.parameters);
  484|      0|    }
  485|       |
  486|  1.36k|    if (EC_GROUP_get_asn1_flag(group) == OPENSSL_EC_NAMED_CURVE) {
  ------------------
  |  |   31|  1.36k|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  |  Branch (486:9): [True: 1.10k, False: 269]
  ------------------
  487|       |        /*
  488|       |         * use the asn1 OID to describe the elliptic curve parameters
  489|       |         */
  490|  1.10k|        tmp = EC_GROUP_get_curve_name(group);
  491|  1.10k|        if (tmp) {
  ------------------
  |  Branch (491:13): [True: 1.10k, False: 0]
  ------------------
  492|  1.10k|            ASN1_OBJECT *asn1obj = OBJ_nid2obj(tmp);
  493|       |
  494|  1.10k|            if (asn1obj == NULL || OBJ_length(asn1obj) == 0) {
  ------------------
  |  Branch (494:17): [True: 0, False: 1.10k]
  |  Branch (494:36): [True: 0, False: 1.10k]
  ------------------
  495|      0|                ASN1_OBJECT_free(asn1obj);
  496|      0|                ERR_raise(ERR_LIB_EC, EC_R_MISSING_OID);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  497|      0|                ok = 0;
  498|  1.10k|            } else {
  499|  1.10k|                ret->type = ECPKPARAMETERS_TYPE_NAMED;
  500|  1.10k|                ret->value.named_curve = asn1obj;
  501|  1.10k|            }
  502|  1.10k|        } else
  503|       |            /* we don't know the nid => ERROR */
  504|      0|            ok = 0;
  505|  1.10k|    } else {
  506|       |        /* use the ECPARAMETERS structure */
  507|    269|        ret->type = ECPKPARAMETERS_TYPE_EXPLICIT;
  508|    269|        if ((ret->value.parameters =
  ------------------
  |  Branch (508:13): [True: 0, False: 269]
  ------------------
  509|    269|             EC_GROUP_get_ecparameters(group, NULL)) == NULL)
  510|      0|            ok = 0;
  511|    269|    }
  512|       |
  513|  1.36k|    if (!ok) {
  ------------------
  |  Branch (513:9): [True: 0, False: 1.36k]
  ------------------
  514|      0|        ECPKPARAMETERS_free(ret);
  515|      0|        return NULL;
  516|      0|    }
  517|  1.36k|    return ret;
  518|  1.36k|}
EC_GROUP_new_from_ecparameters:
  521|  1.17k|{
  522|  1.17k|    int ok = 0, tmp;
  523|  1.17k|    EC_GROUP *ret = NULL, *dup = NULL;
  524|  1.17k|    BIGNUM *p = NULL, *a = NULL, *b = NULL;
  525|  1.17k|    EC_POINT *point = NULL;
  526|  1.17k|    long field_bits;
  527|  1.17k|    int curve_name = NID_undef;
  ------------------
  |  |   18|  1.17k|#define NID_undef                       0
  ------------------
  528|  1.17k|    BN_CTX *ctx = NULL;
  529|       |
  530|  1.17k|    if (params->fieldID == NULL
  ------------------
  |  Branch (530:9): [True: 0, False: 1.17k]
  ------------------
  531|  1.17k|            || params->fieldID->fieldType == NULL
  ------------------
  |  Branch (531:16): [True: 0, False: 1.17k]
  ------------------
  532|  1.17k|            || params->fieldID->p.ptr == NULL) {
  ------------------
  |  Branch (532:16): [True: 0, False: 1.17k]
  ------------------
  533|      0|        ERR_raise(ERR_LIB_EC, EC_R_ASN1_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  534|      0|        goto err;
  535|      0|    }
  536|       |
  537|       |    /*
  538|       |     * Now extract the curve parameters a and b. Note that, although SEC 1
  539|       |     * specifies the length of their encodings, historical versions of OpenSSL
  540|       |     * encoded them incorrectly, so we must accept any length for backwards
  541|       |     * compatibility.
  542|       |     */
  543|  1.17k|    if (params->curve == NULL
  ------------------
  |  Branch (543:9): [True: 0, False: 1.17k]
  ------------------
  544|  1.17k|            || params->curve->a == NULL || params->curve->a->data == NULL
  ------------------
  |  Branch (544:16): [True: 0, False: 1.17k]
  |  Branch (544:44): [True: 0, False: 1.17k]
  ------------------
  545|  1.17k|            || params->curve->b == NULL || params->curve->b->data == NULL) {
  ------------------
  |  Branch (545:16): [True: 0, False: 1.17k]
  |  Branch (545:44): [True: 0, False: 1.17k]
  ------------------
  546|      0|        ERR_raise(ERR_LIB_EC, EC_R_ASN1_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  547|      0|        goto err;
  548|      0|    }
  549|  1.17k|    a = BN_bin2bn(params->curve->a->data, params->curve->a->length, NULL);
  550|  1.17k|    if (a == NULL) {
  ------------------
  |  Branch (550:9): [True: 0, False: 1.17k]
  ------------------
  551|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  552|      0|        goto err;
  553|      0|    }
  554|  1.17k|    b = BN_bin2bn(params->curve->b->data, params->curve->b->length, NULL);
  555|  1.17k|    if (b == NULL) {
  ------------------
  |  Branch (555:9): [True: 0, False: 1.17k]
  ------------------
  556|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  557|      0|        goto err;
  558|      0|    }
  559|       |
  560|       |    /* get the field parameters */
  561|  1.17k|    tmp = OBJ_obj2nid(params->fieldID->fieldType);
  562|  1.17k|    if (tmp == NID_X9_62_characteristic_two_field)
  ------------------
  |  |  156|  1.17k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (562:9): [True: 0, False: 1.17k]
  ------------------
  563|       |#ifdef OPENSSL_NO_EC2M
  564|       |    {
  565|       |        ERR_raise(ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED);
  566|       |        goto err;
  567|       |    }
  568|       |#else
  569|      0|    {
  570|      0|        X9_62_CHARACTERISTIC_TWO *char_two;
  571|       |
  572|      0|        char_two = params->fieldID->p.char_two;
  573|       |
  574|      0|        field_bits = char_two->m;
  575|      0|        if (field_bits > OPENSSL_ECC_MAX_FIELD_BITS) {
  ------------------
  |  |  103|      0|#   define OPENSSL_ECC_MAX_FIELD_BITS 661
  ------------------
  |  Branch (575:13): [True: 0, False: 0]
  ------------------
  576|      0|            ERR_raise(ERR_LIB_EC, EC_R_FIELD_TOO_LARGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  577|      0|            goto err;
  578|      0|        }
  579|       |
  580|      0|        if ((p = BN_new()) == NULL) {
  ------------------
  |  Branch (580:13): [True: 0, False: 0]
  ------------------
  581|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  582|      0|            goto err;
  583|      0|        }
  584|       |
  585|       |        /* get the base type */
  586|      0|        tmp = OBJ_obj2nid(char_two->type);
  587|       |
  588|      0|        if (tmp == NID_X9_62_tpBasis) {
  ------------------
  |  |  168|      0|#define NID_X9_62_tpBasis               682
  ------------------
  |  Branch (588:13): [True: 0, False: 0]
  ------------------
  589|      0|            long tmp_long;
  590|       |
  591|      0|            if (!char_two->p.tpBasis) {
  ------------------
  |  Branch (591:17): [True: 0, False: 0]
  ------------------
  592|      0|                ERR_raise(ERR_LIB_EC, EC_R_ASN1_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  593|      0|                goto err;
  594|      0|            }
  595|       |
  596|      0|            tmp_long = ASN1_INTEGER_get(char_two->p.tpBasis);
  597|       |
  598|      0|            if (!(char_two->m > tmp_long && tmp_long > 0)) {
  ------------------
  |  Branch (598:19): [True: 0, False: 0]
  |  Branch (598:45): [True: 0, False: 0]
  ------------------
  599|      0|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_TRINOMIAL_BASIS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  600|      0|                goto err;
  601|      0|            }
  602|       |
  603|       |            /* create the polynomial */
  604|      0|            if (!BN_set_bit(p, (int)char_two->m))
  ------------------
  |  Branch (604:17): [True: 0, False: 0]
  ------------------
  605|      0|                goto err;
  606|      0|            if (!BN_set_bit(p, (int)tmp_long))
  ------------------
  |  Branch (606:17): [True: 0, False: 0]
  ------------------
  607|      0|                goto err;
  608|      0|            if (!BN_set_bit(p, 0))
  ------------------
  |  Branch (608:17): [True: 0, False: 0]
  ------------------
  609|      0|                goto err;
  610|      0|        } else if (tmp == NID_X9_62_ppBasis) {
  ------------------
  |  |  172|      0|#define NID_X9_62_ppBasis               683
  ------------------
  |  Branch (610:20): [True: 0, False: 0]
  ------------------
  611|      0|            X9_62_PENTANOMIAL *penta;
  612|       |
  613|      0|            penta = char_two->p.ppBasis;
  614|      0|            if (penta == NULL) {
  ------------------
  |  Branch (614:17): [True: 0, False: 0]
  ------------------
  615|      0|                ERR_raise(ERR_LIB_EC, EC_R_ASN1_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  616|      0|                goto err;
  617|      0|            }
  618|       |
  619|      0|            if (!
  620|      0|                (char_two->m > penta->k3 && penta->k3 > penta->k2
  ------------------
  |  Branch (620:18): [True: 0, False: 0]
  |  Branch (620:45): [True: 0, False: 0]
  ------------------
  621|      0|                 && penta->k2 > penta->k1 && penta->k1 > 0)) {
  ------------------
  |  Branch (621:21): [True: 0, False: 0]
  |  Branch (621:46): [True: 0, False: 0]
  ------------------
  622|      0|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_PENTANOMIAL_BASIS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  623|      0|                goto err;
  624|      0|            }
  625|       |
  626|       |            /* create the polynomial */
  627|      0|            if (!BN_set_bit(p, (int)char_two->m))
  ------------------
  |  Branch (627:17): [True: 0, False: 0]
  ------------------
  628|      0|                goto err;
  629|      0|            if (!BN_set_bit(p, (int)penta->k1))
  ------------------
  |  Branch (629:17): [True: 0, False: 0]
  ------------------
  630|      0|                goto err;
  631|      0|            if (!BN_set_bit(p, (int)penta->k2))
  ------------------
  |  Branch (631:17): [True: 0, False: 0]
  ------------------
  632|      0|                goto err;
  633|      0|            if (!BN_set_bit(p, (int)penta->k3))
  ------------------
  |  Branch (633:17): [True: 0, False: 0]
  ------------------
  634|      0|                goto err;
  635|      0|            if (!BN_set_bit(p, 0))
  ------------------
  |  Branch (635:17): [True: 0, False: 0]
  ------------------
  636|      0|                goto err;
  637|      0|        } else if (tmp == NID_X9_62_onBasis) {
  ------------------
  |  |  164|      0|#define NID_X9_62_onBasis               681
  ------------------
  |  Branch (637:20): [True: 0, False: 0]
  ------------------
  638|      0|            ERR_raise(ERR_LIB_EC, EC_R_NOT_IMPLEMENTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  639|      0|            goto err;
  640|      0|        } else {                /* error */
  641|       |
  642|      0|            ERR_raise(ERR_LIB_EC, EC_R_ASN1_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  643|      0|            goto err;
  644|      0|        }
  645|       |
  646|       |        /* create the EC_GROUP structure */
  647|      0|        ret = EC_GROUP_new_curve_GF2m(p, a, b, NULL);
  648|      0|    }
  649|  1.17k|#endif
  650|  1.17k|    else if (tmp == NID_X9_62_prime_field) {
  ------------------
  |  |  152|  1.17k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (650:14): [True: 1.15k, False: 22]
  ------------------
  651|       |        /* we have a curve over a prime field */
  652|       |        /* extract the prime number */
  653|  1.15k|        if (params->fieldID->p.prime == NULL) {
  ------------------
  |  Branch (653:13): [True: 0, False: 1.15k]
  ------------------
  654|      0|            ERR_raise(ERR_LIB_EC, EC_R_ASN1_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  655|      0|            goto err;
  656|      0|        }
  657|  1.15k|        p = ASN1_INTEGER_to_BN(params->fieldID->p.prime, NULL);
  658|  1.15k|        if (p == NULL) {
  ------------------
  |  Branch (658:13): [True: 0, False: 1.15k]
  ------------------
  659|      0|            ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  660|      0|            goto err;
  661|      0|        }
  662|       |
  663|  1.15k|        if (BN_is_negative(p) || BN_is_zero(p)) {
  ------------------
  |  Branch (663:13): [True: 10, False: 1.14k]
  |  Branch (663:34): [True: 5, False: 1.14k]
  ------------------
  664|     15|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_FIELD);
  ------------------
  |  |  401|     15|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     15|    (ERR_new(),                                                 \
  |  |  |  |  404|     15|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     15|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     15|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     15|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     15|     ERR_set_error)
  |  |  ------------------
  ------------------
  665|     15|            goto err;
  666|     15|        }
  667|       |
  668|  1.14k|        field_bits = BN_num_bits(p);
  669|  1.14k|        if (field_bits > OPENSSL_ECC_MAX_FIELD_BITS) {
  ------------------
  |  |  103|  1.14k|#   define OPENSSL_ECC_MAX_FIELD_BITS 661
  ------------------
  |  Branch (669:13): [True: 0, False: 1.14k]
  ------------------
  670|      0|            ERR_raise(ERR_LIB_EC, EC_R_FIELD_TOO_LARGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  671|      0|            goto err;
  672|      0|        }
  673|       |
  674|       |        /* create the EC_GROUP structure */
  675|  1.14k|        ret = EC_GROUP_new_curve_GFp(p, a, b, NULL);
  676|  1.14k|    } else {
  677|     22|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_FIELD);
  ------------------
  |  |  401|     22|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     22|    (ERR_new(),                                                 \
  |  |  |  |  404|     22|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     22|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     22|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     22|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     22|     ERR_set_error)
  |  |  ------------------
  ------------------
  678|     22|        goto err;
  679|     22|    }
  680|       |
  681|  1.14k|    if (ret == NULL) {
  ------------------
  |  Branch (681:9): [True: 196, False: 945]
  ------------------
  682|    196|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|    196|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    196|    (ERR_new(),                                                 \
  |  |  |  |  404|    196|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    196|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    196|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    196|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    196|     ERR_set_error)
  |  |  ------------------
  ------------------
  683|    196|        goto err;
  684|    196|    }
  685|       |
  686|       |    /* extract seed (optional) */
  687|    945|    if (params->curve->seed != NULL) {
  ------------------
  |  Branch (687:9): [True: 329, False: 616]
  ------------------
  688|       |        /*
  689|       |         * This happens for instance with
  690|       |         * fuzz/corpora/asn1/65cf44e85614c62f10cf3b7a7184c26293a19e4a
  691|       |         * and causes the OPENSSL_malloc below to choke on the
  692|       |         * zero length allocation request.
  693|       |         */
  694|    329|        if (params->curve->seed->length == 0) {
  ------------------
  |  Branch (694:13): [True: 5, False: 324]
  ------------------
  695|      5|            ERR_raise(ERR_LIB_EC, EC_R_ASN1_ERROR);
  ------------------
  |  |  401|      5|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      5|    (ERR_new(),                                                 \
  |  |  |  |  404|      5|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      5|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      5|     ERR_set_error)
  |  |  ------------------
  ------------------
  696|      5|            goto err;
  697|      5|        }
  698|    324|        OPENSSL_free(ret->seed);
  ------------------
  |  |  115|    324|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    324|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    324|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  699|    324|        if ((ret->seed = OPENSSL_malloc(params->curve->seed->length)) == NULL)
  ------------------
  |  |  102|    324|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    324|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    324|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (699:13): [True: 0, False: 324]
  ------------------
  700|      0|            goto err;
  701|    324|        memcpy(ret->seed, params->curve->seed->data,
  702|    324|               params->curve->seed->length);
  703|    324|        ret->seed_len = params->curve->seed->length;
  704|    324|    }
  705|       |
  706|    940|    if (params->order == NULL
  ------------------
  |  Branch (706:9): [True: 0, False: 940]
  ------------------
  707|    940|            || params->base == NULL
  ------------------
  |  Branch (707:16): [True: 0, False: 940]
  ------------------
  708|    940|            || params->base->data == NULL
  ------------------
  |  Branch (708:16): [True: 0, False: 940]
  ------------------
  709|    940|            || params->base->length == 0) {
  ------------------
  |  Branch (709:16): [True: 16, False: 924]
  ------------------
  710|     16|        ERR_raise(ERR_LIB_EC, EC_R_ASN1_ERROR);
  ------------------
  |  |  401|     16|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     16|    (ERR_new(),                                                 \
  |  |  |  |  404|     16|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     16|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     16|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     16|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     16|     ERR_set_error)
  |  |  ------------------
  ------------------
  711|     16|        goto err;
  712|     16|    }
  713|       |
  714|    924|    if ((point = EC_POINT_new(ret)) == NULL)
  ------------------
  |  Branch (714:9): [True: 0, False: 924]
  ------------------
  715|      0|        goto err;
  716|       |
  717|       |    /* set the point conversion form */
  718|    924|    EC_GROUP_set_point_conversion_form(ret, (point_conversion_form_t)
  719|    924|                                       (params->base->data[0] & ~0x01));
  720|       |
  721|       |    /* extract the ec point */
  722|    924|    if (!EC_POINT_oct2point(ret, point, params->base->data,
  ------------------
  |  Branch (722:9): [True: 283, False: 641]
  ------------------
  723|    924|                            params->base->length, NULL)) {
  724|    283|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|    283|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    283|    (ERR_new(),                                                 \
  |  |  |  |  404|    283|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    283|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    283|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    283|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    283|     ERR_set_error)
  |  |  ------------------
  ------------------
  725|    283|        goto err;
  726|    283|    }
  727|       |
  728|       |    /* extract the order */
  729|    641|    if (ASN1_INTEGER_to_BN(params->order, a) == NULL) {
  ------------------
  |  Branch (729:9): [True: 0, False: 641]
  ------------------
  730|      0|        ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  731|      0|        goto err;
  732|      0|    }
  733|    641|    if (BN_is_negative(a) || BN_is_zero(a)) {
  ------------------
  |  Branch (733:9): [True: 28, False: 613]
  |  Branch (733:30): [True: 7, False: 606]
  ------------------
  734|     35|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER);
  ------------------
  |  |  401|     35|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     35|    (ERR_new(),                                                 \
  |  |  |  |  404|     35|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     35|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     35|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     35|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     35|     ERR_set_error)
  |  |  ------------------
  ------------------
  735|     35|        goto err;
  736|     35|    }
  737|    606|    if (BN_num_bits(a) > (int)field_bits + 1) { /* Hasse bound */
  ------------------
  |  Branch (737:9): [True: 32, False: 574]
  ------------------
  738|     32|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER);
  ------------------
  |  |  401|     32|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     32|    (ERR_new(),                                                 \
  |  |  |  |  404|     32|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     32|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     32|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     32|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     32|     ERR_set_error)
  |  |  ------------------
  ------------------
  739|     32|        goto err;
  740|     32|    }
  741|       |
  742|       |    /* extract the cofactor (optional) */
  743|    574|    if (params->cofactor == NULL) {
  ------------------
  |  Branch (743:9): [True: 421, False: 153]
  ------------------
  744|    421|        BN_free(b);
  745|    421|        b = NULL;
  746|    421|    } else if (ASN1_INTEGER_to_BN(params->cofactor, b) == NULL) {
  ------------------
  |  Branch (746:16): [True: 0, False: 153]
  ------------------
  747|      0|        ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  748|      0|        goto err;
  749|      0|    }
  750|       |    /* set the generator, order and cofactor (if present) */
  751|    574|    if (!EC_GROUP_set_generator(ret, point, a, b)) {
  ------------------
  |  Branch (751:9): [True: 10, False: 564]
  ------------------
  752|     10|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|     10|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     10|    (ERR_new(),                                                 \
  |  |  |  |  404|     10|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     10|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     10|     ERR_set_error)
  |  |  ------------------
  ------------------
  753|     10|        goto err;
  754|     10|    }
  755|       |
  756|       |    /*
  757|       |     * Check if the explicit parameters group just created matches one of the
  758|       |     * built-in curves.
  759|       |     *
  760|       |     * We create a copy of the group just built, so that we can remove optional
  761|       |     * fields for the lookup: we do this to avoid the possibility that one of
  762|       |     * the optional parameters is used to force the library into using a less
  763|       |     * performant and less secure EC_METHOD instead of the specialized one.
  764|       |     * In any case, `seed` is not really used in any computation, while a
  765|       |     * cofactor different from the one in the built-in table is just
  766|       |     * mathematically wrong anyway and should not be used.
  767|       |     */
  768|    564|    if ((ctx = BN_CTX_new()) == NULL) {
  ------------------
  |  Branch (768:9): [True: 0, False: 564]
  ------------------
  769|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  770|      0|        goto err;
  771|      0|    }
  772|    564|    if ((dup = EC_GROUP_dup(ret)) == NULL
  ------------------
  |  Branch (772:9): [True: 0, False: 564]
  ------------------
  773|    564|            || EC_GROUP_set_seed(dup, NULL, 0) != 1
  ------------------
  |  Branch (773:16): [True: 0, False: 564]
  ------------------
  774|    564|            || !EC_GROUP_set_generator(dup, point, a, NULL)) {
  ------------------
  |  Branch (774:16): [True: 0, False: 564]
  ------------------
  775|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  776|      0|        goto err;
  777|      0|    }
  778|    564|    if ((curve_name = ossl_ec_curve_nid_from_params(dup, ctx)) != NID_undef) {
  ------------------
  |  |   18|    564|#define NID_undef                       0
  ------------------
  |  Branch (778:9): [True: 75, False: 489]
  ------------------
  779|       |        /*
  780|       |         * The input explicit parameters successfully matched one of the
  781|       |         * built-in curves: often for built-in curves we have specialized
  782|       |         * methods with better performance and hardening.
  783|       |         *
  784|       |         * In this case we replace the `EC_GROUP` created through explicit
  785|       |         * parameters with one created from a named group.
  786|       |         */
  787|     75|        EC_GROUP *named_group = NULL;
  788|       |
  789|     75|#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
  790|       |        /*
  791|       |         * NID_wap_wsg_idm_ecid_wtls12 and NID_secp224r1 are both aliases for
  792|       |         * the same curve, we prefer the SECP nid when matching explicit
  793|       |         * parameters as that is associated with a specialized EC_METHOD.
  794|       |         */
  795|     75|        if (curve_name == NID_wap_wsg_idm_ecid_wtls12)
  ------------------
  |  |  494|     75|#define NID_wap_wsg_idm_ecid_wtls12             745
  ------------------
  |  Branch (795:13): [True: 0, False: 75]
  ------------------
  796|      0|            curve_name = NID_secp224r1;
  ------------------
  |  |  364|      0|#define NID_secp224r1           713
  ------------------
  797|     75|#endif /* !def(OPENSSL_NO_EC_NISTP_64_GCC_128) */
  798|       |
  799|     75|        if ((named_group = EC_GROUP_new_by_curve_name(curve_name)) == NULL) {
  ------------------
  |  Branch (799:13): [True: 47, False: 28]
  ------------------
  800|     47|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|     47|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     47|    (ERR_new(),                                                 \
  |  |  |  |  404|     47|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     47|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     47|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     47|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     47|     ERR_set_error)
  |  |  ------------------
  ------------------
  801|     47|            goto err;
  802|     47|        }
  803|     28|        EC_GROUP_free(ret);
  804|     28|        ret = named_group;
  805|       |
  806|       |        /*
  807|       |         * Set the flag so that EC_GROUPs created from explicit parameters are
  808|       |         * serialized using explicit parameters by default.
  809|       |         */
  810|     28|        EC_GROUP_set_asn1_flag(ret, OPENSSL_EC_EXPLICIT_CURVE);
  ------------------
  |  |   30|     28|# define OPENSSL_EC_EXPLICIT_CURVE  0x000
  ------------------
  811|       |
  812|       |        /*
  813|       |         * If the input params do not contain the optional seed field we make
  814|       |         * sure it is not added to the returned group.
  815|       |         *
  816|       |         * The seed field is not really used inside libcrypto anyway, and
  817|       |         * adding it to parsed explicit parameter keys would alter their DER
  818|       |         * encoding output (because of the extra field) which could impact
  819|       |         * applications fingerprinting keys by their DER encoding.
  820|       |         */
  821|     28|        if (params->curve->seed == NULL) {
  ------------------
  |  Branch (821:13): [True: 5, False: 23]
  ------------------
  822|      5|            if (EC_GROUP_set_seed(ret, NULL, 0) != 1)
  ------------------
  |  Branch (822:17): [True: 0, False: 5]
  ------------------
  823|      0|                goto err;
  824|      5|        }
  825|     28|    }
  826|       |
  827|    517|    ok = 1;
  828|       |
  829|  1.17k| err:
  830|  1.17k|    if (!ok) {
  ------------------
  |  Branch (830:9): [True: 661, False: 517]
  ------------------
  831|    661|        EC_GROUP_free(ret);
  832|    661|        ret = NULL;
  833|    661|    }
  834|  1.17k|    EC_GROUP_free(dup);
  835|       |
  836|  1.17k|    BN_free(p);
  837|  1.17k|    BN_free(a);
  838|  1.17k|    BN_free(b);
  839|  1.17k|    EC_POINT_free(point);
  840|       |
  841|  1.17k|    BN_CTX_free(ctx);
  842|       |
  843|  1.17k|    return ret;
  844|    517|}
EC_GROUP_new_from_ecpkparameters:
  847|  4.05k|{
  848|  4.05k|    EC_GROUP *ret = NULL;
  849|  4.05k|    int tmp = 0;
  850|       |
  851|  4.05k|    if (params == NULL) {
  ------------------
  |  Branch (851:9): [True: 0, False: 4.05k]
  ------------------
  852|      0|        ERR_raise(ERR_LIB_EC, EC_R_MISSING_PARAMETERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  853|      0|        return NULL;
  854|      0|    }
  855|       |
  856|  4.05k|    if (params->type == ECPKPARAMETERS_TYPE_NAMED) {
  ------------------
  |  Branch (856:9): [True: 2.86k, False: 1.18k]
  ------------------
  857|       |        /* the curve is given by an OID */
  858|  2.86k|        tmp = OBJ_obj2nid(params->value.named_curve);
  859|  2.86k|        if ((ret = EC_GROUP_new_by_curve_name(tmp)) == NULL) {
  ------------------
  |  Branch (859:13): [True: 496, False: 2.36k]
  ------------------
  860|    496|            ERR_raise(ERR_LIB_EC, EC_R_EC_GROUP_NEW_BY_NAME_FAILURE);
  ------------------
  |  |  401|    496|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    496|    (ERR_new(),                                                 \
  |  |  |  |  404|    496|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    496|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    496|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    496|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    496|     ERR_set_error)
  |  |  ------------------
  ------------------
  861|    496|            return NULL;
  862|    496|        }
  863|  2.36k|        EC_GROUP_set_asn1_flag(ret, OPENSSL_EC_NAMED_CURVE);
  ------------------
  |  |   31|  2.36k|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  864|  2.36k|    } else if (params->type == ECPKPARAMETERS_TYPE_EXPLICIT) {
  ------------------
  |  Branch (864:16): [True: 1.17k, False: 9]
  ------------------
  865|       |        /* the parameters are given by an ECPARAMETERS structure */
  866|  1.17k|        ret = EC_GROUP_new_from_ecparameters(params->value.parameters);
  867|  1.17k|        if (!ret) {
  ------------------
  |  Branch (867:13): [True: 661, False: 517]
  ------------------
  868|    661|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|    661|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    661|    (ERR_new(),                                                 \
  |  |  |  |  404|    661|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    661|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    661|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    661|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    661|     ERR_set_error)
  |  |  ------------------
  ------------------
  869|    661|            return NULL;
  870|    661|        }
  871|    517|        EC_GROUP_set_asn1_flag(ret, OPENSSL_EC_EXPLICIT_CURVE);
  ------------------
  |  |   30|    517|# define OPENSSL_EC_EXPLICIT_CURVE  0x000
  ------------------
  872|    517|    } else if (params->type == ECPKPARAMETERS_TYPE_IMPLICIT) {
  ------------------
  |  Branch (872:16): [True: 9, False: 0]
  ------------------
  873|       |        /* implicit parameters inherited from CA - unsupported */
  874|      9|        return NULL;
  875|      9|    } else {
  876|      0|        ERR_raise(ERR_LIB_EC, EC_R_ASN1_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  877|      0|        return NULL;
  878|      0|    }
  879|       |
  880|  2.88k|    return ret;
  881|  4.05k|}
d2i_ECPKParameters:
  886|  25.6k|{
  887|  25.6k|    EC_GROUP *group = NULL;
  888|  25.6k|    ECPKPARAMETERS *params = NULL;
  889|  25.6k|    const unsigned char *p = *in;
  890|       |
  891|  25.6k|    if ((params = d2i_ECPKPARAMETERS(NULL, &p, len)) == NULL) {
  ------------------
  |  Branch (891:9): [True: 24.5k, False: 1.13k]
  ------------------
  892|  24.5k|        ECPKPARAMETERS_free(params);
  893|  24.5k|        return NULL;
  894|  24.5k|    }
  895|       |
  896|  1.13k|    if ((group = EC_GROUP_new_from_ecpkparameters(params)) == NULL) {
  ------------------
  |  Branch (896:9): [True: 891, False: 239]
  ------------------
  897|    891|        ECPKPARAMETERS_free(params);
  898|    891|        return NULL;
  899|    891|    }
  900|       |
  901|    239|    if (params->type == ECPKPARAMETERS_TYPE_EXPLICIT)
  ------------------
  |  Branch (901:9): [True: 101, False: 138]
  ------------------
  902|    101|        group->decoded_from_explicit_params = 1;
  903|       |
  904|    239|    if (a) {
  ------------------
  |  Branch (904:9): [True: 124, False: 115]
  ------------------
  905|    124|        EC_GROUP_free(*a);
  906|    124|        *a = group;
  907|    124|    }
  908|       |
  909|    239|    ECPKPARAMETERS_free(params);
  910|    239|    *in = p;
  911|    239|    return group;
  912|  1.13k|}
i2d_ECPKParameters:
  915|    248|{
  916|    248|    int ret = 0;
  917|    248|    ECPKPARAMETERS *tmp = EC_GROUP_get_ecpkparameters(a, NULL);
  918|    248|    if (tmp == NULL) {
  ------------------
  |  Branch (918:9): [True: 0, False: 248]
  ------------------
  919|      0|        ERR_raise(ERR_LIB_EC, EC_R_GROUP2PKPARAMETERS_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  920|      0|        return 0;
  921|      0|    }
  922|    248|    if ((ret = i2d_ECPKPARAMETERS(tmp, out)) == 0) {
  ------------------
  |  Branch (922:9): [True: 0, False: 248]
  ------------------
  923|      0|        ERR_raise(ERR_LIB_EC, EC_R_I2D_ECPKPARAMETERS_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  924|      0|        ECPKPARAMETERS_free(tmp);
  925|      0|        return 0;
  926|      0|    }
  927|    248|    ECPKPARAMETERS_free(tmp);
  928|    248|    return ret;
  929|    248|}
d2i_ECPrivateKey:
  934|  39.4k|{
  935|  39.4k|    EC_KEY *ret = NULL;
  936|  39.4k|    EC_PRIVATEKEY *priv_key = NULL;
  937|  39.4k|    const unsigned char *p = *in;
  938|       |
  939|  39.4k|    if ((priv_key = d2i_EC_PRIVATEKEY(NULL, &p, len)) == NULL)
  ------------------
  |  Branch (939:9): [True: 36.3k, False: 3.08k]
  ------------------
  940|  36.3k|        return NULL;
  941|       |
  942|  3.08k|    if (a == NULL || *a == NULL) {
  ------------------
  |  Branch (942:9): [True: 2.93k, False: 152]
  |  Branch (942:22): [True: 0, False: 152]
  ------------------
  943|  2.93k|        if ((ret = EC_KEY_new()) == NULL) {
  ------------------
  |  Branch (943:13): [True: 0, False: 2.93k]
  ------------------
  944|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  945|      0|            goto err;
  946|      0|        }
  947|  2.93k|    } else
  948|    152|        ret = *a;
  949|       |
  950|  3.08k|    if (priv_key->parameters) {
  ------------------
  |  Branch (950:9): [True: 2.92k, False: 165]
  ------------------
  951|  2.92k|        EC_GROUP_free(ret->group);
  952|  2.92k|        ret->group = EC_GROUP_new_from_ecpkparameters(priv_key->parameters);
  953|  2.92k|        if (ret->group != NULL
  ------------------
  |  Branch (953:13): [True: 2.64k, False: 275]
  ------------------
  954|  2.92k|            && priv_key->parameters->type == ECPKPARAMETERS_TYPE_EXPLICIT)
  ------------------
  |  Branch (954:16): [True: 416, False: 2.23k]
  ------------------
  955|    416|            ret->group->decoded_from_explicit_params = 1;
  956|  2.92k|    }
  957|       |
  958|  3.08k|    if (ret->group == NULL) {
  ------------------
  |  Branch (958:9): [True: 300, False: 2.78k]
  ------------------
  959|    300|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|    300|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    300|    (ERR_new(),                                                 \
  |  |  |  |  404|    300|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    300|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    300|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    300|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    300|     ERR_set_error)
  |  |  ------------------
  ------------------
  960|    300|        goto err;
  961|    300|    }
  962|       |
  963|  2.78k|    ret->version = priv_key->version;
  964|       |
  965|  2.78k|    if (priv_key->privateKey) {
  ------------------
  |  Branch (965:9): [True: 2.78k, False: 0]
  ------------------
  966|  2.78k|        ASN1_OCTET_STRING *pkey = priv_key->privateKey;
  967|  2.78k|        if (EC_KEY_oct2priv(ret, ASN1_STRING_get0_data(pkey),
  ------------------
  |  Branch (967:13): [True: 0, False: 2.78k]
  ------------------
  968|  2.78k|                            ASN1_STRING_length(pkey)) == 0)
  969|      0|            goto err;
  970|  2.78k|    } else {
  971|      0|        ERR_raise(ERR_LIB_EC, EC_R_MISSING_PRIVATE_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  972|      0|        goto err;
  973|      0|    }
  974|       |
  975|  2.78k|    if (EC_GROUP_get_curve_name(ret->group) == NID_sm2)
  ------------------
  |  | 1232|  2.78k|#define NID_sm2         1172
  ------------------
  |  Branch (975:9): [True: 14, False: 2.77k]
  ------------------
  976|     14|        EC_KEY_set_flags(ret, EC_FLAG_SM2_RANGE);
  ------------------
  |  |  962|     14|#  define EC_FLAG_SM2_RANGE              0x0004
  ------------------
  977|       |
  978|  2.78k|    EC_POINT_clear_free(ret->pub_key);
  979|  2.78k|    ret->pub_key = EC_POINT_new(ret->group);
  980|  2.78k|    if (ret->pub_key == NULL) {
  ------------------
  |  Branch (980:9): [True: 0, False: 2.78k]
  ------------------
  981|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  982|      0|        goto err;
  983|      0|    }
  984|       |
  985|  2.78k|    if (priv_key->publicKey) {
  ------------------
  |  Branch (985:9): [True: 1.06k, False: 1.72k]
  ------------------
  986|  1.06k|        const unsigned char *pub_oct;
  987|  1.06k|        int pub_oct_len;
  988|       |
  989|  1.06k|        pub_oct = ASN1_STRING_get0_data(priv_key->publicKey);
  990|  1.06k|        pub_oct_len = ASN1_STRING_length(priv_key->publicKey);
  991|  1.06k|        if (!EC_KEY_oct2key(ret, pub_oct, pub_oct_len, NULL)) {
  ------------------
  |  Branch (991:13): [True: 543, False: 517]
  ------------------
  992|    543|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|    543|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    543|    (ERR_new(),                                                 \
  |  |  |  |  404|    543|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    543|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    543|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    543|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    543|     ERR_set_error)
  |  |  ------------------
  ------------------
  993|    543|            goto err;
  994|    543|        }
  995|  1.72k|    } else {
  996|  1.72k|        if (ret->group->meth->keygenpub == NULL
  ------------------
  |  Branch (996:13): [True: 0, False: 1.72k]
  ------------------
  997|  1.72k|            || ret->group->meth->keygenpub(ret) == 0)
  ------------------
  |  Branch (997:16): [True: 0, False: 1.72k]
  ------------------
  998|      0|                goto err;
  999|       |        /* Remember the original private-key-only encoding. */
 1000|  1.72k|        ret->enc_flag |= EC_PKEY_NO_PUBKEY;
  ------------------
  |  |  959|  1.72k|#  define EC_PKEY_NO_PUBKEY       0x002
  ------------------
 1001|  1.72k|    }
 1002|       |
 1003|  2.24k|    if (a)
  ------------------
  |  Branch (1003:9): [True: 96, False: 2.14k]
  ------------------
 1004|     96|        *a = ret;
 1005|  2.24k|    EC_PRIVATEKEY_free(priv_key);
 1006|  2.24k|    *in = p;
 1007|  2.24k|    ret->dirty_cnt++;
 1008|  2.24k|    return ret;
 1009|       |
 1010|    843| err:
 1011|    843|    if (a == NULL || *a != ret)
  ------------------
  |  Branch (1011:9): [True: 787, False: 56]
  |  Branch (1011:22): [True: 0, False: 56]
  ------------------
 1012|    787|        EC_KEY_free(ret);
 1013|    843|    EC_PRIVATEKEY_free(priv_key);
 1014|    843|    return NULL;
 1015|  2.78k|}
i2d_ECPrivateKey:
 1018|  1.72k|{
 1019|  1.72k|    int ret = 0, ok = 0;
 1020|  1.72k|    unsigned char *priv= NULL, *pub= NULL;
 1021|  1.72k|    size_t privlen = 0, publen = 0;
 1022|       |
 1023|  1.72k|    EC_PRIVATEKEY *priv_key = NULL;
 1024|       |
 1025|  1.72k|    if (a == NULL || a->group == NULL ||
  ------------------
  |  Branch (1025:9): [True: 0, False: 1.72k]
  |  Branch (1025:22): [True: 0, False: 1.72k]
  ------------------
 1026|  1.72k|        (!(a->enc_flag & EC_PKEY_NO_PUBKEY) && a->pub_key == NULL)) {
  ------------------
  |  |  959|  1.72k|#  define EC_PKEY_NO_PUBKEY       0x002
  ------------------
  |  Branch (1026:10): [True: 363, False: 1.36k]
  |  Branch (1026:48): [True: 0, False: 363]
  ------------------
 1027|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1028|      0|        goto err;
 1029|      0|    }
 1030|       |
 1031|  1.72k|    if ((priv_key = EC_PRIVATEKEY_new()) == NULL) {
  ------------------
  |  Branch (1031:9): [True: 0, False: 1.72k]
  ------------------
 1032|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1033|      0|        goto err;
 1034|      0|    }
 1035|       |
 1036|  1.72k|    priv_key->version = a->version;
 1037|       |
 1038|  1.72k|    privlen = EC_KEY_priv2buf(a, &priv);
 1039|       |
 1040|  1.72k|    if (privlen == 0) {
  ------------------
  |  Branch (1040:9): [True: 601, False: 1.12k]
  ------------------
 1041|    601|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|    601|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    601|    (ERR_new(),                                                 \
  |  |  |  |  404|    601|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    601|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    601|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    601|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    601|     ERR_set_error)
  |  |  ------------------
  ------------------
 1042|    601|        goto err;
 1043|    601|    }
 1044|       |
 1045|  1.12k|    ASN1_STRING_set0(priv_key->privateKey, priv, privlen);
 1046|  1.12k|    priv = NULL;
 1047|       |
 1048|  1.12k|    if (!(a->enc_flag & EC_PKEY_NO_PARAMETERS)) {
  ------------------
  |  |  958|  1.12k|#  define EC_PKEY_NO_PARAMETERS   0x001
  ------------------
  |  Branch (1048:9): [True: 1.12k, False: 7]
  ------------------
 1049|  1.12k|        if ((priv_key->parameters =
  ------------------
  |  Branch (1049:13): [True: 0, False: 1.12k]
  ------------------
 1050|  1.12k|             EC_GROUP_get_ecpkparameters(a->group,
 1051|  1.12k|                                        priv_key->parameters)) == NULL) {
 1052|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1053|      0|            goto err;
 1054|      0|        }
 1055|  1.12k|    }
 1056|       |
 1057|  1.12k|    if (!(a->enc_flag & EC_PKEY_NO_PUBKEY)) {
  ------------------
  |  |  959|  1.12k|#  define EC_PKEY_NO_PUBKEY       0x002
  ------------------
  |  Branch (1057:9): [True: 340, False: 788]
  ------------------
 1058|    340|        priv_key->publicKey = ASN1_BIT_STRING_new();
 1059|    340|        if (priv_key->publicKey == NULL) {
  ------------------
  |  Branch (1059:13): [True: 0, False: 340]
  ------------------
 1060|      0|            ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1061|      0|            goto err;
 1062|      0|        }
 1063|       |
 1064|    340|        publen = EC_KEY_key2buf(a, a->conv_form, &pub, NULL);
 1065|       |
 1066|    340|        if (publen == 0) {
  ------------------
  |  Branch (1066:13): [True: 25, False: 315]
  ------------------
 1067|     25|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|     25|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     25|    (ERR_new(),                                                 \
  |  |  |  |  404|     25|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     25|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     25|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     25|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     25|     ERR_set_error)
  |  |  ------------------
  ------------------
 1068|     25|            goto err;
 1069|     25|        }
 1070|       |
 1071|    315|        ossl_asn1_string_set_bits_left(priv_key->publicKey, 0);
 1072|    315|        ASN1_STRING_set0(priv_key->publicKey, pub, publen);
 1073|    315|        pub = NULL;
 1074|    315|    }
 1075|       |
 1076|  1.10k|    if ((ret = i2d_EC_PRIVATEKEY(priv_key, out)) == 0) {
  ------------------
  |  Branch (1076:9): [True: 0, False: 1.10k]
  ------------------
 1077|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1078|      0|        goto err;
 1079|      0|    }
 1080|  1.10k|    ok = 1;
 1081|  1.72k| err:
 1082|  1.72k|    OPENSSL_clear_free(priv, privlen);
  ------------------
  |  |  113|  1.72k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.72k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.72k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1083|  1.72k|    OPENSSL_free(pub);
  ------------------
  |  |  115|  1.72k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.72k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.72k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1084|  1.72k|    EC_PRIVATEKEY_free(priv_key);
 1085|  1.72k|    return (ok ? ret : 0);
  ------------------
  |  Branch (1085:13): [True: 1.10k, False: 626]
  ------------------
 1086|  1.10k|}
i2d_ECParameters:
 1089|    149|{
 1090|    149|    if (a == NULL) {
  ------------------
  |  Branch (1090:9): [True: 0, False: 149]
  ------------------
 1091|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1092|      0|        return 0;
 1093|      0|    }
 1094|    149|    return i2d_ECPKParameters(a->group, out);
 1095|    149|}
d2i_ECParameters:
 1098|  12.8k|{
 1099|  12.8k|    EC_KEY *ret;
 1100|       |
 1101|  12.8k|    if (in == NULL || *in == NULL) {
  ------------------
  |  Branch (1101:9): [True: 0, False: 12.8k]
  |  Branch (1101:23): [True: 0, False: 12.8k]
  ------------------
 1102|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1103|      0|        return NULL;
 1104|      0|    }
 1105|       |
 1106|  12.8k|    if (a == NULL || *a == NULL) {
  ------------------
  |  Branch (1106:9): [True: 12.7k, False: 61]
  |  Branch (1106:22): [True: 0, False: 61]
  ------------------
 1107|  12.7k|        if ((ret = EC_KEY_new()) == NULL) {
  ------------------
  |  Branch (1107:13): [True: 0, False: 12.7k]
  ------------------
 1108|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1109|      0|            return NULL;
 1110|      0|        }
 1111|  12.7k|    } else
 1112|     61|        ret = *a;
 1113|       |
 1114|  12.8k|    if (!d2i_ECPKParameters(&ret->group, in, len)) {
  ------------------
  |  Branch (1114:9): [True: 12.6k, False: 124]
  ------------------
 1115|  12.6k|        if (a == NULL || *a != ret)
  ------------------
  |  Branch (1115:13): [True: 12.6k, False: 36]
  |  Branch (1115:26): [True: 0, False: 36]
  ------------------
 1116|  12.6k|             EC_KEY_free(ret);
 1117|     36|        else
 1118|     36|            ret->dirty_cnt++;
 1119|  12.6k|        return NULL;
 1120|  12.6k|    }
 1121|       |
 1122|    124|    if (EC_GROUP_get_curve_name(ret->group) == NID_sm2)
  ------------------
  |  | 1232|    124|#define NID_sm2         1172
  ------------------
  |  Branch (1122:9): [True: 1, False: 123]
  ------------------
 1123|      1|        EC_KEY_set_flags(ret, EC_FLAG_SM2_RANGE);
  ------------------
  |  |  962|      1|#  define EC_FLAG_SM2_RANGE              0x0004
  ------------------
 1124|       |
 1125|    124|    ret->dirty_cnt++;
 1126|       |
 1127|    124|    if (a)
  ------------------
  |  Branch (1127:9): [True: 25, False: 99]
  ------------------
 1128|     25|        *a = ret;
 1129|       |
 1130|    124|    return ret;
 1131|  12.8k|}
o2i_ECPublicKey:
 1134|  22.9k|{
 1135|  22.9k|    EC_KEY *ret = NULL;
 1136|       |
 1137|  22.9k|    if (a == NULL || (*a) == NULL || (*a)->group == NULL) {
  ------------------
  |  Branch (1137:9): [True: 0, False: 22.9k]
  |  Branch (1137:22): [True: 0, False: 22.9k]
  |  Branch (1137:38): [True: 0, False: 22.9k]
  ------------------
 1138|       |        /*
 1139|       |         * sorry, but a EC_GROUP-structure is necessary to set the public key
 1140|       |         */
 1141|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1142|      0|        return 0;
 1143|      0|    }
 1144|  22.9k|    ret = *a;
 1145|       |    /* EC_KEY_opt2key updates dirty_cnt */
 1146|  22.9k|    if (!EC_KEY_oct2key(ret, *in, len, NULL)) {
  ------------------
  |  Branch (1146:9): [True: 16.1k, False: 6.77k]
  ------------------
 1147|  16.1k|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|  16.1k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  16.1k|    (ERR_new(),                                                 \
  |  |  |  |  404|  16.1k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  16.1k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  16.1k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  16.1k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  16.1k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1148|  16.1k|        return 0;
 1149|  16.1k|    }
 1150|  6.77k|    *in += len;
 1151|  6.77k|    return ret;
 1152|  22.9k|}
ECDSA_SIG_new:
 1196|  12.7k|{
 1197|  12.7k|    ECDSA_SIG *sig = OPENSSL_zalloc(sizeof(*sig));
  ------------------
  |  |  104|  12.7k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  12.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  12.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1198|       |
 1199|  12.7k|    return sig;
 1200|  12.7k|}
ECDSA_SIG_free:
 1203|  12.7k|{
 1204|  12.7k|    if (sig == NULL)
  ------------------
  |  Branch (1204:9): [True: 0, False: 12.7k]
  ------------------
 1205|      0|        return;
 1206|  12.7k|    BN_clear_free(sig->r);
 1207|  12.7k|    BN_clear_free(sig->s);
 1208|  12.7k|    OPENSSL_free(sig);
  ------------------
  |  |  115|  12.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  12.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  12.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1209|  12.7k|}
d2i_ECDSA_SIG:
 1212|  12.7k|{
 1213|  12.7k|    ECDSA_SIG *sig;
 1214|       |
 1215|  12.7k|    if (len < 0)
  ------------------
  |  Branch (1215:9): [True: 0, False: 12.7k]
  ------------------
 1216|      0|        return NULL;
 1217|  12.7k|    if (psig != NULL && *psig != NULL) {
  ------------------
  |  Branch (1217:9): [True: 0, False: 12.7k]
  |  Branch (1217:25): [True: 0, False: 0]
  ------------------
 1218|      0|        sig = *psig;
 1219|  12.7k|    } else {
 1220|  12.7k|        sig = ECDSA_SIG_new();
 1221|  12.7k|        if (sig == NULL)
  ------------------
  |  Branch (1221:13): [True: 0, False: 12.7k]
  ------------------
 1222|      0|            return NULL;
 1223|  12.7k|    }
 1224|  12.7k|    if (sig->r == NULL)
  ------------------
  |  Branch (1224:9): [True: 12.7k, False: 0]
  ------------------
 1225|  12.7k|        sig->r = BN_new();
 1226|  12.7k|    if (sig->s == NULL)
  ------------------
  |  Branch (1226:9): [True: 12.7k, False: 0]
  ------------------
 1227|  12.7k|        sig->s = BN_new();
 1228|  12.7k|    if (sig->r == NULL || sig->s == NULL
  ------------------
  |  Branch (1228:9): [True: 0, False: 12.7k]
  |  Branch (1228:27): [True: 0, False: 12.7k]
  ------------------
 1229|  12.7k|        || ossl_decode_der_dsa_sig(sig->r, sig->s, ppin, (size_t)len) == 0) {
  ------------------
  |  Branch (1229:12): [True: 12.7k, False: 35]
  ------------------
 1230|  12.7k|        if (psig == NULL || *psig == NULL)
  ------------------
  |  Branch (1230:13): [True: 12.7k, False: 0]
  |  Branch (1230:29): [True: 0, False: 0]
  ------------------
 1231|  12.7k|            ECDSA_SIG_free(sig);
 1232|  12.7k|        return NULL;
 1233|  12.7k|    }
 1234|     35|    if (psig != NULL && *psig == NULL)
  ------------------
  |  Branch (1234:9): [True: 0, False: 35]
  |  Branch (1234:25): [True: 0, False: 0]
  ------------------
 1235|      0|        *psig = sig;
 1236|     35|    return sig;
 1237|  12.7k|}
i2d_ECDSA_SIG:
 1240|  7.53k|{
 1241|  7.53k|    BUF_MEM *buf = NULL;
 1242|  7.53k|    size_t encoded_len;
 1243|  7.53k|    WPACKET pkt;
 1244|       |
 1245|  7.53k|    if (ppout == NULL) {
  ------------------
  |  Branch (1245:9): [True: 7.50k, False: 35]
  ------------------
 1246|  7.50k|        if (!WPACKET_init_null(&pkt, 0))
  ------------------
  |  Branch (1246:13): [True: 0, False: 7.50k]
  ------------------
 1247|      0|            return -1;
 1248|  7.50k|    } else if (*ppout == NULL) {
  ------------------
  |  Branch (1248:16): [True: 35, False: 0]
  ------------------
 1249|     35|        if ((buf = BUF_MEM_new()) == NULL
  ------------------
  |  Branch (1249:13): [True: 0, False: 35]
  ------------------
 1250|     35|                || !WPACKET_init_len(&pkt, buf, 0)) {
  ------------------
  |  Branch (1250:20): [True: 0, False: 35]
  ------------------
 1251|      0|            BUF_MEM_free(buf);
 1252|      0|            return -1;
 1253|      0|        }
 1254|     35|    } else {
 1255|      0|        if (!WPACKET_init_static_len(&pkt, *ppout, SIZE_MAX, 0))
  ------------------
  |  Branch (1255:13): [True: 0, False: 0]
  ------------------
 1256|      0|            return -1;
 1257|      0|    }
 1258|       |
 1259|  7.53k|    if (!ossl_encode_der_dsa_sig(&pkt, sig->r, sig->s)
  ------------------
  |  Branch (1259:9): [True: 0, False: 7.53k]
  ------------------
 1260|  7.53k|            || !WPACKET_get_total_written(&pkt, &encoded_len)
  ------------------
  |  Branch (1260:16): [True: 0, False: 7.53k]
  ------------------
 1261|  7.53k|            || !WPACKET_finish(&pkt)) {
  ------------------
  |  Branch (1261:16): [True: 0, False: 7.53k]
  ------------------
 1262|      0|        BUF_MEM_free(buf);
 1263|      0|        WPACKET_cleanup(&pkt);
 1264|      0|        return -1;
 1265|      0|    }
 1266|       |
 1267|  7.53k|    if (ppout != NULL) {
  ------------------
  |  Branch (1267:9): [True: 35, False: 7.50k]
  ------------------
 1268|     35|        if (*ppout == NULL) {
  ------------------
  |  Branch (1268:13): [True: 35, False: 0]
  ------------------
 1269|     35|            *ppout = (unsigned char *)buf->data;
 1270|     35|            buf->data = NULL;
 1271|     35|            BUF_MEM_free(buf);
 1272|     35|        } else {
 1273|      0|            *ppout += encoded_len;
 1274|      0|        }
 1275|     35|    }
 1276|       |
 1277|  7.53k|    return (int)encoded_len;
 1278|  7.53k|}
ECDSA_size:
 1310|  7.50k|{
 1311|  7.50k|    int ret;
 1312|  7.50k|    ECDSA_SIG sig;
 1313|  7.50k|    const EC_GROUP *group;
 1314|  7.50k|    const BIGNUM *bn;
 1315|       |
 1316|  7.50k|    if (ec == NULL)
  ------------------
  |  Branch (1316:9): [True: 0, False: 7.50k]
  ------------------
 1317|      0|        return 0;
 1318|  7.50k|    group = EC_KEY_get0_group(ec);
 1319|  7.50k|    if (group == NULL)
  ------------------
  |  Branch (1319:9): [True: 0, False: 7.50k]
  ------------------
 1320|      0|        return 0;
 1321|       |
 1322|  7.50k|    bn = EC_GROUP_get0_order(group);
 1323|  7.50k|    if (bn == NULL)
  ------------------
  |  Branch (1323:9): [True: 0, False: 7.50k]
  ------------------
 1324|      0|        return 0;
 1325|       |
 1326|  7.50k|    sig.r = sig.s = (BIGNUM *)bn;
 1327|  7.50k|    ret = i2d_ECDSA_SIG(&sig, NULL);
 1328|       |
 1329|  7.50k|    if (ret < 0)
  ------------------
  |  Branch (1329:9): [True: 0, False: 7.50k]
  ------------------
 1330|      0|        ret = 0;
 1331|  7.50k|    return ret;
 1332|  7.50k|}
ec_asn1.c:ec_asn1_group2fieldid:
  189|    269|{
  190|    269|    int ok = 0, nid;
  191|    269|    BIGNUM *tmp = NULL;
  192|       |
  193|    269|    if (group == NULL || field == NULL)
  ------------------
  |  Branch (193:9): [True: 0, False: 269]
  |  Branch (193:26): [True: 0, False: 269]
  ------------------
  194|      0|        return 0;
  195|       |
  196|       |    /* clear the old values (if necessary) */
  197|    269|    ASN1_OBJECT_free(field->fieldType);
  198|    269|    ASN1_TYPE_free(field->p.other);
  199|       |
  200|    269|    nid = EC_GROUP_get_field_type(group);
  201|       |    /* set OID for the field */
  202|    269|    if ((field->fieldType = OBJ_nid2obj(nid)) == NULL) {
  ------------------
  |  Branch (202:9): [True: 0, False: 269]
  ------------------
  203|      0|        ERR_raise(ERR_LIB_EC, ERR_R_OBJ_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  204|      0|        goto err;
  205|      0|    }
  206|       |
  207|    269|    if (nid == NID_X9_62_prime_field) {
  ------------------
  |  |  152|    269|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (207:9): [True: 269, False: 0]
  ------------------
  208|    269|        if ((tmp = BN_new()) == NULL) {
  ------------------
  |  Branch (208:13): [True: 0, False: 269]
  ------------------
  209|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  210|      0|            goto err;
  211|      0|        }
  212|       |        /* the parameters are specified by the prime number p */
  213|    269|        if (!EC_GROUP_get_curve(group, tmp, NULL, NULL, NULL)) {
  ------------------
  |  Branch (213:13): [True: 0, False: 269]
  ------------------
  214|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  215|      0|            goto err;
  216|      0|        }
  217|       |        /* set the prime number */
  218|    269|        field->p.prime = BN_to_ASN1_INTEGER(tmp, NULL);
  219|    269|        if (field->p.prime == NULL) {
  ------------------
  |  Branch (219:13): [True: 0, False: 269]
  ------------------
  220|      0|            ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  221|      0|            goto err;
  222|      0|        }
  223|    269|    } else if (nid == NID_X9_62_characteristic_two_field)
  ------------------
  |  |  156|      0|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (223:16): [True: 0, False: 0]
  ------------------
  224|       |#ifdef OPENSSL_NO_EC2M
  225|       |    {
  226|       |        ERR_raise(ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED);
  227|       |        goto err;
  228|       |    }
  229|       |#else
  230|      0|    {
  231|      0|        int field_type;
  232|      0|        X9_62_CHARACTERISTIC_TWO *char_two;
  233|       |
  234|      0|        field->p.char_two = X9_62_CHARACTERISTIC_TWO_new();
  235|      0|        char_two = field->p.char_two;
  236|       |
  237|      0|        if (char_two == NULL) {
  ------------------
  |  Branch (237:13): [True: 0, False: 0]
  ------------------
  238|      0|            ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  239|      0|            goto err;
  240|      0|        }
  241|       |
  242|      0|        char_two->m = (long)EC_GROUP_get_degree(group);
  243|       |
  244|      0|        field_type = EC_GROUP_get_basis_type(group);
  245|       |
  246|      0|        if (field_type == 0) {
  ------------------
  |  Branch (246:13): [True: 0, False: 0]
  ------------------
  247|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  248|      0|            goto err;
  249|      0|        }
  250|       |        /* set base type OID */
  251|      0|        if ((char_two->type = OBJ_nid2obj(field_type)) == NULL) {
  ------------------
  |  Branch (251:13): [True: 0, False: 0]
  ------------------
  252|      0|            ERR_raise(ERR_LIB_EC, ERR_R_OBJ_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  253|      0|            goto err;
  254|      0|        }
  255|       |
  256|      0|        if (field_type == NID_X9_62_tpBasis) {
  ------------------
  |  |  168|      0|#define NID_X9_62_tpBasis               682
  ------------------
  |  Branch (256:13): [True: 0, False: 0]
  ------------------
  257|      0|            unsigned int k;
  258|       |
  259|      0|            if (!EC_GROUP_get_trinomial_basis(group, &k))
  ------------------
  |  Branch (259:17): [True: 0, False: 0]
  ------------------
  260|      0|                goto err;
  261|       |
  262|      0|            char_two->p.tpBasis = ASN1_INTEGER_new();
  263|      0|            if (char_two->p.tpBasis == NULL) {
  ------------------
  |  Branch (263:17): [True: 0, False: 0]
  ------------------
  264|      0|                ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  265|      0|                goto err;
  266|      0|            }
  267|      0|            if (!ASN1_INTEGER_set(char_two->p.tpBasis, (long)k)) {
  ------------------
  |  Branch (267:17): [True: 0, False: 0]
  ------------------
  268|      0|                ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  269|      0|                goto err;
  270|      0|            }
  271|      0|        } else if (field_type == NID_X9_62_ppBasis) {
  ------------------
  |  |  172|      0|#define NID_X9_62_ppBasis               683
  ------------------
  |  Branch (271:20): [True: 0, False: 0]
  ------------------
  272|      0|            unsigned int k1, k2, k3;
  273|       |
  274|      0|            if (!EC_GROUP_get_pentanomial_basis(group, &k1, &k2, &k3))
  ------------------
  |  Branch (274:17): [True: 0, False: 0]
  ------------------
  275|      0|                goto err;
  276|       |
  277|      0|            char_two->p.ppBasis = X9_62_PENTANOMIAL_new();
  278|      0|            if (char_two->p.ppBasis == NULL) {
  ------------------
  |  Branch (278:17): [True: 0, False: 0]
  ------------------
  279|      0|                ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  280|      0|                goto err;
  281|      0|            }
  282|       |
  283|       |            /* set k? values */
  284|      0|            char_two->p.ppBasis->k1 = (long)k1;
  285|      0|            char_two->p.ppBasis->k2 = (long)k2;
  286|      0|            char_two->p.ppBasis->k3 = (long)k3;
  287|      0|        } else {                /* field_type == NID_X9_62_onBasis */
  288|       |
  289|       |            /* for ONB the parameters are (asn1) NULL */
  290|      0|            char_two->p.onBasis = ASN1_NULL_new();
  291|      0|            if (char_two->p.onBasis == NULL) {
  ------------------
  |  Branch (291:17): [True: 0, False: 0]
  ------------------
  292|      0|                ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  293|      0|                goto err;
  294|      0|            }
  295|      0|        }
  296|      0|    }
  297|      0|#endif
  298|      0|    else {
  299|      0|        ERR_raise(ERR_LIB_EC, EC_R_UNSUPPORTED_FIELD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  300|      0|        goto err;
  301|      0|    }
  302|       |
  303|    269|    ok = 1;
  304|       |
  305|    269| err:
  306|    269|    BN_free(tmp);
  307|    269|    return ok;
  308|    269|}
ec_asn1.c:ec_asn1_group2curve:
  311|    269|{
  312|    269|    int ok = 0;
  313|    269|    BIGNUM *tmp_1 = NULL, *tmp_2 = NULL;
  314|    269|    unsigned char *a_buf = NULL, *b_buf = NULL;
  315|    269|    size_t len;
  316|       |
  317|    269|    if (!group || !curve || !curve->a || !curve->b)
  ------------------
  |  Branch (317:9): [True: 0, False: 269]
  |  Branch (317:19): [True: 0, False: 269]
  |  Branch (317:29): [True: 0, False: 269]
  |  Branch (317:42): [True: 0, False: 269]
  ------------------
  318|      0|        return 0;
  319|       |
  320|    269|    if ((tmp_1 = BN_new()) == NULL || (tmp_2 = BN_new()) == NULL) {
  ------------------
  |  Branch (320:9): [True: 0, False: 269]
  |  Branch (320:39): [True: 0, False: 269]
  ------------------
  321|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  322|      0|        goto err;
  323|      0|    }
  324|       |
  325|       |    /* get a and b */
  326|    269|    if (!EC_GROUP_get_curve(group, NULL, tmp_1, tmp_2, NULL)) {
  ------------------
  |  Branch (326:9): [True: 0, False: 269]
  ------------------
  327|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  328|      0|        goto err;
  329|      0|    }
  330|       |
  331|       |    /*
  332|       |     * Per SEC 1, the curve coefficients must be padded up to size. See C.2's
  333|       |     * definition of Curve, C.1's definition of FieldElement, and 2.3.5's
  334|       |     * definition of how to encode the field elements.
  335|       |     */
  336|    269|    len = ((size_t)EC_GROUP_get_degree(group) + 7) / 8;
  337|    269|    if ((a_buf = OPENSSL_malloc(len)) == NULL
  ------------------
  |  |  102|    269|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (337:9): [True: 0, False: 269]
  ------------------
  338|    269|        || (b_buf = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |  102|    269|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (338:12): [True: 0, False: 269]
  ------------------
  339|      0|        goto err;
  340|    269|    if (BN_bn2binpad(tmp_1, a_buf, len) < 0
  ------------------
  |  Branch (340:9): [True: 0, False: 269]
  ------------------
  341|    269|        || BN_bn2binpad(tmp_2, b_buf, len) < 0) {
  ------------------
  |  Branch (341:12): [True: 0, False: 269]
  ------------------
  342|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  343|      0|        goto err;
  344|      0|    }
  345|       |
  346|       |    /* set a and b */
  347|    269|    if (!ASN1_OCTET_STRING_set(curve->a, a_buf, len)
  ------------------
  |  Branch (347:9): [True: 0, False: 269]
  ------------------
  348|    269|        || !ASN1_OCTET_STRING_set(curve->b, b_buf, len)) {
  ------------------
  |  Branch (348:12): [True: 0, False: 269]
  ------------------
  349|      0|        ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  350|      0|        goto err;
  351|      0|    }
  352|       |
  353|       |    /* set the seed (optional) */
  354|    269|    if (group->seed) {
  ------------------
  |  Branch (354:9): [True: 68, False: 201]
  ------------------
  355|     68|        if (!curve->seed)
  ------------------
  |  Branch (355:13): [True: 68, False: 0]
  ------------------
  356|     68|            if ((curve->seed = ASN1_BIT_STRING_new()) == NULL) {
  ------------------
  |  Branch (356:17): [True: 0, False: 68]
  ------------------
  357|      0|                ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  358|      0|                goto err;
  359|      0|            }
  360|     68|        ossl_asn1_string_set_bits_left(curve->seed, 0);
  361|     68|        if (!ASN1_BIT_STRING_set(curve->seed, group->seed,
  ------------------
  |  Branch (361:13): [True: 0, False: 68]
  ------------------
  362|     68|                                 (int)group->seed_len)) {
  363|      0|            ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  364|      0|            goto err;
  365|      0|        }
  366|    201|    } else {
  367|    201|        ASN1_BIT_STRING_free(curve->seed);
  368|    201|        curve->seed = NULL;
  369|    201|    }
  370|       |
  371|    269|    ok = 1;
  372|       |
  373|    269| err:
  374|    269|    OPENSSL_free(a_buf);
  ------------------
  |  |  115|    269|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  375|    269|    OPENSSL_free(b_buf);
  ------------------
  |  |  115|    269|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  376|    269|    BN_free(tmp_1);
  377|    269|    BN_free(tmp_2);
  378|    269|    return ok;
  379|    269|}

ossl_ec_check_group_type_id2name:
   76|  7.50k|{
   77|  7.50k|    size_t i, sz;
   78|       |
   79|  7.50k|    for (i = 0, sz = OSSL_NELEM(check_group_type_nameid_map); i < sz; i++) {
  ------------------
  |  |   14|  7.50k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (79:63): [True: 7.50k, False: 0]
  ------------------
   80|  7.50k|        if (id == (int)check_group_type_nameid_map[i].id)
  ------------------
  |  Branch (80:13): [True: 7.50k, False: 0]
  ------------------
   81|  7.50k|            return check_group_type_nameid_map[i].ptr;
   82|  7.50k|    }
   83|      0|    return NULL;
   84|  7.50k|}
ossl_ec_pt_format_id2name:
  147|  15.0k|{
  148|  15.0k|    size_t i, sz;
  149|       |
  150|  22.1k|    for (i = 0, sz = OSSL_NELEM(format_nameid_map); i < sz; i++) {
  ------------------
  |  |   14|  15.0k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (150:53): [True: 22.0k, False: 26]
  ------------------
  151|  22.0k|        if (id == (int)format_nameid_map[i].id)
  ------------------
  |  Branch (151:13): [True: 14.9k, False: 7.10k]
  ------------------
  152|  14.9k|            return format_nameid_map[i].ptr;
  153|  22.0k|    }
  154|     26|    return NULL;
  155|  15.0k|}
ossl_ec_group_todata:
  292|  7.50k|{
  293|  7.50k|    int ret = 0, curve_nid, encoding_flag;
  294|  7.50k|    const char *encoding_name, *pt_form_name;
  295|  7.50k|    point_conversion_form_t genform;
  296|       |
  297|  7.50k|    if (group == NULL) {
  ------------------
  |  Branch (297:9): [True: 0, False: 7.50k]
  ------------------
  298|      0|        ERR_raise(ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  299|      0|        return 0;
  300|      0|    }
  301|       |
  302|  7.50k|    genform = EC_GROUP_get_point_conversion_form(group);
  303|  7.50k|    pt_form_name = ossl_ec_pt_format_id2name(genform);
  304|  7.50k|    if (pt_form_name == NULL
  ------------------
  |  Branch (304:9): [True: 0, False: 7.50k]
  ------------------
  305|  7.50k|        || !ossl_param_build_set_utf8_string(
  ------------------
  |  Branch (305:12): [True: 0, False: 7.50k]
  ------------------
  306|  7.50k|                tmpl, params,
  307|  7.50k|                OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT, pt_form_name)) {
  ------------------
  |  |  386|  7.50k|# define OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT "point-format"
  ------------------
  308|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_FORM);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  309|      0|        return 0;
  310|      0|    }
  311|  7.50k|    encoding_flag = EC_GROUP_get_asn1_flag(group) & OPENSSL_EC_NAMED_CURVE;
  ------------------
  |  |   31|  7.50k|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  312|  7.50k|    encoding_name = ec_param_encoding_id2name(encoding_flag);
  313|  7.50k|    if (encoding_name == NULL
  ------------------
  |  Branch (313:9): [True: 0, False: 7.50k]
  ------------------
  314|  7.50k|        || !ossl_param_build_set_utf8_string(tmpl, params,
  ------------------
  |  Branch (314:12): [True: 0, False: 7.50k]
  ------------------
  315|  7.50k|                                             OSSL_PKEY_PARAM_EC_ENCODING,
  ------------------
  |  |  379|  7.50k|# define OSSL_PKEY_PARAM_EC_ENCODING "encoding"
  ------------------
  316|  7.50k|                                             encoding_name)) {
  317|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  318|      0|        return 0;
  319|      0|    }
  320|       |
  321|  7.50k|    if (!ossl_param_build_set_int(tmpl, params,
  ------------------
  |  Branch (321:9): [True: 0, False: 7.50k]
  ------------------
  322|  7.50k|                                  OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS,
  ------------------
  |  |  378|  7.50k|# define OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS "decoded-from-explicit"
  ------------------
  323|  7.50k|                                  group->decoded_from_explicit_params))
  324|      0|        return 0;
  325|       |
  326|  7.50k|    curve_nid = EC_GROUP_get_curve_name(group);
  327|       |
  328|       |    /*
  329|       |     * Get the explicit parameters in these two cases:
  330|       |     * - We do not have a template, i.e. specific parameters are requested
  331|       |     * - The curve is not a named curve
  332|       |     */
  333|  7.50k|    if (tmpl == NULL || curve_nid == NID_undef)
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (333:9): [True: 7.50k, False: 0]
  |  Branch (333:25): [True: 0, False: 0]
  ------------------
  334|  7.50k|        if (!ec_group_explicit_todata(group, tmpl, params, bnctx, genbuf))
  ------------------
  |  Branch (334:13): [True: 0, False: 7.50k]
  ------------------
  335|      0|            goto err;
  336|       |
  337|  7.50k|    if (curve_nid != NID_undef) {
  ------------------
  |  |   18|  7.50k|#define NID_undef                       0
  ------------------
  |  Branch (337:9): [True: 7.38k, False: 119]
  ------------------
  338|       |        /* Named curve */
  339|  7.38k|        const char *curve_name = OSSL_EC_curve_nid2name(curve_nid);
  340|       |
  341|  7.38k|        if (curve_name == NULL
  ------------------
  |  Branch (341:13): [True: 0, False: 7.38k]
  ------------------
  342|  7.38k|            || !ossl_param_build_set_utf8_string(tmpl, params,
  ------------------
  |  Branch (342:16): [True: 0, False: 7.38k]
  ------------------
  343|  7.38k|                                                 OSSL_PKEY_PARAM_GROUP_NAME,
  ------------------
  |  |  412|  7.38k|# define OSSL_PKEY_PARAM_GROUP_NAME "group"
  ------------------
  344|  7.38k|                                                 curve_name)) {
  345|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_CURVE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  346|      0|            goto err;
  347|      0|        }
  348|  7.38k|    }
  349|  7.50k|    ret = 1;
  350|  7.50k|err:
  351|  7.50k|    return ret;
  352|  7.50k|}
ossl_ec_key_is_foreign:
  588|  6.78k|{
  589|  6.78k|#ifndef FIPS_MODULE
  590|  6.78k|    if (ec->engine != NULL || EC_KEY_get_method(ec) != EC_KEY_OpenSSL())
  ------------------
  |  Branch (590:9): [True: 0, False: 6.78k]
  |  Branch (590:31): [True: 0, False: 6.78k]
  ------------------
  591|      0|        return 1;
  592|  6.78k|#endif
  593|  6.78k|    return 0;
  594|       |
  595|  6.78k|}
ossl_x509_algor_is_sm2:
  732|  24.1k|{
  733|  24.1k|    int ptype = 0;
  734|  24.1k|    const void *pval = NULL;
  735|       |
  736|  24.1k|    X509_ALGOR_get0(NULL, &ptype, &pval, palg);
  737|       |
  738|  24.1k|    if (ptype == V_ASN1_OBJECT)
  ------------------
  |  |   68|  24.1k|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (738:9): [True: 23.8k, False: 228]
  ------------------
  739|  23.8k|        return OBJ_obj2nid((ASN1_OBJECT *)pval) == NID_sm2;
  ------------------
  |  | 1232|  23.8k|#define NID_sm2         1172
  ------------------
  740|       |
  741|    228|    if (ptype == V_ASN1_SEQUENCE) {
  ------------------
  |  |   74|    228|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (741:9): [True: 68, False: 160]
  ------------------
  742|     68|        const ASN1_STRING *str = pval;
  743|     68|        const unsigned char *der = str->data;
  744|     68|        int derlen = str->length;
  745|     68|        EC_GROUP *group;
  746|     68|        int ret;
  747|       |
  748|     68|        if ((group = d2i_ECPKParameters(NULL, &der, derlen)) == NULL)
  ------------------
  |  Branch (748:13): [True: 52, False: 16]
  ------------------
  749|     52|            ret = 0;
  750|     16|        else
  751|     16|            ret = (EC_GROUP_get_curve_name(group) == NID_sm2);
  ------------------
  |  | 1232|     16|#define NID_sm2         1172
  ------------------
  752|       |
  753|     68|        EC_GROUP_free(group);
  754|     68|        return ret;
  755|     68|    }
  756|       |
  757|    160|    return 0;
  758|    228|}
ossl_ec_key_param_from_x509_algor:
  762|  23.7k|{
  763|  23.7k|    int ptype = 0;
  764|  23.7k|    const void *pval = NULL;
  765|  23.7k|    EC_KEY *eckey = NULL;
  766|  23.7k|    EC_GROUP *group = NULL;
  767|       |
  768|  23.7k|    X509_ALGOR_get0(NULL, &ptype, &pval, palg);
  769|  23.7k|    if ((eckey = EC_KEY_new_ex(libctx, propq)) == NULL) {
  ------------------
  |  Branch (769:9): [True: 0, False: 23.7k]
  ------------------
  770|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  771|      0|        goto ecerr;
  772|      0|    }
  773|       |
  774|  23.7k|    if (ptype == V_ASN1_SEQUENCE) {
  ------------------
  |  |   74|  23.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (774:9): [True: 61, False: 23.7k]
  ------------------
  775|     61|        const ASN1_STRING *pstr = pval;
  776|     61|        const unsigned char *pm = pstr->data;
  777|     61|        int pmlen = pstr->length;
  778|       |
  779|       |
  780|     61|        if (d2i_ECParameters(&eckey, &pm, pmlen) == NULL) {
  ------------------
  |  Branch (780:13): [True: 36, False: 25]
  ------------------
  781|     36|            ERR_raise(ERR_LIB_EC, EC_R_DECODE_ERROR);
  ------------------
  |  |  401|     36|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     36|    (ERR_new(),                                                 \
  |  |  |  |  404|     36|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     36|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     36|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     36|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     36|     ERR_set_error)
  |  |  ------------------
  ------------------
  782|     36|            goto ecerr;
  783|     36|        }
  784|  23.7k|    } else if (ptype == V_ASN1_OBJECT) {
  ------------------
  |  |   68|  23.7k|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (784:16): [True: 23.5k, False: 138]
  ------------------
  785|  23.5k|        const ASN1_OBJECT *poid = pval;
  786|       |
  787|       |        /*
  788|       |         * type == V_ASN1_OBJECT => the parameters are given by an asn1 OID
  789|       |         */
  790|       |
  791|  23.5k|        group = EC_GROUP_new_by_curve_name_ex(libctx, propq, OBJ_obj2nid(poid));
  792|  23.5k|        if (group == NULL)
  ------------------
  |  Branch (792:13): [True: 468, False: 23.1k]
  ------------------
  793|    468|            goto ecerr;
  794|  23.1k|        EC_GROUP_set_asn1_flag(group, OPENSSL_EC_NAMED_CURVE);
  ------------------
  |  |   31|  23.1k|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  795|  23.1k|        if (EC_KEY_set_group(eckey, group) == 0)
  ------------------
  |  Branch (795:13): [True: 0, False: 23.1k]
  ------------------
  796|      0|            goto ecerr;
  797|  23.1k|        EC_GROUP_free(group);
  798|  23.1k|    } else {
  799|    138|        ERR_raise(ERR_LIB_EC, EC_R_DECODE_ERROR);
  ------------------
  |  |  401|    138|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    138|    (ERR_new(),                                                 \
  |  |  |  |  404|    138|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    138|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    138|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    138|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    138|     ERR_set_error)
  |  |  ------------------
  ------------------
  800|    138|        goto ecerr;
  801|    138|    }
  802|       |
  803|  23.1k|    return eckey;
  804|       |
  805|    642| ecerr:
  806|    642|    EC_KEY_free(eckey);
  807|    642|    EC_GROUP_free(group);
  808|    642|    return NULL;
  809|  23.7k|}
ossl_ec_key_from_pkcs8:
  813|    193|{
  814|    193|    const unsigned char *p = NULL;
  815|    193|    int pklen;
  816|    193|    EC_KEY *eckey = NULL;
  817|    193|    const X509_ALGOR *palg;
  818|       |
  819|    193|    if (!PKCS8_pkey_get0(NULL, &p, &pklen, &palg, p8inf))
  ------------------
  |  Branch (819:9): [True: 0, False: 193]
  ------------------
  820|      0|        return 0;
  821|    193|    eckey = ossl_ec_key_param_from_x509_algor(palg, libctx, propq);
  822|    193|    if (eckey == NULL)
  ------------------
  |  Branch (822:9): [True: 23, False: 170]
  ------------------
  823|     23|        goto err;
  824|       |
  825|       |    /* We have parameters now set private key */
  826|    170|    if (!d2i_ECPrivateKey(&eckey, &p, pklen)) {
  ------------------
  |  Branch (826:9): [True: 74, False: 96]
  ------------------
  827|     74|        ERR_raise(ERR_LIB_EC, EC_R_DECODE_ERROR);
  ------------------
  |  |  401|     74|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     74|    (ERR_new(),                                                 \
  |  |  |  |  404|     74|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     74|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     74|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     74|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     74|     ERR_set_error)
  |  |  ------------------
  ------------------
  828|     74|        goto err;
  829|     74|    }
  830|       |
  831|     96|    return eckey;
  832|     97| err:
  833|     97|    EC_KEY_free(eckey);
  834|     97|    return NULL;
  835|    170|}
ec_backend.c:ec_param_encoding_id2name:
   65|  7.50k|{
   66|  7.50k|    size_t i, sz;
   67|       |
   68|  14.8k|    for (i = 0, sz = OSSL_NELEM(encoding_nameid_map); i < sz; i++) {
  ------------------
  |  |   14|  7.50k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (68:55): [True: 14.8k, False: 0]
  ------------------
   69|  14.8k|        if (id == (int)encoding_nameid_map[i].id)
  ------------------
  |  Branch (69:13): [True: 7.50k, False: 7.38k]
  ------------------
   70|  7.50k|            return encoding_nameid_map[i].ptr;
   71|  14.8k|    }
   72|      0|    return NULL;
   73|  7.50k|}
ec_backend.c:ec_group_explicit_todata:
  160|  7.50k|{
  161|  7.50k|    int ret = 0, fid;
  162|  7.50k|    const char *field_type;
  163|  7.50k|    const OSSL_PARAM *param = NULL;
  164|  7.50k|    const OSSL_PARAM *param_p = NULL;
  165|  7.50k|    const OSSL_PARAM *param_a = NULL;
  166|  7.50k|    const OSSL_PARAM *param_b = NULL;
  167|       |
  168|  7.50k|    fid = EC_GROUP_get_field_type(group);
  169|       |
  170|  7.50k|    if (fid == NID_X9_62_prime_field) {
  ------------------
  |  |  152|  7.50k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (170:9): [True: 674, False: 6.83k]
  ------------------
  171|    674|        field_type = SN_X9_62_prime_field;
  ------------------
  |  |  151|    674|#define SN_X9_62_prime_field            "prime-field"
  ------------------
  172|  6.83k|    } else if (fid == NID_X9_62_characteristic_two_field) {
  ------------------
  |  |  156|  6.83k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (172:16): [True: 6.83k, False: 0]
  ------------------
  173|       |#ifdef OPENSSL_NO_EC2M
  174|       |        ERR_raise(ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED);
  175|       |        goto err;
  176|       |#else
  177|  6.83k|        field_type = SN_X9_62_characteristic_two_field;
  ------------------
  |  |  155|  6.83k|#define SN_X9_62_characteristic_two_field               "characteristic-two-field"
  ------------------
  178|  6.83k|#endif
  179|  6.83k|    } else {
  180|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_FIELD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  181|      0|        return 0;
  182|      0|    }
  183|       |
  184|  7.50k|    param_p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_P);
  ------------------
  |  |  385|  7.50k|# define OSSL_PKEY_PARAM_EC_P "p"
  ------------------
  185|  7.50k|    param_a = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_A);
  ------------------
  |  |  369|  7.50k|# define OSSL_PKEY_PARAM_EC_A "a"
  ------------------
  186|  7.50k|    param_b = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_B);
  ------------------
  |  |  370|  7.50k|# define OSSL_PKEY_PARAM_EC_B "b"
  ------------------
  187|  7.50k|    if (tmpl != NULL || param_p != NULL || param_a != NULL || param_b != NULL) {
  ------------------
  |  Branch (187:9): [True: 0, False: 7.50k]
  |  Branch (187:25): [True: 0, False: 7.50k]
  |  Branch (187:44): [True: 0, False: 7.50k]
  |  Branch (187:63): [True: 0, False: 7.50k]
  ------------------
  188|      0|        BIGNUM *p = BN_CTX_get(bnctx);
  189|      0|        BIGNUM *a = BN_CTX_get(bnctx);
  190|      0|        BIGNUM *b = BN_CTX_get(bnctx);
  191|       |
  192|      0|        if (b == NULL) {
  ------------------
  |  Branch (192:13): [True: 0, False: 0]
  ------------------
  193|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  194|      0|            goto err;
  195|      0|        }
  196|       |
  197|      0|        if (!EC_GROUP_get_curve(group, p, a, b, bnctx)) {
  ------------------
  |  Branch (197:13): [True: 0, False: 0]
  ------------------
  198|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_CURVE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  199|      0|            goto err;
  200|      0|        }
  201|      0|        if (!ossl_param_build_set_bn(tmpl, params, OSSL_PKEY_PARAM_EC_P, p)
  ------------------
  |  |  385|      0|# define OSSL_PKEY_PARAM_EC_P "p"
  ------------------
  |  Branch (201:13): [True: 0, False: 0]
  ------------------
  202|      0|            || !ossl_param_build_set_bn(tmpl, params, OSSL_PKEY_PARAM_EC_A, a)
  ------------------
  |  |  369|      0|# define OSSL_PKEY_PARAM_EC_A "a"
  ------------------
  |  Branch (202:16): [True: 0, False: 0]
  ------------------
  203|      0|            || !ossl_param_build_set_bn(tmpl, params, OSSL_PKEY_PARAM_EC_B, b)) {
  ------------------
  |  |  370|      0|# define OSSL_PKEY_PARAM_EC_B "b"
  ------------------
  |  Branch (203:16): [True: 0, False: 0]
  ------------------
  204|      0|            ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  205|      0|            goto err;
  206|      0|        }
  207|      0|    }
  208|       |
  209|  7.50k|    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_ORDER);
  ------------------
  |  |  384|  7.50k|# define OSSL_PKEY_PARAM_EC_ORDER "order"
  ------------------
  210|  7.50k|    if (tmpl != NULL || param != NULL) {
  ------------------
  |  Branch (210:9): [True: 0, False: 7.50k]
  |  Branch (210:25): [True: 0, False: 7.50k]
  ------------------
  211|      0|        const BIGNUM *order = EC_GROUP_get0_order(group);
  212|       |
  213|      0|        if (order == NULL) {
  ------------------
  |  Branch (213:13): [True: 0, False: 0]
  ------------------
  214|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  215|      0|            goto err;
  216|      0|        }
  217|      0|        if (!ossl_param_build_set_bn(tmpl, params, OSSL_PKEY_PARAM_EC_ORDER,
  ------------------
  |  |  384|      0|# define OSSL_PKEY_PARAM_EC_ORDER "order"
  ------------------
  |  Branch (217:13): [True: 0, False: 0]
  ------------------
  218|      0|                                    order)) {
  219|      0|            ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  220|      0|            goto err;
  221|      0|        }
  222|      0|    }
  223|       |
  224|  7.50k|    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_FIELD_TYPE);
  ------------------
  |  |  380|  7.50k|# define OSSL_PKEY_PARAM_EC_FIELD_TYPE "field-type"
  ------------------
  225|  7.50k|    if (tmpl != NULL || param != NULL) {
  ------------------
  |  Branch (225:9): [True: 0, False: 7.50k]
  |  Branch (225:25): [True: 0, False: 7.50k]
  ------------------
  226|      0|        if (!ossl_param_build_set_utf8_string(tmpl, params,
  ------------------
  |  Branch (226:13): [True: 0, False: 0]
  ------------------
  227|      0|                                              OSSL_PKEY_PARAM_EC_FIELD_TYPE,
  ------------------
  |  |  380|      0|# define OSSL_PKEY_PARAM_EC_FIELD_TYPE "field-type"
  ------------------
  228|      0|                                              field_type)) {
  229|      0|            ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  230|      0|            goto err;
  231|      0|        }
  232|      0|    }
  233|       |
  234|  7.50k|    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_GENERATOR);
  ------------------
  |  |  381|  7.50k|# define OSSL_PKEY_PARAM_EC_GENERATOR "generator"
  ------------------
  235|  7.50k|    if (tmpl != NULL || param != NULL) {
  ------------------
  |  Branch (235:9): [True: 0, False: 7.50k]
  |  Branch (235:25): [True: 0, False: 7.50k]
  ------------------
  236|      0|        size_t genbuf_len;
  237|      0|        const EC_POINT *genpt = EC_GROUP_get0_generator(group);
  238|      0|        point_conversion_form_t genform = EC_GROUP_get_point_conversion_form(group);
  239|       |
  240|      0|        if (genpt == NULL) {
  ------------------
  |  Branch (240:13): [True: 0, False: 0]
  ------------------
  241|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_GENERATOR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  242|      0|            goto err;
  243|      0|        }
  244|      0|        genbuf_len = EC_POINT_point2buf(group, genpt, genform, genbuf, bnctx);
  245|      0|        if (genbuf_len == 0) {
  ------------------
  |  Branch (245:13): [True: 0, False: 0]
  ------------------
  246|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_GENERATOR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  247|      0|            goto err;
  248|      0|        }
  249|      0|        if (!ossl_param_build_set_octet_string(tmpl, params,
  ------------------
  |  Branch (249:13): [True: 0, False: 0]
  ------------------
  250|      0|                                               OSSL_PKEY_PARAM_EC_GENERATOR,
  ------------------
  |  |  381|      0|# define OSSL_PKEY_PARAM_EC_GENERATOR "generator"
  ------------------
  251|      0|                                               *genbuf, genbuf_len)) {
  252|      0|            ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  253|      0|            goto err;
  254|      0|        }
  255|      0|    }
  256|       |
  257|  7.50k|    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_COFACTOR);
  ------------------
  |  |  377|  7.50k|# define OSSL_PKEY_PARAM_EC_COFACTOR "cofactor"
  ------------------
  258|  7.50k|    if (tmpl != NULL || param != NULL) {
  ------------------
  |  Branch (258:9): [True: 0, False: 7.50k]
  |  Branch (258:25): [True: 0, False: 7.50k]
  ------------------
  259|      0|        const BIGNUM *cofactor = EC_GROUP_get0_cofactor(group);
  260|       |
  261|      0|        if (cofactor != NULL
  ------------------
  |  Branch (261:13): [True: 0, False: 0]
  ------------------
  262|      0|            && !ossl_param_build_set_bn(tmpl, params,
  ------------------
  |  Branch (262:16): [True: 0, False: 0]
  ------------------
  263|      0|                                        OSSL_PKEY_PARAM_EC_COFACTOR, cofactor)) {
  ------------------
  |  |  377|      0|# define OSSL_PKEY_PARAM_EC_COFACTOR "cofactor"
  ------------------
  264|      0|            ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  265|      0|            goto err;
  266|      0|        }
  267|      0|    }
  268|       |
  269|  7.50k|    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_SEED);
  ------------------
  |  |  389|  7.50k|# define OSSL_PKEY_PARAM_EC_SEED "seed"
  ------------------
  270|  7.50k|    if (tmpl != NULL || param != NULL) {
  ------------------
  |  Branch (270:9): [True: 0, False: 7.50k]
  |  Branch (270:25): [True: 0, False: 7.50k]
  ------------------
  271|      0|        unsigned char *seed = EC_GROUP_get0_seed(group);
  272|      0|        size_t seed_len = EC_GROUP_get_seed_len(group);
  273|       |
  274|      0|        if (seed != NULL
  ------------------
  |  Branch (274:13): [True: 0, False: 0]
  ------------------
  275|      0|            && seed_len > 0
  ------------------
  |  Branch (275:16): [True: 0, False: 0]
  ------------------
  276|      0|            && !ossl_param_build_set_octet_string(tmpl, params,
  ------------------
  |  Branch (276:16): [True: 0, False: 0]
  ------------------
  277|      0|                                                  OSSL_PKEY_PARAM_EC_SEED,
  ------------------
  |  |  389|      0|# define OSSL_PKEY_PARAM_EC_SEED "seed"
  ------------------
  278|      0|                                                  seed, seed_len)) {
  279|      0|            ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  280|      0|            goto err;
  281|      0|        }
  282|      0|    }
  283|  7.50k|    ret = 1;
  284|  7.50k|err:
  285|  7.50k|    return ret;
  286|  7.50k|}

EC_GROUP_new_by_curve_name_ex:
 3315|  26.5k|{
 3316|  26.5k|    EC_GROUP *ret = NULL;
 3317|  26.5k|    const ec_list_element *curve;
 3318|       |
 3319|  26.5k|    if ((curve = ec_curve_nid2curve(nid)) == NULL
  ------------------
  |  Branch (3319:9): [True: 1.01k, False: 25.5k]
  ------------------
 3320|  26.5k|        || (ret = ec_group_new_from_data(libctx, propq, *curve)) == NULL) {
  ------------------
  |  Branch (3320:12): [True: 0, False: 25.5k]
  ------------------
 3321|  1.01k|#ifndef FIPS_MODULE
 3322|  1.01k|        ERR_raise_data(ERR_LIB_EC, EC_R_UNKNOWN_GROUP,
  ------------------
  |  |  403|  1.01k|    (ERR_new(),                                                 \
  |  |  404|  1.01k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|  1.01k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|  1.01k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|  1.01k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|  1.01k|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EC, EC_R_UNKNOWN_GROUP,
  ------------------
  |  |   86|  1.01k|# define ERR_LIB_EC              16
  ------------------
                      ERR_raise_data(ERR_LIB_EC, EC_R_UNKNOWN_GROUP,
  ------------------
  |  |   97|  1.01k|#  define EC_R_UNKNOWN_GROUP                               129
  ------------------
 3323|  1.01k|                       "name=%s", OBJ_nid2sn(nid));
 3324|       |#else
 3325|       |        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_GROUP);
 3326|       |#endif
 3327|  1.01k|        return NULL;
 3328|  1.01k|    }
 3329|       |
 3330|  25.5k|    return ret;
 3331|  26.5k|}
EC_GROUP_new_by_curve_name:
 3335|  2.94k|{
 3336|  2.94k|    return EC_GROUP_new_by_curve_name_ex(NULL, NULL, nid);
 3337|  2.94k|}
EC_curve_nid2nist:
 3358|  1.08k|{
 3359|  1.08k|    return ossl_ec_curve_nid2nist_int(nid);
 3360|  1.08k|}
ossl_ec_curve_nid_from_params:
 3377|    564|{
 3378|    564|    int ret = -1, nid, len, field_type, param_len;
 3379|    564|    size_t i, seed_len;
 3380|    564|    const unsigned char *seed, *params_seed, *params;
 3381|    564|    unsigned char *param_bytes = NULL;
 3382|    564|    const EC_CURVE_DATA *data;
 3383|    564|    const EC_POINT *generator = NULL;
 3384|    564|    const BIGNUM *cofactor = NULL;
 3385|       |    /* An array of BIGNUMs for (p, a, b, x, y, order) */
 3386|    564|    BIGNUM *bn[NUM_BN_FIELDS] = {NULL, NULL, NULL, NULL, NULL, NULL};
 3387|       |
 3388|       |    /* Use the optional named curve nid as a search field */
 3389|    564|    nid = EC_GROUP_get_curve_name(group);
 3390|    564|    field_type = EC_GROUP_get_field_type(group);
 3391|    564|    seed_len = EC_GROUP_get_seed_len(group);
 3392|    564|    seed = EC_GROUP_get0_seed(group);
 3393|    564|    cofactor = EC_GROUP_get0_cofactor(group);
 3394|       |
 3395|    564|    BN_CTX_start(ctx);
 3396|       |
 3397|       |    /*
 3398|       |     * The built-in curves contains data fields (p, a, b, x, y, order) that are
 3399|       |     * all zero-padded to be the same size. The size of the padding is
 3400|       |     * determined by either the number of bytes in the field modulus (p) or the
 3401|       |     * EC group order, whichever is larger.
 3402|       |     */
 3403|    564|    param_len = BN_num_bytes(group->order);
  ------------------
  |  |  189|    564|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
 3404|    564|    len = BN_num_bytes(group->field);
  ------------------
  |  |  189|    564|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
 3405|    564|    if (len > param_len)
  ------------------
  |  Branch (3405:9): [True: 482, False: 82]
  ------------------
 3406|    482|        param_len = len;
 3407|       |
 3408|       |    /* Allocate space to store the padded data for (p, a, b, x, y, order)  */
 3409|    564|    param_bytes = OPENSSL_malloc(param_len * NUM_BN_FIELDS);
  ------------------
  |  |  102|    564|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    564|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    564|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3410|    564|    if (param_bytes == NULL)
  ------------------
  |  Branch (3410:9): [True: 0, False: 564]
  ------------------
 3411|      0|        goto end;
 3412|       |
 3413|       |    /* Create the bignums */
 3414|  3.94k|    for (i = 0; i < NUM_BN_FIELDS; ++i) {
  ------------------
  |  | 3367|  3.94k|#define NUM_BN_FIELDS 6
  ------------------
  |  Branch (3414:17): [True: 3.38k, False: 564]
  ------------------
 3415|  3.38k|        if ((bn[i] = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (3415:13): [True: 0, False: 3.38k]
  ------------------
 3416|      0|            goto end;
 3417|  3.38k|    }
 3418|       |    /*
 3419|       |     * Fill in the bn array with the same values as the internal curves
 3420|       |     * i.e. the values are p, a, b, x, y, order.
 3421|       |     */
 3422|       |    /* Get p, a & b */
 3423|    564|    if (!(EC_GROUP_get_curve(group, bn[0], bn[1], bn[2], ctx)
  ------------------
  |  Branch (3423:11): [True: 564, False: 0]
  ------------------
 3424|    564|        && ((generator = EC_GROUP_get0_generator(group)) != NULL)
  ------------------
  |  Branch (3424:12): [True: 564, False: 0]
  ------------------
 3425|       |        /* Get x & y */
 3426|    564|        && EC_POINT_get_affine_coordinates(group, generator, bn[3], bn[4], ctx)
  ------------------
  |  Branch (3426:12): [True: 517, False: 47]
  ------------------
 3427|       |        /* Get order */
 3428|    564|        && EC_GROUP_get_order(group, bn[5], ctx)))
  ------------------
  |  Branch (3428:12): [True: 517, False: 0]
  ------------------
 3429|     47|        goto end;
 3430|       |
 3431|       |   /*
 3432|       |     * Convert the bignum array to bytes that are joined together to form
 3433|       |     * a single buffer that contains data for all fields.
 3434|       |     * (p, a, b, x, y, order) are all zero padded to be the same size.
 3435|       |     */
 3436|  3.61k|    for (i = 0; i < NUM_BN_FIELDS; ++i) {
  ------------------
  |  | 3367|  3.61k|#define NUM_BN_FIELDS 6
  ------------------
  |  Branch (3436:17): [True: 3.10k, False: 517]
  ------------------
 3437|  3.10k|        if (BN_bn2binpad(bn[i], &param_bytes[i*param_len], param_len) <= 0)
  ------------------
  |  Branch (3437:13): [True: 0, False: 3.10k]
  ------------------
 3438|      0|            goto end;
 3439|  3.10k|    }
 3440|       |
 3441|  41.2k|    for (i = 0; i < curve_list_length; i++) {
  ------------------
  |  | 3134|  41.2k|#define curve_list_length OSSL_NELEM(curve_list)
  |  |  ------------------
  |  |  |  |   14|  41.2k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
  |  Branch (3441:17): [True: 40.7k, False: 489]
  ------------------
 3442|  40.7k|        const ec_list_element curve = curve_list[i];
 3443|       |
 3444|  40.7k|        data = curve.data;
 3445|       |        /* Get the raw order byte data */
 3446|  40.7k|        params_seed = (const unsigned char *)(data + 1); /* skip header */
 3447|  40.7k|        params = params_seed + data->seed_len;
 3448|       |
 3449|       |        /* Look for unique fields in the fixed curve data */
 3450|  40.7k|        if (data->field_type == field_type
  ------------------
  |  Branch (3450:13): [True: 20.0k, False: 20.7k]
  ------------------
 3451|  40.7k|            && param_len == data->param_len
  ------------------
  |  Branch (3451:16): [True: 1.87k, False: 18.1k]
  ------------------
 3452|  40.7k|            && (nid <= 0 || nid == curve.nid)
  ------------------
  |  Branch (3452:17): [True: 1.87k, False: 0]
  |  Branch (3452:29): [True: 0, False: 0]
  ------------------
 3453|       |            /* check the optional cofactor (ignore if its zero) */
 3454|  40.7k|            && (BN_is_zero(cofactor)
  ------------------
  |  Branch (3454:17): [True: 1.61k, False: 257]
  ------------------
 3455|  1.87k|                || BN_is_word(cofactor, (const BN_ULONG)curve.data->cofactor))
  ------------------
  |  Branch (3455:20): [True: 112, False: 145]
  ------------------
 3456|       |            /* Check the optional seed (ignore if its not set) */
 3457|  40.7k|            && (data->seed_len == 0 || seed_len == 0
  ------------------
  |  Branch (3457:17): [True: 1.28k, False: 442]
  |  Branch (3457:40): [True: 442, False: 0]
  ------------------
 3458|  1.72k|                || ((size_t)data->seed_len == seed_len
  ------------------
  |  Branch (3458:21): [True: 0, False: 0]
  ------------------
 3459|      0|                     && memcmp(params_seed, seed, seed_len) == 0))
  ------------------
  |  Branch (3459:25): [True: 0, False: 0]
  ------------------
 3460|       |            /* Check that the groups params match the built-in curve params */
 3461|  40.7k|            && memcmp(param_bytes, params, param_len * NUM_BN_FIELDS)
  ------------------
  |  | 3367|  1.72k|#define NUM_BN_FIELDS 6
  ------------------
  |  Branch (3461:16): [True: 28, False: 1.70k]
  ------------------
 3462|  1.72k|                             == 0) {
 3463|     28|            ret = curve.nid;
 3464|     28|            goto end;
 3465|     28|        }
 3466|  40.7k|    }
 3467|       |    /* Gets here if the group was not found */
 3468|    489|    ret = NID_undef;
  ------------------
  |  |   18|    489|#define NID_undef                       0
  ------------------
 3469|    564|end:
 3470|    564|    OPENSSL_free(param_bytes);
  ------------------
  |  |  115|    564|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    564|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    564|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3471|    564|    BN_CTX_end(ctx);
 3472|    564|    return ret;
 3473|    489|}
ec_curve.c:ec_curve_nid2curve:
 3137|  26.5k|{
 3138|  26.5k|    size_t i;
 3139|       |
 3140|  26.5k|    if (nid <= 0)
  ------------------
  |  Branch (3140:9): [True: 951, False: 25.5k]
  ------------------
 3141|    951|        return NULL;
 3142|       |
 3143|   667k|    for (i = 0; i < curve_list_length; i++) {
  ------------------
  |  | 3134|   667k|#define curve_list_length OSSL_NELEM(curve_list)
  |  |  ------------------
  |  |  |  |   14|   667k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
  |  Branch (3143:17): [True: 667k, False: 60]
  ------------------
 3144|   667k|        if (curve_list[i].nid == nid)
  ------------------
  |  Branch (3144:13): [True: 25.5k, False: 642k]
  ------------------
 3145|  25.5k|            return &curve_list[i];
 3146|   667k|    }
 3147|     60|    return NULL;
 3148|  25.5k|}
ec_curve.c:ec_group_new_from_data:
 3153|  25.5k|{
 3154|  25.5k|    EC_GROUP *group = NULL;
 3155|  25.5k|    EC_POINT *P = NULL;
 3156|  25.5k|    BN_CTX *ctx = NULL;
 3157|  25.5k|    BIGNUM *p = NULL, *a = NULL, *b = NULL, *x = NULL, *y = NULL, *order =
 3158|  25.5k|        NULL;
 3159|  25.5k|    int ok = 0;
 3160|  25.5k|    int seed_len, param_len;
 3161|  25.5k|    const EC_METHOD *meth;
 3162|  25.5k|    const EC_CURVE_DATA *data;
 3163|  25.5k|    const unsigned char *params;
 3164|       |
 3165|       |    /* If no curve data curve method must handle everything */
 3166|  25.5k|    if (curve.data == NULL)
  ------------------
  |  Branch (3166:9): [True: 0, False: 25.5k]
  ------------------
 3167|      0|        return ossl_ec_group_new_ex(libctx, propq,
 3168|      0|                                    curve.meth != NULL ? curve.meth() : NULL);
  ------------------
  |  Branch (3168:37): [True: 0, False: 0]
  ------------------
 3169|       |
 3170|  25.5k|    if ((ctx = BN_CTX_new_ex(libctx)) == NULL) {
  ------------------
  |  Branch (3170:9): [True: 0, False: 25.5k]
  ------------------
 3171|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3172|      0|        goto err;
 3173|      0|    }
 3174|       |
 3175|  25.5k|    data = curve.data;
 3176|  25.5k|    seed_len = data->seed_len;
 3177|  25.5k|    param_len = data->param_len;
 3178|  25.5k|    params = (const unsigned char *)(data + 1); /* skip header */
 3179|       |
 3180|  25.5k|    if (curve.meth != NULL) {
  ------------------
  |  Branch (3180:9): [True: 763, False: 24.7k]
  ------------------
 3181|    763|        meth = curve.meth();
 3182|    763|        if ((group = ossl_ec_group_new_ex(libctx, propq, meth)) == NULL) {
  ------------------
  |  Branch (3182:13): [True: 0, False: 763]
  ------------------
 3183|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3184|      0|            goto err;
 3185|      0|        }
 3186|    763|        if (group->meth->group_full_init != NULL) {
  ------------------
  |  Branch (3186:13): [True: 49, False: 714]
  ------------------
 3187|     49|            if (!group->meth->group_full_init(group, params)){
  ------------------
  |  Branch (3187:17): [True: 0, False: 49]
  ------------------
 3188|      0|                ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3189|      0|                goto err;
 3190|      0|            }
 3191|     49|            EC_GROUP_set_curve_name(group, curve.nid);
 3192|     49|            BN_CTX_free(ctx);
 3193|     49|            return group;
 3194|     49|        }
 3195|    763|    }
 3196|       |
 3197|  25.4k|    params += seed_len;         /* skip seed */
 3198|       |
 3199|  25.4k|    if ((p = BN_bin2bn(params + 0 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (3199:9): [True: 0, False: 25.4k]
  ------------------
 3200|  25.4k|        || (a = BN_bin2bn(params + 1 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (3200:12): [True: 0, False: 25.4k]
  ------------------
 3201|  25.4k|        || (b = BN_bin2bn(params + 2 * param_len, param_len, NULL)) == NULL) {
  ------------------
  |  Branch (3201:12): [True: 0, False: 25.4k]
  ------------------
 3202|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3203|      0|        goto err;
 3204|      0|    }
 3205|       |
 3206|  25.4k|    if (group != NULL) {
  ------------------
  |  Branch (3206:9): [True: 714, False: 24.7k]
  ------------------
 3207|    714|        if (group->meth->group_set_curve(group, p, a, b, ctx) == 0) {
  ------------------
  |  Branch (3207:13): [True: 0, False: 714]
  ------------------
 3208|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3209|      0|            goto err;
 3210|      0|        }
 3211|  24.7k|    } else if (data->field_type == NID_X9_62_prime_field) {
  ------------------
  |  |  152|  24.7k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (3211:16): [True: 1.48k, False: 23.2k]
  ------------------
 3212|  1.48k|        if ((group = EC_GROUP_new_curve_GFp(p, a, b, ctx)) == NULL) {
  ------------------
  |  Branch (3212:13): [True: 0, False: 1.48k]
  ------------------
 3213|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3214|      0|            goto err;
 3215|      0|        }
 3216|  1.48k|    }
 3217|  23.2k|#ifndef OPENSSL_NO_EC2M
 3218|  23.2k|    else {                      /* field_type ==
 3219|       |                                 * NID_X9_62_characteristic_two_field */
 3220|       |
 3221|  23.2k|        if ((group = EC_GROUP_new_curve_GF2m(p, a, b, ctx)) == NULL) {
  ------------------
  |  Branch (3221:13): [True: 0, False: 23.2k]
  ------------------
 3222|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3223|      0|            goto err;
 3224|      0|        }
 3225|  23.2k|    }
 3226|  25.4k|#endif
 3227|       |
 3228|  25.4k|    EC_GROUP_set_curve_name(group, curve.nid);
 3229|       |
 3230|  25.4k|    if ((P = EC_POINT_new(group)) == NULL) {
  ------------------
  |  Branch (3230:9): [True: 0, False: 25.4k]
  ------------------
 3231|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3232|      0|        goto err;
 3233|      0|    }
 3234|       |
 3235|  25.4k|    if ((x = BN_bin2bn(params + 3 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (3235:9): [True: 0, False: 25.4k]
  ------------------
 3236|  25.4k|        || (y = BN_bin2bn(params + 4 * param_len, param_len, NULL)) == NULL) {
  ------------------
  |  Branch (3236:12): [True: 0, False: 25.4k]
  ------------------
 3237|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3238|      0|        goto err;
 3239|      0|    }
 3240|  25.4k|    if (!EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) {
  ------------------
  |  Branch (3240:9): [True: 0, False: 25.4k]
  ------------------
 3241|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3242|      0|        goto err;
 3243|      0|    }
 3244|  25.4k|    if ((order = BN_bin2bn(params + 5 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (3244:9): [True: 0, False: 25.4k]
  ------------------
 3245|  25.4k|        || !BN_set_word(x, (BN_ULONG)data->cofactor)) {
  ------------------
  |  Branch (3245:12): [True: 0, False: 25.4k]
  ------------------
 3246|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3247|      0|        goto err;
 3248|      0|    }
 3249|  25.4k|    if (!EC_GROUP_set_generator(group, P, order, x)) {
  ------------------
  |  Branch (3249:9): [True: 0, False: 25.4k]
  ------------------
 3250|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3251|      0|        goto err;
 3252|      0|    }
 3253|  25.4k|    if (seed_len) {
  ------------------
  |  Branch (3253:9): [True: 15.1k, False: 10.3k]
  ------------------
 3254|  15.1k|        if (!EC_GROUP_set_seed(group, params - seed_len, seed_len)) {
  ------------------
  |  Branch (3254:13): [True: 0, False: 15.1k]
  ------------------
 3255|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3256|      0|            goto err;
 3257|      0|        }
 3258|  15.1k|    }
 3259|       |
 3260|  25.4k|#ifndef FIPS_MODULE
 3261|  25.4k|    if (EC_GROUP_get_asn1_flag(group) == OPENSSL_EC_NAMED_CURVE) {
  ------------------
  |  |   31|  25.4k|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  |  Branch (3261:9): [True: 25.4k, False: 0]
  ------------------
 3262|       |        /*
 3263|       |         * Some curves don't have an associated OID: for those we should not
 3264|       |         * default to `OPENSSL_EC_NAMED_CURVE` encoding of parameters and
 3265|       |         * instead set the ASN1 flag to `OPENSSL_EC_EXPLICIT_CURVE`.
 3266|       |         *
 3267|       |         * Note that `OPENSSL_EC_NAMED_CURVE` is set as the default ASN1 flag on
 3268|       |         * `EC_GROUP_new()`, when we don't have enough elements to determine if
 3269|       |         * an OID for the curve name actually exists.
 3270|       |         * We could implement this check on `EC_GROUP_set_curve_name()` but
 3271|       |         * overloading the simple setter with this lookup could have a negative
 3272|       |         * performance impact and unexpected consequences.
 3273|       |         */
 3274|  25.4k|        ASN1_OBJECT *asn1obj = OBJ_nid2obj(curve.nid);
 3275|       |
 3276|  25.4k|        if (asn1obj == NULL) {
  ------------------
  |  Branch (3276:13): [True: 0, False: 25.4k]
  ------------------
 3277|      0|            ERR_raise(ERR_LIB_EC, ERR_R_OBJ_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3278|      0|            goto err;
 3279|      0|        }
 3280|  25.4k|        if (OBJ_length(asn1obj) == 0)
  ------------------
  |  Branch (3280:13): [True: 0, False: 25.4k]
  ------------------
 3281|      0|            EC_GROUP_set_asn1_flag(group, OPENSSL_EC_EXPLICIT_CURVE);
  ------------------
  |  |   30|      0|# define OPENSSL_EC_EXPLICIT_CURVE  0x000
  ------------------
 3282|       |
 3283|  25.4k|        ASN1_OBJECT_free(asn1obj);
 3284|  25.4k|    }
 3285|       |#else
 3286|       |    /*
 3287|       |     * Inside the FIPS module we do not support explicit curves anyway
 3288|       |     * so the above check is not necessary.
 3289|       |     *
 3290|       |     * Skipping it is also necessary because `OBJ_length()` and
 3291|       |     * `ASN1_OBJECT_free()` are not available within the FIPS module
 3292|       |     * boundaries.
 3293|       |     */
 3294|       |#endif
 3295|       |
 3296|  25.4k|    ok = 1;
 3297|  25.4k| err:
 3298|  25.4k|    if (!ok) {
  ------------------
  |  Branch (3298:9): [True: 0, False: 25.4k]
  ------------------
 3299|      0|        EC_GROUP_free(group);
 3300|      0|        group = NULL;
 3301|      0|    }
 3302|  25.4k|    EC_POINT_free(P);
 3303|  25.4k|    BN_CTX_free(ctx);
 3304|  25.4k|    BN_free(p);
 3305|  25.4k|    BN_free(a);
 3306|  25.4k|    BN_free(b);
 3307|  25.4k|    BN_free(order);
 3308|  25.4k|    BN_free(x);
 3309|  25.4k|    BN_free(y);
 3310|  25.4k|    return group;
 3311|  25.4k|}

EC_GROUP_new_curve_GFp:
   23|  2.62k|{
   24|  2.62k|    const EC_METHOD *meth;
   25|  2.62k|    EC_GROUP *ret;
   26|       |
   27|  2.62k|#if defined(OPENSSL_BN_ASM_MONT)
   28|       |    /*
   29|       |     * This might appear controversial, but the fact is that generic
   30|       |     * prime method was observed to deliver better performance even
   31|       |     * for NIST primes on a range of platforms, e.g.: 60%-15%
   32|       |     * improvement on IA-64, ~25% on ARM, 30%-90% on P4, 20%-25%
   33|       |     * in 32-bit build and 35%--12% in 64-bit build on Core2...
   34|       |     * Coefficients are relative to optimized bn_nist.c for most
   35|       |     * intensive ECDSA verify and ECDH operations for 192- and 521-
   36|       |     * bit keys respectively. Choice of these boundary values is
   37|       |     * arguable, because the dependency of improvement coefficient
   38|       |     * from key length is not a "monotone" curve. For example while
   39|       |     * 571-bit result is 23% on ARM, 384-bit one is -1%. But it's
   40|       |     * generally faster, sometimes "respectfully" faster, sometimes
   41|       |     * "tolerably" slower... What effectively happens is that loop
   42|       |     * with bn_mul_add_words is put against bn_mul_mont, and the
   43|       |     * latter "wins" on short vectors. Correct solution should be
   44|       |     * implementing dedicated NxN multiplication subroutines for
   45|       |     * small N. But till it materializes, let's stick to generic
   46|       |     * prime method...
   47|       |     *                                              <@dot-asm>
   48|       |     */
   49|  2.62k|    meth = EC_GFp_mont_method();
   50|       |#else
   51|       |    if (BN_nist_mod_func(p))
   52|       |        meth = EC_GFp_nist_method();
   53|       |    else
   54|       |        meth = EC_GFp_mont_method();
   55|       |#endif
   56|       |
   57|  2.62k|    ret = ossl_ec_group_new_ex(ossl_bn_get_libctx(ctx), NULL, meth);
   58|  2.62k|    if (ret == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 2.62k]
  ------------------
   59|      0|        return NULL;
   60|       |
   61|  2.62k|    if (!EC_GROUP_set_curve(ret, p, a, b, ctx)) {
  ------------------
  |  Branch (61:9): [True: 196, False: 2.43k]
  ------------------
   62|    196|        EC_GROUP_free(ret);
   63|    196|        return NULL;
   64|    196|    }
   65|       |
   66|  2.43k|    return ret;
   67|  2.62k|}
EC_GROUP_new_curve_GF2m:
   72|  23.2k|{
   73|  23.2k|    const EC_METHOD *meth;
   74|  23.2k|    EC_GROUP *ret;
   75|       |
   76|  23.2k|    meth = EC_GF2m_simple_method();
   77|       |
   78|  23.2k|    ret = ossl_ec_group_new_ex(ossl_bn_get_libctx(ctx), NULL, meth);
   79|  23.2k|    if (ret == NULL)
  ------------------
  |  Branch (79:9): [True: 0, False: 23.2k]
  ------------------
   80|      0|        return NULL;
   81|       |
   82|  23.2k|    if (!EC_GROUP_set_curve(ret, p, a, b, ctx)) {
  ------------------
  |  Branch (82:9): [True: 0, False: 23.2k]
  ------------------
   83|      0|        EC_GROUP_free(ret);
   84|      0|        return NULL;
   85|      0|    }
   86|       |
   87|  23.2k|    return ret;
   88|  23.2k|}

ossl_err_load_EC_strings:
  127|      2|{
  128|      2|# ifndef OPENSSL_NO_ERR
  129|      2|    if (ERR_reason_error_string(EC_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (129:9): [True: 2, False: 0]
  ------------------
  130|      2|        ERR_load_strings_const(EC_str_reasons);
  131|      2|# endif
  132|      2|    return 1;
  133|      2|}

EC_KEY_new:
   35|  15.6k|{
   36|  15.6k|    return ossl_ec_key_new_method_int(NULL, NULL, NULL);
   37|  15.6k|}
EC_KEY_new_ex:
   41|  23.7k|{
   42|  23.7k|    return ossl_ec_key_new_method_int(ctx, propq, NULL);
   43|  23.7k|}
EC_KEY_free:
   72|   142k|{
   73|   142k|    int i;
   74|       |
   75|   142k|    if (r == NULL)
  ------------------
  |  Branch (75:9): [True: 96.6k, False: 46.2k]
  ------------------
   76|  96.6k|        return;
   77|       |
   78|  46.2k|    CRYPTO_DOWN_REF(&r->references, &i);
   79|  46.2k|    REF_PRINT_COUNT("EC_KEY", i, r);
  ------------------
  |  |  301|  46.2k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  46.2k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  46.2k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  46.2k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   80|  46.2k|    if (i > 0)
  ------------------
  |  Branch (80:9): [True: 6.77k, False: 39.4k]
  ------------------
   81|  6.77k|        return;
   82|  39.4k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|  39.4k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 39.4k]
  |  |  ------------------
  ------------------
   83|       |
   84|  39.4k|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (84:9): [True: 39.4k, False: 0]
  |  Branch (84:28): [True: 0, False: 39.4k]
  ------------------
   85|      0|        r->meth->finish(r);
   86|       |
   87|  39.4k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   88|  39.4k|    ENGINE_finish(r->engine);
   89|  39.4k|#endif
   90|       |
   91|  39.4k|    if (r->group && r->group->meth->keyfinish)
  ------------------
  |  Branch (91:9): [True: 25.8k, False: 13.5k]
  |  Branch (91:21): [True: 0, False: 25.8k]
  ------------------
   92|      0|        r->group->meth->keyfinish(r);
   93|       |
   94|  39.4k|#ifndef FIPS_MODULE
   95|  39.4k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EC_KEY, r, &r->ex_data);
  ------------------
  |  |  237|  39.4k|# define CRYPTO_EX_INDEX_EC_KEY           8
  ------------------
   96|  39.4k|#endif
   97|  39.4k|    CRYPTO_FREE_REF(&r->references);
   98|  39.4k|    EC_GROUP_free(r->group);
   99|  39.4k|    EC_POINT_free(r->pub_key);
  100|  39.4k|    BN_clear_free(r->priv_key);
  101|  39.4k|    OPENSSL_free(r->propq);
  ------------------
  |  |  115|  39.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  39.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  39.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  102|       |
  103|  39.4k|    OPENSSL_clear_free((void *)r, sizeof(EC_KEY));
  ------------------
  |  |  113|  39.4k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  39.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  39.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|  39.4k|}
EC_KEY_up_ref:
  194|  6.77k|{
  195|  6.77k|    int i;
  196|       |
  197|  6.77k|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (197:9): [True: 0, False: 6.77k]
  ------------------
  198|      0|        return 0;
  199|       |
  200|  6.77k|    REF_PRINT_COUNT("EC_KEY", i, r);
  ------------------
  |  |  301|  6.77k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  6.77k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  6.77k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  6.77k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  201|  6.77k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|  6.77k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 6.77k]
  |  |  ------------------
  ------------------
  202|  6.77k|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (202:13): [True: 6.77k, False: 0]
  ------------------
  203|  6.77k|}
ossl_ec_key_simple_generate_public_key:
  448|  1.72k|{
  449|  1.72k|    int ret;
  450|  1.72k|    BN_CTX *ctx = BN_CTX_new_ex(eckey->libctx);
  451|       |
  452|  1.72k|    if (ctx == NULL)
  ------------------
  |  Branch (452:9): [True: 0, False: 1.72k]
  ------------------
  453|      0|        return 0;
  454|       |
  455|       |    /*
  456|       |     * See SP800-56AR3 5.6.1.2.2: Step (8)
  457|       |     * pub_key = priv_key * G (where G is a point on the curve)
  458|       |     */
  459|  1.72k|    ret = EC_POINT_mul(eckey->group, eckey->pub_key, eckey->priv_key, NULL,
  460|  1.72k|                       NULL, ctx);
  461|       |
  462|  1.72k|    BN_CTX_free(ctx);
  463|  1.72k|    if (ret == 1)
  ------------------
  |  Branch (463:9): [True: 1.72k, False: 0]
  ------------------
  464|  1.72k|        eckey->dirty_cnt++;
  465|       |
  466|  1.72k|    return ret;
  467|  1.72k|}
ossl_ec_key_get_libctx:
  752|  15.5k|{
  753|  15.5k|    return key->libctx;
  754|  15.5k|}
ossl_ec_key_get0_propq:
  757|  7.50k|{
  758|  7.50k|    return key->propq;
  759|  7.50k|}
ossl_ec_key_set0_libctx:
  762|  7.50k|{
  763|  7.50k|    key->libctx = libctx;
  764|       |    /* Do we need to propagate this to the group? */
  765|  7.50k|}
EC_KEY_get0_group:
  768|  38.6k|{
  769|  38.6k|    return key->group;
  770|  38.6k|}
EC_KEY_set_group:
  773|  23.1k|{
  774|  23.1k|    if (key->meth->set_group != NULL && key->meth->set_group(key, group) == 0)
  ------------------
  |  Branch (774:9): [True: 0, False: 23.1k]
  |  Branch (774:41): [True: 0, False: 0]
  ------------------
  775|      0|        return 0;
  776|  23.1k|    EC_GROUP_free(key->group);
  777|  23.1k|    key->group = EC_GROUP_dup(group);
  778|  23.1k|    if (key->group != NULL && EC_GROUP_get_curve_name(key->group) == NID_sm2)
  ------------------
  |  | 1232|  23.1k|#define NID_sm2         1172
  ------------------
  |  Branch (778:9): [True: 23.1k, False: 0]
  |  Branch (778:31): [True: 2, False: 23.1k]
  ------------------
  779|      2|        EC_KEY_set_flags(key, EC_FLAG_SM2_RANGE);
  ------------------
  |  |  962|      2|#  define EC_FLAG_SM2_RANGE              0x0004
  ------------------
  780|       |
  781|  23.1k|    key->dirty_cnt++;
  782|  23.1k|    return (key->group == NULL) ? 0 : 1;
  ------------------
  |  Branch (782:12): [True: 0, False: 23.1k]
  ------------------
  783|  23.1k|}
EC_KEY_get0_private_key:
  786|  10.5k|{
  787|  10.5k|    return key->priv_key;
  788|  10.5k|}
EC_KEY_get0_public_key:
  886|  8.81k|{
  887|  8.81k|    return key->pub_key;
  888|  8.81k|}
EC_KEY_get_enc_flags:
  902|  7.71k|{
  903|  7.71k|    return key->enc_flag;
  904|  7.71k|}
EC_KEY_set_enc_flags:
  907|    424|{
  908|    424|    key->enc_flag = flags;
  909|    424|}
EC_KEY_get_conv_form:
  912|  8.81k|{
  913|  8.81k|    return key->conv_form;
  914|  8.81k|}
EC_KEY_get_flags:
  939|  30.7k|{
  940|  30.7k|    return key->flags;
  941|  30.7k|}
EC_KEY_set_flags:
  944|     17|{
  945|     17|    key->flags |= flags;
  946|     17|    key->dirty_cnt++;
  947|     17|}
EC_KEY_key2buf:
  964|  1.65k|{
  965|  1.65k|    if (key == NULL || key->pub_key == NULL || key->group == NULL)
  ------------------
  |  Branch (965:9): [True: 0, False: 1.65k]
  |  Branch (965:24): [True: 0, False: 1.65k]
  |  Branch (965:48): [True: 0, False: 1.65k]
  ------------------
  966|      0|        return 0;
  967|  1.65k|    return EC_POINT_point2buf(key->group, key->pub_key, form, pbuf, ctx);
  968|  1.65k|}
EC_KEY_oct2key:
  972|  24.0k|{
  973|  24.0k|    if (key == NULL || key->group == NULL)
  ------------------
  |  Branch (973:9): [True: 0, False: 24.0k]
  |  Branch (973:24): [True: 0, False: 24.0k]
  ------------------
  974|      0|        return 0;
  975|  24.0k|    if (key->pub_key == NULL)
  ------------------
  |  Branch (975:9): [True: 22.9k, False: 1.06k]
  ------------------
  976|  22.9k|        key->pub_key = EC_POINT_new(key->group);
  977|  24.0k|    if (key->pub_key == NULL)
  ------------------
  |  Branch (977:9): [True: 0, False: 24.0k]
  ------------------
  978|      0|        return 0;
  979|  24.0k|    if (EC_POINT_oct2point(key->group, key->pub_key, buf, len, ctx) == 0)
  ------------------
  |  Branch (979:9): [True: 16.7k, False: 7.29k]
  ------------------
  980|  16.7k|        return 0;
  981|  7.29k|    key->dirty_cnt++;
  982|       |    /*
  983|       |     * Save the point conversion form.
  984|       |     * For non-custom curves the first octet of the buffer (excluding
  985|       |     * the last significant bit) contains the point conversion form.
  986|       |     * EC_POINT_oct2point() has already performed sanity checking of
  987|       |     * the buffer so we know it is valid.
  988|       |     */
  989|  7.29k|    if ((key->group->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0)
  ------------------
  |  |   29|  7.29k|#define EC_FLAGS_CUSTOM_CURVE   0x2
  ------------------
  |  Branch (989:9): [True: 7.29k, False: 0]
  ------------------
  990|  7.29k|        key->conv_form = (point_conversion_form_t)(buf[0] & ~0x01);
  991|  7.29k|    return 1;
  992|  24.0k|}
EC_KEY_priv2oct:
  996|  6.46k|{
  997|  6.46k|    if (eckey->group == NULL || eckey->group->meth == NULL)
  ------------------
  |  Branch (997:9): [True: 0, False: 6.46k]
  |  Branch (997:33): [True: 0, False: 6.46k]
  ------------------
  998|      0|        return 0;
  999|  6.46k|    if (eckey->group->meth->priv2oct == NULL) {
  ------------------
  |  Branch (999:9): [True: 0, False: 6.46k]
  ------------------
 1000|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1001|      0|        return 0;
 1002|      0|    }
 1003|       |
 1004|  6.46k|    return eckey->group->meth->priv2oct(eckey, buf, len);
 1005|  6.46k|}
ossl_ec_key_simple_priv2oct:
 1009|  6.46k|{
 1010|  6.46k|    size_t buf_len;
 1011|       |
 1012|  6.46k|    buf_len = (EC_GROUP_order_bits(eckey->group) + 7) / 8;
 1013|  6.46k|    if (eckey->priv_key == NULL)
  ------------------
  |  Branch (1013:9): [True: 0, False: 6.46k]
  ------------------
 1014|      0|        return 0;
 1015|  6.46k|    if (buf == NULL)
  ------------------
  |  Branch (1015:9): [True: 3.23k, False: 3.23k]
  ------------------
 1016|  3.23k|        return buf_len;
 1017|  3.23k|    else if (len < buf_len)
  ------------------
  |  Branch (1017:14): [True: 0, False: 3.23k]
  ------------------
 1018|      0|        return 0;
 1019|       |
 1020|       |    /* Octetstring may need leading zeros if BN is to short */
 1021|       |
 1022|  3.23k|    if (BN_bn2binpad(eckey->priv_key, buf, buf_len) == -1) {
  ------------------
  |  Branch (1022:9): [True: 994, False: 2.23k]
  ------------------
 1023|    994|        ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|    994|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    994|    (ERR_new(),                                                 \
  |  |  |  |  404|    994|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    994|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    994|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    994|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    994|     ERR_set_error)
  |  |  ------------------
  ------------------
 1024|    994|        return 0;
 1025|    994|    }
 1026|       |
 1027|  2.23k|    return buf_len;
 1028|  3.23k|}
EC_KEY_oct2priv:
 1031|  2.78k|{
 1032|  2.78k|    int ret;
 1033|       |
 1034|  2.78k|    if (eckey->group == NULL || eckey->group->meth == NULL)
  ------------------
  |  Branch (1034:9): [True: 0, False: 2.78k]
  |  Branch (1034:33): [True: 0, False: 2.78k]
  ------------------
 1035|      0|        return 0;
 1036|  2.78k|    if (eckey->group->meth->oct2priv == NULL) {
  ------------------
  |  Branch (1036:9): [True: 0, False: 2.78k]
  ------------------
 1037|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1038|      0|        return 0;
 1039|      0|    }
 1040|  2.78k|    ret = eckey->group->meth->oct2priv(eckey, buf, len);
 1041|  2.78k|    if (ret == 1)
  ------------------
  |  Branch (1041:9): [True: 2.78k, False: 0]
  ------------------
 1042|  2.78k|        eckey->dirty_cnt++;
 1043|  2.78k|    return ret;
 1044|  2.78k|}
ossl_ec_key_simple_oct2priv:
 1048|  2.78k|{
 1049|  2.78k|    if (eckey->priv_key == NULL)
  ------------------
  |  Branch (1049:9): [True: 2.78k, False: 0]
  ------------------
 1050|  2.78k|        eckey->priv_key = BN_secure_new();
 1051|  2.78k|    if (eckey->priv_key == NULL) {
  ------------------
  |  Branch (1051:9): [True: 0, False: 2.78k]
  ------------------
 1052|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1053|      0|        return 0;
 1054|      0|    }
 1055|  2.78k|    if (BN_bin2bn(buf, len, eckey->priv_key) == NULL) {
  ------------------
  |  Branch (1055:9): [True: 0, False: 2.78k]
  ------------------
 1056|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1057|      0|        return 0;
 1058|      0|    }
 1059|  2.78k|    eckey->dirty_cnt++;
 1060|  2.78k|    return 1;
 1061|  2.78k|}
EC_KEY_priv2buf:
 1064|  3.23k|{
 1065|  3.23k|    size_t len;
 1066|  3.23k|    unsigned char *buf;
 1067|       |
 1068|  3.23k|    len = EC_KEY_priv2oct(eckey, NULL, 0);
 1069|  3.23k|    if (len == 0)
  ------------------
  |  Branch (1069:9): [True: 0, False: 3.23k]
  ------------------
 1070|      0|        return 0;
 1071|  3.23k|    if ((buf = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |  102|  3.23k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.23k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.23k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (1071:9): [True: 0, False: 3.23k]
  ------------------
 1072|      0|        return 0;
 1073|  3.23k|    len = EC_KEY_priv2oct(eckey, buf, len);
 1074|  3.23k|    if (len == 0) {
  ------------------
  |  Branch (1074:9): [True: 994, False: 2.23k]
  ------------------
 1075|    994|        OPENSSL_free(buf);
  ------------------
  |  |  115|    994|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    994|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    994|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1076|    994|        return 0;
 1077|    994|    }
 1078|  2.23k|    *pbuf = buf;
 1079|  2.23k|    return len;
 1080|  3.23k|}

EC_KEY_OpenSSL:
   41|  6.78k|{
   42|  6.78k|    return &openssl_ec_key_method;
   43|  6.78k|}
EC_KEY_get_default_method:
   46|  39.4k|{
   47|  39.4k|    return default_ec_key_meth;
   48|  39.4k|}
EC_KEY_get_method:
   59|  6.78k|{
   60|  6.78k|    return key->meth;
   61|  6.78k|}
ossl_ec_key_new_method_int:
   83|  39.4k|{
   84|  39.4k|    EC_KEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  39.4k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  39.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  39.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   85|       |
   86|  39.4k|    if (ret == NULL)
  ------------------
  |  Branch (86:9): [True: 0, False: 39.4k]
  ------------------
   87|      0|        return NULL;
   88|       |
   89|  39.4k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 39.4k]
  ------------------
   90|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   91|      0|        return NULL;
   92|      0|    }
   93|       |
   94|  39.4k|    ret->libctx = libctx;
   95|  39.4k|    if (propq != NULL) {
  ------------------
  |  Branch (95:9): [True: 160, False: 39.3k]
  ------------------
   96|    160|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  119|    160|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    160|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    160|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   97|    160|        if (ret->propq == NULL)
  ------------------
  |  Branch (97:13): [True: 0, False: 160]
  ------------------
   98|      0|            goto err;
   99|    160|    }
  100|       |
  101|  39.4k|    ret->meth = EC_KEY_get_default_method();
  102|  39.4k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  103|  39.4k|    if (engine != NULL) {
  ------------------
  |  Branch (103:9): [True: 0, False: 39.4k]
  ------------------
  104|      0|        if (!ENGINE_init(engine)) {
  ------------------
  |  Branch (104:13): [True: 0, False: 0]
  ------------------
  105|      0|            ERR_raise(ERR_LIB_EC, ERR_R_ENGINE_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  106|      0|            goto err;
  107|      0|        }
  108|      0|        ret->engine = engine;
  109|      0|    } else
  110|  39.4k|        ret->engine = ENGINE_get_default_EC();
  111|  39.4k|    if (ret->engine != NULL) {
  ------------------
  |  Branch (111:9): [True: 0, False: 39.4k]
  ------------------
  112|      0|        ret->meth = ENGINE_get_EC(ret->engine);
  113|      0|        if (ret->meth == NULL) {
  ------------------
  |  Branch (113:13): [True: 0, False: 0]
  ------------------
  114|      0|            ERR_raise(ERR_LIB_EC, ERR_R_ENGINE_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  115|      0|            goto err;
  116|      0|        }
  117|      0|    }
  118|  39.4k|#endif
  119|       |
  120|  39.4k|    ret->version = 1;
  121|  39.4k|    ret->conv_form = POINT_CONVERSION_UNCOMPRESSED;
  122|       |
  123|       |/* No ex_data inside the FIPS provider */
  124|  39.4k|#ifndef FIPS_MODULE
  125|  39.4k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_EC_KEY, ret, &ret->ex_data)) {
  ------------------
  |  |  237|  39.4k|# define CRYPTO_EX_INDEX_EC_KEY           8
  ------------------
  |  Branch (125:9): [True: 0, False: 39.4k]
  ------------------
  126|      0|        ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  127|      0|        goto err;
  128|      0|    }
  129|  39.4k|#endif
  130|       |
  131|  39.4k|    if (ret->meth->init != NULL && ret->meth->init(ret) == 0) {
  ------------------
  |  Branch (131:9): [True: 0, False: 39.4k]
  |  Branch (131:36): [True: 0, False: 0]
  ------------------
  132|      0|        ERR_raise(ERR_LIB_EC, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  133|      0|        goto err;
  134|      0|    }
  135|  39.4k|    return ret;
  136|       |
  137|      0| err:
  138|      0|    EC_KEY_free(ret);
  139|      0|    return NULL;
  140|  39.4k|}

ossl_ec_group_new_ex:
   32|  50.3k|{
   33|  50.3k|    EC_GROUP *ret;
   34|       |
   35|  50.3k|    if (meth == NULL) {
  ------------------
  |  Branch (35:9): [True: 0, False: 50.3k]
  ------------------
   36|      0|        ERR_raise(ERR_LIB_EC, EC_R_SLOT_FULL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   37|      0|        return NULL;
   38|      0|    }
   39|  50.3k|    if (meth->group_init == 0) {
  ------------------
  |  Branch (39:9): [True: 0, False: 50.3k]
  ------------------
   40|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   41|      0|        return NULL;
   42|      0|    }
   43|       |
   44|  50.3k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  50.3k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  50.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  50.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|  50.3k|    if (ret == NULL)
  ------------------
  |  Branch (45:9): [True: 0, False: 50.3k]
  ------------------
   46|      0|        return NULL;
   47|       |
   48|  50.3k|    ret->libctx = libctx;
   49|  50.3k|    if (propq != NULL) {
  ------------------
  |  Branch (49:9): [True: 44, False: 50.2k]
  ------------------
   50|     44|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  119|     44|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     44|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     44|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   51|     44|        if (ret->propq == NULL)
  ------------------
  |  Branch (51:13): [True: 0, False: 44]
  ------------------
   52|      0|            goto err;
   53|     44|    }
   54|  50.3k|    ret->meth = meth;
   55|  50.3k|    if ((ret->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0) {
  ------------------
  |  |   29|  50.3k|#define EC_FLAGS_CUSTOM_CURVE   0x2
  ------------------
  |  Branch (55:9): [True: 50.3k, False: 0]
  ------------------
   56|  50.3k|        ret->order = BN_new();
   57|  50.3k|        if (ret->order == NULL)
  ------------------
  |  Branch (57:13): [True: 0, False: 50.3k]
  ------------------
   58|      0|            goto err;
   59|  50.3k|        ret->cofactor = BN_new();
   60|  50.3k|        if (ret->cofactor == NULL)
  ------------------
  |  Branch (60:13): [True: 0, False: 50.3k]
  ------------------
   61|      0|            goto err;
   62|  50.3k|    }
   63|  50.3k|    ret->asn1_flag = OPENSSL_EC_EXPLICIT_CURVE;
  ------------------
  |  |   30|  50.3k|# define OPENSSL_EC_EXPLICIT_CURVE  0x000
  ------------------
   64|  50.3k|    ret->asn1_form = POINT_CONVERSION_UNCOMPRESSED;
   65|  50.3k|    if (!meth->group_init(ret))
  ------------------
  |  Branch (65:9): [True: 0, False: 50.3k]
  ------------------
   66|      0|        goto err;
   67|  50.3k|    return ret;
   68|       |
   69|      0| err:
   70|      0|    BN_free(ret->order);
   71|      0|    BN_free(ret->cofactor);
   72|      0|    OPENSSL_free(ret->propq);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|      0|    OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   74|      0|    return NULL;
   75|  50.3k|}
EC_pre_comp_free:
   87|  50.3k|{
   88|  50.3k|    switch (group->pre_comp_type) {
  ------------------
  |  Branch (88:13): [True: 0, False: 50.3k]
  ------------------
   89|  50.3k|    case PCT_none:
  ------------------
  |  Branch (89:5): [True: 50.3k, False: 0]
  ------------------
   90|  50.3k|        break;
   91|      0|    case PCT_nistz256:
  ------------------
  |  Branch (91:5): [True: 0, False: 50.3k]
  ------------------
   92|      0|#ifdef ECP_NISTZ256_ASM
   93|      0|        EC_nistz256_pre_comp_free(group->pre_comp.nistz256);
   94|      0|#endif
   95|      0|        break;
   96|      0|#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
   97|      0|    case PCT_nistp224:
  ------------------
  |  Branch (97:5): [True: 0, False: 50.3k]
  ------------------
   98|      0|        EC_nistp224_pre_comp_free(group->pre_comp.nistp224);
   99|      0|        break;
  100|      0|    case PCT_nistp256:
  ------------------
  |  Branch (100:5): [True: 0, False: 50.3k]
  ------------------
  101|      0|        EC_nistp256_pre_comp_free(group->pre_comp.nistp256);
  102|      0|        break;
  103|      0|    case PCT_nistp384:
  ------------------
  |  Branch (103:5): [True: 0, False: 50.3k]
  ------------------
  104|      0|        ossl_ec_nistp384_pre_comp_free(group->pre_comp.nistp384);
  105|      0|        break;
  106|      0|    case PCT_nistp521:
  ------------------
  |  Branch (106:5): [True: 0, False: 50.3k]
  ------------------
  107|      0|        EC_nistp521_pre_comp_free(group->pre_comp.nistp521);
  108|      0|        break;
  109|       |#else
  110|       |    case PCT_nistp224:
  111|       |    case PCT_nistp256:
  112|       |    case PCT_nistp384:
  113|       |    case PCT_nistp521:
  114|       |        break;
  115|       |#endif
  116|      0|    case PCT_ec:
  ------------------
  |  Branch (116:5): [True: 0, False: 50.3k]
  ------------------
  117|      0|        EC_ec_pre_comp_free(group->pre_comp.ec);
  118|      0|        break;
  119|  50.3k|    }
  120|  50.3k|    group->pre_comp.ec = NULL;
  121|  50.3k|}
EC_GROUP_free:
  124|  91.5k|{
  125|  91.5k|    if (!group)
  ------------------
  |  Branch (125:9): [True: 41.2k, False: 50.3k]
  ------------------
  126|  41.2k|        return;
  127|       |
  128|  50.3k|    if (group->meth->group_finish != 0)
  ------------------
  |  Branch (128:9): [True: 50.3k, False: 0]
  ------------------
  129|  50.3k|        group->meth->group_finish(group);
  130|       |
  131|  50.3k|    EC_pre_comp_free(group);
  132|  50.3k|    BN_MONT_CTX_free(group->mont_data);
  133|  50.3k|    EC_POINT_free(group->generator);
  134|  50.3k|    BN_free(group->order);
  135|  50.3k|    BN_free(group->cofactor);
  136|  50.3k|    OPENSSL_free(group->seed);
  ------------------
  |  |  115|  50.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  50.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  50.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|  50.3k|    OPENSSL_free(group->propq);
  ------------------
  |  |  115|  50.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  50.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  50.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  138|  50.3k|    OPENSSL_free(group);
  ------------------
  |  |  115|  50.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  50.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  50.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  139|  50.3k|}
EC_GROUP_copy:
  163|  23.6k|{
  164|  23.6k|    if (dest->meth->group_copy == 0) {
  ------------------
  |  Branch (164:9): [True: 0, False: 23.6k]
  ------------------
  165|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  166|      0|        return 0;
  167|      0|    }
  168|  23.6k|    if (dest->meth != src->meth) {
  ------------------
  |  Branch (168:9): [True: 0, False: 23.6k]
  ------------------
  169|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  170|      0|        return 0;
  171|      0|    }
  172|  23.6k|    if (dest == src)
  ------------------
  |  Branch (172:9): [True: 0, False: 23.6k]
  ------------------
  173|      0|        return 1;
  174|       |
  175|  23.6k|    dest->libctx = src->libctx;
  176|  23.6k|    dest->curve_name = src->curve_name;
  177|       |
  178|       |    /* Copy precomputed */
  179|  23.6k|    dest->pre_comp_type = src->pre_comp_type;
  180|  23.6k|    switch (src->pre_comp_type) {
  ------------------
  |  Branch (180:13): [True: 0, False: 23.6k]
  ------------------
  181|  23.6k|    case PCT_none:
  ------------------
  |  Branch (181:5): [True: 23.6k, False: 0]
  ------------------
  182|  23.6k|        dest->pre_comp.ec = NULL;
  183|  23.6k|        break;
  184|      0|    case PCT_nistz256:
  ------------------
  |  Branch (184:5): [True: 0, False: 23.6k]
  ------------------
  185|      0|#ifdef ECP_NISTZ256_ASM
  186|      0|        dest->pre_comp.nistz256 = EC_nistz256_pre_comp_dup(src->pre_comp.nistz256);
  187|      0|#endif
  188|      0|        break;
  189|      0|#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
  190|      0|    case PCT_nistp224:
  ------------------
  |  Branch (190:5): [True: 0, False: 23.6k]
  ------------------
  191|      0|        dest->pre_comp.nistp224 = EC_nistp224_pre_comp_dup(src->pre_comp.nistp224);
  192|      0|        break;
  193|      0|    case PCT_nistp256:
  ------------------
  |  Branch (193:5): [True: 0, False: 23.6k]
  ------------------
  194|      0|        dest->pre_comp.nistp256 = EC_nistp256_pre_comp_dup(src->pre_comp.nistp256);
  195|      0|        break;
  196|      0|    case PCT_nistp384:
  ------------------
  |  Branch (196:5): [True: 0, False: 23.6k]
  ------------------
  197|      0|        dest->pre_comp.nistp384 = ossl_ec_nistp384_pre_comp_dup(src->pre_comp.nistp384);
  198|      0|        break;
  199|      0|    case PCT_nistp521:
  ------------------
  |  Branch (199:5): [True: 0, False: 23.6k]
  ------------------
  200|      0|        dest->pre_comp.nistp521 = EC_nistp521_pre_comp_dup(src->pre_comp.nistp521);
  201|      0|        break;
  202|       |#else
  203|       |    case PCT_nistp224:
  204|       |    case PCT_nistp256:
  205|       |    case PCT_nistp384:
  206|       |    case PCT_nistp521:
  207|       |        break;
  208|       |#endif
  209|      0|    case PCT_ec:
  ------------------
  |  Branch (209:5): [True: 0, False: 23.6k]
  ------------------
  210|      0|        dest->pre_comp.ec = EC_ec_pre_comp_dup(src->pre_comp.ec);
  211|      0|        break;
  212|  23.6k|    }
  213|       |
  214|  23.6k|    if (src->mont_data != NULL) {
  ------------------
  |  Branch (214:9): [True: 23.4k, False: 205]
  ------------------
  215|  23.4k|        if (dest->mont_data == NULL) {
  ------------------
  |  Branch (215:13): [True: 23.4k, False: 0]
  ------------------
  216|  23.4k|            dest->mont_data = BN_MONT_CTX_new();
  217|  23.4k|            if (dest->mont_data == NULL)
  ------------------
  |  Branch (217:17): [True: 0, False: 23.4k]
  ------------------
  218|      0|                return 0;
  219|  23.4k|        }
  220|  23.4k|        if (!BN_MONT_CTX_copy(dest->mont_data, src->mont_data))
  ------------------
  |  Branch (220:13): [True: 0, False: 23.4k]
  ------------------
  221|      0|            return 0;
  222|  23.4k|    } else {
  223|       |        /* src->generator == NULL */
  224|    205|        BN_MONT_CTX_free(dest->mont_data);
  225|    205|        dest->mont_data = NULL;
  226|    205|    }
  227|       |
  228|  23.6k|    if (src->generator != NULL) {
  ------------------
  |  Branch (228:9): [True: 23.6k, False: 0]
  ------------------
  229|  23.6k|        if (dest->generator == NULL) {
  ------------------
  |  Branch (229:13): [True: 23.6k, False: 0]
  ------------------
  230|  23.6k|            dest->generator = EC_POINT_new(dest);
  231|  23.6k|            if (dest->generator == NULL)
  ------------------
  |  Branch (231:17): [True: 0, False: 23.6k]
  ------------------
  232|      0|                return 0;
  233|  23.6k|        }
  234|  23.6k|        if (!EC_POINT_copy(dest->generator, src->generator))
  ------------------
  |  Branch (234:13): [True: 0, False: 23.6k]
  ------------------
  235|      0|            return 0;
  236|  23.6k|    } else {
  237|       |        /* src->generator == NULL */
  238|      0|        EC_POINT_clear_free(dest->generator);
  239|      0|        dest->generator = NULL;
  240|      0|    }
  241|       |
  242|  23.6k|    if ((src->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0) {
  ------------------
  |  |   29|  23.6k|#define EC_FLAGS_CUSTOM_CURVE   0x2
  ------------------
  |  Branch (242:9): [True: 23.6k, False: 0]
  ------------------
  243|  23.6k|        if (!BN_copy(dest->order, src->order))
  ------------------
  |  Branch (243:13): [True: 0, False: 23.6k]
  ------------------
  244|      0|            return 0;
  245|  23.6k|        if (!BN_copy(dest->cofactor, src->cofactor))
  ------------------
  |  Branch (245:13): [True: 0, False: 23.6k]
  ------------------
  246|      0|            return 0;
  247|  23.6k|    }
  248|       |
  249|  23.6k|    dest->asn1_flag = src->asn1_flag;
  250|  23.6k|    dest->asn1_form = src->asn1_form;
  251|  23.6k|    dest->decoded_from_explicit_params = src->decoded_from_explicit_params;
  252|       |
  253|  23.6k|    if (src->seed) {
  ------------------
  |  Branch (253:9): [True: 14.0k, False: 9.61k]
  ------------------
  254|  14.0k|        OPENSSL_free(dest->seed);
  ------------------
  |  |  115|  14.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  14.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  14.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  255|  14.0k|        if ((dest->seed = OPENSSL_malloc(src->seed_len)) == NULL)
  ------------------
  |  |  102|  14.0k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  14.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  14.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (255:13): [True: 0, False: 14.0k]
  ------------------
  256|      0|            return 0;
  257|  14.0k|        if (!memcpy(dest->seed, src->seed, src->seed_len))
  ------------------
  |  Branch (257:13): [True: 0, False: 14.0k]
  ------------------
  258|      0|            return 0;
  259|  14.0k|        dest->seed_len = src->seed_len;
  260|  14.0k|    } else {
  261|  9.61k|        OPENSSL_free(dest->seed);
  ------------------
  |  |  115|  9.61k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  9.61k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  9.61k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  262|  9.61k|        dest->seed = NULL;
  263|  9.61k|        dest->seed_len = 0;
  264|  9.61k|    }
  265|       |
  266|  23.6k|    return dest->meth->group_copy(dest, src);
  267|  23.6k|}
EC_GROUP_dup:
  270|  23.6k|{
  271|  23.6k|    EC_GROUP *t = NULL;
  272|  23.6k|    int ok = 0;
  273|       |
  274|  23.6k|    if (a == NULL)
  ------------------
  |  Branch (274:9): [True: 0, False: 23.6k]
  ------------------
  275|      0|        return NULL;
  276|       |
  277|  23.6k|    if ((t = ossl_ec_group_new_ex(a->libctx, a->propq, a->meth)) == NULL)
  ------------------
  |  Branch (277:9): [True: 0, False: 23.6k]
  ------------------
  278|      0|        return NULL;
  279|  23.6k|    if (!EC_GROUP_copy(t, a))
  ------------------
  |  Branch (279:9): [True: 0, False: 23.6k]
  ------------------
  280|      0|        goto err;
  281|       |
  282|  23.6k|    ok = 1;
  283|       |
  284|  23.6k| err:
  285|  23.6k|    if (!ok) {
  ------------------
  |  Branch (285:9): [True: 0, False: 23.6k]
  ------------------
  286|      0|        EC_GROUP_free(t);
  287|      0|        return NULL;
  288|      0|    }
  289|  23.6k|        return t;
  290|  23.6k|}
EC_GROUP_set_generator:
  369|  26.5k|{
  370|  26.5k|    if (generator == NULL) {
  ------------------
  |  Branch (370:9): [True: 0, False: 26.5k]
  ------------------
  371|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  372|      0|        return 0;
  373|      0|    }
  374|       |
  375|       |    /* require group->field >= 1 */
  376|  26.5k|    if (group->field == NULL || BN_is_zero(group->field)
  ------------------
  |  Branch (376:9): [True: 0, False: 26.5k]
  |  Branch (376:33): [True: 0, False: 26.5k]
  ------------------
  377|  26.5k|        || BN_is_negative(group->field)) {
  ------------------
  |  Branch (377:12): [True: 0, False: 26.5k]
  ------------------
  378|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_FIELD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  379|      0|        return 0;
  380|      0|    }
  381|       |
  382|       |    /*-
  383|       |     * - require order >= 1
  384|       |     * - enforce upper bound due to Hasse thm: order can be no more than one bit
  385|       |     *   longer than field cardinality
  386|       |     */
  387|  26.5k|    if (order == NULL || BN_is_zero(order) || BN_is_negative(order)
  ------------------
  |  Branch (387:9): [True: 0, False: 26.5k]
  |  Branch (387:26): [True: 0, False: 26.5k]
  |  Branch (387:47): [True: 0, False: 26.5k]
  ------------------
  388|  26.5k|        || BN_num_bits(order) > BN_num_bits(group->field) + 1) {
  ------------------
  |  Branch (388:12): [True: 0, False: 26.5k]
  ------------------
  389|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  390|      0|        return 0;
  391|      0|    }
  392|       |
  393|       |    /*-
  394|       |     * Unfortunately the cofactor is an optional field in many standards.
  395|       |     * Internally, the lib uses 0 cofactor as a marker for "unknown cofactor".
  396|       |     * So accept cofactor == NULL or cofactor >= 0.
  397|       |     */
  398|  26.5k|    if (cofactor != NULL && BN_is_negative(cofactor)) {
  ------------------
  |  Branch (398:9): [True: 25.6k, False: 985]
  |  Branch (398:29): [True: 10, False: 25.5k]
  ------------------
  399|     10|        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR);
  ------------------
  |  |  401|     10|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     10|    (ERR_new(),                                                 \
  |  |  |  |  404|     10|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     10|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     10|     ERR_set_error)
  |  |  ------------------
  ------------------
  400|     10|        return 0;
  401|     10|    }
  402|       |
  403|  26.5k|    if (group->generator == NULL) {
  ------------------
  |  Branch (403:9): [True: 26.0k, False: 564]
  ------------------
  404|  26.0k|        group->generator = EC_POINT_new(group);
  405|  26.0k|        if (group->generator == NULL)
  ------------------
  |  Branch (405:13): [True: 0, False: 26.0k]
  ------------------
  406|      0|            return 0;
  407|  26.0k|    }
  408|  26.5k|    if (!EC_POINT_copy(group->generator, generator))
  ------------------
  |  Branch (408:9): [True: 0, False: 26.5k]
  ------------------
  409|      0|        return 0;
  410|       |
  411|  26.5k|    if (!BN_copy(group->order, order))
  ------------------
  |  Branch (411:9): [True: 0, False: 26.5k]
  ------------------
  412|      0|        return 0;
  413|       |
  414|       |    /* Either take the provided positive cofactor, or try to compute it */
  415|  26.5k|    if (cofactor != NULL && !BN_is_zero(cofactor)) {
  ------------------
  |  Branch (415:9): [True: 25.5k, False: 985]
  |  Branch (415:29): [True: 25.5k, False: 18]
  ------------------
  416|  25.5k|        if (!BN_copy(group->cofactor, cofactor))
  ------------------
  |  Branch (416:13): [True: 0, False: 25.5k]
  ------------------
  417|      0|            return 0;
  418|  25.5k|    } else if (!ec_guess_cofactor(group)) {
  ------------------
  |  Branch (418:16): [True: 0, False: 1.00k]
  ------------------
  419|      0|        BN_zero(group->cofactor);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  420|      0|        return 0;
  421|      0|    }
  422|       |
  423|       |    /*
  424|       |     * Some groups have an order with
  425|       |     * factors of two, which makes the Montgomery setup fail.
  426|       |     * |group->mont_data| will be NULL in this case.
  427|       |     */
  428|  26.5k|    if (BN_is_odd(group->order)) {
  ------------------
  |  Branch (428:9): [True: 26.1k, False: 410]
  ------------------
  429|  26.1k|        return ec_precompute_mont_data(group);
  430|  26.1k|    }
  431|       |
  432|    410|    BN_MONT_CTX_free(group->mont_data);
  433|    410|    group->mont_data = NULL;
  434|    410|    return 1;
  435|  26.5k|}
EC_GROUP_get0_generator:
  438|  1.34k|{
  439|  1.34k|    return group->generator;
  440|  1.34k|}
EC_GROUP_get_order:
  448|    517|{
  449|    517|    if (group->order == NULL)
  ------------------
  |  Branch (449:9): [True: 0, False: 517]
  ------------------
  450|      0|        return 0;
  451|    517|    if (!BN_copy(order, group->order))
  ------------------
  |  Branch (451:9): [True: 0, False: 517]
  ------------------
  452|      0|        return 0;
  453|       |
  454|    517|    return !BN_is_zero(order);
  455|    517|}
EC_GROUP_get0_order:
  458|  7.99k|{
  459|  7.99k|    return group->order;
  460|  7.99k|}
EC_GROUP_order_bits:
  463|  23.4k|{
  464|  23.4k|    return group->meth->group_order_bits(group);
  465|  23.4k|}
EC_GROUP_get0_cofactor:
  480|  1.05k|{
  481|  1.05k|    return group->cofactor;
  482|  1.05k|}
EC_GROUP_set_curve_name:
  485|  25.5k|{
  486|  25.5k|    group->curve_name = nid;
  487|  25.5k|    group->asn1_flag =
  488|  25.5k|        (nid != NID_undef)
  ------------------
  |  |   18|  25.5k|#define NID_undef                       0
  ------------------
  |  Branch (488:9): [True: 25.5k, False: 0]
  ------------------
  489|  25.5k|        ? OPENSSL_EC_NAMED_CURVE
  ------------------
  |  |   31|  25.5k|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  490|  25.5k|        : OPENSSL_EC_EXPLICIT_CURVE;
  ------------------
  |  |   30|  25.5k|# define OPENSSL_EC_EXPLICIT_CURVE  0x000
  ------------------
  491|  25.5k|}
EC_GROUP_get_curve_name:
  494|  50.7k|{
  495|  50.7k|    return group->curve_name;
  496|  50.7k|}
EC_GROUP_get_field_type:
  504|  29.7k|{
  505|  29.7k|    return group->meth->field_type;
  506|  29.7k|}
EC_GROUP_set_asn1_flag:
  509|  26.0k|{
  510|  26.0k|    group->asn1_flag = flag;
  511|  26.0k|}
EC_GROUP_get_asn1_flag:
  514|  35.7k|{
  515|  35.7k|    return group->asn1_flag;
  516|  35.7k|}
EC_GROUP_set_point_conversion_form:
  520|    924|{
  521|    924|    group->asn1_form = form;
  522|    924|}
EC_GROUP_get_point_conversion_form:
  526|  7.99k|{
  527|  7.99k|    return group->asn1_form;
  528|  7.99k|}
EC_GROUP_set_seed:
  531|  15.7k|{
  532|  15.7k|    OPENSSL_free(group->seed);
  ------------------
  |  |  115|  15.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  15.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  15.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  533|  15.7k|    group->seed = NULL;
  534|  15.7k|    group->seed_len = 0;
  535|       |
  536|  15.7k|    if (!len || !p)
  ------------------
  |  Branch (536:9): [True: 569, False: 15.1k]
  |  Branch (536:17): [True: 0, False: 15.1k]
  ------------------
  537|    569|        return 1;
  538|       |
  539|  15.1k|    if ((group->seed = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |  102|  15.1k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  15.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  15.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (539:9): [True: 0, False: 15.1k]
  ------------------
  540|      0|        return 0;
  541|  15.1k|    memcpy(group->seed, p, len);
  542|  15.1k|    group->seed_len = len;
  543|       |
  544|  15.1k|    return len;
  545|  15.1k|}
EC_GROUP_get0_seed:
  548|    783|{
  549|    783|    return group->seed;
  550|    783|}
EC_GROUP_get_seed_len:
  553|    619|{
  554|    619|    return group->seed_len;
  555|    619|}
EC_GROUP_set_curve:
  559|  25.8k|{
  560|  25.8k|    if (group->meth->group_set_curve == 0) {
  ------------------
  |  Branch (560:9): [True: 0, False: 25.8k]
  ------------------
  561|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  562|      0|        return 0;
  563|      0|    }
  564|  25.8k|    return group->meth->group_set_curve(group, p, a, b, ctx);
  565|  25.8k|}
EC_GROUP_get_curve:
  569|  1.32k|{
  570|  1.32k|    if (group->meth->group_get_curve == NULL) {
  ------------------
  |  Branch (570:9): [True: 0, False: 1.32k]
  ------------------
  571|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  572|      0|        return 0;
  573|      0|    }
  574|  1.32k|    return group->meth->group_get_curve(group, p, a, b, ctx);
  575|  1.32k|}
EC_GROUP_get_degree:
  606|  29.9k|{
  607|  29.9k|    if (group->meth->group_get_degree == 0) {
  ------------------
  |  Branch (607:9): [True: 0, False: 29.9k]
  ------------------
  608|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  609|      0|        return 0;
  610|      0|    }
  611|  29.9k|    return group->meth->group_get_degree(group);
  612|  29.9k|}
EC_POINT_new:
  718|   105k|{
  719|   105k|    EC_POINT *ret;
  720|       |
  721|   105k|    if (group == NULL) {
  ------------------
  |  Branch (721:9): [True: 0, False: 105k]
  ------------------
  722|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  723|      0|        return NULL;
  724|      0|    }
  725|   105k|    if (group->meth->point_init == NULL) {
  ------------------
  |  Branch (725:9): [True: 0, False: 105k]
  ------------------
  726|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  727|      0|        return NULL;
  728|      0|    }
  729|       |
  730|   105k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|   105k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   105k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   105k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  731|   105k|    if (ret == NULL)
  ------------------
  |  Branch (731:9): [True: 0, False: 105k]
  ------------------
  732|      0|        return NULL;
  733|       |
  734|   105k|    ret->meth = group->meth;
  735|   105k|    ret->curve_name = group->curve_name;
  736|       |
  737|   105k|    if (!ret->meth->point_init(ret)) {
  ------------------
  |  Branch (737:9): [True: 0, False: 105k]
  ------------------
  738|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  739|      0|        return NULL;
  740|      0|    }
  741|       |
  742|   105k|    return ret;
  743|   105k|}
EC_POINT_free:
  746|   118k|{
  747|   118k|    if (point == NULL)
  ------------------
  |  Branch (747:9): [True: 14.5k, False: 103k]
  ------------------
  748|  14.5k|        return;
  749|       |
  750|       |#ifdef OPENSSL_PEDANTIC_ZEROIZATION
  751|       |    EC_POINT_clear_free(point);
  752|       |#else
  753|   103k|    if (point->meth->point_finish != 0)
  ------------------
  |  Branch (753:9): [True: 103k, False: 0]
  ------------------
  754|   103k|        point->meth->point_finish(point);
  755|   103k|    OPENSSL_free(point);
  ------------------
  |  |  115|   103k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   103k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   103k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  756|   103k|#endif
  757|   103k|}
EC_POINT_clear_free:
  760|  5.00k|{
  761|  5.00k|    if (point == NULL)
  ------------------
  |  Branch (761:9): [True: 2.78k, False: 2.21k]
  ------------------
  762|  2.78k|        return;
  763|       |
  764|  2.21k|    if (point->meth->point_clear_finish != 0)
  ------------------
  |  Branch (764:9): [True: 2.21k, False: 0]
  ------------------
  765|  2.21k|        point->meth->point_clear_finish(point);
  766|      0|    else if (point->meth->point_finish != 0)
  ------------------
  |  Branch (766:14): [True: 0, False: 0]
  ------------------
  767|      0|        point->meth->point_finish(point);
  768|  2.21k|    OPENSSL_clear_free(point, sizeof(*point));
  ------------------
  |  |  113|  2.21k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.21k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.21k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  769|  2.21k|}
EC_POINT_copy:
  772|  53.6k|{
  773|  53.6k|    if (dest->meth->point_copy == 0) {
  ------------------
  |  Branch (773:9): [True: 0, False: 53.6k]
  ------------------
  774|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  775|      0|        return 0;
  776|      0|    }
  777|  53.6k|    if (dest->meth != src->meth
  ------------------
  |  Branch (777:9): [True: 0, False: 53.6k]
  ------------------
  778|  53.6k|            || (dest->curve_name != src->curve_name
  ------------------
  |  Branch (778:17): [True: 9, False: 53.6k]
  ------------------
  779|  53.6k|                 && dest->curve_name != 0
  ------------------
  |  Branch (779:21): [True: 9, False: 0]
  ------------------
  780|  53.6k|                 && src->curve_name != 0)) {
  ------------------
  |  Branch (780:21): [True: 0, False: 9]
  ------------------
  781|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  782|      0|        return 0;
  783|      0|    }
  784|  53.6k|    if (dest == src)
  ------------------
  |  Branch (784:9): [True: 0, False: 53.6k]
  ------------------
  785|      0|        return 1;
  786|  53.6k|    return dest->meth->point_copy(dest, src);
  787|  53.6k|}
EC_POINT_set_to_infinity:
  816|    288|{
  817|    288|    if (group->meth->point_set_to_infinity == 0) {
  ------------------
  |  Branch (817:9): [True: 0, False: 288]
  ------------------
  818|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  819|      0|        return 0;
  820|      0|    }
  821|    288|    if (group->meth != point->meth) {
  ------------------
  |  Branch (821:9): [True: 0, False: 288]
  ------------------
  822|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  823|      0|        return 0;
  824|      0|    }
  825|    288|    return group->meth->point_set_to_infinity(group, point);
  826|    288|}
EC_POINT_set_Jprojective_coordinates_GFp:
  833|  3.52k|{
  834|  3.52k|    if (group->meth->field_type != NID_X9_62_prime_field) {
  ------------------
  |  |  152|  3.52k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (834:9): [True: 0, False: 3.52k]
  ------------------
  835|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  836|      0|        return 0;
  837|      0|    }
  838|  3.52k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (838:9): [True: 0, False: 3.52k]
  ------------------
  839|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  840|      0|        return 0;
  841|      0|    }
  842|  3.52k|    return ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group, point,
  843|  3.52k|                                                              x, y, z, ctx);
  844|  3.52k|}
EC_POINT_set_affine_coordinates:
  867|  35.8k|{
  868|  35.8k|    if (group->meth->point_set_affine_coordinates == NULL) {
  ------------------
  |  Branch (868:9): [True: 0, False: 35.8k]
  ------------------
  869|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  870|      0|        return 0;
  871|      0|    }
  872|  35.8k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (872:9): [True: 0, False: 35.8k]
  ------------------
  873|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  874|      0|        return 0;
  875|      0|    }
  876|  35.8k|    if (!group->meth->point_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (876:9): [True: 0, False: 35.8k]
  ------------------
  877|      0|        return 0;
  878|       |
  879|  35.8k|    if (EC_POINT_is_on_curve(group, point, ctx) <= 0) {
  ------------------
  |  Branch (879:9): [True: 2.51k, False: 33.3k]
  ------------------
  880|  2.51k|        ERR_raise(ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE);
  ------------------
  |  |  401|  2.51k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.51k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.51k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  2.51k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  2.51k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.51k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.51k|     ERR_set_error)
  |  |  ------------------
  ------------------
  881|  2.51k|        return 0;
  882|  2.51k|    }
  883|  33.3k|    return 1;
  884|  35.8k|}
EC_POINT_get_affine_coordinates:
  907|  2.51k|{
  908|  2.51k|    if (group->meth->point_get_affine_coordinates == NULL) {
  ------------------
  |  Branch (908:9): [True: 0, False: 2.51k]
  ------------------
  909|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  910|      0|        return 0;
  911|      0|    }
  912|  2.51k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (912:9): [True: 0, False: 2.51k]
  ------------------
  913|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  914|      0|        return 0;
  915|      0|    }
  916|  2.51k|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (916:9): [True: 47, False: 2.46k]
  ------------------
  917|     47|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  401|     47|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     47|    (ERR_new(),                                                 \
  |  |  |  |  404|     47|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     47|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     47|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     47|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     47|     ERR_set_error)
  |  |  ------------------
  ------------------
  918|     47|        return 0;
  919|     47|    }
  920|  2.46k|    return group->meth->point_get_affine_coordinates(group, point, x, y, ctx);
  921|  2.51k|}
EC_POINT_add:
  943|  5.73k|{
  944|  5.73k|    if (group->meth->add == 0) {
  ------------------
  |  Branch (944:9): [True: 0, False: 5.73k]
  ------------------
  945|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  946|      0|        return 0;
  947|      0|    }
  948|  5.73k|    if (!ec_point_is_compat(r, group) || !ec_point_is_compat(a, group)
  ------------------
  |  Branch (948:9): [True: 0, False: 5.73k]
  |  Branch (948:42): [True: 0, False: 5.73k]
  ------------------
  949|  5.73k|        || !ec_point_is_compat(b, group)) {
  ------------------
  |  Branch (949:12): [True: 0, False: 5.73k]
  ------------------
  950|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  951|      0|        return 0;
  952|      0|    }
  953|  5.73k|    return group->meth->add(group, r, a, b, ctx);
  954|  5.73k|}
EC_POINT_dbl:
  958|  39.1k|{
  959|  39.1k|    if (group->meth->dbl == 0) {
  ------------------
  |  Branch (959:9): [True: 0, False: 39.1k]
  ------------------
  960|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  961|      0|        return 0;
  962|      0|    }
  963|  39.1k|    if (!ec_point_is_compat(r, group) || !ec_point_is_compat(a, group)) {
  ------------------
  |  Branch (963:9): [True: 0, False: 39.1k]
  |  Branch (963:42): [True: 0, False: 39.1k]
  ------------------
  964|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  965|      0|        return 0;
  966|      0|    }
  967|  39.1k|    return group->meth->dbl(group, r, a, ctx);
  968|  39.1k|}
EC_POINT_invert:
  971|  2.21k|{
  972|  2.21k|    if (group->meth->invert == 0) {
  ------------------
  |  Branch (972:9): [True: 0, False: 2.21k]
  ------------------
  973|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  974|      0|        return 0;
  975|      0|    }
  976|  2.21k|    if (!ec_point_is_compat(a, group)) {
  ------------------
  |  Branch (976:9): [True: 0, False: 2.21k]
  ------------------
  977|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  978|      0|        return 0;
  979|      0|    }
  980|  2.21k|    return group->meth->invert(group, a, ctx);
  981|  2.21k|}
EC_POINT_is_at_infinity:
  984|  96.8k|{
  985|  96.8k|    if (group->meth->is_at_infinity == 0) {
  ------------------
  |  Branch (985:9): [True: 0, False: 96.8k]
  ------------------
  986|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  987|      0|        return 0;
  988|      0|    }
  989|  96.8k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (989:9): [True: 0, False: 96.8k]
  ------------------
  990|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  991|      0|        return 0;
  992|      0|    }
  993|  96.8k|    return group->meth->is_at_infinity(group, point);
  994|  96.8k|}
EC_POINT_is_on_curve:
 1005|  35.8k|{
 1006|  35.8k|    if (group->meth->is_on_curve == 0) {
  ------------------
  |  Branch (1006:9): [True: 0, False: 35.8k]
  ------------------
 1007|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1008|      0|        return 0;
 1009|      0|    }
 1010|  35.8k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (1010:9): [True: 0, False: 35.8k]
  ------------------
 1011|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1012|      0|        return 0;
 1013|      0|    }
 1014|  35.8k|    return group->meth->is_on_curve(group, point, ctx);
 1015|  35.8k|}
EC_POINT_cmp:
 1019|    150|{
 1020|    150|    if (group->meth->point_cmp == 0) {
  ------------------
  |  Branch (1020:9): [True: 0, False: 150]
  ------------------
 1021|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1022|      0|        return -1;
 1023|      0|    }
 1024|    150|    if (!ec_point_is_compat(a, group) || !ec_point_is_compat(b, group)) {
  ------------------
  |  Branch (1024:9): [True: 0, False: 150]
  |  Branch (1024:42): [True: 0, False: 150]
  ------------------
 1025|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1026|      0|        return -1;
 1027|      0|    }
 1028|    150|    return group->meth->point_cmp(group, a, b, ctx);
 1029|    150|}
EC_POINT_mul:
 1120|  1.72k|{
 1121|  1.72k|    int ret = 0;
 1122|  1.72k|    size_t num;
 1123|  1.72k|#ifndef FIPS_MODULE
 1124|  1.72k|    BN_CTX *new_ctx = NULL;
 1125|  1.72k|#endif
 1126|       |
 1127|  1.72k|    if (!ec_point_is_compat(r, group)
  ------------------
  |  Branch (1127:9): [True: 0, False: 1.72k]
  ------------------
 1128|  1.72k|        || (point != NULL && !ec_point_is_compat(point, group))) {
  ------------------
  |  Branch (1128:13): [True: 0, False: 1.72k]
  |  Branch (1128:30): [True: 0, False: 0]
  ------------------
 1129|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1130|      0|        return 0;
 1131|      0|    }
 1132|       |
 1133|  1.72k|    if (g_scalar == NULL && p_scalar == NULL)
  ------------------
  |  Branch (1133:9): [True: 0, False: 1.72k]
  |  Branch (1133:29): [True: 0, False: 0]
  ------------------
 1134|      0|        return EC_POINT_set_to_infinity(group, r);
 1135|       |
 1136|  1.72k|#ifndef FIPS_MODULE
 1137|  1.72k|    if (ctx == NULL)
  ------------------
  |  Branch (1137:9): [True: 0, False: 1.72k]
  ------------------
 1138|      0|        ctx = new_ctx = BN_CTX_secure_new();
 1139|  1.72k|#endif
 1140|  1.72k|    if (ctx == NULL) {
  ------------------
  |  Branch (1140:9): [True: 0, False: 1.72k]
  ------------------
 1141|      0|        ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1142|      0|        return 0;
 1143|      0|    }
 1144|       |
 1145|  1.72k|    num = (point != NULL && p_scalar != NULL) ? 1 : 0;
  ------------------
  |  Branch (1145:12): [True: 0, False: 1.72k]
  |  Branch (1145:29): [True: 0, False: 0]
  ------------------
 1146|  1.72k|    if (group->meth->mul != NULL)
  ------------------
  |  Branch (1146:9): [True: 932, False: 795]
  ------------------
 1147|    932|        ret = group->meth->mul(group, r, g_scalar, num, &point, &p_scalar, ctx);
 1148|    795|    else
 1149|       |        /* use default */
 1150|    795|        ret = ossl_ec_wNAF_mul(group, r, g_scalar, num, &point, &p_scalar, ctx);
 1151|       |
 1152|  1.72k|#ifndef FIPS_MODULE
 1153|  1.72k|    BN_CTX_free(new_ctx);
 1154|  1.72k|#endif
 1155|  1.72k|    return ret;
 1156|  1.72k|}
ossl_ec_group_simple_order_bits:
 1231|  23.4k|{
 1232|  23.4k|    if (group->order == NULL)
  ------------------
  |  Branch (1232:9): [True: 0, False: 23.4k]
  ------------------
 1233|      0|        return 0;
 1234|  23.4k|    return BN_num_bits(group->order);
 1235|  23.4k|}
ossl_ec_point_blind_coordinates:
 1319|    251|{
 1320|    251|    if (group->meth->blind_coordinates == NULL)
  ------------------
  |  Branch (1320:9): [True: 0, False: 251]
  ------------------
 1321|      0|        return 1; /* ignore if not implemented */
 1322|       |
 1323|    251|    return group->meth->blind_coordinates(group, p, ctx);
 1324|    251|}
EC_GROUP_get_basis_type:
 1327|  6.83k|{
 1328|  6.83k|    int i;
 1329|       |
 1330|  6.83k|    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field)
  ------------------
  |  |  156|  6.83k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (1330:9): [True: 0, False: 6.83k]
  ------------------
 1331|       |        /* everything else is currently not supported */
 1332|      0|        return 0;
 1333|       |
 1334|       |    /* Find the last non-zero element of group->poly[] */
 1335|  6.83k|    for (i = 0;
 1336|  33.7k|         i < (int)OSSL_NELEM(group->poly) && group->poly[i] != 0;
  ------------------
  |  |   14|  67.5k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1336:10): [True: 33.7k, False: 0]
  |  Branch (1336:46): [True: 26.9k, False: 6.83k]
  ------------------
 1337|  26.9k|         i++)
 1338|  26.9k|        continue;
 1339|       |
 1340|  6.83k|    if (i == 4)
  ------------------
  |  Branch (1340:9): [True: 6.63k, False: 196]
  ------------------
 1341|  6.63k|        return NID_X9_62_ppBasis;
  ------------------
  |  |  172|  6.63k|#define NID_X9_62_ppBasis               683
  ------------------
 1342|    196|    else if (i == 2)
  ------------------
  |  Branch (1342:14): [True: 196, False: 0]
  ------------------
 1343|    196|        return NID_X9_62_tpBasis;
  ------------------
  |  |  168|    196|#define NID_X9_62_tpBasis               682
  ------------------
 1344|      0|    else
 1345|       |        /* everything else is currently not supported */
 1346|      0|        return 0;
 1347|  6.83k|}
EC_GROUP_get_trinomial_basis:
 1351|    196|{
 1352|    196|    if (group == NULL)
  ------------------
  |  Branch (1352:9): [True: 0, False: 196]
  ------------------
 1353|      0|        return 0;
 1354|       |
 1355|    196|    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field
  ------------------
  |  |  156|    392|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (1355:9): [True: 0, False: 196]
  ------------------
 1356|    196|        || !((group->poly[0] != 0) && (group->poly[1] != 0)
  ------------------
  |  Branch (1356:14): [True: 196, False: 0]
  |  Branch (1356:39): [True: 196, False: 0]
  ------------------
 1357|    196|             && (group->poly[2] == 0))) {
  ------------------
  |  Branch (1357:17): [True: 196, False: 0]
  ------------------
 1358|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1359|      0|        return 0;
 1360|      0|    }
 1361|       |
 1362|    196|    if (k)
  ------------------
  |  Branch (1362:9): [True: 196, False: 0]
  ------------------
 1363|    196|        *k = group->poly[1];
 1364|       |
 1365|    196|    return 1;
 1366|    196|}
EC_GROUP_get_pentanomial_basis:
 1370|  6.63k|{
 1371|  6.63k|    if (group == NULL)
  ------------------
  |  Branch (1371:9): [True: 0, False: 6.63k]
  ------------------
 1372|      0|        return 0;
 1373|       |
 1374|  6.63k|    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field
  ------------------
  |  |  156|  13.2k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (1374:9): [True: 0, False: 6.63k]
  ------------------
 1375|  6.63k|        || !((group->poly[0] != 0) && (group->poly[1] != 0)
  ------------------
  |  Branch (1375:14): [True: 6.63k, False: 0]
  |  Branch (1375:39): [True: 6.63k, False: 0]
  ------------------
 1376|  6.63k|             && (group->poly[2] != 0) && (group->poly[3] != 0)
  ------------------
  |  Branch (1376:17): [True: 6.63k, False: 0]
  |  Branch (1376:42): [True: 6.63k, False: 0]
  ------------------
 1377|  6.63k|             && (group->poly[4] == 0))) {
  ------------------
  |  Branch (1377:17): [True: 6.63k, False: 0]
  ------------------
 1378|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1379|      0|        return 0;
 1380|      0|    }
 1381|       |
 1382|  6.63k|    if (k1)
  ------------------
  |  Branch (1382:9): [True: 6.63k, False: 0]
  ------------------
 1383|  6.63k|        *k1 = group->poly[3];
 1384|  6.63k|    if (k2)
  ------------------
  |  Branch (1384:9): [True: 6.63k, False: 0]
  ------------------
 1385|  6.63k|        *k2 = group->poly[2];
 1386|  6.63k|    if (k3)
  ------------------
  |  Branch (1386:9): [True: 6.63k, False: 0]
  ------------------
 1387|  6.63k|        *k3 = group->poly[1];
 1388|       |
 1389|  6.63k|    return 1;
 1390|  6.63k|}
ec_lib.c:ec_guess_cofactor:
  319|  1.00k|static int ec_guess_cofactor(EC_GROUP *group) {
  320|  1.00k|    int ret = 0;
  321|  1.00k|    BN_CTX *ctx = NULL;
  322|  1.00k|    BIGNUM *q = NULL;
  323|       |
  324|       |    /*-
  325|       |     * If the cofactor is too large, we cannot guess it.
  326|       |     * The RHS of below is a strict overestimate of lg(4 * sqrt(q))
  327|       |     */
  328|  1.00k|    if (BN_num_bits(group->order) <= (BN_num_bits(group->field) + 1) / 2 + 3) {
  ------------------
  |  Branch (328:9): [True: 786, False: 217]
  ------------------
  329|       |        /* default to 0 */
  330|    786|        BN_zero(group->cofactor);
  ------------------
  |  |  202|    786|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  331|       |        /* return success */
  332|    786|        return 1;
  333|    786|    }
  334|       |
  335|    217|    if ((ctx = BN_CTX_new_ex(group->libctx)) == NULL)
  ------------------
  |  Branch (335:9): [True: 0, False: 217]
  ------------------
  336|      0|        return 0;
  337|       |
  338|    217|    BN_CTX_start(ctx);
  339|    217|    if ((q = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (339:9): [True: 0, False: 217]
  ------------------
  340|      0|        goto err;
  341|       |
  342|       |    /* set q = 2**m for binary fields; q = p otherwise */
  343|    217|    if (group->meth->field_type == NID_X9_62_characteristic_two_field) {
  ------------------
  |  |  156|    217|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (343:9): [True: 0, False: 217]
  ------------------
  344|      0|        BN_zero(q);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  345|      0|        if (!BN_set_bit(q, BN_num_bits(group->field) - 1))
  ------------------
  |  Branch (345:13): [True: 0, False: 0]
  ------------------
  346|      0|            goto err;
  347|    217|    } else {
  348|    217|        if (!BN_copy(q, group->field))
  ------------------
  |  Branch (348:13): [True: 0, False: 217]
  ------------------
  349|      0|            goto err;
  350|    217|    }
  351|       |
  352|       |    /* compute h = \lfloor (q + 1)/n \rceil = \lfloor (q + 1 + n/2)/n \rfloor */
  353|    217|    if (!BN_rshift1(group->cofactor, group->order) /* n/2 */
  ------------------
  |  Branch (353:9): [True: 0, False: 217]
  ------------------
  354|    217|        || !BN_add(group->cofactor, group->cofactor, q) /* q + n/2 */
  ------------------
  |  Branch (354:12): [True: 0, False: 217]
  ------------------
  355|       |        /* q + 1 + n/2 */
  356|    217|        || !BN_add(group->cofactor, group->cofactor, BN_value_one())
  ------------------
  |  Branch (356:12): [True: 0, False: 217]
  ------------------
  357|       |        /* (q + 1 + n/2)/n */
  358|    217|        || !BN_div(group->cofactor, NULL, group->cofactor, group->order, ctx))
  ------------------
  |  Branch (358:12): [True: 0, False: 217]
  ------------------
  359|      0|        goto err;
  360|    217|    ret = 1;
  361|    217| err:
  362|    217|    BN_CTX_end(ctx);
  363|    217|    BN_CTX_free(ctx);
  364|    217|    return ret;
  365|    217|}
ec_lib.c:ec_precompute_mont_data:
 1190|  26.1k|{
 1191|  26.1k|    BN_CTX *ctx = BN_CTX_new_ex(group->libctx);
 1192|  26.1k|    int ret = 0;
 1193|       |
 1194|  26.1k|    BN_MONT_CTX_free(group->mont_data);
 1195|  26.1k|    group->mont_data = NULL;
 1196|       |
 1197|  26.1k|    if (ctx == NULL)
  ------------------
  |  Branch (1197:9): [True: 0, False: 26.1k]
  ------------------
 1198|      0|        goto err;
 1199|       |
 1200|  26.1k|    group->mont_data = BN_MONT_CTX_new();
 1201|  26.1k|    if (group->mont_data == NULL)
  ------------------
  |  Branch (1201:9): [True: 0, False: 26.1k]
  ------------------
 1202|      0|        goto err;
 1203|       |
 1204|  26.1k|    if (!BN_MONT_CTX_set(group->mont_data, group->order, ctx)) {
  ------------------
  |  Branch (1204:9): [True: 0, False: 26.1k]
  ------------------
 1205|      0|        BN_MONT_CTX_free(group->mont_data);
 1206|      0|        group->mont_data = NULL;
 1207|      0|        goto err;
 1208|      0|    }
 1209|       |
 1210|  26.1k|    ret = 1;
 1211|       |
 1212|  26.1k| err:
 1213|       |
 1214|  26.1k|    BN_CTX_free(ctx);
 1215|  26.1k|    return ret;
 1216|  26.1k|}

ec_lib.c:ec_point_is_compat:
  329|   274k|{
  330|   274k|    return group->meth == point->meth
  ------------------
  |  Branch (330:12): [True: 274k, False: 0]
  ------------------
  331|   274k|           && (group->curve_name == 0
  ------------------
  |  Branch (331:16): [True: 157k, False: 117k]
  ------------------
  332|   274k|               || point->curve_name == 0
  ------------------
  |  Branch (332:19): [True: 20, False: 117k]
  ------------------
  333|   274k|               || group->curve_name == point->curve_name);
  ------------------
  |  Branch (333:19): [True: 117k, False: 0]
  ------------------
  334|   274k|}
ec_mult.c:ec_point_ladder_pre:
  769|  1.28k|{
  770|  1.28k|    if (group->meth->ladder_pre != NULL)
  ------------------
  |  Branch (770:9): [True: 1.28k, False: 0]
  ------------------
  771|  1.28k|        return group->meth->ladder_pre(group, r, s, p, ctx);
  772|       |
  773|      0|    if (!EC_POINT_copy(s, p)
  ------------------
  |  Branch (773:9): [True: 0, False: 0]
  ------------------
  774|      0|        || !EC_POINT_dbl(group, r, s, ctx))
  ------------------
  |  Branch (774:12): [True: 0, False: 0]
  ------------------
  775|      0|        return 0;
  776|       |
  777|      0|    return 1;
  778|      0|}
ec_mult.c:ec_point_ladder_step:
  783|   300k|{
  784|   300k|    if (group->meth->ladder_step != NULL)
  ------------------
  |  Branch (784:9): [True: 300k, False: 0]
  ------------------
  785|   300k|        return group->meth->ladder_step(group, r, s, p, ctx);
  786|       |
  787|      0|    if (!EC_POINT_add(group, s, r, s, ctx)
  ------------------
  |  Branch (787:9): [True: 0, False: 0]
  ------------------
  788|      0|        || !EC_POINT_dbl(group, r, r, ctx))
  ------------------
  |  Branch (788:12): [True: 0, False: 0]
  ------------------
  789|      0|        return 0;
  790|       |
  791|      0|    return 1;
  792|       |
  793|      0|}
ec_mult.c:ec_point_ladder_post:
  798|  1.28k|{
  799|  1.28k|    if (group->meth->ladder_post != NULL)
  ------------------
  |  Branch (799:9): [True: 1.28k, False: 0]
  ------------------
  800|  1.28k|        return group->meth->ladder_post(group, r, s, p, ctx);
  801|       |
  802|      0|    return 1;
  803|  1.28k|}
ec_oct.c:ec_point_is_compat:
  329|  42.2k|{
  330|  42.2k|    return group->meth == point->meth
  ------------------
  |  Branch (330:12): [True: 42.2k, False: 0]
  ------------------
  331|  42.2k|           && (group->curve_name == 0
  ------------------
  |  Branch (331:16): [True: 3.18k, False: 39.0k]
  ------------------
  332|  42.2k|               || point->curve_name == 0
  ------------------
  |  Branch (332:19): [True: 8, False: 39.0k]
  ------------------
  333|  42.2k|               || group->curve_name == point->curve_name);
  ------------------
  |  Branch (333:19): [True: 39.0k, False: 0]
  ------------------
  334|  42.2k|}

ossl_ec_scalar_mul_ladder:
  142|  1.28k|{
  143|  1.28k|    int i, cardinality_bits, group_top, kbit, pbit, Z_is_one;
  144|  1.28k|    EC_POINT *p = NULL;
  145|  1.28k|    EC_POINT *s = NULL;
  146|  1.28k|    BIGNUM *k = NULL;
  147|  1.28k|    BIGNUM *lambda = NULL;
  148|  1.28k|    BIGNUM *cardinality = NULL;
  149|  1.28k|    int ret = 0;
  150|       |
  151|       |    /* early exit if the input point is the point at infinity */
  152|  1.28k|    if (point != NULL && EC_POINT_is_at_infinity(group, point))
  ------------------
  |  Branch (152:9): [True: 0, False: 1.28k]
  |  Branch (152:26): [True: 0, False: 0]
  ------------------
  153|      0|        return EC_POINT_set_to_infinity(group, r);
  154|       |
  155|  1.28k|    if (BN_is_zero(group->order)) {
  ------------------
  |  Branch (155:9): [True: 0, False: 1.28k]
  ------------------
  156|      0|        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_ORDER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  157|      0|        return 0;
  158|      0|    }
  159|  1.28k|    if (BN_is_zero(group->cofactor)) {
  ------------------
  |  Branch (159:9): [True: 0, False: 1.28k]
  ------------------
  160|      0|        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  161|      0|        return 0;
  162|      0|    }
  163|       |
  164|  1.28k|    BN_CTX_start(ctx);
  165|       |
  166|  1.28k|    if (((p = EC_POINT_new(group)) == NULL)
  ------------------
  |  Branch (166:9): [True: 0, False: 1.28k]
  ------------------
  167|  1.28k|        || ((s = EC_POINT_new(group)) == NULL)) {
  ------------------
  |  Branch (167:12): [True: 0, False: 1.28k]
  ------------------
  168|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  169|      0|        goto err;
  170|      0|    }
  171|       |
  172|  1.28k|    if (point == NULL) {
  ------------------
  |  Branch (172:9): [True: 1.28k, False: 0]
  ------------------
  173|  1.28k|        if (!EC_POINT_copy(p, group->generator)) {
  ------------------
  |  Branch (173:13): [True: 0, False: 1.28k]
  ------------------
  174|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  175|      0|            goto err;
  176|      0|        }
  177|  1.28k|    } else {
  178|      0|        if (!EC_POINT_copy(p, point)) {
  ------------------
  |  Branch (178:13): [True: 0, False: 0]
  ------------------
  179|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  180|      0|            goto err;
  181|      0|        }
  182|      0|    }
  183|       |
  184|  1.28k|    EC_POINT_BN_set_flags(p, BN_FLG_CONSTTIME);
  ------------------
  |  |  104|  1.28k|#define EC_POINT_BN_set_flags(P, flags) do { \
  |  |  105|  1.28k|    BN_set_flags((P)->X, (flags)); \
  |  |  106|  1.28k|    BN_set_flags((P)->Y, (flags)); \
  |  |  107|  1.28k|    BN_set_flags((P)->Z, (flags)); \
  |  |  108|  1.28k|} while(0)
  |  |  ------------------
  |  |  |  Branch (108:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  185|  1.28k|    EC_POINT_BN_set_flags(r, BN_FLG_CONSTTIME);
  ------------------
  |  |  104|  1.28k|#define EC_POINT_BN_set_flags(P, flags) do { \
  |  |  105|  1.28k|    BN_set_flags((P)->X, (flags)); \
  |  |  106|  1.28k|    BN_set_flags((P)->Y, (flags)); \
  |  |  107|  1.28k|    BN_set_flags((P)->Z, (flags)); \
  |  |  108|  1.28k|} while(0)
  |  |  ------------------
  |  |  |  Branch (108:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  186|  1.28k|    EC_POINT_BN_set_flags(s, BN_FLG_CONSTTIME);
  ------------------
  |  |  104|  1.28k|#define EC_POINT_BN_set_flags(P, flags) do { \
  |  |  105|  1.28k|    BN_set_flags((P)->X, (flags)); \
  |  |  106|  1.28k|    BN_set_flags((P)->Y, (flags)); \
  |  |  107|  1.28k|    BN_set_flags((P)->Z, (flags)); \
  |  |  108|  1.28k|} while(0)
  |  |  ------------------
  |  |  |  Branch (108:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  187|       |
  188|  1.28k|    cardinality = BN_CTX_get(ctx);
  189|  1.28k|    lambda = BN_CTX_get(ctx);
  190|  1.28k|    k = BN_CTX_get(ctx);
  191|  1.28k|    if (k == NULL) {
  ------------------
  |  Branch (191:9): [True: 0, False: 1.28k]
  ------------------
  192|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  193|      0|        goto err;
  194|      0|    }
  195|       |
  196|  1.28k|    if (!BN_mul(cardinality, group->order, group->cofactor, ctx)) {
  ------------------
  |  Branch (196:9): [True: 0, False: 1.28k]
  ------------------
  197|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  198|      0|        goto err;
  199|      0|    }
  200|       |
  201|       |    /*
  202|       |     * Group cardinalities are often on a word boundary.
  203|       |     * So when we pad the scalar, some timing diff might
  204|       |     * pop if it needs to be expanded due to carries.
  205|       |     * So expand ahead of time.
  206|       |     */
  207|  1.28k|    cardinality_bits = BN_num_bits(cardinality);
  208|  1.28k|    group_top = bn_get_top(cardinality);
  209|  1.28k|    if ((bn_wexpand(k, group_top + 2) == NULL)
  ------------------
  |  Branch (209:9): [True: 0, False: 1.28k]
  ------------------
  210|  1.28k|        || (bn_wexpand(lambda, group_top + 2) == NULL)) {
  ------------------
  |  Branch (210:12): [True: 0, False: 1.28k]
  ------------------
  211|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  212|      0|        goto err;
  213|      0|    }
  214|       |
  215|  1.28k|    if (!BN_copy(k, scalar)) {
  ------------------
  |  Branch (215:9): [True: 0, False: 1.28k]
  ------------------
  216|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  217|      0|        goto err;
  218|      0|    }
  219|       |
  220|  1.28k|    BN_set_flags(k, BN_FLG_CONSTTIME);
  ------------------
  |  |   67|  1.28k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  221|       |
  222|  1.28k|    if ((BN_num_bits(k) > cardinality_bits) || (BN_is_negative(k))) {
  ------------------
  |  Branch (222:9): [True: 409, False: 872]
  |  Branch (222:48): [True: 0, False: 872]
  ------------------
  223|       |        /*-
  224|       |         * this is an unusual input, and we don't guarantee
  225|       |         * constant-timeness
  226|       |         */
  227|    409|        if (!BN_nnmod(k, k, cardinality, ctx)) {
  ------------------
  |  Branch (227:13): [True: 0, False: 409]
  ------------------
  228|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  229|      0|            goto err;
  230|      0|        }
  231|    409|    }
  232|       |
  233|  1.28k|    if (!BN_add(lambda, k, cardinality)) {
  ------------------
  |  Branch (233:9): [True: 0, False: 1.28k]
  ------------------
  234|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  235|      0|        goto err;
  236|      0|    }
  237|  1.28k|    BN_set_flags(lambda, BN_FLG_CONSTTIME);
  ------------------
  |  |   67|  1.28k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  238|  1.28k|    if (!BN_add(k, lambda, cardinality)) {
  ------------------
  |  Branch (238:9): [True: 0, False: 1.28k]
  ------------------
  239|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  240|      0|        goto err;
  241|      0|    }
  242|       |    /*
  243|       |     * lambda := scalar + cardinality
  244|       |     * k := scalar + 2*cardinality
  245|       |     */
  246|  1.28k|    kbit = BN_is_bit_set(lambda, cardinality_bits);
  247|  1.28k|    BN_consttime_swap(kbit, k, lambda, group_top + 2);
  248|       |
  249|  1.28k|    group_top = bn_get_top(group->field);
  250|  1.28k|    if ((bn_wexpand(s->X, group_top) == NULL)
  ------------------
  |  Branch (250:9): [True: 0, False: 1.28k]
  ------------------
  251|  1.28k|        || (bn_wexpand(s->Y, group_top) == NULL)
  ------------------
  |  Branch (251:12): [True: 0, False: 1.28k]
  ------------------
  252|  1.28k|        || (bn_wexpand(s->Z, group_top) == NULL)
  ------------------
  |  Branch (252:12): [True: 0, False: 1.28k]
  ------------------
  253|  1.28k|        || (bn_wexpand(r->X, group_top) == NULL)
  ------------------
  |  Branch (253:12): [True: 0, False: 1.28k]
  ------------------
  254|  1.28k|        || (bn_wexpand(r->Y, group_top) == NULL)
  ------------------
  |  Branch (254:12): [True: 0, False: 1.28k]
  ------------------
  255|  1.28k|        || (bn_wexpand(r->Z, group_top) == NULL)
  ------------------
  |  Branch (255:12): [True: 0, False: 1.28k]
  ------------------
  256|  1.28k|        || (bn_wexpand(p->X, group_top) == NULL)
  ------------------
  |  Branch (256:12): [True: 0, False: 1.28k]
  ------------------
  257|  1.28k|        || (bn_wexpand(p->Y, group_top) == NULL)
  ------------------
  |  Branch (257:12): [True: 0, False: 1.28k]
  ------------------
  258|  1.28k|        || (bn_wexpand(p->Z, group_top) == NULL)) {
  ------------------
  |  Branch (258:12): [True: 0, False: 1.28k]
  ------------------
  259|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  260|      0|        goto err;
  261|      0|    }
  262|       |
  263|       |    /* ensure input point is in affine coords for ladder step efficiency */
  264|  1.28k|    if (!p->Z_is_one && (group->meth->make_affine == NULL
  ------------------
  |  Branch (264:9): [True: 0, False: 1.28k]
  |  Branch (264:26): [True: 0, False: 0]
  ------------------
  265|      0|                         || !group->meth->make_affine(group, p, ctx))) {
  ------------------
  |  Branch (265:29): [True: 0, False: 0]
  ------------------
  266|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  267|      0|            goto err;
  268|      0|    }
  269|       |
  270|       |    /* Initialize the Montgomery ladder */
  271|  1.28k|    if (!ec_point_ladder_pre(group, r, s, p, ctx)) {
  ------------------
  |  Branch (271:9): [True: 0, False: 1.28k]
  ------------------
  272|      0|        ERR_raise(ERR_LIB_EC, EC_R_LADDER_PRE_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  273|      0|        goto err;
  274|      0|    }
  275|       |
  276|       |    /* top bit is a 1, in a fixed pos */
  277|  1.28k|    pbit = 1;
  278|       |
  279|  1.28k|#define EC_POINT_CSWAP(c, a, b, w, t) do {         \
  280|  1.28k|        BN_consttime_swap(c, (a)->X, (b)->X, w);   \
  281|  1.28k|        BN_consttime_swap(c, (a)->Y, (b)->Y, w);   \
  282|  1.28k|        BN_consttime_swap(c, (a)->Z, (b)->Z, w);   \
  283|  1.28k|        t = ((a)->Z_is_one ^ (b)->Z_is_one) & (c); \
  284|  1.28k|        (a)->Z_is_one ^= (t);                      \
  285|  1.28k|        (b)->Z_is_one ^= (t);                      \
  286|  1.28k|} while(0)
  287|       |
  288|       |    /*-
  289|       |     * The ladder step, with branches, is
  290|       |     *
  291|       |     * k[i] == 0: S = add(R, S), R = dbl(R)
  292|       |     * k[i] == 1: R = add(S, R), S = dbl(S)
  293|       |     *
  294|       |     * Swapping R, S conditionally on k[i] leaves you with state
  295|       |     *
  296|       |     * k[i] == 0: T, U = R, S
  297|       |     * k[i] == 1: T, U = S, R
  298|       |     *
  299|       |     * Then perform the ECC ops.
  300|       |     *
  301|       |     * U = add(T, U)
  302|       |     * T = dbl(T)
  303|       |     *
  304|       |     * Which leaves you with state
  305|       |     *
  306|       |     * k[i] == 0: U = add(R, S), T = dbl(R)
  307|       |     * k[i] == 1: U = add(S, R), T = dbl(S)
  308|       |     *
  309|       |     * Swapping T, U conditionally on k[i] leaves you with state
  310|       |     *
  311|       |     * k[i] == 0: R, S = T, U
  312|       |     * k[i] == 1: R, S = U, T
  313|       |     *
  314|       |     * Which leaves you with state
  315|       |     *
  316|       |     * k[i] == 0: S = add(R, S), R = dbl(R)
  317|       |     * k[i] == 1: R = add(S, R), S = dbl(S)
  318|       |     *
  319|       |     * So we get the same logic, but instead of a branch it's a
  320|       |     * conditional swap, followed by ECC ops, then another conditional swap.
  321|       |     *
  322|       |     * Optimization: The end of iteration i and start of i-1 looks like
  323|       |     *
  324|       |     * ...
  325|       |     * CSWAP(k[i], R, S)
  326|       |     * ECC
  327|       |     * CSWAP(k[i], R, S)
  328|       |     * (next iteration)
  329|       |     * CSWAP(k[i-1], R, S)
  330|       |     * ECC
  331|       |     * CSWAP(k[i-1], R, S)
  332|       |     * ...
  333|       |     *
  334|       |     * So instead of two contiguous swaps, you can merge the condition
  335|       |     * bits and do a single swap.
  336|       |     *
  337|       |     * k[i]   k[i-1]    Outcome
  338|       |     * 0      0         No Swap
  339|       |     * 0      1         Swap
  340|       |     * 1      0         Swap
  341|       |     * 1      1         No Swap
  342|       |     *
  343|       |     * This is XOR. pbit tracks the previous bit of k.
  344|       |     */
  345|       |
  346|   301k|    for (i = cardinality_bits - 1; i >= 0; i--) {
  ------------------
  |  Branch (346:36): [True: 300k, False: 1.28k]
  ------------------
  347|   300k|        kbit = BN_is_bit_set(k, i) ^ pbit;
  348|   300k|        EC_POINT_CSWAP(kbit, r, s, group_top, Z_is_one);
  ------------------
  |  |  279|   300k|#define EC_POINT_CSWAP(c, a, b, w, t) do {         \
  |  |  280|   300k|        BN_consttime_swap(c, (a)->X, (b)->X, w);   \
  |  |  281|   300k|        BN_consttime_swap(c, (a)->Y, (b)->Y, w);   \
  |  |  282|   300k|        BN_consttime_swap(c, (a)->Z, (b)->Z, w);   \
  |  |  283|   300k|        t = ((a)->Z_is_one ^ (b)->Z_is_one) & (c); \
  |  |  284|   300k|        (a)->Z_is_one ^= (t);                      \
  |  |  285|   300k|        (b)->Z_is_one ^= (t);                      \
  |  |  286|   300k|} while(0)
  |  |  ------------------
  |  |  |  Branch (286:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  349|       |
  350|       |        /* Perform a single step of the Montgomery ladder */
  351|   300k|        if (!ec_point_ladder_step(group, r, s, p, ctx)) {
  ------------------
  |  Branch (351:13): [True: 0, False: 300k]
  ------------------
  352|      0|            ERR_raise(ERR_LIB_EC, EC_R_LADDER_STEP_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  353|      0|            goto err;
  354|      0|        }
  355|       |        /*
  356|       |         * pbit logic merges this cswap with that of the
  357|       |         * next iteration
  358|       |         */
  359|   300k|        pbit ^= kbit;
  360|   300k|    }
  361|       |    /* one final cswap to move the right value into r */
  362|  1.28k|    EC_POINT_CSWAP(pbit, r, s, group_top, Z_is_one);
  ------------------
  |  |  279|  1.28k|#define EC_POINT_CSWAP(c, a, b, w, t) do {         \
  |  |  280|  1.28k|        BN_consttime_swap(c, (a)->X, (b)->X, w);   \
  |  |  281|  1.28k|        BN_consttime_swap(c, (a)->Y, (b)->Y, w);   \
  |  |  282|  1.28k|        BN_consttime_swap(c, (a)->Z, (b)->Z, w);   \
  |  |  283|  1.28k|        t = ((a)->Z_is_one ^ (b)->Z_is_one) & (c); \
  |  |  284|  1.28k|        (a)->Z_is_one ^= (t);                      \
  |  |  285|  1.28k|        (b)->Z_is_one ^= (t);                      \
  |  |  286|  1.28k|} while(0)
  |  |  ------------------
  |  |  |  Branch (286:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  363|  1.28k|#undef EC_POINT_CSWAP
  364|       |
  365|       |    /* Finalize ladder (and recover full point coordinates) */
  366|  1.28k|    if (!ec_point_ladder_post(group, r, s, p, ctx)) {
  ------------------
  |  Branch (366:9): [True: 0, False: 1.28k]
  ------------------
  367|      0|        ERR_raise(ERR_LIB_EC, EC_R_LADDER_POST_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  368|      0|        goto err;
  369|      0|    }
  370|       |
  371|  1.28k|    ret = 1;
  372|       |
  373|  1.28k| err:
  374|  1.28k|    EC_POINT_free(p);
  375|  1.28k|    EC_POINT_clear_free(s);
  376|  1.28k|    BN_CTX_end(ctx);
  377|       |
  378|  1.28k|    return ret;
  379|  1.28k|}
ossl_ec_wNAF_mul:
  407|    795|{
  408|    795|    const EC_POINT *generator = NULL;
  409|    795|    EC_POINT *tmp = NULL;
  410|    795|    size_t totalnum;
  411|    795|    size_t blocksize = 0, numblocks = 0; /* for wNAF splitting */
  412|    795|    size_t pre_points_per_block = 0;
  413|    795|    size_t i, j;
  414|    795|    int k;
  415|    795|    int r_is_inverted = 0;
  416|    795|    int r_is_at_infinity = 1;
  417|    795|    size_t *wsize = NULL;       /* individual window sizes */
  418|    795|    signed char **wNAF = NULL;  /* individual wNAFs */
  419|    795|    size_t *wNAF_len = NULL;
  420|    795|    size_t max_len = 0;
  421|    795|    size_t num_val;
  422|    795|    EC_POINT **val = NULL;      /* precomputation */
  423|    795|    EC_POINT **v;
  424|    795|    EC_POINT ***val_sub = NULL; /* pointers to sub-arrays of 'val' or
  425|       |                                 * 'pre_comp->points' */
  426|    795|    const EC_PRE_COMP *pre_comp = NULL;
  427|    795|    int num_scalar = 0;         /* flag: will be set to 1 if 'scalar' must be
  428|       |                                 * treated like other scalars, i.e.
  429|       |                                 * precomputation is not available */
  430|    795|    int ret = 0;
  431|       |
  432|    795|    if (!BN_is_zero(group->order) && !BN_is_zero(group->cofactor)) {
  ------------------
  |  Branch (432:9): [True: 795, False: 0]
  |  Branch (432:38): [True: 526, False: 269]
  ------------------
  433|       |        /*-
  434|       |         * Handle the common cases where the scalar is secret, enforcing a
  435|       |         * scalar multiplication implementation based on a Montgomery ladder,
  436|       |         * with various timing attack defenses.
  437|       |         */
  438|    526|        if ((scalar != group->order) && (scalar != NULL) && (num == 0)) {
  ------------------
  |  Branch (438:13): [True: 526, False: 0]
  |  Branch (438:41): [True: 526, False: 0]
  |  Branch (438:61): [True: 526, False: 0]
  ------------------
  439|       |            /*-
  440|       |             * In this case we want to compute scalar * GeneratorPoint: this
  441|       |             * codepath is reached most prominently by (ephemeral) key
  442|       |             * generation of EC cryptosystems (i.e. ECDSA keygen and sign setup,
  443|       |             * ECDH keygen/first half), where the scalar is always secret. This
  444|       |             * is why we ignore if BN_FLG_CONSTTIME is actually set and we
  445|       |             * always call the ladder version.
  446|       |             */
  447|    526|            return ossl_ec_scalar_mul_ladder(group, r, scalar, NULL, ctx);
  448|    526|        }
  449|      0|        if ((scalar == NULL) && (num == 1) && (scalars[0] != group->order)) {
  ------------------
  |  Branch (449:13): [True: 0, False: 0]
  |  Branch (449:33): [True: 0, False: 0]
  |  Branch (449:47): [True: 0, False: 0]
  ------------------
  450|       |            /*-
  451|       |             * In this case we want to compute scalar * VariablePoint: this
  452|       |             * codepath is reached most prominently by the second half of ECDH,
  453|       |             * where the secret scalar is multiplied by the peer's public point.
  454|       |             * To protect the secret scalar, we ignore if BN_FLG_CONSTTIME is
  455|       |             * actually set and we always call the ladder version.
  456|       |             */
  457|      0|            return ossl_ec_scalar_mul_ladder(group, r, scalars[0], points[0],
  458|      0|                                             ctx);
  459|      0|        }
  460|      0|    }
  461|       |
  462|    269|    if (scalar != NULL) {
  ------------------
  |  Branch (462:9): [True: 269, False: 0]
  ------------------
  463|    269|        generator = EC_GROUP_get0_generator(group);
  464|    269|        if (generator == NULL) {
  ------------------
  |  Branch (464:13): [True: 0, False: 269]
  ------------------
  465|      0|            ERR_raise(ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  466|      0|            goto err;
  467|      0|        }
  468|       |
  469|       |        /* look if we can use precomputed multiples of generator */
  470|       |
  471|    269|        pre_comp = group->pre_comp.ec;
  472|    269|        if (pre_comp && pre_comp->numblocks
  ------------------
  |  Branch (472:13): [True: 0, False: 269]
  |  Branch (472:25): [True: 0, False: 0]
  ------------------
  473|    269|            && (EC_POINT_cmp(group, generator, pre_comp->points[0], ctx) ==
  ------------------
  |  Branch (473:16): [True: 0, False: 0]
  ------------------
  474|      0|                0)) {
  475|      0|            blocksize = pre_comp->blocksize;
  476|       |
  477|       |            /*
  478|       |             * determine maximum number of blocks that wNAF splitting may
  479|       |             * yield (NB: maximum wNAF length is bit length plus one)
  480|       |             */
  481|      0|            numblocks = (BN_num_bits(scalar) / blocksize) + 1;
  482|       |
  483|       |            /*
  484|       |             * we cannot use more blocks than we have precomputation for
  485|       |             */
  486|      0|            if (numblocks > pre_comp->numblocks)
  ------------------
  |  Branch (486:17): [True: 0, False: 0]
  ------------------
  487|      0|                numblocks = pre_comp->numblocks;
  488|       |
  489|      0|            pre_points_per_block = (size_t)1 << (pre_comp->w - 1);
  490|       |
  491|       |            /* check that pre_comp looks sane */
  492|      0|            if (pre_comp->num != (pre_comp->numblocks * pre_points_per_block)) {
  ------------------
  |  Branch (492:17): [True: 0, False: 0]
  ------------------
  493|      0|                ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  494|      0|                goto err;
  495|      0|            }
  496|    269|        } else {
  497|       |            /* can't use precomputation */
  498|    269|            pre_comp = NULL;
  499|    269|            numblocks = 1;
  500|    269|            num_scalar = 1;     /* treat 'scalar' like 'num'-th element of
  501|       |                                 * 'scalars' */
  502|    269|        }
  503|    269|    }
  504|       |
  505|    269|    totalnum = num + numblocks;
  506|       |
  507|    269|    wsize = OPENSSL_malloc(totalnum * sizeof(wsize[0]));
  ------------------
  |  |  102|    269|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  508|    269|    wNAF_len = OPENSSL_malloc(totalnum * sizeof(wNAF_len[0]));
  ------------------
  |  |  102|    269|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  509|       |    /* include space for pivot */
  510|    269|    wNAF = OPENSSL_malloc((totalnum + 1) * sizeof(wNAF[0]));
  ------------------
  |  |  102|    269|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  511|    269|    val_sub = OPENSSL_malloc(totalnum * sizeof(val_sub[0]));
  ------------------
  |  |  102|    269|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  512|       |
  513|       |    /* Ensure wNAF is initialised in case we end up going to err */
  514|    269|    if (wNAF != NULL)
  ------------------
  |  Branch (514:9): [True: 269, False: 0]
  ------------------
  515|    269|        wNAF[0] = NULL;         /* preliminary pivot */
  516|       |
  517|    269|    if (wsize == NULL || wNAF_len == NULL || wNAF == NULL || val_sub == NULL)
  ------------------
  |  Branch (517:9): [True: 0, False: 269]
  |  Branch (517:26): [True: 0, False: 269]
  |  Branch (517:46): [True: 0, False: 269]
  |  Branch (517:62): [True: 0, False: 269]
  ------------------
  518|      0|        goto err;
  519|       |
  520|       |    /*
  521|       |     * num_val will be the total number of temporarily precomputed points
  522|       |     */
  523|    269|    num_val = 0;
  524|       |
  525|    538|    for (i = 0; i < num + num_scalar; i++) {
  ------------------
  |  Branch (525:17): [True: 269, False: 269]
  ------------------
  526|    269|        size_t bits;
  527|       |
  528|    269|        bits = i < num ? BN_num_bits(scalars[i]) : BN_num_bits(scalar);
  ------------------
  |  Branch (528:16): [True: 0, False: 269]
  ------------------
  529|    269|        wsize[i] = EC_window_bits_for_scalar_size(bits);
  ------------------
  |  |  389|    269|                ((size_t) \
  |  |  390|    269|                 ((b) >= 2000 ? 6 : \
  |  |  ------------------
  |  |  |  Branch (390:19): [True: 7, False: 262]
  |  |  ------------------
  |  |  391|    269|                  (b) >=  800 ? 5 : \
  |  |  ------------------
  |  |  |  Branch (391:19): [True: 9, False: 253]
  |  |  ------------------
  |  |  392|    262|                  (b) >=  300 ? 4 : \
  |  |  ------------------
  |  |  |  Branch (392:19): [True: 23, False: 230]
  |  |  ------------------
  |  |  393|    253|                  (b) >=   70 ? 3 : \
  |  |  ------------------
  |  |  |  Branch (393:19): [True: 31, False: 199]
  |  |  ------------------
  |  |  394|    230|                  (b) >=   20 ? 2 : \
  |  |  ------------------
  |  |  |  Branch (394:19): [True: 59, False: 140]
  |  |  ------------------
  |  |  395|    199|                  1))
  ------------------
  530|    269|        num_val += (size_t)1 << (wsize[i] - 1);
  531|    269|        wNAF[i + 1] = NULL;     /* make sure we always have a pivot */
  532|    269|        wNAF[i] =
  533|    269|            bn_compute_wNAF((i < num ? scalars[i] : scalar), wsize[i],
  ------------------
  |  Branch (533:30): [True: 0, False: 269]
  ------------------
  534|    269|                            &wNAF_len[i]);
  535|    269|        if (wNAF[i] == NULL)
  ------------------
  |  Branch (535:13): [True: 0, False: 269]
  ------------------
  536|      0|            goto err;
  537|    269|        if (wNAF_len[i] > max_len)
  ------------------
  |  Branch (537:13): [True: 269, False: 0]
  ------------------
  538|    269|            max_len = wNAF_len[i];
  539|    269|    }
  540|       |
  541|    269|    if (numblocks) {
  ------------------
  |  Branch (541:9): [True: 269, False: 0]
  ------------------
  542|       |        /* we go here iff scalar != NULL */
  543|       |
  544|    269|        if (pre_comp == NULL) {
  ------------------
  |  Branch (544:13): [True: 269, False: 0]
  ------------------
  545|    269|            if (num_scalar != 1) {
  ------------------
  |  Branch (545:17): [True: 0, False: 269]
  ------------------
  546|      0|                ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  547|      0|                goto err;
  548|      0|            }
  549|       |            /* we have already generated a wNAF for 'scalar' */
  550|    269|        } else {
  551|      0|            signed char *tmp_wNAF = NULL;
  552|      0|            size_t tmp_len = 0;
  553|       |
  554|      0|            if (num_scalar != 0) {
  ------------------
  |  Branch (554:17): [True: 0, False: 0]
  ------------------
  555|      0|                ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  556|      0|                goto err;
  557|      0|            }
  558|       |
  559|       |            /*
  560|       |             * use the window size for which we have precomputation
  561|       |             */
  562|      0|            wsize[num] = pre_comp->w;
  563|      0|            tmp_wNAF = bn_compute_wNAF(scalar, wsize[num], &tmp_len);
  564|      0|            if (!tmp_wNAF)
  ------------------
  |  Branch (564:17): [True: 0, False: 0]
  ------------------
  565|      0|                goto err;
  566|       |
  567|      0|            if (tmp_len <= max_len) {
  ------------------
  |  Branch (567:17): [True: 0, False: 0]
  ------------------
  568|       |                /*
  569|       |                 * One of the other wNAFs is at least as long as the wNAF
  570|       |                 * belonging to the generator, so wNAF splitting will not buy
  571|       |                 * us anything.
  572|       |                 */
  573|       |
  574|      0|                numblocks = 1;
  575|      0|                totalnum = num + 1; /* don't use wNAF splitting */
  576|      0|                wNAF[num] = tmp_wNAF;
  577|      0|                wNAF[num + 1] = NULL;
  578|      0|                wNAF_len[num] = tmp_len;
  579|       |                /*
  580|       |                 * pre_comp->points starts with the points that we need here:
  581|       |                 */
  582|      0|                val_sub[num] = pre_comp->points;
  583|      0|            } else {
  584|       |                /*
  585|       |                 * don't include tmp_wNAF directly into wNAF array - use wNAF
  586|       |                 * splitting and include the blocks
  587|       |                 */
  588|       |
  589|      0|                signed char *pp;
  590|      0|                EC_POINT **tmp_points;
  591|       |
  592|      0|                if (tmp_len < numblocks * blocksize) {
  ------------------
  |  Branch (592:21): [True: 0, False: 0]
  ------------------
  593|       |                    /*
  594|       |                     * possibly we can do with fewer blocks than estimated
  595|       |                     */
  596|      0|                    numblocks = (tmp_len + blocksize - 1) / blocksize;
  597|      0|                    if (numblocks > pre_comp->numblocks) {
  ------------------
  |  Branch (597:25): [True: 0, False: 0]
  ------------------
  598|      0|                        ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  599|      0|                        OPENSSL_free(tmp_wNAF);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  600|      0|                        goto err;
  601|      0|                    }
  602|      0|                    totalnum = num + numblocks;
  603|      0|                }
  604|       |
  605|       |                /* split wNAF in 'numblocks' parts */
  606|      0|                pp = tmp_wNAF;
  607|      0|                tmp_points = pre_comp->points;
  608|       |
  609|      0|                for (i = num; i < totalnum; i++) {
  ------------------
  |  Branch (609:31): [True: 0, False: 0]
  ------------------
  610|      0|                    if (i < totalnum - 1) {
  ------------------
  |  Branch (610:25): [True: 0, False: 0]
  ------------------
  611|      0|                        wNAF_len[i] = blocksize;
  612|      0|                        if (tmp_len < blocksize) {
  ------------------
  |  Branch (612:29): [True: 0, False: 0]
  ------------------
  613|      0|                            ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  614|      0|                            OPENSSL_free(tmp_wNAF);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  615|      0|                            goto err;
  616|      0|                        }
  617|      0|                        tmp_len -= blocksize;
  618|      0|                    } else
  619|       |                        /*
  620|       |                         * last block gets whatever is left (this could be
  621|       |                         * more or less than 'blocksize'!)
  622|       |                         */
  623|      0|                        wNAF_len[i] = tmp_len;
  624|       |
  625|      0|                    wNAF[i + 1] = NULL;
  626|      0|                    wNAF[i] = OPENSSL_malloc(wNAF_len[i]);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  627|      0|                    if (wNAF[i] == NULL) {
  ------------------
  |  Branch (627:25): [True: 0, False: 0]
  ------------------
  628|      0|                        OPENSSL_free(tmp_wNAF);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  629|      0|                        goto err;
  630|      0|                    }
  631|      0|                    memcpy(wNAF[i], pp, wNAF_len[i]);
  632|      0|                    if (wNAF_len[i] > max_len)
  ------------------
  |  Branch (632:25): [True: 0, False: 0]
  ------------------
  633|      0|                        max_len = wNAF_len[i];
  634|       |
  635|      0|                    if (*tmp_points == NULL) {
  ------------------
  |  Branch (635:25): [True: 0, False: 0]
  ------------------
  636|      0|                        ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  637|      0|                        OPENSSL_free(tmp_wNAF);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  638|      0|                        goto err;
  639|      0|                    }
  640|      0|                    val_sub[i] = tmp_points;
  641|      0|                    tmp_points += pre_points_per_block;
  642|      0|                    pp += blocksize;
  643|      0|                }
  644|      0|                OPENSSL_free(tmp_wNAF);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  645|      0|            }
  646|      0|        }
  647|    269|    }
  648|       |
  649|       |    /*
  650|       |     * All points we precompute now go into a single array 'val'.
  651|       |     * 'val_sub[i]' is a pointer to the subarray for the i-th point, or to a
  652|       |     * subarray of 'pre_comp->points' if we already have precomputation.
  653|       |     */
  654|    269|    val = OPENSSL_malloc((num_val + 1) * sizeof(val[0]));
  ------------------
  |  |  102|    269|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  655|    269|    if (val == NULL)
  ------------------
  |  Branch (655:9): [True: 0, False: 269]
  ------------------
  656|      0|        goto err;
  657|    269|    val[num_val] = NULL;        /* pivot element */
  658|       |
  659|       |    /* allocate points for precomputation */
  660|    269|    v = val;
  661|    538|    for (i = 0; i < num + num_scalar; i++) {
  ------------------
  |  Branch (661:17): [True: 269, False: 269]
  ------------------
  662|    269|        val_sub[i] = v;
  663|  1.20k|        for (j = 0; j < ((size_t)1 << (wsize[i] - 1)); j++) {
  ------------------
  |  Branch (663:21): [True: 934, False: 269]
  ------------------
  664|    934|            *v = EC_POINT_new(group);
  665|    934|            if (*v == NULL)
  ------------------
  |  Branch (665:17): [True: 0, False: 934]
  ------------------
  666|      0|                goto err;
  667|    934|            v++;
  668|    934|        }
  669|    269|    }
  670|    269|    if (!(v == val + num_val)) {
  ------------------
  |  Branch (670:9): [True: 0, False: 269]
  ------------------
  671|      0|        ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  672|      0|        goto err;
  673|      0|    }
  674|       |
  675|    269|    if ((tmp = EC_POINT_new(group)) == NULL)
  ------------------
  |  Branch (675:9): [True: 0, False: 269]
  ------------------
  676|      0|        goto err;
  677|       |
  678|       |    /*-
  679|       |     * prepare precomputed values:
  680|       |     *    val_sub[i][0] :=     points[i]
  681|       |     *    val_sub[i][1] := 3 * points[i]
  682|       |     *    val_sub[i][2] := 5 * points[i]
  683|       |     *    ...
  684|       |     */
  685|    538|    for (i = 0; i < num + num_scalar; i++) {
  ------------------
  |  Branch (685:17): [True: 269, False: 269]
  ------------------
  686|    269|        if (i < num) {
  ------------------
  |  Branch (686:13): [True: 0, False: 269]
  ------------------
  687|      0|            if (!EC_POINT_copy(val_sub[i][0], points[i]))
  ------------------
  |  Branch (687:17): [True: 0, False: 0]
  ------------------
  688|      0|                goto err;
  689|    269|        } else {
  690|    269|            if (!EC_POINT_copy(val_sub[i][0], generator))
  ------------------
  |  Branch (690:17): [True: 0, False: 269]
  ------------------
  691|      0|                goto err;
  692|    269|        }
  693|       |
  694|    269|        if (wsize[i] > 1) {
  ------------------
  |  Branch (694:13): [True: 129, False: 140]
  ------------------
  695|    129|            if (!EC_POINT_dbl(group, tmp, val_sub[i][0], ctx))
  ------------------
  |  Branch (695:17): [True: 0, False: 129]
  ------------------
  696|      0|                goto err;
  697|    794|            for (j = 1; j < ((size_t)1 << (wsize[i] - 1)); j++) {
  ------------------
  |  Branch (697:25): [True: 665, False: 129]
  ------------------
  698|    665|                if (!EC_POINT_add
  ------------------
  |  Branch (698:21): [True: 0, False: 665]
  ------------------
  699|    665|                    (group, val_sub[i][j], val_sub[i][j - 1], tmp, ctx))
  700|      0|                    goto err;
  701|    665|            }
  702|    129|        }
  703|    269|    }
  704|       |
  705|    269|    if (group->meth->points_make_affine == NULL
  ------------------
  |  Branch (705:9): [True: 0, False: 269]
  ------------------
  706|    269|        || !group->meth->points_make_affine(group, num_val, val, ctx))
  ------------------
  |  Branch (706:12): [True: 0, False: 269]
  ------------------
  707|      0|        goto err;
  708|       |
  709|    269|    r_is_at_infinity = 1;
  710|       |
  711|  39.5k|    for (k = max_len - 1; k >= 0; k--) {
  ------------------
  |  Branch (711:27): [True: 39.3k, False: 269]
  ------------------
  712|  39.3k|        if (!r_is_at_infinity) {
  ------------------
  |  Branch (712:13): [True: 39.0k, False: 269]
  ------------------
  713|  39.0k|            if (!EC_POINT_dbl(group, r, r, ctx))
  ------------------
  |  Branch (713:17): [True: 0, False: 39.0k]
  ------------------
  714|      0|                goto err;
  715|  39.0k|        }
  716|       |
  717|  78.6k|        for (i = 0; i < totalnum; i++) {
  ------------------
  |  Branch (717:21): [True: 39.3k, False: 39.3k]
  ------------------
  718|  39.3k|            if (wNAF_len[i] > (size_t)k) {
  ------------------
  |  Branch (718:17): [True: 39.3k, False: 0]
  ------------------
  719|  39.3k|                int digit = wNAF[i][k];
  720|  39.3k|                int is_neg;
  721|       |
  722|  39.3k|                if (digit) {
  ------------------
  |  Branch (722:21): [True: 5.32k, False: 33.9k]
  ------------------
  723|  5.32k|                    is_neg = digit < 0;
  724|       |
  725|  5.32k|                    if (is_neg)
  ------------------
  |  Branch (725:25): [True: 2.00k, False: 3.32k]
  ------------------
  726|  2.00k|                        digit = -digit;
  727|       |
  728|  5.32k|                    if (is_neg != r_is_inverted) {
  ------------------
  |  Branch (728:25): [True: 2.11k, False: 3.20k]
  ------------------
  729|  2.11k|                        if (!r_is_at_infinity) {
  ------------------
  |  Branch (729:29): [True: 2.11k, False: 0]
  ------------------
  730|  2.11k|                            if (!EC_POINT_invert(group, r, ctx))
  ------------------
  |  Branch (730:33): [True: 0, False: 2.11k]
  ------------------
  731|      0|                                goto err;
  732|  2.11k|                        }
  733|  2.11k|                        r_is_inverted = !r_is_inverted;
  734|  2.11k|                    }
  735|       |
  736|       |                    /* digit > 0 */
  737|       |
  738|  5.32k|                    if (r_is_at_infinity) {
  ------------------
  |  Branch (738:25): [True: 251, False: 5.07k]
  ------------------
  739|    251|                        if (!EC_POINT_copy(r, val_sub[i][digit >> 1]))
  ------------------
  |  Branch (739:29): [True: 0, False: 251]
  ------------------
  740|      0|                            goto err;
  741|       |
  742|       |                        /*-
  743|       |                         * Apply coordinate blinding for EC_POINT.
  744|       |                         *
  745|       |                         * The underlying EC_METHOD can optionally implement this function:
  746|       |                         * ossl_ec_point_blind_coordinates() returns 0 in case of errors or 1 on
  747|       |                         * success or if coordinate blinding is not implemented for this
  748|       |                         * group.
  749|       |                         */
  750|    251|                        if (!ossl_ec_point_blind_coordinates(group, r, ctx)) {
  ------------------
  |  Branch (750:29): [True: 0, False: 251]
  ------------------
  751|      0|                            ERR_raise(ERR_LIB_EC, EC_R_POINT_COORDINATES_BLIND_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  752|      0|                            goto err;
  753|      0|                        }
  754|       |
  755|    251|                        r_is_at_infinity = 0;
  756|  5.07k|                    } else {
  757|  5.07k|                        if (!EC_POINT_add
  ------------------
  |  Branch (757:29): [True: 0, False: 5.07k]
  ------------------
  758|  5.07k|                            (group, r, r, val_sub[i][digit >> 1], ctx))
  759|      0|                            goto err;
  760|  5.07k|                    }
  761|  5.32k|                }
  762|  39.3k|            }
  763|  39.3k|        }
  764|  39.3k|    }
  765|       |
  766|    269|    if (r_is_at_infinity) {
  ------------------
  |  Branch (766:9): [True: 18, False: 251]
  ------------------
  767|     18|        if (!EC_POINT_set_to_infinity(group, r))
  ------------------
  |  Branch (767:13): [True: 0, False: 18]
  ------------------
  768|      0|            goto err;
  769|    251|    } else {
  770|    251|        if (r_is_inverted)
  ------------------
  |  Branch (770:13): [True: 93, False: 158]
  ------------------
  771|     93|            if (!EC_POINT_invert(group, r, ctx))
  ------------------
  |  Branch (771:17): [True: 0, False: 93]
  ------------------
  772|      0|                goto err;
  773|    251|    }
  774|       |
  775|    269|    ret = 1;
  776|       |
  777|    269| err:
  778|    269|    EC_POINT_free(tmp);
  779|    269|    OPENSSL_free(wsize);
  ------------------
  |  |  115|    269|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  780|    269|    OPENSSL_free(wNAF_len);
  ------------------
  |  |  115|    269|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  781|    269|    if (wNAF != NULL) {
  ------------------
  |  Branch (781:9): [True: 269, False: 0]
  ------------------
  782|    269|        signed char **w;
  783|       |
  784|    538|        for (w = wNAF; *w != NULL; w++)
  ------------------
  |  Branch (784:24): [True: 269, False: 269]
  ------------------
  785|    269|            OPENSSL_free(*w);
  ------------------
  |  |  115|    269|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  786|       |
  787|    269|        OPENSSL_free(wNAF);
  ------------------
  |  |  115|    269|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  788|    269|    }
  789|    269|    if (val != NULL) {
  ------------------
  |  Branch (789:9): [True: 269, False: 0]
  ------------------
  790|  1.20k|        for (v = val; *v != NULL; v++)
  ------------------
  |  Branch (790:23): [True: 934, False: 269]
  ------------------
  791|    934|            EC_POINT_clear_free(*v);
  792|       |
  793|    269|        OPENSSL_free(val);
  ------------------
  |  |  115|    269|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  794|    269|    }
  795|    269|    OPENSSL_free(val_sub);
  ------------------
  |  |  115|    269|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  796|    269|    return ret;
  797|    269|}

EC_POINT_set_compressed_coordinates:
   26|  13.0k|{
   27|  13.0k|    if (group->meth->point_set_compressed_coordinates == NULL
  ------------------
  |  Branch (27:9): [True: 13.0k, False: 0]
  ------------------
   28|  13.0k|        && !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
  ------------------
  |  |   26|  13.0k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (28:12): [True: 0, False: 13.0k]
  ------------------
   29|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   30|      0|        return 0;
   31|      0|    }
   32|  13.0k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (32:9): [True: 0, False: 13.0k]
  ------------------
   33|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   34|      0|        return 0;
   35|      0|    }
   36|  13.0k|    if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {
  ------------------
  |  |   26|  13.0k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (36:9): [True: 13.0k, False: 0]
  ------------------
   37|  13.0k|        if (group->meth->field_type == NID_X9_62_prime_field)
  ------------------
  |  |  152|  13.0k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (37:13): [True: 1.85k, False: 11.2k]
  ------------------
   38|  1.85k|            return ossl_ec_GFp_simple_set_compressed_coordinates(group, point, x,
   39|  1.85k|                                                                 y_bit, ctx);
   40|  11.2k|        else
   41|       |#ifdef OPENSSL_NO_EC2M
   42|       |        {
   43|       |            ERR_raise(ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED);
   44|       |            return 0;
   45|       |        }
   46|       |#else
   47|  11.2k|            return ossl_ec_GF2m_simple_set_compressed_coordinates(group, point,
   48|  11.2k|                                                                  x, y_bit, ctx);
   49|  13.0k|#endif
   50|  13.0k|    }
   51|      0|    return group->meth->point_set_compressed_coordinates(group, point, x,
   52|      0|                                                         y_bit, ctx);
   53|  13.0k|}
EC_POINT_point2oct:
   76|  4.23k|{
   77|  4.23k|    if (point == NULL) {
  ------------------
  |  Branch (77:9): [True: 0, False: 4.23k]
  ------------------
   78|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   79|      0|        return 0;
   80|      0|    }
   81|  4.23k|    if (group->meth->point2oct == 0
  ------------------
  |  Branch (81:9): [True: 4.23k, False: 0]
  ------------------
   82|  4.23k|        && !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
  ------------------
  |  |   26|  4.23k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (82:12): [True: 0, False: 4.23k]
  ------------------
   83|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   84|      0|        return 0;
   85|      0|    }
   86|  4.23k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (86:9): [True: 0, False: 4.23k]
  ------------------
   87|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   88|      0|        return 0;
   89|      0|    }
   90|  4.23k|    if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {
  ------------------
  |  |   26|  4.23k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (90:9): [True: 4.23k, False: 0]
  ------------------
   91|  4.23k|        if (group->meth->field_type == NID_X9_62_prime_field)
  ------------------
  |  |  152|  4.23k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (91:13): [True: 3.40k, False: 828]
  ------------------
   92|  3.40k|            return ossl_ec_GFp_simple_point2oct(group, point, form, buf, len,
   93|  3.40k|                                                ctx);
   94|    828|        else
   95|       |#ifdef OPENSSL_NO_EC2M
   96|       |        {
   97|       |            ERR_raise(ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED);
   98|       |            return 0;
   99|       |        }
  100|       |#else
  101|    828|            return ossl_ec_GF2m_simple_point2oct(group, point,
  102|    828|                                                 form, buf, len, ctx);
  103|  4.23k|#endif
  104|  4.23k|    }
  105|       |
  106|      0|    return group->meth->point2oct(group, point, form, buf, len, ctx);
  107|  4.23k|}
EC_POINT_oct2point:
  111|  24.9k|{
  112|  24.9k|    if (group->meth->oct2point == 0
  ------------------
  |  Branch (112:9): [True: 24.9k, False: 0]
  ------------------
  113|  24.9k|        && !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
  ------------------
  |  |   26|  24.9k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (113:12): [True: 0, False: 24.9k]
  ------------------
  114|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  115|      0|        return 0;
  116|      0|    }
  117|  24.9k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (117:9): [True: 0, False: 24.9k]
  ------------------
  118|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  119|      0|        return 0;
  120|      0|    }
  121|  24.9k|    if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {
  ------------------
  |  |   26|  24.9k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (121:9): [True: 24.9k, False: 0]
  ------------------
  122|  24.9k|        if (group->meth->field_type == NID_X9_62_prime_field)
  ------------------
  |  |  152|  24.9k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (122:13): [True: 2.52k, False: 22.4k]
  ------------------
  123|  2.52k|            return ossl_ec_GFp_simple_oct2point(group, point, buf, len, ctx);
  124|  22.4k|        else
  125|       |#ifdef OPENSSL_NO_EC2M
  126|       |        {
  127|       |            ERR_raise(ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED);
  128|       |            return 0;
  129|       |        }
  130|       |#else
  131|  22.4k|            return ossl_ec_GF2m_simple_oct2point(group, point, buf, len, ctx);
  132|  24.9k|#endif
  133|  24.9k|    }
  134|      0|    return group->meth->oct2point(group, point, buf, len, ctx);
  135|  24.9k|}
EC_POINT_point2buf:
  140|  2.14k|{
  141|  2.14k|    size_t len;
  142|  2.14k|    unsigned char *buf;
  143|       |
  144|  2.14k|    len = EC_POINT_point2oct(group, point, form, NULL, 0, NULL);
  145|  2.14k|    if (len == 0)
  ------------------
  |  Branch (145:9): [True: 46, False: 2.09k]
  ------------------
  146|     46|        return 0;
  147|  2.09k|    if ((buf = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |  102|  2.09k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.09k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.09k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (147:9): [True: 0, False: 2.09k]
  ------------------
  148|      0|        return 0;
  149|  2.09k|    len = EC_POINT_point2oct(group, point, form, buf, len, ctx);
  150|  2.09k|    if (len == 0) {
  ------------------
  |  Branch (150:9): [True: 0, False: 2.09k]
  ------------------
  151|      0|        OPENSSL_free(buf);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  152|      0|        return 0;
  153|      0|    }
  154|  2.09k|    *pbuf = buf;
  155|  2.09k|    return len;
  156|  2.09k|}

ECPKParameters_print:
   71|    782|{
   72|    782|    int ret = 0, reason = ERR_R_BIO_LIB;
  ------------------
  |  |  330|    782|# define ERR_R_BIO_LIB          (ERR_LIB_BIO/* 32 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   93|    782|# define ERR_LIB_BIO             32
  |  |  ------------------
  |  |               # define ERR_R_BIO_LIB          (ERR_LIB_BIO/* 32 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|    782|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|    782|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   73|    782|    BN_CTX *ctx = NULL;
   74|    782|    const EC_POINT *point = NULL;
   75|    782|    BIGNUM *p = NULL, *a = NULL, *b = NULL;
   76|    782|    unsigned char *gen_buf = NULL;
   77|    782|    const BIGNUM *order = NULL, *cofactor = NULL;
   78|    782|    const unsigned char *seed;
   79|    782|    size_t seed_len = 0, gen_buf_len = 0;
   80|       |
   81|    782|    static const char *gen_compressed = "Generator (compressed):";
   82|    782|    static const char *gen_uncompressed = "Generator (uncompressed):";
   83|    782|    static const char *gen_hybrid = "Generator (hybrid):";
   84|       |
   85|    782|    if (!x) {
  ------------------
  |  Branch (85:9): [True: 0, False: 782]
  ------------------
   86|      0|        reason = ERR_R_PASSED_NULL_PARAMETER;
  ------------------
  |  |  353|      0|# define ERR_R_PASSED_NULL_PARAMETER             (258|ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  350|      0|# define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  236|      0|# define ERR_RFLAG_FATAL                (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   87|      0|        goto err;
   88|      0|    }
   89|       |
   90|    782|    ctx = BN_CTX_new();
   91|    782|    if (ctx == NULL) {
  ------------------
  |  Branch (91:9): [True: 0, False: 782]
  ------------------
   92|      0|        reason = ERR_R_BN_LIB;
  ------------------
  |  |  316|      0|# define ERR_R_BN_LIB           (ERR_LIB_BN/* 3 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   73|      0|# define ERR_LIB_BN              3
  |  |  ------------------
  |  |               # define ERR_R_BN_LIB           (ERR_LIB_BN/* 3 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   93|      0|        goto err;
   94|      0|    }
   95|       |
   96|    782|    if (EC_GROUP_get_asn1_flag(x)) {
  ------------------
  |  Branch (96:9): [True: 633, False: 149]
  ------------------
   97|       |        /* the curve parameter are given by an asn1 OID */
   98|    633|        int nid;
   99|    633|        const char *nname;
  100|       |
  101|    633|        if (!BIO_indent(bp, off, 128))
  ------------------
  |  Branch (101:13): [True: 0, False: 633]
  ------------------
  102|      0|            goto err;
  103|       |
  104|    633|        nid = EC_GROUP_get_curve_name(x);
  105|    633|        if (nid == 0)
  ------------------
  |  Branch (105:13): [True: 0, False: 633]
  ------------------
  106|      0|            goto err;
  107|    633|        if (BIO_printf(bp, "ASN1 OID: %s", OBJ_nid2sn(nid)) <= 0)
  ------------------
  |  Branch (107:13): [True: 0, False: 633]
  ------------------
  108|      0|            goto err;
  109|    633|        if (BIO_printf(bp, "\n") <= 0)
  ------------------
  |  Branch (109:13): [True: 0, False: 633]
  ------------------
  110|      0|            goto err;
  111|    633|        nname = EC_curve_nid2nist(nid);
  112|    633|        if (nname) {
  ------------------
  |  Branch (112:13): [True: 250, False: 383]
  ------------------
  113|    250|            if (!BIO_indent(bp, off, 128))
  ------------------
  |  Branch (113:17): [True: 0, False: 250]
  ------------------
  114|      0|                goto err;
  115|    250|            if (BIO_printf(bp, "NIST CURVE: %s\n", nname) <= 0)
  ------------------
  |  Branch (115:17): [True: 0, False: 250]
  ------------------
  116|      0|                goto err;
  117|    250|        }
  118|    633|    } else {
  119|    149|        const char *form_str;
  120|       |        /* explicit parameters */
  121|    149|        int is_char_two = 0;
  122|    149|        point_conversion_form_t form;
  123|    149|        int tmp_nid = EC_GROUP_get_field_type(x);
  124|       |
  125|    149|        if (tmp_nid == NID_X9_62_characteristic_two_field)
  ------------------
  |  |  156|    149|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (125:13): [True: 0, False: 149]
  ------------------
  126|      0|            is_char_two = 1;
  127|       |
  128|    149|        if ((p = BN_new()) == NULL || (a = BN_new()) == NULL ||
  ------------------
  |  Branch (128:13): [True: 0, False: 149]
  |  Branch (128:39): [True: 0, False: 149]
  ------------------
  129|    149|            (b = BN_new()) == NULL) {
  ------------------
  |  Branch (129:13): [True: 0, False: 149]
  ------------------
  130|      0|            reason = ERR_R_BN_LIB;
  ------------------
  |  |  316|      0|# define ERR_R_BN_LIB           (ERR_LIB_BN/* 3 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   73|      0|# define ERR_LIB_BN              3
  |  |  ------------------
  |  |               # define ERR_R_BN_LIB           (ERR_LIB_BN/* 3 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  131|      0|            goto err;
  132|      0|        }
  133|       |
  134|    149|        if (!EC_GROUP_get_curve(x, p, a, b, ctx)) {
  ------------------
  |  Branch (134:13): [True: 0, False: 149]
  ------------------
  135|      0|            reason = ERR_R_EC_LIB;
  ------------------
  |  |  328|      0|# define ERR_R_EC_LIB           (ERR_LIB_EC/* 16 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   86|      0|# define ERR_LIB_EC              16
  |  |  ------------------
  |  |               # define ERR_R_EC_LIB           (ERR_LIB_EC/* 16 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  136|      0|            goto err;
  137|      0|        }
  138|       |
  139|    149|        if ((point = EC_GROUP_get0_generator(x)) == NULL) {
  ------------------
  |  Branch (139:13): [True: 0, False: 149]
  ------------------
  140|      0|            reason = ERR_R_EC_LIB;
  ------------------
  |  |  328|      0|# define ERR_R_EC_LIB           (ERR_LIB_EC/* 16 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   86|      0|# define ERR_LIB_EC              16
  |  |  ------------------
  |  |               # define ERR_R_EC_LIB           (ERR_LIB_EC/* 16 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  141|      0|            goto err;
  142|      0|        }
  143|    149|        order = EC_GROUP_get0_order(x);
  144|    149|        cofactor = EC_GROUP_get0_cofactor(x);
  145|    149|        if (order == NULL) {
  ------------------
  |  Branch (145:13): [True: 0, False: 149]
  ------------------
  146|      0|            reason = ERR_R_EC_LIB;
  ------------------
  |  |  328|      0|# define ERR_R_EC_LIB           (ERR_LIB_EC/* 16 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   86|      0|# define ERR_LIB_EC              16
  |  |  ------------------
  |  |               # define ERR_R_EC_LIB           (ERR_LIB_EC/* 16 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  147|      0|            goto err;
  148|      0|        }
  149|       |
  150|    149|        form = EC_GROUP_get_point_conversion_form(x);
  151|       |
  152|    149|        gen_buf_len = EC_POINT_point2buf(x, point, form, &gen_buf, ctx);
  153|    149|        if (gen_buf_len == 0) {
  ------------------
  |  Branch (153:13): [True: 0, False: 149]
  ------------------
  154|      0|            reason = ERR_R_EC_LIB;
  ------------------
  |  |  328|      0|# define ERR_R_EC_LIB           (ERR_LIB_EC/* 16 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   86|      0|# define ERR_LIB_EC              16
  |  |  ------------------
  |  |               # define ERR_R_EC_LIB           (ERR_LIB_EC/* 16 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  155|      0|            goto err;
  156|      0|        }
  157|       |
  158|    149|        if ((seed = EC_GROUP_get0_seed(x)) != NULL)
  ------------------
  |  Branch (158:13): [True: 37, False: 112]
  ------------------
  159|     37|            seed_len = EC_GROUP_get_seed_len(x);
  160|       |
  161|    149|        if (!BIO_indent(bp, off, 128))
  ------------------
  |  Branch (161:13): [True: 0, False: 149]
  ------------------
  162|      0|            goto err;
  163|       |
  164|       |        /* print the 'short name' of the field type */
  165|    149|        if (BIO_printf(bp, "Field Type: %s\n", OBJ_nid2sn(tmp_nid))
  ------------------
  |  Branch (165:13): [True: 0, False: 149]
  ------------------
  166|    149|            <= 0)
  167|      0|            goto err;
  168|       |
  169|    149|        if (is_char_two) {
  ------------------
  |  Branch (169:13): [True: 0, False: 149]
  ------------------
  170|       |            /* print the 'short name' of the base type OID */
  171|      0|            int basis_type = EC_GROUP_get_basis_type(x);
  172|      0|            if (basis_type == 0)
  ------------------
  |  Branch (172:17): [True: 0, False: 0]
  ------------------
  173|      0|                goto err;
  174|       |
  175|      0|            if (!BIO_indent(bp, off, 128))
  ------------------
  |  Branch (175:17): [True: 0, False: 0]
  ------------------
  176|      0|                goto err;
  177|       |
  178|      0|            if (BIO_printf(bp, "Basis Type: %s\n",
  ------------------
  |  Branch (178:17): [True: 0, False: 0]
  ------------------
  179|      0|                           OBJ_nid2sn(basis_type)) <= 0)
  180|      0|                goto err;
  181|       |
  182|       |            /* print the polynomial */
  183|      0|            if ((p != NULL) && !ASN1_bn_print(bp, "Polynomial:", p, NULL,
  ------------------
  |  Branch (183:17): [True: 0, False: 0]
  |  Branch (183:32): [True: 0, False: 0]
  ------------------
  184|      0|                                              off))
  185|      0|                goto err;
  186|    149|        } else {
  187|    149|            if ((p != NULL) && !ASN1_bn_print(bp, "Prime:", p, NULL, off))
  ------------------
  |  Branch (187:17): [True: 149, False: 0]
  |  Branch (187:32): [True: 0, False: 149]
  ------------------
  188|      0|                goto err;
  189|    149|        }
  190|    149|        if ((a != NULL) && !ASN1_bn_print(bp, "A:   ", a, NULL, off))
  ------------------
  |  Branch (190:13): [True: 149, False: 0]
  |  Branch (190:28): [True: 0, False: 149]
  ------------------
  191|      0|            goto err;
  192|    149|        if ((b != NULL) && !ASN1_bn_print(bp, "B:   ", b, NULL, off))
  ------------------
  |  Branch (192:13): [True: 149, False: 0]
  |  Branch (192:28): [True: 0, False: 149]
  ------------------
  193|      0|            goto err;
  194|       |
  195|    149|        if (form == POINT_CONVERSION_COMPRESSED)
  ------------------
  |  Branch (195:13): [True: 133, False: 16]
  ------------------
  196|    133|            form_str = gen_compressed;
  197|     16|        else if (form == POINT_CONVERSION_UNCOMPRESSED)
  ------------------
  |  Branch (197:18): [True: 13, False: 3]
  ------------------
  198|     13|            form_str = gen_uncompressed;
  199|      3|        else
  200|      3|            form_str = gen_hybrid;
  201|    149|        if (gen_buf != NULL
  ------------------
  |  Branch (201:13): [True: 149, False: 0]
  ------------------
  202|    149|            && !print_bin(bp, form_str, gen_buf, gen_buf_len, off))
  ------------------
  |  Branch (202:16): [True: 0, False: 149]
  ------------------
  203|      0|            goto err;
  204|       |
  205|    149|        if ((order != NULL) && !ASN1_bn_print(bp, "Order: ", order, NULL, off))
  ------------------
  |  Branch (205:13): [True: 149, False: 0]
  |  Branch (205:32): [True: 0, False: 149]
  ------------------
  206|      0|            goto err;
  207|    149|        if ((cofactor != NULL) && !ASN1_bn_print(bp, "Cofactor: ", cofactor,
  ------------------
  |  Branch (207:13): [True: 149, False: 0]
  |  Branch (207:35): [True: 0, False: 149]
  ------------------
  208|    149|                                                 NULL, off))
  209|      0|            goto err;
  210|    149|        if (seed && !print_bin(bp, "Seed:", seed, seed_len, off))
  ------------------
  |  Branch (210:13): [True: 37, False: 112]
  |  Branch (210:21): [True: 0, False: 37]
  ------------------
  211|      0|            goto err;
  212|    149|    }
  213|    782|    ret = 1;
  214|    782| err:
  215|    782|    if (!ret)
  ------------------
  |  Branch (215:9): [True: 0, False: 782]
  ------------------
  216|    782|        ERR_raise(ERR_LIB_EC, reason);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  217|    782|    BN_free(p);
  218|    782|    BN_free(a);
  219|    782|    BN_free(b);
  220|    782|    OPENSSL_clear_free(gen_buf, gen_buf_len);
  ------------------
  |  |  113|    782|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    782|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    782|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  221|    782|    BN_CTX_free(ctx);
  222|    782|    return ret;
  223|    782|}
eck_prn.c:print_bin:
  227|    186|{
  228|    186|    size_t i;
  229|    186|    char str[128 + 1 + 4];
  230|       |
  231|    186|    if (buf == NULL)
  ------------------
  |  Branch (231:9): [True: 0, False: 186]
  ------------------
  232|      0|        return 1;
  233|    186|    if (off > 0) {
  ------------------
  |  Branch (233:9): [True: 41, False: 145]
  ------------------
  234|     41|        if (off > 128)
  ------------------
  |  Branch (234:13): [True: 0, False: 41]
  ------------------
  235|      0|            off = 128;
  236|     41|        memset(str, ' ', off);
  237|     41|        if (BIO_write(fp, str, off) <= 0)
  ------------------
  |  Branch (237:13): [True: 0, False: 41]
  ------------------
  238|      0|            return 0;
  239|    145|    } else {
  240|    145|        off = 0;
  241|    145|    }
  242|       |
  243|    186|    if (BIO_printf(fp, "%s", name) <= 0)
  ------------------
  |  Branch (243:9): [True: 0, False: 186]
  ------------------
  244|      0|        return 0;
  245|       |
  246|  5.77k|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (246:17): [True: 5.58k, False: 186]
  ------------------
  247|  5.58k|        if ((i % 15) == 0) {
  ------------------
  |  Branch (247:13): [True: 413, False: 5.17k]
  ------------------
  248|    413|            str[0] = '\n';
  249|    413|            memset(&(str[1]), ' ', off + 4);
  250|    413|            if (BIO_write(fp, str, off + 1 + 4) <= 0)
  ------------------
  |  Branch (250:17): [True: 0, False: 413]
  ------------------
  251|      0|                return 0;
  252|    413|        }
  253|  5.58k|        if (BIO_printf(fp, "%02x%s", buf[i], ((i + 1) == len) ? "" : ":") <=
  ------------------
  |  Branch (253:13): [True: 0, False: 5.58k]
  |  Branch (253:46): [True: 186, False: 5.40k]
  ------------------
  254|  5.58k|            0)
  255|      0|            return 0;
  256|  5.58k|    }
  257|    186|    if (BIO_write(fp, "\n", 1) <= 0)
  ------------------
  |  Branch (257:9): [True: 0, False: 186]
  ------------------
  258|      0|        return 0;
  259|       |
  260|    186|    return 1;
  261|    186|}

EC_GFp_mont_method:
   22|  2.62k|{
   23|  2.62k|    static const EC_METHOD ret = {
   24|  2.62k|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|  2.62k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
   25|  2.62k|        NID_X9_62_prime_field,
  ------------------
  |  |  152|  2.62k|#define NID_X9_62_prime_field           406
  ------------------
   26|  2.62k|        ossl_ec_GFp_mont_group_init,
   27|  2.62k|        ossl_ec_GFp_mont_group_finish,
   28|  2.62k|        ossl_ec_GFp_mont_group_clear_finish,
   29|  2.62k|        ossl_ec_GFp_mont_group_copy,
   30|  2.62k|        ossl_ec_GFp_mont_group_set_curve,
   31|  2.62k|        ossl_ec_GFp_simple_group_get_curve,
   32|  2.62k|        ossl_ec_GFp_simple_group_get_degree,
   33|  2.62k|        ossl_ec_group_simple_order_bits,
   34|  2.62k|        ossl_ec_GFp_simple_group_check_discriminant,
   35|  2.62k|        ossl_ec_GFp_simple_point_init,
   36|  2.62k|        ossl_ec_GFp_simple_point_finish,
   37|  2.62k|        ossl_ec_GFp_simple_point_clear_finish,
   38|  2.62k|        ossl_ec_GFp_simple_point_copy,
   39|  2.62k|        ossl_ec_GFp_simple_point_set_to_infinity,
   40|  2.62k|        ossl_ec_GFp_simple_point_set_affine_coordinates,
   41|  2.62k|        ossl_ec_GFp_simple_point_get_affine_coordinates,
   42|  2.62k|        0, 0, 0,
   43|  2.62k|        ossl_ec_GFp_simple_add,
   44|  2.62k|        ossl_ec_GFp_simple_dbl,
   45|  2.62k|        ossl_ec_GFp_simple_invert,
   46|  2.62k|        ossl_ec_GFp_simple_is_at_infinity,
   47|  2.62k|        ossl_ec_GFp_simple_is_on_curve,
   48|  2.62k|        ossl_ec_GFp_simple_cmp,
   49|  2.62k|        ossl_ec_GFp_simple_make_affine,
   50|  2.62k|        ossl_ec_GFp_simple_points_make_affine,
   51|  2.62k|        0 /* mul */ ,
   52|  2.62k|        0 /* precompute_mult */ ,
   53|  2.62k|        0 /* have_precompute_mult */ ,
   54|  2.62k|        ossl_ec_GFp_mont_field_mul,
   55|  2.62k|        ossl_ec_GFp_mont_field_sqr,
   56|  2.62k|        0 /* field_div */ ,
   57|  2.62k|        ossl_ec_GFp_mont_field_inv,
   58|  2.62k|        ossl_ec_GFp_mont_field_encode,
   59|  2.62k|        ossl_ec_GFp_mont_field_decode,
   60|  2.62k|        ossl_ec_GFp_mont_field_set_to_one,
   61|  2.62k|        ossl_ec_key_simple_priv2oct,
   62|  2.62k|        ossl_ec_key_simple_oct2priv,
   63|  2.62k|        0, /* set private */
   64|  2.62k|        ossl_ec_key_simple_generate_key,
   65|  2.62k|        ossl_ec_key_simple_check_key,
   66|  2.62k|        ossl_ec_key_simple_generate_public_key,
   67|  2.62k|        0, /* keycopy */
   68|  2.62k|        0, /* keyfinish */
   69|  2.62k|        ossl_ecdh_simple_compute_key,
   70|  2.62k|        ossl_ecdsa_simple_sign_setup,
   71|  2.62k|        ossl_ecdsa_simple_sign_sig,
   72|  2.62k|        ossl_ecdsa_simple_verify_sig,
   73|  2.62k|        0, /* field_inverse_mod_ord */
   74|  2.62k|        ossl_ec_GFp_simple_blind_coordinates,
   75|  2.62k|        ossl_ec_GFp_simple_ladder_pre,
   76|  2.62k|        ossl_ec_GFp_simple_ladder_step,
   77|  2.62k|        ossl_ec_GFp_simple_ladder_post
   78|  2.62k|    };
   79|       |
   80|  2.62k|    return &ret;
   81|  2.62k|}
ossl_ec_GFp_mont_group_init:
   84|  3.88k|{
   85|  3.88k|    int ok;
   86|       |
   87|  3.88k|    ok = ossl_ec_GFp_simple_group_init(group);
   88|  3.88k|    group->field_data1 = NULL;
   89|  3.88k|    group->field_data2 = NULL;
   90|  3.88k|    return ok;
   91|  3.88k|}
ossl_ec_GFp_mont_group_finish:
   94|  3.88k|{
   95|  3.88k|    BN_MONT_CTX_free(group->field_data1);
   96|  3.88k|    group->field_data1 = NULL;
   97|  3.88k|    BN_free(group->field_data2);
   98|  3.88k|    group->field_data2 = NULL;
   99|  3.88k|    ossl_ec_GFp_simple_group_finish(group);
  100|  3.88k|}
ossl_ec_GFp_mont_group_copy:
  112|  1.20k|{
  113|  1.20k|    BN_MONT_CTX_free(dest->field_data1);
  114|  1.20k|    dest->field_data1 = NULL;
  115|  1.20k|    BN_clear_free(dest->field_data2);
  116|  1.20k|    dest->field_data2 = NULL;
  117|       |
  118|  1.20k|    if (!ossl_ec_GFp_simple_group_copy(dest, src))
  ------------------
  |  Branch (118:9): [True: 0, False: 1.20k]
  ------------------
  119|      0|        return 0;
  120|       |
  121|  1.20k|    if (src->field_data1 != NULL) {
  ------------------
  |  Branch (121:9): [True: 1.20k, False: 0]
  ------------------
  122|  1.20k|        dest->field_data1 = BN_MONT_CTX_new();
  123|  1.20k|        if (dest->field_data1 == NULL)
  ------------------
  |  Branch (123:13): [True: 0, False: 1.20k]
  ------------------
  124|      0|            return 0;
  125|  1.20k|        if (!BN_MONT_CTX_copy(dest->field_data1, src->field_data1))
  ------------------
  |  Branch (125:13): [True: 0, False: 1.20k]
  ------------------
  126|      0|            goto err;
  127|  1.20k|    }
  128|  1.20k|    if (src->field_data2 != NULL) {
  ------------------
  |  Branch (128:9): [True: 1.20k, False: 0]
  ------------------
  129|  1.20k|        dest->field_data2 = BN_dup(src->field_data2);
  130|  1.20k|        if (dest->field_data2 == NULL)
  ------------------
  |  Branch (130:13): [True: 0, False: 1.20k]
  ------------------
  131|      0|            goto err;
  132|  1.20k|    }
  133|       |
  134|  1.20k|    return 1;
  135|       |
  136|      0| err:
  137|      0|    BN_MONT_CTX_free(dest->field_data1);
  138|      0|    dest->field_data1 = NULL;
  139|      0|    return 0;
  140|  1.20k|}
ossl_ec_GFp_mont_group_set_curve:
  145|  2.62k|{
  146|  2.62k|    BN_CTX *new_ctx = NULL;
  147|  2.62k|    BN_MONT_CTX *mont = NULL;
  148|  2.62k|    BIGNUM *one = NULL;
  149|  2.62k|    int ret = 0;
  150|       |
  151|  2.62k|    BN_MONT_CTX_free(group->field_data1);
  152|  2.62k|    group->field_data1 = NULL;
  153|  2.62k|    BN_free(group->field_data2);
  154|  2.62k|    group->field_data2 = NULL;
  155|       |
  156|  2.62k|    if (ctx == NULL) {
  ------------------
  |  Branch (156:9): [True: 1.14k, False: 1.48k]
  ------------------
  157|  1.14k|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  158|  1.14k|        if (ctx == NULL)
  ------------------
  |  Branch (158:13): [True: 0, False: 1.14k]
  ------------------
  159|      0|            return 0;
  160|  1.14k|    }
  161|       |
  162|  2.62k|    mont = BN_MONT_CTX_new();
  163|  2.62k|    if (mont == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 2.62k]
  ------------------
  164|      0|        goto err;
  165|  2.62k|    if (!BN_MONT_CTX_set(mont, p, ctx)) {
  ------------------
  |  Branch (165:9): [True: 191, False: 2.43k]
  ------------------
  166|    191|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|    191|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    191|    (ERR_new(),                                                 \
  |  |  |  |  404|    191|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    191|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    191|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    191|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    191|     ERR_set_error)
  |  |  ------------------
  ------------------
  167|    191|        goto err;
  168|    191|    }
  169|  2.43k|    one = BN_new();
  170|  2.43k|    if (one == NULL)
  ------------------
  |  Branch (170:9): [True: 0, False: 2.43k]
  ------------------
  171|      0|        goto err;
  172|  2.43k|    if (!BN_to_montgomery(one, BN_value_one(), mont, ctx))
  ------------------
  |  Branch (172:9): [True: 0, False: 2.43k]
  ------------------
  173|      0|        goto err;
  174|       |
  175|  2.43k|    group->field_data1 = mont;
  176|  2.43k|    mont = NULL;
  177|  2.43k|    group->field_data2 = one;
  178|  2.43k|    one = NULL;
  179|       |
  180|  2.43k|    ret = ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
  181|       |
  182|  2.43k|    if (!ret) {
  ------------------
  |  Branch (182:9): [True: 5, False: 2.43k]
  ------------------
  183|      5|        BN_MONT_CTX_free(group->field_data1);
  184|      5|        group->field_data1 = NULL;
  185|      5|        BN_free(group->field_data2);
  186|      5|        group->field_data2 = NULL;
  187|      5|    }
  188|       |
  189|  2.62k| err:
  190|  2.62k|    BN_free(one);
  191|  2.62k|    BN_CTX_free(new_ctx);
  192|  2.62k|    BN_MONT_CTX_free(mont);
  193|  2.62k|    return ret;
  194|  2.43k|}
ossl_ec_GFp_mont_field_mul:
  198|  2.00M|{
  199|  2.00M|    if (group->field_data1 == NULL) {
  ------------------
  |  Branch (199:9): [True: 0, False: 2.00M]
  ------------------
  200|      0|        ERR_raise(ERR_LIB_EC, EC_R_NOT_INITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  201|      0|        return 0;
  202|      0|    }
  203|       |
  204|  2.00M|    return BN_mod_mul_montgomery(r, a, b, group->field_data1, ctx);
  205|  2.00M|}
ossl_ec_GFp_mont_field_sqr:
  209|  1.18M|{
  210|  1.18M|    if (group->field_data1 == NULL) {
  ------------------
  |  Branch (210:9): [True: 0, False: 1.18M]
  ------------------
  211|      0|        ERR_raise(ERR_LIB_EC, EC_R_NOT_INITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  212|      0|        return 0;
  213|      0|    }
  214|       |
  215|  1.18M|    return BN_mod_mul_montgomery(r, a, a, group->field_data1, ctx);
  216|  1.18M|}
ossl_ec_GFp_mont_field_inv:
  225|    826|{
  226|    826|    BIGNUM *e = NULL;
  227|    826|    BN_CTX *new_ctx = NULL;
  228|    826|    int ret = 0;
  229|       |
  230|    826|    if (group->field_data1 == NULL)
  ------------------
  |  Branch (230:9): [True: 0, False: 826]
  ------------------
  231|      0|        return 0;
  232|       |
  233|    826|    if (ctx == NULL
  ------------------
  |  Branch (233:9): [True: 0, False: 826]
  ------------------
  234|    826|            && (ctx = new_ctx = BN_CTX_secure_new_ex(group->libctx)) == NULL)
  ------------------
  |  Branch (234:16): [True: 0, False: 0]
  ------------------
  235|      0|        return 0;
  236|       |
  237|    826|    BN_CTX_start(ctx);
  238|    826|    if ((e = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (238:9): [True: 0, False: 826]
  ------------------
  239|      0|        goto err;
  240|       |
  241|       |    /* Inverse in constant time with Fermats Little Theorem */
  242|    826|    if (!BN_set_word(e, 2))
  ------------------
  |  Branch (242:9): [True: 0, False: 826]
  ------------------
  243|      0|        goto err;
  244|    826|    if (!BN_sub(e, group->field, e))
  ------------------
  |  Branch (244:9): [True: 0, False: 826]
  ------------------
  245|      0|        goto err;
  246|       |    /*-
  247|       |     * Exponent e is public.
  248|       |     * No need for scatter-gather or BN_FLG_CONSTTIME.
  249|       |     */
  250|    826|    if (!BN_mod_exp_mont(r, a, e, group->field, ctx, group->field_data1))
  ------------------
  |  Branch (250:9): [True: 0, False: 826]
  ------------------
  251|      0|        goto err;
  252|       |
  253|       |    /* throw an error on zero */
  254|    826|    if (BN_is_zero(r)) {
  ------------------
  |  Branch (254:9): [True: 0, False: 826]
  ------------------
  255|      0|        ERR_raise(ERR_LIB_EC, EC_R_CANNOT_INVERT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  256|      0|        goto err;
  257|      0|    }
  258|       |
  259|    826|    ret = 1;
  260|       |
  261|    826| err:
  262|    826|    BN_CTX_end(ctx);
  263|    826|    BN_CTX_free(new_ctx);
  264|    826|    return ret;
  265|    826|}
ossl_ec_GFp_mont_field_encode:
  269|  12.1k|{
  270|  12.1k|    if (group->field_data1 == NULL) {
  ------------------
  |  Branch (270:9): [True: 0, False: 12.1k]
  ------------------
  271|      0|        ERR_raise(ERR_LIB_EC, EC_R_NOT_INITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        return 0;
  273|      0|    }
  274|       |
  275|  12.1k|    return BN_to_montgomery(r, a, (BN_MONT_CTX *)group->field_data1, ctx);
  276|  12.1k|}
ossl_ec_GFp_mont_field_decode:
  280|  9.65k|{
  281|  9.65k|    if (group->field_data1 == NULL) {
  ------------------
  |  Branch (281:9): [True: 0, False: 9.65k]
  ------------------
  282|      0|        ERR_raise(ERR_LIB_EC, EC_R_NOT_INITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  283|      0|        return 0;
  284|      0|    }
  285|       |
  286|  9.65k|    return BN_from_montgomery(r, a, group->field_data1, ctx);
  287|  9.65k|}
ossl_ec_GFp_mont_field_set_to_one:
  291|  3.84k|{
  292|  3.84k|    if (group->field_data2 == NULL) {
  ------------------
  |  Branch (292:9): [True: 0, False: 3.84k]
  ------------------
  293|      0|        ERR_raise(ERR_LIB_EC, EC_R_NOT_INITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  294|      0|        return 0;
  295|      0|    }
  296|       |
  297|  3.84k|    if (!BN_copy(r, group->field_data2))
  ------------------
  |  Branch (297:9): [True: 0, False: 3.84k]
  ------------------
  298|      0|        return 0;
  299|  3.84k|    return 1;
  300|  3.84k|}

ossl_ec_GFp_nist_group_copy:
   86|     88|{
   87|     88|    dest->field_mod_func = src->field_mod_func;
   88|       |
   89|     88|    return ossl_ec_GFp_simple_group_copy(dest, src);
   90|     88|}
ossl_ec_GFp_nist_field_mul:
  130|  1.55k|{
  131|  1.55k|    int ret = 0;
  132|  1.55k|    BN_CTX *ctx_new = NULL;
  133|       |
  134|  1.55k|    if (!group || !r || !a || !b) {
  ------------------
  |  Branch (134:9): [True: 0, False: 1.55k]
  |  Branch (134:19): [True: 0, False: 1.55k]
  |  Branch (134:25): [True: 0, False: 1.55k]
  |  Branch (134:31): [True: 0, False: 1.55k]
  ------------------
  135|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  136|      0|        goto err;
  137|      0|    }
  138|  1.55k|    if (!ctx)
  ------------------
  |  Branch (138:9): [True: 0, False: 1.55k]
  ------------------
  139|      0|        if ((ctx_new = ctx = BN_CTX_new_ex(group->libctx)) == NULL)
  ------------------
  |  Branch (139:13): [True: 0, False: 0]
  ------------------
  140|      0|            goto err;
  141|       |
  142|  1.55k|    if (!BN_mul(r, a, b, ctx))
  ------------------
  |  Branch (142:9): [True: 0, False: 1.55k]
  ------------------
  143|      0|        goto err;
  144|  1.55k|    if (!group->field_mod_func(r, r, group->field, ctx))
  ------------------
  |  Branch (144:9): [True: 0, False: 1.55k]
  ------------------
  145|      0|        goto err;
  146|       |
  147|  1.55k|    ret = 1;
  148|  1.55k| err:
  149|  1.55k|    BN_CTX_free(ctx_new);
  150|  1.55k|    return ret;
  151|  1.55k|}
ossl_ec_GFp_nist_field_sqr:
  155|  2.62k|{
  156|  2.62k|    int ret = 0;
  157|  2.62k|    BN_CTX *ctx_new = NULL;
  158|       |
  159|  2.62k|    if (!group || !r || !a) {
  ------------------
  |  Branch (159:9): [True: 0, False: 2.62k]
  |  Branch (159:19): [True: 0, False: 2.62k]
  |  Branch (159:25): [True: 0, False: 2.62k]
  ------------------
  160|      0|        ERR_raise(ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  161|      0|        goto err;
  162|      0|    }
  163|  2.62k|    if (!ctx)
  ------------------
  |  Branch (163:9): [True: 0, False: 2.62k]
  ------------------
  164|      0|        if ((ctx_new = ctx = BN_CTX_new_ex(group->libctx)) == NULL)
  ------------------
  |  Branch (164:13): [True: 0, False: 0]
  ------------------
  165|      0|            goto err;
  166|       |
  167|  2.62k|    if (!BN_sqr(r, a, ctx))
  ------------------
  |  Branch (167:9): [True: 0, False: 2.62k]
  ------------------
  168|      0|        goto err;
  169|  2.62k|    if (!group->field_mod_func(r, r, group->field, ctx))
  ------------------
  |  Branch (169:9): [True: 0, False: 2.62k]
  ------------------
  170|      0|        goto err;
  171|       |
  172|  2.62k|    ret = 1;
  173|  2.62k| err:
  174|  2.62k|    BN_CTX_free(ctx_new);
  175|  2.62k|    return ret;
  176|  2.62k|}

EC_GFp_nistp224_method:
  244|    417|{
  245|    417|    static const EC_METHOD ret = {
  246|    417|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|    417|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  247|    417|        NID_X9_62_prime_field,
  ------------------
  |  |  152|    417|#define NID_X9_62_prime_field           406
  ------------------
  248|    417|        ossl_ec_GFp_nistp224_group_init,
  249|    417|        ossl_ec_GFp_simple_group_finish,
  250|    417|        ossl_ec_GFp_simple_group_clear_finish,
  251|    417|        ossl_ec_GFp_nist_group_copy,
  252|    417|        ossl_ec_GFp_nistp224_group_set_curve,
  253|    417|        ossl_ec_GFp_simple_group_get_curve,
  254|    417|        ossl_ec_GFp_simple_group_get_degree,
  255|    417|        ossl_ec_group_simple_order_bits,
  256|    417|        ossl_ec_GFp_simple_group_check_discriminant,
  257|    417|        ossl_ec_GFp_simple_point_init,
  258|    417|        ossl_ec_GFp_simple_point_finish,
  259|    417|        ossl_ec_GFp_simple_point_clear_finish,
  260|    417|        ossl_ec_GFp_simple_point_copy,
  261|    417|        ossl_ec_GFp_simple_point_set_to_infinity,
  262|    417|        ossl_ec_GFp_simple_point_set_affine_coordinates,
  263|    417|        ossl_ec_GFp_nistp224_point_get_affine_coordinates,
  264|    417|        0 /* point_set_compressed_coordinates */ ,
  265|    417|        0 /* point2oct */ ,
  266|    417|        0 /* oct2point */ ,
  267|    417|        ossl_ec_GFp_simple_add,
  268|    417|        ossl_ec_GFp_simple_dbl,
  269|    417|        ossl_ec_GFp_simple_invert,
  270|    417|        ossl_ec_GFp_simple_is_at_infinity,
  271|    417|        ossl_ec_GFp_simple_is_on_curve,
  272|    417|        ossl_ec_GFp_simple_cmp,
  273|    417|        ossl_ec_GFp_simple_make_affine,
  274|    417|        ossl_ec_GFp_simple_points_make_affine,
  275|    417|        ossl_ec_GFp_nistp224_points_mul,
  276|    417|        ossl_ec_GFp_nistp224_precompute_mult,
  277|    417|        ossl_ec_GFp_nistp224_have_precompute_mult,
  278|    417|        ossl_ec_GFp_nist_field_mul,
  279|    417|        ossl_ec_GFp_nist_field_sqr,
  280|    417|        0 /* field_div */ ,
  281|    417|        ossl_ec_GFp_simple_field_inv,
  282|    417|        0 /* field_encode */ ,
  283|    417|        0 /* field_decode */ ,
  284|    417|        0,                      /* field_set_to_one */
  285|    417|        ossl_ec_key_simple_priv2oct,
  286|    417|        ossl_ec_key_simple_oct2priv,
  287|    417|        0, /* set private */
  288|    417|        ossl_ec_key_simple_generate_key,
  289|    417|        ossl_ec_key_simple_check_key,
  290|    417|        ossl_ec_key_simple_generate_public_key,
  291|    417|        0, /* keycopy */
  292|    417|        0, /* keyfinish */
  293|    417|        ossl_ecdh_simple_compute_key,
  294|    417|        ossl_ecdsa_simple_sign_setup,
  295|    417|        ossl_ecdsa_simple_sign_sig,
  296|    417|        ossl_ecdsa_simple_verify_sig,
  297|    417|        0, /* field_inverse_mod_ord */
  298|    417|        0, /* blind_coordinates */
  299|    417|        0, /* ladder_pre */
  300|    417|        0, /* ladder_step */
  301|    417|        0  /* ladder_post */
  302|    417|    };
  303|       |
  304|    417|    return &ret;
  305|    417|}
ossl_ec_GFp_nistp224_group_init:
 1282|    434|{
 1283|    434|    int ret;
 1284|    434|    ret = ossl_ec_GFp_simple_group_init(group);
 1285|    434|    group->a_is_minus3 = 1;
 1286|    434|    return ret;
 1287|    434|}
ossl_ec_GFp_nistp224_group_set_curve:
 1292|    417|{
 1293|    417|    int ret = 0;
 1294|    417|    BIGNUM *curve_p, *curve_a, *curve_b;
 1295|    417|#ifndef FIPS_MODULE
 1296|    417|    BN_CTX *new_ctx = NULL;
 1297|       |
 1298|    417|    if (ctx == NULL)
  ------------------
  |  Branch (1298:9): [True: 0, False: 417]
  ------------------
 1299|      0|        ctx = new_ctx = BN_CTX_new();
 1300|    417|#endif
 1301|    417|    if (ctx == NULL)
  ------------------
  |  Branch (1301:9): [True: 0, False: 417]
  ------------------
 1302|      0|        return 0;
 1303|       |
 1304|    417|    BN_CTX_start(ctx);
 1305|    417|    curve_p = BN_CTX_get(ctx);
 1306|    417|    curve_a = BN_CTX_get(ctx);
 1307|    417|    curve_b = BN_CTX_get(ctx);
 1308|    417|    if (curve_b == NULL)
  ------------------
  |  Branch (1308:9): [True: 0, False: 417]
  ------------------
 1309|      0|        goto err;
 1310|    417|    BN_bin2bn(nistp224_curve_params[0], sizeof(felem_bytearray), curve_p);
 1311|    417|    BN_bin2bn(nistp224_curve_params[1], sizeof(felem_bytearray), curve_a);
 1312|    417|    BN_bin2bn(nistp224_curve_params[2], sizeof(felem_bytearray), curve_b);
 1313|    417|    if ((BN_cmp(curve_p, p)) || (BN_cmp(curve_a, a)) || (BN_cmp(curve_b, b))) {
  ------------------
  |  Branch (1313:9): [True: 0, False: 417]
  |  Branch (1313:33): [True: 0, False: 417]
  |  Branch (1313:57): [True: 0, False: 417]
  ------------------
 1314|      0|        ERR_raise(ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1315|      0|        goto err;
 1316|      0|    }
 1317|    417|    group->field_mod_func = BN_nist_mod_224;
 1318|    417|    ret = ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
 1319|    417| err:
 1320|    417|    BN_CTX_end(ctx);
 1321|    417|#ifndef FIPS_MODULE
 1322|    417|    BN_CTX_free(new_ctx);
 1323|    417|#endif
 1324|    417|    return ret;
 1325|    417|}
ossl_ec_GFp_nistp224_point_get_affine_coordinates:
 1335|    360|{
 1336|    360|    felem z1, z2, x_in, y_in, x_out, y_out;
 1337|    360|    widefelem tmp;
 1338|       |
 1339|    360|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (1339:9): [True: 0, False: 360]
  ------------------
 1340|      0|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1341|      0|        return 0;
 1342|      0|    }
 1343|    360|    if ((!BN_to_felem(x_in, point->X)) || (!BN_to_felem(y_in, point->Y)) ||
  ------------------
  |  Branch (1343:9): [True: 0, False: 360]
  |  Branch (1343:43): [True: 0, False: 360]
  ------------------
 1344|    360|        (!BN_to_felem(z1, point->Z)))
  ------------------
  |  Branch (1344:9): [True: 0, False: 360]
  ------------------
 1345|      0|        return 0;
 1346|    360|    felem_inv(z2, z1);
 1347|    360|    felem_square(tmp, z2);
 1348|    360|    felem_reduce(z1, tmp);
 1349|    360|    felem_mul(tmp, x_in, z1);
 1350|    360|    felem_reduce(x_in, tmp);
 1351|    360|    felem_contract(x_out, x_in);
 1352|    360|    if (x != NULL) {
  ------------------
  |  Branch (1352:9): [True: 360, False: 0]
  ------------------
 1353|    360|        if (!felem_to_BN(x, x_out)) {
  ------------------
  |  Branch (1353:13): [True: 0, False: 360]
  ------------------
 1354|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1355|      0|            return 0;
 1356|      0|        }
 1357|    360|    }
 1358|    360|    felem_mul(tmp, z1, z2);
 1359|    360|    felem_reduce(z1, tmp);
 1360|    360|    felem_mul(tmp, y_in, z1);
 1361|    360|    felem_reduce(y_in, tmp);
 1362|    360|    felem_contract(y_out, y_in);
 1363|    360|    if (y != NULL) {
  ------------------
  |  Branch (1363:9): [True: 360, False: 0]
  ------------------
 1364|    360|        if (!felem_to_BN(y, y_out)) {
  ------------------
  |  Branch (1364:13): [True: 0, False: 360]
  ------------------
 1365|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1366|      0|            return 0;
 1367|      0|        }
 1368|    360|    }
 1369|    360|    return 1;
 1370|    360|}
ossl_ec_GFp_nistp224_points_mul:
 1409|     97|{
 1410|     97|    int ret = 0;
 1411|     97|    int j;
 1412|     97|    unsigned i;
 1413|     97|    int mixed = 0;
 1414|     97|    BIGNUM *x, *y, *z, *tmp_scalar;
 1415|     97|    felem_bytearray g_secret;
 1416|     97|    felem_bytearray *secrets = NULL;
 1417|     97|    felem (*pre_comp)[17][3] = NULL;
 1418|     97|    felem *tmp_felems = NULL;
 1419|     97|    int num_bytes;
 1420|     97|    int have_pre_comp = 0;
 1421|     97|    size_t num_points = num;
 1422|     97|    felem x_in, y_in, z_in, x_out, y_out, z_out;
 1423|     97|    NISTP224_PRE_COMP *pre = NULL;
 1424|     97|    const felem(*g_pre_comp)[16][3] = NULL;
 1425|     97|    EC_POINT *generator = NULL;
 1426|     97|    const EC_POINT *p = NULL;
 1427|     97|    const BIGNUM *p_scalar = NULL;
 1428|       |
 1429|     97|    BN_CTX_start(ctx);
 1430|     97|    x = BN_CTX_get(ctx);
 1431|     97|    y = BN_CTX_get(ctx);
 1432|     97|    z = BN_CTX_get(ctx);
 1433|     97|    tmp_scalar = BN_CTX_get(ctx);
 1434|     97|    if (tmp_scalar == NULL)
  ------------------
  |  Branch (1434:9): [True: 0, False: 97]
  ------------------
 1435|      0|        goto err;
 1436|       |
 1437|     97|    if (scalar != NULL) {
  ------------------
  |  Branch (1437:9): [True: 97, False: 0]
  ------------------
 1438|     97|        pre = group->pre_comp.nistp224;
 1439|     97|        if (pre)
  ------------------
  |  Branch (1439:13): [True: 0, False: 97]
  ------------------
 1440|       |            /* we have precomputation, try to use it */
 1441|      0|            g_pre_comp = (const felem(*)[16][3])pre->g_pre_comp;
 1442|     97|        else
 1443|       |            /* try to use the standard precomputation */
 1444|     97|            g_pre_comp = &gmul[0];
 1445|     97|        generator = EC_POINT_new(group);
 1446|     97|        if (generator == NULL)
  ------------------
  |  Branch (1446:13): [True: 0, False: 97]
  ------------------
 1447|      0|            goto err;
 1448|       |        /* get the generator from precomputation */
 1449|     97|        if (!felem_to_BN(x, g_pre_comp[0][1][0]) ||
  ------------------
  |  Branch (1449:13): [True: 0, False: 97]
  ------------------
 1450|     97|            !felem_to_BN(y, g_pre_comp[0][1][1]) ||
  ------------------
  |  Branch (1450:13): [True: 0, False: 97]
  ------------------
 1451|     97|            !felem_to_BN(z, g_pre_comp[0][1][2])) {
  ------------------
  |  Branch (1451:13): [True: 0, False: 97]
  ------------------
 1452|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1453|      0|            goto err;
 1454|      0|        }
 1455|     97|        if (!ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group,
  ------------------
  |  Branch (1455:13): [True: 0, False: 97]
  ------------------
 1456|     97|                                                                generator,
 1457|     97|                                                                x, y, z, ctx))
 1458|      0|            goto err;
 1459|     97|        if (0 == EC_POINT_cmp(group, generator, group->generator, ctx))
  ------------------
  |  Branch (1459:13): [True: 97, False: 0]
  ------------------
 1460|       |            /* precomputation matches generator */
 1461|     97|            have_pre_comp = 1;
 1462|      0|        else
 1463|       |            /*
 1464|       |             * we don't have valid precomputation: treat the generator as a
 1465|       |             * random point
 1466|       |             */
 1467|      0|            num_points = num_points + 1;
 1468|     97|    }
 1469|       |
 1470|     97|    if (num_points > 0) {
  ------------------
  |  Branch (1470:9): [True: 0, False: 97]
  ------------------
 1471|      0|        if (num_points >= 3) {
  ------------------
  |  Branch (1471:13): [True: 0, False: 0]
  ------------------
 1472|       |            /*
 1473|       |             * unless we precompute multiples for just one or two points,
 1474|       |             * converting those into affine form is time well spent
 1475|       |             */
 1476|      0|            mixed = 1;
 1477|      0|        }
 1478|      0|        secrets = OPENSSL_zalloc(sizeof(*secrets) * num_points);
  ------------------
  |  |  104|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1479|      0|        pre_comp = OPENSSL_zalloc(sizeof(*pre_comp) * num_points);
  ------------------
  |  |  104|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1480|      0|        if (mixed)
  ------------------
  |  Branch (1480:13): [True: 0, False: 0]
  ------------------
 1481|      0|            tmp_felems =
 1482|      0|                OPENSSL_malloc(sizeof(felem) * (num_points * 17 + 1));
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1483|      0|        if ((secrets == NULL) || (pre_comp == NULL)
  ------------------
  |  Branch (1483:13): [True: 0, False: 0]
  |  Branch (1483:34): [True: 0, False: 0]
  ------------------
 1484|      0|            || (mixed && (tmp_felems == NULL)))
  ------------------
  |  Branch (1484:17): [True: 0, False: 0]
  |  Branch (1484:26): [True: 0, False: 0]
  ------------------
 1485|      0|            goto err;
 1486|       |
 1487|       |        /*
 1488|       |         * we treat NULL scalars as 0, and NULL points as points at infinity,
 1489|       |         * i.e., they contribute nothing to the linear combination
 1490|       |         */
 1491|      0|        for (i = 0; i < num_points; ++i) {
  ------------------
  |  Branch (1491:21): [True: 0, False: 0]
  ------------------
 1492|      0|            if (i == num) {
  ------------------
  |  Branch (1492:17): [True: 0, False: 0]
  ------------------
 1493|       |                /* the generator */
 1494|      0|                p = EC_GROUP_get0_generator(group);
 1495|      0|                p_scalar = scalar;
 1496|      0|            } else {
 1497|       |                /* the i^th point */
 1498|      0|                p = points[i];
 1499|      0|                p_scalar = scalars[i];
 1500|      0|            }
 1501|      0|            if ((p_scalar != NULL) && (p != NULL)) {
  ------------------
  |  Branch (1501:17): [True: 0, False: 0]
  |  Branch (1501:39): [True: 0, False: 0]
  ------------------
 1502|       |                /* reduce scalar to 0 <= scalar < 2^224 */
 1503|      0|                if ((BN_num_bits(p_scalar) > 224)
  ------------------
  |  Branch (1503:21): [True: 0, False: 0]
  ------------------
 1504|      0|                    || (BN_is_negative(p_scalar))) {
  ------------------
  |  Branch (1504:24): [True: 0, False: 0]
  ------------------
 1505|       |                    /*
 1506|       |                     * this is an unusual input, and we don't guarantee
 1507|       |                     * constant-timeness
 1508|       |                     */
 1509|      0|                    if (!BN_nnmod(tmp_scalar, p_scalar, group->order, ctx)) {
  ------------------
  |  Branch (1509:25): [True: 0, False: 0]
  ------------------
 1510|      0|                        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1511|      0|                        goto err;
 1512|      0|                    }
 1513|      0|                    num_bytes = BN_bn2lebinpad(tmp_scalar,
 1514|      0|                                               secrets[i], sizeof(secrets[i]));
 1515|      0|                } else {
 1516|      0|                    num_bytes = BN_bn2lebinpad(p_scalar,
 1517|      0|                                               secrets[i], sizeof(secrets[i]));
 1518|      0|                }
 1519|      0|                if (num_bytes < 0) {
  ------------------
  |  Branch (1519:21): [True: 0, False: 0]
  ------------------
 1520|      0|                    ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1521|      0|                    goto err;
 1522|      0|                }
 1523|       |                /* precompute multiples */
 1524|      0|                if ((!BN_to_felem(x_out, p->X)) ||
  ------------------
  |  Branch (1524:21): [True: 0, False: 0]
  ------------------
 1525|      0|                    (!BN_to_felem(y_out, p->Y)) ||
  ------------------
  |  Branch (1525:21): [True: 0, False: 0]
  ------------------
 1526|      0|                    (!BN_to_felem(z_out, p->Z)))
  ------------------
  |  Branch (1526:21): [True: 0, False: 0]
  ------------------
 1527|      0|                    goto err;
 1528|      0|                felem_assign(pre_comp[i][1][0], x_out);
 1529|      0|                felem_assign(pre_comp[i][1][1], y_out);
 1530|      0|                felem_assign(pre_comp[i][1][2], z_out);
 1531|      0|                for (j = 2; j <= 16; ++j) {
  ------------------
  |  Branch (1531:29): [True: 0, False: 0]
  ------------------
 1532|      0|                    if (j & 1) {
  ------------------
  |  Branch (1532:25): [True: 0, False: 0]
  ------------------
 1533|      0|                        point_add(pre_comp[i][j][0], pre_comp[i][j][1],
 1534|      0|                                  pre_comp[i][j][2], pre_comp[i][1][0],
 1535|      0|                                  pre_comp[i][1][1], pre_comp[i][1][2], 0,
 1536|      0|                                  pre_comp[i][j - 1][0],
 1537|      0|                                  pre_comp[i][j - 1][1],
 1538|      0|                                  pre_comp[i][j - 1][2]);
 1539|      0|                    } else {
 1540|      0|                        point_double(pre_comp[i][j][0], pre_comp[i][j][1],
 1541|      0|                                     pre_comp[i][j][2], pre_comp[i][j / 2][0],
 1542|      0|                                     pre_comp[i][j / 2][1],
 1543|      0|                                     pre_comp[i][j / 2][2]);
 1544|      0|                    }
 1545|      0|                }
 1546|      0|            }
 1547|      0|        }
 1548|      0|        if (mixed)
  ------------------
  |  Branch (1548:13): [True: 0, False: 0]
  ------------------
 1549|      0|            make_points_affine(num_points * 17, pre_comp[0], tmp_felems);
 1550|      0|    }
 1551|       |
 1552|       |    /* the scalar for the generator */
 1553|     97|    if ((scalar != NULL) && (have_pre_comp)) {
  ------------------
  |  Branch (1553:9): [True: 97, False: 0]
  |  Branch (1553:29): [True: 97, False: 0]
  ------------------
 1554|     97|        memset(g_secret, 0, sizeof(g_secret));
 1555|       |        /* reduce scalar to 0 <= scalar < 2^224 */
 1556|     97|        if ((BN_num_bits(scalar) > 224) || (BN_is_negative(scalar))) {
  ------------------
  |  Branch (1556:13): [True: 6, False: 91]
  |  Branch (1556:44): [True: 0, False: 91]
  ------------------
 1557|       |            /*
 1558|       |             * this is an unusual input, and we don't guarantee
 1559|       |             * constant-timeness
 1560|       |             */
 1561|      6|            if (!BN_nnmod(tmp_scalar, scalar, group->order, ctx)) {
  ------------------
  |  Branch (1561:17): [True: 0, False: 6]
  ------------------
 1562|      0|                ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1563|      0|                goto err;
 1564|      0|            }
 1565|      6|            num_bytes = BN_bn2lebinpad(tmp_scalar, g_secret, sizeof(g_secret));
 1566|     91|        } else {
 1567|     91|            num_bytes = BN_bn2lebinpad(scalar, g_secret, sizeof(g_secret));
 1568|     91|        }
 1569|       |        /* do the multiplication with generator precomputation */
 1570|     97|        batch_mul(x_out, y_out, z_out,
 1571|     97|                  (const felem_bytearray(*))secrets, num_points,
 1572|     97|                  g_secret,
 1573|     97|                  mixed, (const felem(*)[17][3])pre_comp, g_pre_comp);
 1574|     97|    } else {
 1575|       |        /* do the multiplication without generator precomputation */
 1576|      0|        batch_mul(x_out, y_out, z_out,
 1577|      0|                  (const felem_bytearray(*))secrets, num_points,
 1578|      0|                  NULL, mixed, (const felem(*)[17][3])pre_comp, NULL);
 1579|      0|    }
 1580|       |    /* reduce the output to its unique minimal representation */
 1581|     97|    felem_contract(x_in, x_out);
 1582|     97|    felem_contract(y_in, y_out);
 1583|     97|    felem_contract(z_in, z_out);
 1584|     97|    if ((!felem_to_BN(x, x_in)) || (!felem_to_BN(y, y_in)) ||
  ------------------
  |  Branch (1584:9): [True: 0, False: 97]
  |  Branch (1584:36): [True: 0, False: 97]
  ------------------
 1585|     97|        (!felem_to_BN(z, z_in))) {
  ------------------
  |  Branch (1585:9): [True: 0, False: 97]
  ------------------
 1586|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1587|      0|        goto err;
 1588|      0|    }
 1589|     97|    ret = ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group, r, x, y, z,
 1590|     97|                                                             ctx);
 1591|       |
 1592|     97| err:
 1593|     97|    BN_CTX_end(ctx);
 1594|     97|    EC_POINT_free(generator);
 1595|     97|    OPENSSL_free(secrets);
  ------------------
  |  |  115|     97|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     97|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     97|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1596|     97|    OPENSSL_free(pre_comp);
  ------------------
  |  |  115|     97|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     97|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     97|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1597|     97|    OPENSSL_free(tmp_felems);
  ------------------
  |  |  115|     97|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     97|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     97|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1598|     97|    return ret;
 1599|     97|}
ecp_nistp224.c:BN_to_felem:
  331|  1.08k|{
  332|  1.08k|    felem_bytearray b_out;
  333|  1.08k|    int num_bytes;
  334|       |
  335|  1.08k|    if (BN_is_negative(bn)) {
  ------------------
  |  Branch (335:9): [True: 0, False: 1.08k]
  ------------------
  336|      0|        ERR_raise(ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  337|      0|        return 0;
  338|      0|    }
  339|  1.08k|    num_bytes = BN_bn2lebinpad(bn, b_out, sizeof(b_out));
  340|  1.08k|    if (num_bytes < 0) {
  ------------------
  |  Branch (340:9): [True: 0, False: 1.08k]
  ------------------
  341|      0|        ERR_raise(ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  342|      0|        return 0;
  343|      0|    }
  344|  1.08k|    bin28_to_felem(out, b_out);
  345|  1.08k|    return 1;
  346|  1.08k|}
ecp_nistp224.c:bin28_to_felem:
  311|  1.08k|{
  312|  1.08k|    out[0] = *((const limb *)(in)) & 0x00ffffffffffffff;
  313|  1.08k|    out[1] = (*((const limb_aX *)(in + 7))) & 0x00ffffffffffffff;
  314|  1.08k|    out[2] = (*((const limb_aX *)(in + 14))) & 0x00ffffffffffffff;
  315|  1.08k|    out[3] = (*((const limb_aX *)(in + 20))) >> 8;
  316|  1.08k|}
ecp_nistp224.c:felem_inv:
  702|    360|{
  703|    360|    felem ftmp, ftmp2, ftmp3, ftmp4;
  704|    360|    widefelem tmp;
  705|    360|    unsigned i;
  706|       |
  707|    360|    felem_square(tmp, in);
  708|    360|    felem_reduce(ftmp, tmp);    /* 2 */
  709|    360|    felem_mul(tmp, in, ftmp);
  710|    360|    felem_reduce(ftmp, tmp);    /* 2^2 - 1 */
  711|    360|    felem_square(tmp, ftmp);
  712|    360|    felem_reduce(ftmp, tmp);    /* 2^3 - 2 */
  713|    360|    felem_mul(tmp, in, ftmp);
  714|    360|    felem_reduce(ftmp, tmp);    /* 2^3 - 1 */
  715|    360|    felem_square(tmp, ftmp);
  716|    360|    felem_reduce(ftmp2, tmp);   /* 2^4 - 2 */
  717|    360|    felem_square(tmp, ftmp2);
  718|    360|    felem_reduce(ftmp2, tmp);   /* 2^5 - 4 */
  719|    360|    felem_square(tmp, ftmp2);
  720|    360|    felem_reduce(ftmp2, tmp);   /* 2^6 - 8 */
  721|    360|    felem_mul(tmp, ftmp2, ftmp);
  722|    360|    felem_reduce(ftmp, tmp);    /* 2^6 - 1 */
  723|    360|    felem_square(tmp, ftmp);
  724|    360|    felem_reduce(ftmp2, tmp);   /* 2^7 - 2 */
  725|  2.16k|    for (i = 0; i < 5; ++i) {   /* 2^12 - 2^6 */
  ------------------
  |  Branch (725:17): [True: 1.80k, False: 360]
  ------------------
  726|  1.80k|        felem_square(tmp, ftmp2);
  727|  1.80k|        felem_reduce(ftmp2, tmp);
  728|  1.80k|    }
  729|    360|    felem_mul(tmp, ftmp2, ftmp);
  730|    360|    felem_reduce(ftmp2, tmp);   /* 2^12 - 1 */
  731|    360|    felem_square(tmp, ftmp2);
  732|    360|    felem_reduce(ftmp3, tmp);   /* 2^13 - 2 */
  733|  4.32k|    for (i = 0; i < 11; ++i) {  /* 2^24 - 2^12 */
  ------------------
  |  Branch (733:17): [True: 3.96k, False: 360]
  ------------------
  734|  3.96k|        felem_square(tmp, ftmp3);
  735|  3.96k|        felem_reduce(ftmp3, tmp);
  736|  3.96k|    }
  737|    360|    felem_mul(tmp, ftmp3, ftmp2);
  738|    360|    felem_reduce(ftmp2, tmp);   /* 2^24 - 1 */
  739|    360|    felem_square(tmp, ftmp2);
  740|    360|    felem_reduce(ftmp3, tmp);   /* 2^25 - 2 */
  741|  8.64k|    for (i = 0; i < 23; ++i) {  /* 2^48 - 2^24 */
  ------------------
  |  Branch (741:17): [True: 8.28k, False: 360]
  ------------------
  742|  8.28k|        felem_square(tmp, ftmp3);
  743|  8.28k|        felem_reduce(ftmp3, tmp);
  744|  8.28k|    }
  745|    360|    felem_mul(tmp, ftmp3, ftmp2);
  746|    360|    felem_reduce(ftmp3, tmp);   /* 2^48 - 1 */
  747|    360|    felem_square(tmp, ftmp3);
  748|    360|    felem_reduce(ftmp4, tmp);   /* 2^49 - 2 */
  749|  17.2k|    for (i = 0; i < 47; ++i) {  /* 2^96 - 2^48 */
  ------------------
  |  Branch (749:17): [True: 16.9k, False: 360]
  ------------------
  750|  16.9k|        felem_square(tmp, ftmp4);
  751|  16.9k|        felem_reduce(ftmp4, tmp);
  752|  16.9k|    }
  753|    360|    felem_mul(tmp, ftmp3, ftmp4);
  754|    360|    felem_reduce(ftmp3, tmp);   /* 2^96 - 1 */
  755|    360|    felem_square(tmp, ftmp3);
  756|    360|    felem_reduce(ftmp4, tmp);   /* 2^97 - 2 */
  757|  8.64k|    for (i = 0; i < 23; ++i) {  /* 2^120 - 2^24 */
  ------------------
  |  Branch (757:17): [True: 8.28k, False: 360]
  ------------------
  758|  8.28k|        felem_square(tmp, ftmp4);
  759|  8.28k|        felem_reduce(ftmp4, tmp);
  760|  8.28k|    }
  761|    360|    felem_mul(tmp, ftmp2, ftmp4);
  762|    360|    felem_reduce(ftmp2, tmp);   /* 2^120 - 1 */
  763|  2.52k|    for (i = 0; i < 6; ++i) {   /* 2^126 - 2^6 */
  ------------------
  |  Branch (763:17): [True: 2.16k, False: 360]
  ------------------
  764|  2.16k|        felem_square(tmp, ftmp2);
  765|  2.16k|        felem_reduce(ftmp2, tmp);
  766|  2.16k|    }
  767|    360|    felem_mul(tmp, ftmp2, ftmp);
  768|    360|    felem_reduce(ftmp, tmp);    /* 2^126 - 1 */
  769|    360|    felem_square(tmp, ftmp);
  770|    360|    felem_reduce(ftmp, tmp);    /* 2^127 - 2 */
  771|    360|    felem_mul(tmp, ftmp, in);
  772|    360|    felem_reduce(ftmp, tmp);    /* 2^127 - 1 */
  773|  35.2k|    for (i = 0; i < 97; ++i) {  /* 2^224 - 2^97 */
  ------------------
  |  Branch (773:17): [True: 34.9k, False: 360]
  ------------------
  774|  34.9k|        felem_square(tmp, ftmp);
  775|  34.9k|        felem_reduce(ftmp, tmp);
  776|  34.9k|    }
  777|    360|    felem_mul(tmp, ftmp, ftmp3);
  778|    360|    felem_reduce(out, tmp);     /* 2^224 - 2^96 - 1 */
  779|    360|}
ecp_nistp224.c:felem_square:
  493|   109k|{
  494|   109k|    limb tmp0, tmp1, tmp2;
  495|   109k|    tmp0 = 2 * in[0];
  496|   109k|    tmp1 = 2 * in[1];
  497|   109k|    tmp2 = 2 * in[2];
  498|   109k|    out[0] = ((widelimb) in[0]) * in[0];
  499|   109k|    out[1] = ((widelimb) in[0]) * tmp1;
  500|   109k|    out[2] = ((widelimb) in[0]) * tmp2 + ((widelimb) in[1]) * in[1];
  501|   109k|    out[3] = ((widelimb) in[3]) * tmp0 + ((widelimb) in[1]) * tmp2;
  502|   109k|    out[4] = ((widelimb) in[3]) * tmp1 + ((widelimb) in[2]) * in[2];
  503|   109k|    out[5] = ((widelimb) in[3]) * tmp2;
  504|   109k|    out[6] = ((widelimb) in[3]) * in[3];
  505|   109k|}
ecp_nistp224.c:felem_reduce:
  527|   157k|{
  528|   157k|    static const widelimb two127p15 = (((widelimb) 1) << 127) +
  529|   157k|        (((widelimb) 1) << 15);
  530|   157k|    static const widelimb two127m71 = (((widelimb) 1) << 127) -
  531|   157k|        (((widelimb) 1) << 71);
  532|   157k|    static const widelimb two127m71m55 = (((widelimb) 1) << 127) -
  533|   157k|        (((widelimb) 1) << 71) - (((widelimb) 1) << 55);
  534|   157k|    widelimb output[5];
  535|       |
  536|       |    /* Add 0 mod 2^224-2^96+1 to ensure all differences are positive */
  537|   157k|    output[0] = in[0] + two127p15;
  538|   157k|    output[1] = in[1] + two127m71m55;
  539|   157k|    output[2] = in[2] + two127m71;
  540|   157k|    output[3] = in[3];
  541|   157k|    output[4] = in[4];
  542|       |
  543|       |    /* Eliminate in[4], in[5], in[6] */
  544|   157k|    output[4] += in[6] >> 16;
  545|   157k|    output[3] += (in[6] & 0xffff) << 40;
  546|   157k|    output[2] -= in[6];
  547|       |
  548|   157k|    output[3] += in[5] >> 16;
  549|   157k|    output[2] += (in[5] & 0xffff) << 40;
  550|   157k|    output[1] -= in[5];
  551|       |
  552|   157k|    output[2] += output[4] >> 16;
  553|   157k|    output[1] += (output[4] & 0xffff) << 40;
  554|   157k|    output[0] -= output[4];
  555|       |
  556|       |    /* Carry 2 -> 3 -> 4 */
  557|   157k|    output[3] += output[2] >> 56;
  558|   157k|    output[2] &= 0x00ffffffffffffff;
  559|       |
  560|   157k|    output[4] = output[3] >> 56;
  561|   157k|    output[3] &= 0x00ffffffffffffff;
  562|       |
  563|       |    /* Now output[2] < 2^56, output[3] < 2^56, output[4] < 2^72 */
  564|       |
  565|       |    /* Eliminate output[4] */
  566|   157k|    output[2] += output[4] >> 16;
  567|       |    /* output[2] < 2^56 + 2^56 = 2^57 */
  568|   157k|    output[1] += (output[4] & 0xffff) << 40;
  569|   157k|    output[0] -= output[4];
  570|       |
  571|       |    /* Carry 0 -> 1 -> 2 -> 3 */
  572|   157k|    output[1] += output[0] >> 56;
  573|   157k|    out[0] = output[0] & 0x00ffffffffffffff;
  574|       |
  575|   157k|    output[2] += output[1] >> 56;
  576|       |    /* output[2] < 2^57 + 2^72 */
  577|   157k|    out[1] = output[1] & 0x00ffffffffffffff;
  578|   157k|    output[3] += output[2] >> 56;
  579|       |    /* output[3] <= 2^56 + 2^16 */
  580|   157k|    out[2] = output[2] & 0x00ffffffffffffff;
  581|       |
  582|       |    /*-
  583|       |     * out[0] < 2^56, out[1] < 2^56, out[2] < 2^56,
  584|       |     * out[3] <= 2^56 + 2^16 (due to final carry),
  585|       |     * so out < 2*p
  586|       |     */
  587|   157k|    out[3] = output[3];
  588|   157k|}
ecp_nistp224.c:felem_mul:
  509|  55.5k|{
  510|  55.5k|    out[0] = ((widelimb) in1[0]) * in2[0];
  511|  55.5k|    out[1] = ((widelimb) in1[0]) * in2[1] + ((widelimb) in1[1]) * in2[0];
  512|  55.5k|    out[2] = ((widelimb) in1[0]) * in2[2] + ((widelimb) in1[1]) * in2[1] +
  513|  55.5k|             ((widelimb) in1[2]) * in2[0];
  514|  55.5k|    out[3] = ((widelimb) in1[0]) * in2[3] + ((widelimb) in1[1]) * in2[2] +
  515|  55.5k|             ((widelimb) in1[2]) * in2[1] + ((widelimb) in1[3]) * in2[0];
  516|  55.5k|    out[4] = ((widelimb) in1[1]) * in2[3] + ((widelimb) in1[2]) * in2[2] +
  517|  55.5k|             ((widelimb) in1[3]) * in2[1];
  518|  55.5k|    out[5] = ((widelimb) in1[2]) * in2[3] + ((widelimb) in1[3]) * in2[2];
  519|  55.5k|    out[6] = ((widelimb) in1[3]) * in2[3];
  520|  55.5k|}
ecp_nistp224.c:felem_contract:
  609|  1.01k|{
  610|  1.01k|    static const int64_t two56 = ((limb) 1) << 56;
  611|       |    /* 0 <= in < 2*p, p = 2^224 - 2^96 + 1 */
  612|       |    /* if in > p , reduce in = in - 2^224 + 2^96 - 1 */
  613|  1.01k|    int64_t tmp[4], a;
  614|  1.01k|    tmp[0] = in[0];
  615|  1.01k|    tmp[1] = in[1];
  616|  1.01k|    tmp[2] = in[2];
  617|  1.01k|    tmp[3] = in[3];
  618|       |    /* Case 1: a = 1 iff in >= 2^224 */
  619|  1.01k|    a = (in[3] >> 56);
  620|  1.01k|    tmp[0] -= a;
  621|  1.01k|    tmp[1] += a << 40;
  622|  1.01k|    tmp[3] &= 0x00ffffffffffffff;
  623|       |    /*
  624|       |     * Case 2: a = 0 iff p <= in < 2^224, i.e., the high 128 bits are all 1
  625|       |     * and the lower part is non-zero
  626|       |     */
  627|  1.01k|    a = ((in[3] & in[2] & (in[1] | 0x000000ffffffffff)) + 1) |
  628|  1.01k|        (((int64_t) (in[0] + (in[1] & 0x000000ffffffffff)) - 1) >> 63);
  629|  1.01k|    a &= 0x00ffffffffffffff;
  630|       |    /* turn a into an all-one mask (if a = 0) or an all-zero mask */
  631|  1.01k|    a = (a - 1) >> 63;
  632|       |    /* subtract 2^224 - 2^96 + 1 if a is all-one */
  633|  1.01k|    tmp[3] &= a ^ 0xffffffffffffffff;
  634|  1.01k|    tmp[2] &= a ^ 0xffffffffffffffff;
  635|  1.01k|    tmp[1] &= (a ^ 0xffffffffffffffff) | 0x000000ffffffffff;
  636|  1.01k|    tmp[0] -= 1 & a;
  637|       |
  638|       |    /*
  639|       |     * eliminate negative coefficients: if tmp[0] is negative, tmp[1] must be
  640|       |     * non-zero, so we only need one step
  641|       |     */
  642|  1.01k|    a = tmp[0] >> 63;
  643|  1.01k|    tmp[0] += two56 & a;
  644|  1.01k|    tmp[1] -= 1 & a;
  645|       |
  646|       |    /* carry 1 -> 2 -> 3 */
  647|  1.01k|    tmp[2] += tmp[1] >> 56;
  648|  1.01k|    tmp[1] &= 0x00ffffffffffffff;
  649|       |
  650|  1.01k|    tmp[3] += tmp[2] >> 56;
  651|  1.01k|    tmp[2] &= 0x00ffffffffffffff;
  652|       |
  653|       |    /* Now 0 <= out < p */
  654|  1.01k|    out[0] = tmp[0];
  655|  1.01k|    out[1] = tmp[1];
  656|  1.01k|    out[2] = tmp[2];
  657|  1.01k|    out[3] = tmp[3];
  658|  1.01k|}
ecp_nistp224.c:felem_to_BN:
  350|  1.30k|{
  351|  1.30k|    felem_bytearray b_out;
  352|  1.30k|    felem_to_bin28(b_out, in);
  353|  1.30k|    return BN_lebin2bn(b_out, sizeof(b_out), out);
  354|  1.30k|}
ecp_nistp224.c:felem_to_bin28:
  319|  1.30k|{
  320|  1.30k|    unsigned i;
  321|  10.4k|    for (i = 0; i < 7; ++i) {
  ------------------
  |  Branch (321:17): [True: 9.11k, False: 1.30k]
  ------------------
  322|  9.11k|        out[i] = in[0] >> (8 * i);
  323|  9.11k|        out[i + 7] = in[1] >> (8 * i);
  324|  9.11k|        out[i + 14] = in[2] >> (8 * i);
  325|  9.11k|        out[i + 21] = in[3] >> (8 * i);
  326|  9.11k|    }
  327|  1.30k|}
ecp_nistp224.c:felem_assign:
  376|  53.4k|{
  377|  53.4k|    out[0] = in[0];
  378|  53.4k|    out[1] = in[1];
  379|  53.4k|    out[2] = in[2];
  380|  53.4k|    out[3] = in[3];
  381|  53.4k|}
ecp_nistp224.c:point_add:
  910|  5.33k|{
  911|  5.33k|    felem ftmp, ftmp2, ftmp3, ftmp4, ftmp5, x_out, y_out, z_out;
  912|  5.33k|    widefelem tmp, tmp2;
  913|  5.33k|    limb z1_is_zero, z2_is_zero, x_equal, y_equal;
  914|  5.33k|    limb points_equal;
  915|       |
  916|  5.33k|    if (!mixed) {
  ------------------
  |  Branch (916:9): [True: 0, False: 5.33k]
  ------------------
  917|       |        /* ftmp2 = z2^2 */
  918|      0|        felem_square(tmp, z2);
  919|      0|        felem_reduce(ftmp2, tmp);
  920|       |
  921|       |        /* ftmp4 = z2^3 */
  922|      0|        felem_mul(tmp, ftmp2, z2);
  923|      0|        felem_reduce(ftmp4, tmp);
  924|       |
  925|       |        /* ftmp4 = z2^3*y1 */
  926|      0|        felem_mul(tmp2, ftmp4, y1);
  927|      0|        felem_reduce(ftmp4, tmp2);
  928|       |
  929|       |        /* ftmp2 = z2^2*x1 */
  930|      0|        felem_mul(tmp2, ftmp2, x1);
  931|      0|        felem_reduce(ftmp2, tmp2);
  932|  5.33k|    } else {
  933|       |        /*
  934|       |         * We'll assume z2 = 1 (special case z2 = 0 is handled later)
  935|       |         */
  936|       |
  937|       |        /* ftmp4 = z2^3*y1 */
  938|  5.33k|        felem_assign(ftmp4, y1);
  939|       |
  940|       |        /* ftmp2 = z2^2*x1 */
  941|  5.33k|        felem_assign(ftmp2, x1);
  942|  5.33k|    }
  943|       |
  944|       |    /* ftmp = z1^2 */
  945|  5.33k|    felem_square(tmp, z1);
  946|  5.33k|    felem_reduce(ftmp, tmp);
  947|       |
  948|       |    /* ftmp3 = z1^3 */
  949|  5.33k|    felem_mul(tmp, ftmp, z1);
  950|  5.33k|    felem_reduce(ftmp3, tmp);
  951|       |
  952|       |    /* tmp = z1^3*y2 */
  953|  5.33k|    felem_mul(tmp, ftmp3, y2);
  954|       |    /* tmp[i] < 4 * 2^57 * 2^57 = 2^116 */
  955|       |
  956|       |    /* ftmp3 = z1^3*y2 - z2^3*y1 */
  957|  5.33k|    felem_diff_128_64(tmp, ftmp4);
  958|       |    /* tmp[i] < 2^116 + 2^64 + 8 < 2^117 */
  959|  5.33k|    felem_reduce(ftmp3, tmp);
  960|       |
  961|       |    /* tmp = z1^2*x2 */
  962|  5.33k|    felem_mul(tmp, ftmp, x2);
  963|       |    /* tmp[i] < 4 * 2^57 * 2^57 = 2^116 */
  964|       |
  965|       |    /* ftmp = z1^2*x2 - z2^2*x1 */
  966|  5.33k|    felem_diff_128_64(tmp, ftmp2);
  967|       |    /* tmp[i] < 2^116 + 2^64 + 8 < 2^117 */
  968|  5.33k|    felem_reduce(ftmp, tmp);
  969|       |
  970|       |    /*
  971|       |     * The formulae are incorrect if the points are equal, in affine coordinates
  972|       |     * (X_1, Y_1) == (X_2, Y_2), so we check for this and do doubling if this
  973|       |     * happens.
  974|       |     *
  975|       |     * We use bitwise operations to avoid potential side-channels introduced by
  976|       |     * the short-circuiting behaviour of boolean operators.
  977|       |     */
  978|  5.33k|    x_equal = felem_is_zero(ftmp);
  979|  5.33k|    y_equal = felem_is_zero(ftmp3);
  980|       |    /*
  981|       |     * The special case of either point being the point at infinity (z1 and/or
  982|       |     * z2 are zero), is handled separately later on in this function, so we
  983|       |     * avoid jumping to point_double here in those special cases.
  984|       |     */
  985|  5.33k|    z1_is_zero = felem_is_zero(z1);
  986|  5.33k|    z2_is_zero = felem_is_zero(z2);
  987|       |
  988|       |    /*
  989|       |     * Compared to `ecp_nistp256.c` and `ecp_nistp521.c`, in this
  990|       |     * specific implementation `felem_is_zero()` returns truth as `0x1`
  991|       |     * (rather than `0xff..ff`).
  992|       |     *
  993|       |     * This implies that `~true` in this implementation becomes
  994|       |     * `0xff..fe` (rather than `0x0`): for this reason, to be used in
  995|       |     * the if expression, we mask out only the last bit in the next
  996|       |     * line.
  997|       |     */
  998|  5.33k|    points_equal = (x_equal & y_equal & (~z1_is_zero) & (~z2_is_zero)) & 1;
  999|       |
 1000|  5.33k|    if (points_equal) {
  ------------------
  |  Branch (1000:9): [True: 0, False: 5.33k]
  ------------------
 1001|       |        /*
 1002|       |         * This is obviously not constant-time but, as mentioned before, this
 1003|       |         * case never happens during single point multiplication, so there is no
 1004|       |         * timing leak for ECDH or ECDSA signing.
 1005|       |         */
 1006|      0|        point_double(x3, y3, z3, x1, y1, z1);
 1007|      0|        return;
 1008|      0|    }
 1009|       |
 1010|       |    /* ftmp5 = z1*z2 */
 1011|  5.33k|    if (!mixed) {
  ------------------
  |  Branch (1011:9): [True: 0, False: 5.33k]
  ------------------
 1012|      0|        felem_mul(tmp, z1, z2);
 1013|      0|        felem_reduce(ftmp5, tmp);
 1014|  5.33k|    } else {
 1015|       |        /* special case z2 = 0 is handled later */
 1016|  5.33k|        felem_assign(ftmp5, z1);
 1017|  5.33k|    }
 1018|       |
 1019|       |    /* z_out = (z1^2*x2 - z2^2*x1)*(z1*z2) */
 1020|  5.33k|    felem_mul(tmp, ftmp, ftmp5);
 1021|  5.33k|    felem_reduce(z_out, tmp);
 1022|       |
 1023|       |    /* ftmp = (z1^2*x2 - z2^2*x1)^2 */
 1024|  5.33k|    felem_assign(ftmp5, ftmp);
 1025|  5.33k|    felem_square(tmp, ftmp);
 1026|  5.33k|    felem_reduce(ftmp, tmp);
 1027|       |
 1028|       |    /* ftmp5 = (z1^2*x2 - z2^2*x1)^3 */
 1029|  5.33k|    felem_mul(tmp, ftmp, ftmp5);
 1030|  5.33k|    felem_reduce(ftmp5, tmp);
 1031|       |
 1032|       |    /* ftmp2 = z2^2*x1*(z1^2*x2 - z2^2*x1)^2 */
 1033|  5.33k|    felem_mul(tmp, ftmp2, ftmp);
 1034|  5.33k|    felem_reduce(ftmp2, tmp);
 1035|       |
 1036|       |    /* tmp = z2^3*y1*(z1^2*x2 - z2^2*x1)^3 */
 1037|  5.33k|    felem_mul(tmp, ftmp4, ftmp5);
 1038|       |    /* tmp[i] < 4 * 2^57 * 2^57 = 2^116 */
 1039|       |
 1040|       |    /* tmp2 = (z1^3*y2 - z2^3*y1)^2 */
 1041|  5.33k|    felem_square(tmp2, ftmp3);
 1042|       |    /* tmp2[i] < 4 * 2^57 * 2^57 < 2^116 */
 1043|       |
 1044|       |    /* tmp2 = (z1^3*y2 - z2^3*y1)^2 - (z1^2*x2 - z2^2*x1)^3 */
 1045|  5.33k|    felem_diff_128_64(tmp2, ftmp5);
 1046|       |    /* tmp2[i] < 2^116 + 2^64 + 8 < 2^117 */
 1047|       |
 1048|       |    /* ftmp5 = 2*z2^2*x1*(z1^2*x2 - z2^2*x1)^2 */
 1049|  5.33k|    felem_assign(ftmp5, ftmp2);
 1050|  5.33k|    felem_scalar(ftmp5, 2);
 1051|       |    /* ftmp5[i] < 2 * 2^57 = 2^58 */
 1052|       |
 1053|       |    /*-
 1054|       |     * x_out = (z1^3*y2 - z2^3*y1)^2 - (z1^2*x2 - z2^2*x1)^3 -
 1055|       |     *  2*z2^2*x1*(z1^2*x2 - z2^2*x1)^2
 1056|       |     */
 1057|  5.33k|    felem_diff_128_64(tmp2, ftmp5);
 1058|       |    /* tmp2[i] < 2^117 + 2^64 + 8 < 2^118 */
 1059|  5.33k|    felem_reduce(x_out, tmp2);
 1060|       |
 1061|       |    /* ftmp2 = z2^2*x1*(z1^2*x2 - z2^2*x1)^2 - x_out */
 1062|  5.33k|    felem_diff(ftmp2, x_out);
 1063|       |    /* ftmp2[i] < 2^57 + 2^58 + 2 < 2^59 */
 1064|       |
 1065|       |    /*
 1066|       |     * tmp2 = (z1^3*y2 - z2^3*y1)*(z2^2*x1*(z1^2*x2 - z2^2*x1)^2 - x_out)
 1067|       |     */
 1068|  5.33k|    felem_mul(tmp2, ftmp3, ftmp2);
 1069|       |    /* tmp2[i] < 4 * 2^57 * 2^59 = 2^118 */
 1070|       |
 1071|       |    /*-
 1072|       |     * y_out = (z1^3*y2 - z2^3*y1)*(z2^2*x1*(z1^2*x2 - z2^2*x1)^2 - x_out) -
 1073|       |     *  z2^3*y1*(z1^2*x2 - z2^2*x1)^3
 1074|       |     */
 1075|  5.33k|    widefelem_diff(tmp2, tmp);
 1076|       |    /* tmp2[i] < 2^118 + 2^120 < 2^121 */
 1077|  5.33k|    felem_reduce(y_out, tmp2);
 1078|       |
 1079|       |    /*
 1080|       |     * the result (x_out, y_out, z_out) is incorrect if one of the inputs is
 1081|       |     * the point at infinity, so we need to check for this separately
 1082|       |     */
 1083|       |
 1084|       |    /*
 1085|       |     * if point 1 is at infinity, copy point 2 to output, and vice versa
 1086|       |     */
 1087|  5.33k|    copy_conditional(x_out, x2, z1_is_zero);
 1088|  5.33k|    copy_conditional(x_out, x1, z2_is_zero);
 1089|  5.33k|    copy_conditional(y_out, y2, z1_is_zero);
 1090|  5.33k|    copy_conditional(y_out, y1, z2_is_zero);
 1091|  5.33k|    copy_conditional(z_out, z2, z1_is_zero);
 1092|  5.33k|    copy_conditional(z_out, z1, z2_is_zero);
 1093|  5.33k|    felem_assign(x3, x_out);
 1094|  5.33k|    felem_assign(y3, y_out);
 1095|  5.33k|    felem_assign(z3, z_out);
 1096|  5.33k|}
ecp_nistp224.c:felem_diff_128_64:
  444|  26.5k|{
  445|  26.5k|    static const widelimb two64p8 = (((widelimb) 1) << 64) +
  446|  26.5k|        (((widelimb) 1) << 8);
  447|  26.5k|    static const widelimb two64m8 = (((widelimb) 1) << 64) -
  448|  26.5k|        (((widelimb) 1) << 8);
  449|  26.5k|    static const widelimb two64m48m8 = (((widelimb) 1) << 64) -
  450|  26.5k|        (((widelimb) 1) << 48) - (((widelimb) 1) << 8);
  451|       |
  452|       |    /* Add 0 mod 2^224-2^96+1 to ensure out > in */
  453|  26.5k|    out[0] += two64p8;
  454|  26.5k|    out[1] += two64m48m8;
  455|  26.5k|    out[2] += two64m8;
  456|  26.5k|    out[3] += two64m8;
  457|       |
  458|  26.5k|    out[0] -= in[0];
  459|  26.5k|    out[1] -= in[1];
  460|  26.5k|    out[2] -= in[2];
  461|  26.5k|    out[3] -= in[3];
  462|  26.5k|}
ecp_nistp224.c:felem_is_zero:
  680|  21.3k|{
  681|  21.3k|    limb zero, two224m96p1, two225m97p2;
  682|       |
  683|  21.3k|    zero = in[0] | in[1] | in[2] | in[3];
  684|  21.3k|    zero = (((int64_t) (zero) - 1) >> 63) & 1;
  685|  21.3k|    two224m96p1 = (in[0] ^ 1) | (in[1] ^ 0x00ffff0000000000)
  686|  21.3k|        | (in[2] ^ 0x00ffffffffffffff) | (in[3] ^ 0x00ffffffffffffff);
  687|  21.3k|    two224m96p1 = (((int64_t) (two224m96p1) - 1) >> 63) & 1;
  688|  21.3k|    two225m97p2 = (in[0] ^ 2) | (in[1] ^ 0x00fffe0000000000)
  689|  21.3k|        | (in[2] ^ 0x00ffffffffffffff) | (in[3] ^ 0x01ffffffffffffff);
  690|  21.3k|    two225m97p2 = (((int64_t) (two225m97p2) - 1) >> 63) & 1;
  691|  21.3k|    return (zero | two224m96p1 | two225m97p2);
  692|  21.3k|}
ecp_nistp224.c:felem_scalar:
  469|  13.1k|{
  470|  13.1k|    out[0] *= scalar;
  471|  13.1k|    out[1] *= scalar;
  472|  13.1k|    out[2] *= scalar;
  473|  13.1k|    out[3] *= scalar;
  474|  13.1k|}
ecp_nistp224.c:felem_diff:
  395|  10.5k|{
  396|  10.5k|    static const limb two58p2 = (((limb) 1) << 58) + (((limb) 1) << 2);
  397|  10.5k|    static const limb two58m2 = (((limb) 1) << 58) - (((limb) 1) << 2);
  398|  10.5k|    static const limb two58m42m2 = (((limb) 1) << 58) -
  399|  10.5k|        (((limb) 1) << 42) - (((limb) 1) << 2);
  400|       |
  401|       |    /* Add 0 mod 2^224-2^96+1 to ensure out > in */
  402|  10.5k|    out[0] += two58p2;
  403|  10.5k|    out[1] += two58m42m2;
  404|  10.5k|    out[2] += two58m2;
  405|  10.5k|    out[3] += two58m2;
  406|       |
  407|  10.5k|    out[0] -= in[0];
  408|  10.5k|    out[1] -= in[1];
  409|  10.5k|    out[2] -= in[2];
  410|  10.5k|    out[3] -= in[3];
  411|  10.5k|}
ecp_nistp224.c:widefelem_diff:
  416|  7.95k|{
  417|  7.95k|    static const widelimb two120 = ((widelimb) 1) << 120;
  418|  7.95k|    static const widelimb two120m64 = (((widelimb) 1) << 120) -
  419|  7.95k|        (((widelimb) 1) << 64);
  420|  7.95k|    static const widelimb two120m104m64 = (((widelimb) 1) << 120) -
  421|  7.95k|        (((widelimb) 1) << 104) - (((widelimb) 1) << 64);
  422|       |
  423|       |    /* Add 0 mod 2^224-2^96+1 to ensure out > in */
  424|  7.95k|    out[0] += two120;
  425|  7.95k|    out[1] += two120m64;
  426|  7.95k|    out[2] += two120m64;
  427|  7.95k|    out[3] += two120;
  428|  7.95k|    out[4] += two120m104m64;
  429|  7.95k|    out[5] += two120m64;
  430|  7.95k|    out[6] += two120m64;
  431|       |
  432|  7.95k|    out[0] -= in[0];
  433|  7.95k|    out[1] -= in[1];
  434|  7.95k|    out[2] -= in[2];
  435|  7.95k|    out[3] -= in[3];
  436|  7.95k|    out[4] -= in[4];
  437|  7.95k|    out[5] -= in[5];
  438|  7.95k|    out[6] -= in[6];
  439|  7.95k|}
ecp_nistp224.c:copy_conditional:
  786|  32.0k|{
  787|  32.0k|    unsigned i;
  788|       |    /*
  789|       |     * icopy is a (64-bit) 0 or 1, so copy is either all-zero or all-one
  790|       |     */
  791|  32.0k|    const limb copy = -icopy;
  792|   160k|    for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (792:17): [True: 128k, False: 32.0k]
  ------------------
  793|   128k|        const limb tmp = copy & (in[i] ^ out[i]);
  794|   128k|        out[i] ^= tmp;
  795|   128k|    }
  796|  32.0k|}
ecp_nistp224.c:point_double:
  820|  2.61k|{
  821|  2.61k|    widefelem tmp, tmp2;
  822|  2.61k|    felem delta, gamma, beta, alpha, ftmp, ftmp2;
  823|       |
  824|  2.61k|    felem_assign(ftmp, x_in);
  825|  2.61k|    felem_assign(ftmp2, x_in);
  826|       |
  827|       |    /* delta = z^2 */
  828|  2.61k|    felem_square(tmp, z_in);
  829|  2.61k|    felem_reduce(delta, tmp);
  830|       |
  831|       |    /* gamma = y^2 */
  832|  2.61k|    felem_square(tmp, y_in);
  833|  2.61k|    felem_reduce(gamma, tmp);
  834|       |
  835|       |    /* beta = x*gamma */
  836|  2.61k|    felem_mul(tmp, x_in, gamma);
  837|  2.61k|    felem_reduce(beta, tmp);
  838|       |
  839|       |    /* alpha = 3*(x-delta)*(x+delta) */
  840|  2.61k|    felem_diff(ftmp, delta);
  841|       |    /* ftmp[i] < 2^57 + 2^58 + 2 < 2^59 */
  842|  2.61k|    felem_sum(ftmp2, delta);
  843|       |    /* ftmp2[i] < 2^57 + 2^57 = 2^58 */
  844|  2.61k|    felem_scalar(ftmp2, 3);
  845|       |    /* ftmp2[i] < 3 * 2^58 < 2^60 */
  846|  2.61k|    felem_mul(tmp, ftmp, ftmp2);
  847|       |    /* tmp[i] < 2^60 * 2^59 * 4 = 2^121 */
  848|  2.61k|    felem_reduce(alpha, tmp);
  849|       |
  850|       |    /* x' = alpha^2 - 8*beta */
  851|  2.61k|    felem_square(tmp, alpha);
  852|       |    /* tmp[i] < 4 * 2^57 * 2^57 = 2^116 */
  853|  2.61k|    felem_assign(ftmp, beta);
  854|  2.61k|    felem_scalar(ftmp, 8);
  855|       |    /* ftmp[i] < 8 * 2^57 = 2^60 */
  856|  2.61k|    felem_diff_128_64(tmp, ftmp);
  857|       |    /* tmp[i] < 2^116 + 2^64 + 8 < 2^117 */
  858|  2.61k|    felem_reduce(x_out, tmp);
  859|       |
  860|       |    /* z' = (y + z)^2 - gamma - delta */
  861|  2.61k|    felem_sum(delta, gamma);
  862|       |    /* delta[i] < 2^57 + 2^57 = 2^58 */
  863|  2.61k|    felem_assign(ftmp, y_in);
  864|  2.61k|    felem_sum(ftmp, z_in);
  865|       |    /* ftmp[i] < 2^57 + 2^57 = 2^58 */
  866|  2.61k|    felem_square(tmp, ftmp);
  867|       |    /* tmp[i] < 4 * 2^58 * 2^58 = 2^118 */
  868|  2.61k|    felem_diff_128_64(tmp, delta);
  869|       |    /* tmp[i] < 2^118 + 2^64 + 8 < 2^119 */
  870|  2.61k|    felem_reduce(z_out, tmp);
  871|       |
  872|       |    /* y' = alpha*(4*beta - x') - 8*gamma^2 */
  873|  2.61k|    felem_scalar(beta, 4);
  874|       |    /* beta[i] < 4 * 2^57 = 2^59 */
  875|  2.61k|    felem_diff(beta, x_out);
  876|       |    /* beta[i] < 2^59 + 2^58 + 2 < 2^60 */
  877|  2.61k|    felem_mul(tmp, alpha, beta);
  878|       |    /* tmp[i] < 4 * 2^57 * 2^60 = 2^119 */
  879|  2.61k|    felem_square(tmp2, gamma);
  880|       |    /* tmp2[i] < 4 * 2^57 * 2^57 = 2^116 */
  881|  2.61k|    widefelem_scalar(tmp2, 8);
  882|       |    /* tmp2[i] < 8 * 2^116 = 2^119 */
  883|  2.61k|    widefelem_diff(tmp, tmp2);
  884|       |    /* tmp[i] < 2^119 + 2^120 < 2^121 */
  885|  2.61k|    felem_reduce(y_out, tmp);
  886|  2.61k|}
ecp_nistp224.c:felem_sum:
  385|  7.85k|{
  386|  7.85k|    out[0] += in[0];
  387|  7.85k|    out[1] += in[1];
  388|  7.85k|    out[2] += in[2];
  389|  7.85k|    out[3] += in[3];
  390|  7.85k|}
ecp_nistp224.c:widefelem_scalar:
  481|  2.61k|{
  482|  2.61k|    out[0] *= scalar;
  483|  2.61k|    out[1] *= scalar;
  484|  2.61k|    out[2] *= scalar;
  485|  2.61k|    out[3] *= scalar;
  486|  2.61k|    out[4] *= scalar;
  487|  2.61k|    out[5] *= scalar;
  488|  2.61k|    out[6] *= scalar;
  489|  2.61k|}
ecp_nistp224.c:batch_mul:
 1143|     97|{
 1144|     97|    int i, skip;
 1145|     97|    unsigned num;
 1146|     97|    unsigned gen_mul = (g_scalar != NULL);
 1147|     97|    felem nq[3], tmp[4];
 1148|     97|    u64 bits;
 1149|     97|    u8 sign, digit;
 1150|       |
 1151|       |    /* set nq to the point at infinity */
 1152|     97|    memset(nq, 0, sizeof(nq));
 1153|       |
 1154|       |    /*
 1155|       |     * Loop over all scalars msb-to-lsb, interleaving additions of multiples
 1156|       |     * of the generator (two in each of the last 28 rounds) and additions of
 1157|       |     * other points multiples (every 5th round).
 1158|       |     */
 1159|     97|    skip = 1;                   /* save two point operations in the first
 1160|       |                                 * round */
 1161|  2.81k|    for (i = (num_points ? 220 : 27); i >= 0; --i) {
  ------------------
  |  Branch (1161:15): [True: 0, False: 97]
  |  Branch (1161:39): [True: 2.71k, False: 97]
  ------------------
 1162|       |        /* double */
 1163|  2.71k|        if (!skip)
  ------------------
  |  Branch (1163:13): [True: 2.61k, False: 97]
  ------------------
 1164|  2.61k|            point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]);
 1165|       |
 1166|       |        /* add multiples of the generator */
 1167|  2.71k|        if (gen_mul && (i <= 27)) {
  ------------------
  |  Branch (1167:13): [True: 2.71k, False: 0]
  |  Branch (1167:24): [True: 2.71k, False: 0]
  ------------------
 1168|       |            /* first, look 28 bits upwards */
 1169|  2.71k|            bits = get_bit(g_scalar, i + 196) << 3;
 1170|  2.71k|            bits |= get_bit(g_scalar, i + 140) << 2;
 1171|  2.71k|            bits |= get_bit(g_scalar, i + 84) << 1;
 1172|  2.71k|            bits |= get_bit(g_scalar, i + 28);
 1173|       |            /* select the point to add, in constant time */
 1174|  2.71k|            select_point(bits, 16, g_pre_comp[1], tmp);
 1175|       |
 1176|  2.71k|            if (!skip) {
  ------------------
  |  Branch (1176:17): [True: 2.61k, False: 97]
  ------------------
 1177|       |                /* value 1 below is argument for "mixed" */
 1178|  2.61k|                point_add(nq[0], nq[1], nq[2],
 1179|  2.61k|                          nq[0], nq[1], nq[2], 1, tmp[0], tmp[1], tmp[2]);
 1180|  2.61k|            } else {
 1181|     97|                memcpy(nq, tmp, 3 * sizeof(felem));
 1182|     97|                skip = 0;
 1183|     97|            }
 1184|       |
 1185|       |            /* second, look at the current position */
 1186|  2.71k|            bits = get_bit(g_scalar, i + 168) << 3;
 1187|  2.71k|            bits |= get_bit(g_scalar, i + 112) << 2;
 1188|  2.71k|            bits |= get_bit(g_scalar, i + 56) << 1;
 1189|  2.71k|            bits |= get_bit(g_scalar, i);
 1190|       |            /* select the point to add, in constant time */
 1191|  2.71k|            select_point(bits, 16, g_pre_comp[0], tmp);
 1192|  2.71k|            point_add(nq[0], nq[1], nq[2],
 1193|  2.71k|                      nq[0], nq[1], nq[2],
 1194|  2.71k|                      1 /* mixed */ , tmp[0], tmp[1], tmp[2]);
 1195|  2.71k|        }
 1196|       |
 1197|       |        /* do other additions every 5 doublings */
 1198|  2.71k|        if (num_points && (i % 5 == 0)) {
  ------------------
  |  Branch (1198:13): [True: 0, False: 2.71k]
  |  Branch (1198:27): [True: 0, False: 0]
  ------------------
 1199|       |            /* loop over all scalars */
 1200|      0|            for (num = 0; num < num_points; ++num) {
  ------------------
  |  Branch (1200:27): [True: 0, False: 0]
  ------------------
 1201|      0|                bits = get_bit(scalars[num], i + 4) << 5;
 1202|      0|                bits |= get_bit(scalars[num], i + 3) << 4;
 1203|      0|                bits |= get_bit(scalars[num], i + 2) << 3;
 1204|      0|                bits |= get_bit(scalars[num], i + 1) << 2;
 1205|      0|                bits |= get_bit(scalars[num], i) << 1;
 1206|      0|                bits |= get_bit(scalars[num], i - 1);
 1207|      0|                ossl_ec_GFp_nistp_recode_scalar_bits(&sign, &digit, bits);
 1208|       |
 1209|       |                /* select the point to add or subtract */
 1210|      0|                select_point(digit, 17, pre_comp[num], tmp);
 1211|      0|                felem_neg(tmp[3], tmp[1]); /* (X, -Y, Z) is the negative
 1212|       |                                            * point */
 1213|      0|                copy_conditional(tmp[1], tmp[3], sign);
 1214|       |
 1215|      0|                if (!skip) {
  ------------------
  |  Branch (1215:21): [True: 0, False: 0]
  ------------------
 1216|      0|                    point_add(nq[0], nq[1], nq[2],
 1217|      0|                              nq[0], nq[1], nq[2],
 1218|      0|                              mixed, tmp[0], tmp[1], tmp[2]);
 1219|      0|                } else {
 1220|      0|                    memcpy(nq, tmp, 3 * sizeof(felem));
 1221|      0|                    skip = 0;
 1222|      0|                }
 1223|      0|            }
 1224|      0|        }
 1225|  2.71k|    }
 1226|     97|    felem_assign(x_out, nq[0]);
 1227|     97|    felem_assign(y_out, nq[1]);
 1228|     97|    felem_assign(z_out, nq[2]);
 1229|     97|}
ecp_nistp224.c:get_bit:
 1125|  21.7k|{
 1126|  21.7k|    if (i >= 224)
  ------------------
  |  Branch (1126:9): [True: 0, False: 21.7k]
  ------------------
 1127|      0|        return 0;
 1128|  21.7k|    return (in[i >> 3] >> (i & 7)) & 1;
 1129|  21.7k|}
ecp_nistp224.c:select_point:
 1105|  5.43k|{
 1106|  5.43k|    unsigned i, j;
 1107|  5.43k|    limb *outlimbs = &out[0][0];
 1108|       |
 1109|  5.43k|    memset(out, 0, sizeof(*out) * 3);
 1110|  92.3k|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (1110:17): [True: 86.9k, False: 5.43k]
  ------------------
 1111|  86.9k|        const limb *inlimbs = &pre_comp[i][0][0];
 1112|  86.9k|        u64 mask = i ^ idx;
 1113|  86.9k|        mask |= mask >> 4;
 1114|  86.9k|        mask |= mask >> 2;
 1115|  86.9k|        mask |= mask >> 1;
 1116|  86.9k|        mask &= 1;
 1117|  86.9k|        mask--;
 1118|  1.12M|        for (j = 0; j < 4 * 3; j++)
  ------------------
  |  Branch (1118:21): [True: 1.04M, False: 86.9k]
  ------------------
 1119|  1.04M|            outlimbs[j] |= inlimbs[j] & mask;
 1120|  86.9k|    }
 1121|  5.43k|}

ossl_ec_GFp_nistp384_method:
 1500|    214|{
 1501|    214|    static const EC_METHOD ret = {
 1502|    214|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|    214|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
 1503|    214|        NID_X9_62_prime_field,
  ------------------
  |  |  152|    214|#define NID_X9_62_prime_field           406
  ------------------
 1504|    214|        ossl_ec_GFp_nistp384_group_init,
 1505|    214|        ossl_ec_GFp_simple_group_finish,
 1506|    214|        ossl_ec_GFp_simple_group_clear_finish,
 1507|    214|        ossl_ec_GFp_nist_group_copy,
 1508|    214|        ossl_ec_GFp_nistp384_group_set_curve,
 1509|    214|        ossl_ec_GFp_simple_group_get_curve,
 1510|    214|        ossl_ec_GFp_simple_group_get_degree,
 1511|    214|        ossl_ec_group_simple_order_bits,
 1512|    214|        ossl_ec_GFp_simple_group_check_discriminant,
 1513|    214|        ossl_ec_GFp_simple_point_init,
 1514|    214|        ossl_ec_GFp_simple_point_finish,
 1515|    214|        ossl_ec_GFp_simple_point_clear_finish,
 1516|    214|        ossl_ec_GFp_simple_point_copy,
 1517|    214|        ossl_ec_GFp_simple_point_set_to_infinity,
 1518|    214|        ossl_ec_GFp_simple_point_set_affine_coordinates,
 1519|    214|        ossl_ec_GFp_nistp384_point_get_affine_coordinates,
 1520|    214|        0, /* point_set_compressed_coordinates */
 1521|    214|        0, /* point2oct */
 1522|    214|        0, /* oct2point */
 1523|    214|        ossl_ec_GFp_simple_add,
 1524|    214|        ossl_ec_GFp_simple_dbl,
 1525|    214|        ossl_ec_GFp_simple_invert,
 1526|    214|        ossl_ec_GFp_simple_is_at_infinity,
 1527|    214|        ossl_ec_GFp_simple_is_on_curve,
 1528|    214|        ossl_ec_GFp_simple_cmp,
 1529|    214|        ossl_ec_GFp_simple_make_affine,
 1530|    214|        ossl_ec_GFp_simple_points_make_affine,
 1531|    214|        ossl_ec_GFp_nistp384_points_mul,
 1532|    214|        ossl_ec_GFp_nistp384_precompute_mult,
 1533|    214|        ossl_ec_GFp_nistp384_have_precompute_mult,
 1534|    214|        ossl_ec_GFp_nist_field_mul,
 1535|    214|        ossl_ec_GFp_nist_field_sqr,
 1536|    214|        0, /* field_div */
 1537|    214|        ossl_ec_GFp_simple_field_inv,
 1538|    214|        0, /* field_encode */
 1539|    214|        0, /* field_decode */
 1540|    214|        0, /* field_set_to_one */
 1541|    214|        ossl_ec_key_simple_priv2oct,
 1542|    214|        ossl_ec_key_simple_oct2priv,
 1543|    214|        0, /* set private */
 1544|    214|        ossl_ec_key_simple_generate_key,
 1545|    214|        ossl_ec_key_simple_check_key,
 1546|    214|        ossl_ec_key_simple_generate_public_key,
 1547|    214|        0, /* keycopy */
 1548|    214|        0, /* keyfinish */
 1549|    214|        ossl_ecdh_simple_compute_key,
 1550|    214|        ossl_ecdsa_simple_sign_setup,
 1551|    214|        ossl_ecdsa_simple_sign_sig,
 1552|    214|        ossl_ecdsa_simple_verify_sig,
 1553|    214|        0, /* field_inverse_mod_ord */
 1554|    214|        0, /* blind_coordinates */
 1555|    214|        0, /* ladder_pre */
 1556|    214|        0, /* ladder_step */
 1557|    214|        0  /* ladder_post */
 1558|    214|    };
 1559|       |
 1560|    214|    return &ret;
 1561|    214|}
ossl_ec_GFp_nistp384_group_init:
 1614|    245|{
 1615|    245|    int ret;
 1616|       |
 1617|    245|    ret = ossl_ec_GFp_simple_group_init(group);
 1618|    245|    group->a_is_minus3 = 1;
 1619|    245|    return ret;
 1620|    245|}
ossl_ec_GFp_nistp384_group_set_curve:
 1625|    214|{
 1626|    214|    int ret = 0;
 1627|    214|    BIGNUM *curve_p, *curve_a, *curve_b;
 1628|    214|#ifndef FIPS_MODULE
 1629|    214|    BN_CTX *new_ctx = NULL;
 1630|       |
 1631|    214|    if (ctx == NULL)
  ------------------
  |  Branch (1631:9): [True: 0, False: 214]
  ------------------
 1632|      0|        ctx = new_ctx = BN_CTX_new();
 1633|    214|#endif
 1634|    214|    if (ctx == NULL)
  ------------------
  |  Branch (1634:9): [True: 0, False: 214]
  ------------------
 1635|      0|        return 0;
 1636|       |
 1637|    214|    BN_CTX_start(ctx);
 1638|    214|    curve_p = BN_CTX_get(ctx);
 1639|    214|    curve_a = BN_CTX_get(ctx);
 1640|    214|    curve_b = BN_CTX_get(ctx);
 1641|    214|    if (curve_b == NULL)
  ------------------
  |  Branch (1641:9): [True: 0, False: 214]
  ------------------
 1642|      0|        goto err;
 1643|    214|    BN_bin2bn(nistp384_curve_params[0], sizeof(felem_bytearray), curve_p);
 1644|    214|    BN_bin2bn(nistp384_curve_params[1], sizeof(felem_bytearray), curve_a);
 1645|    214|    BN_bin2bn(nistp384_curve_params[2], sizeof(felem_bytearray), curve_b);
 1646|    214|    if ((BN_cmp(curve_p, p)) || (BN_cmp(curve_a, a)) || (BN_cmp(curve_b, b))) {
  ------------------
  |  Branch (1646:9): [True: 0, False: 214]
  |  Branch (1646:33): [True: 0, False: 214]
  |  Branch (1646:57): [True: 0, False: 214]
  ------------------
 1647|      0|        ERR_raise(ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1648|      0|        goto err;
 1649|      0|    }
 1650|    214|    group->field_mod_func = BN_nist_mod_384;
 1651|    214|    ret = ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
 1652|    214| err:
 1653|    214|    BN_CTX_end(ctx);
 1654|    214|#ifndef FIPS_MODULE
 1655|    214|    BN_CTX_free(new_ctx);
 1656|    214|#endif
 1657|    214|    return ret;
 1658|    214|}
ossl_ec_GFp_nistp384_point_get_affine_coordinates:
 1668|    109|{
 1669|    109|    felem z1, z2, x_in, y_in, x_out, y_out;
 1670|    109|    widefelem tmp;
 1671|       |
 1672|    109|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (1672:9): [True: 0, False: 109]
  ------------------
 1673|      0|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1674|      0|        return 0;
 1675|      0|    }
 1676|    109|    if ((!BN_to_felem(x_in, point->X)) || (!BN_to_felem(y_in, point->Y)) ||
  ------------------
  |  Branch (1676:9): [True: 0, False: 109]
  |  Branch (1676:43): [True: 0, False: 109]
  ------------------
 1677|    109|        (!BN_to_felem(z1, point->Z)))
  ------------------
  |  Branch (1677:9): [True: 0, False: 109]
  ------------------
 1678|      0|        return 0;
 1679|    109|    felem_inv(z2, z1);
 1680|    109|    felem_square(tmp, z2);
  ------------------
  |  |  771|    109|# define felem_square felem_square_ref
  ------------------
 1681|    109|    felem_reduce(z1, tmp);
  ------------------
  |  |  773|    109|# define felem_reduce felem_reduce_ref
  ------------------
 1682|    109|    felem_mul(tmp, x_in, z1);
  ------------------
  |  |  772|    109|# define felem_mul felem_mul_ref
  ------------------
 1683|    109|    felem_reduce(x_in, tmp);
  ------------------
  |  |  773|    109|# define felem_reduce felem_reduce_ref
  ------------------
 1684|    109|    felem_contract(x_out, x_in);
 1685|    109|    if (x != NULL) {
  ------------------
  |  Branch (1685:9): [True: 109, False: 0]
  ------------------
 1686|    109|        if (!felem_to_BN(x, x_out)) {
  ------------------
  |  Branch (1686:13): [True: 0, False: 109]
  ------------------
 1687|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1688|      0|            return 0;
 1689|      0|        }
 1690|    109|    }
 1691|    109|    felem_mul(tmp, z1, z2);
  ------------------
  |  |  772|    109|# define felem_mul felem_mul_ref
  ------------------
 1692|    109|    felem_reduce(z1, tmp);
  ------------------
  |  |  773|    109|# define felem_reduce felem_reduce_ref
  ------------------
 1693|    109|    felem_mul(tmp, y_in, z1);
  ------------------
  |  |  772|    109|# define felem_mul felem_mul_ref
  ------------------
 1694|    109|    felem_reduce(y_in, tmp);
  ------------------
  |  |  773|    109|# define felem_reduce felem_reduce_ref
  ------------------
 1695|    109|    felem_contract(y_out, y_in);
 1696|    109|    if (y != NULL) {
  ------------------
  |  Branch (1696:9): [True: 109, False: 0]
  ------------------
 1697|    109|        if (!felem_to_BN(y, y_out)) {
  ------------------
  |  Branch (1697:13): [True: 0, False: 109]
  ------------------
 1698|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1699|      0|            return 0;
 1700|      0|        }
 1701|    109|    }
 1702|    109|    return 1;
 1703|    109|}
ossl_ec_GFp_nistp384_points_mul:
 1739|     21|{
 1740|     21|    int ret = 0;
 1741|     21|    int j;
 1742|     21|    int mixed = 0;
 1743|     21|    BIGNUM *x, *y, *z, *tmp_scalar;
 1744|     21|    felem_bytearray g_secret;
 1745|     21|    felem_bytearray *secrets = NULL;
 1746|     21|    felem (*pre_comp)[17][3] = NULL;
 1747|     21|    felem *tmp_felems = NULL;
 1748|     21|    unsigned int i;
 1749|     21|    int num_bytes;
 1750|     21|    int have_pre_comp = 0;
 1751|     21|    size_t num_points = num;
 1752|     21|    felem x_in, y_in, z_in, x_out, y_out, z_out;
 1753|     21|    NISTP384_PRE_COMP *pre = NULL;
 1754|     21|    felem(*g_pre_comp)[3] = NULL;
 1755|     21|    EC_POINT *generator = NULL;
 1756|     21|    const EC_POINT *p = NULL;
 1757|     21|    const BIGNUM *p_scalar = NULL;
 1758|       |
 1759|     21|    BN_CTX_start(ctx);
 1760|     21|    x = BN_CTX_get(ctx);
 1761|     21|    y = BN_CTX_get(ctx);
 1762|     21|    z = BN_CTX_get(ctx);
 1763|     21|    tmp_scalar = BN_CTX_get(ctx);
 1764|     21|    if (tmp_scalar == NULL)
  ------------------
  |  Branch (1764:9): [True: 0, False: 21]
  ------------------
 1765|      0|        goto err;
 1766|       |
 1767|     21|    if (scalar != NULL) {
  ------------------
  |  Branch (1767:9): [True: 21, False: 0]
  ------------------
 1768|     21|        pre = group->pre_comp.nistp384;
 1769|     21|        if (pre)
  ------------------
  |  Branch (1769:13): [True: 0, False: 21]
  ------------------
 1770|       |            /* we have precomputation, try to use it */
 1771|      0|            g_pre_comp = &pre->g_pre_comp[0];
 1772|     21|        else
 1773|       |            /* try to use the standard precomputation */
 1774|     21|            g_pre_comp = (felem(*)[3]) gmul;
 1775|     21|        generator = EC_POINT_new(group);
 1776|     21|        if (generator == NULL)
  ------------------
  |  Branch (1776:13): [True: 0, False: 21]
  ------------------
 1777|      0|            goto err;
 1778|       |        /* get the generator from precomputation */
 1779|     21|        if (!felem_to_BN(x, g_pre_comp[1][0]) ||
  ------------------
  |  Branch (1779:13): [True: 0, False: 21]
  ------------------
 1780|     21|            !felem_to_BN(y, g_pre_comp[1][1]) ||
  ------------------
  |  Branch (1780:13): [True: 0, False: 21]
  ------------------
 1781|     21|            !felem_to_BN(z, g_pre_comp[1][2])) {
  ------------------
  |  Branch (1781:13): [True: 0, False: 21]
  ------------------
 1782|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1783|      0|            goto err;
 1784|      0|        }
 1785|     21|        if (!ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group,
  ------------------
  |  Branch (1785:13): [True: 0, False: 21]
  ------------------
 1786|     21|                                                                generator,
 1787|     21|                                                                x, y, z, ctx))
 1788|      0|            goto err;
 1789|     21|        if (0 == EC_POINT_cmp(group, generator, group->generator, ctx))
  ------------------
  |  Branch (1789:13): [True: 21, False: 0]
  ------------------
 1790|       |            /* precomputation matches generator */
 1791|     21|            have_pre_comp = 1;
 1792|      0|        else
 1793|       |            /*
 1794|       |             * we don't have valid precomputation: treat the generator as a
 1795|       |             * random point
 1796|       |             */
 1797|      0|            num_points++;
 1798|     21|    }
 1799|       |
 1800|     21|    if (num_points > 0) {
  ------------------
  |  Branch (1800:9): [True: 0, False: 21]
  ------------------
 1801|      0|        if (num_points >= 2) {
  ------------------
  |  Branch (1801:13): [True: 0, False: 0]
  ------------------
 1802|       |            /*
 1803|       |             * unless we precompute multiples for just one point, converting
 1804|       |             * those into affine form is time well spent
 1805|       |             */
 1806|      0|            mixed = 1;
 1807|      0|        }
 1808|      0|        secrets = OPENSSL_zalloc(sizeof(*secrets) * num_points);
  ------------------
  |  |  104|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1809|      0|        pre_comp = OPENSSL_zalloc(sizeof(*pre_comp) * num_points);
  ------------------
  |  |  104|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1810|      0|        if (mixed)
  ------------------
  |  Branch (1810:13): [True: 0, False: 0]
  ------------------
 1811|      0|            tmp_felems =
 1812|      0|                OPENSSL_malloc(sizeof(*tmp_felems) * (num_points * 17 + 1));
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1813|      0|        if ((secrets == NULL) || (pre_comp == NULL)
  ------------------
  |  Branch (1813:13): [True: 0, False: 0]
  |  Branch (1813:34): [True: 0, False: 0]
  ------------------
 1814|      0|            || (mixed && (tmp_felems == NULL)))
  ------------------
  |  Branch (1814:17): [True: 0, False: 0]
  |  Branch (1814:26): [True: 0, False: 0]
  ------------------
 1815|      0|            goto err;
 1816|       |
 1817|       |        /*
 1818|       |         * we treat NULL scalars as 0, and NULL points as points at infinity,
 1819|       |         * i.e., they contribute nothing to the linear combination
 1820|       |         */
 1821|      0|        for (i = 0; i < num_points; ++i) {
  ------------------
  |  Branch (1821:21): [True: 0, False: 0]
  ------------------
 1822|      0|            if (i == num) {
  ------------------
  |  Branch (1822:17): [True: 0, False: 0]
  ------------------
 1823|       |                /*
 1824|       |                 * we didn't have a valid precomputation, so we pick the
 1825|       |                 * generator
 1826|       |                 */
 1827|      0|                p = EC_GROUP_get0_generator(group);
 1828|      0|                p_scalar = scalar;
 1829|      0|            } else {
 1830|       |                /* the i^th point */
 1831|      0|                p = points[i];
 1832|      0|                p_scalar = scalars[i];
 1833|      0|            }
 1834|      0|            if (p_scalar != NULL && p != NULL) {
  ------------------
  |  Branch (1834:17): [True: 0, False: 0]
  |  Branch (1834:37): [True: 0, False: 0]
  ------------------
 1835|       |                /* reduce scalar to 0 <= scalar < 2^384 */
 1836|      0|                if ((BN_num_bits(p_scalar) > 384)
  ------------------
  |  Branch (1836:21): [True: 0, False: 0]
  ------------------
 1837|      0|                    || (BN_is_negative(p_scalar))) {
  ------------------
  |  Branch (1837:24): [True: 0, False: 0]
  ------------------
 1838|       |                    /*
 1839|       |                     * this is an unusual input, and we don't guarantee
 1840|       |                     * constant-timeness
 1841|       |                     */
 1842|      0|                    if (!BN_nnmod(tmp_scalar, p_scalar, group->order, ctx)) {
  ------------------
  |  Branch (1842:25): [True: 0, False: 0]
  ------------------
 1843|      0|                        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1844|      0|                        goto err;
 1845|      0|                    }
 1846|      0|                    num_bytes = BN_bn2lebinpad(tmp_scalar,
 1847|      0|                                               secrets[i], sizeof(secrets[i]));
 1848|      0|                } else {
 1849|      0|                    num_bytes = BN_bn2lebinpad(p_scalar,
 1850|      0|                                               secrets[i], sizeof(secrets[i]));
 1851|      0|                }
 1852|      0|                if (num_bytes < 0) {
  ------------------
  |  Branch (1852:21): [True: 0, False: 0]
  ------------------
 1853|      0|                    ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1854|      0|                    goto err;
 1855|      0|                }
 1856|       |                /* precompute multiples */
 1857|      0|                if ((!BN_to_felem(x_out, p->X)) ||
  ------------------
  |  Branch (1857:21): [True: 0, False: 0]
  ------------------
 1858|      0|                    (!BN_to_felem(y_out, p->Y)) ||
  ------------------
  |  Branch (1858:21): [True: 0, False: 0]
  ------------------
 1859|      0|                    (!BN_to_felem(z_out, p->Z)))
  ------------------
  |  Branch (1859:21): [True: 0, False: 0]
  ------------------
 1860|      0|                    goto err;
 1861|      0|                memcpy(pre_comp[i][1][0], x_out, sizeof(felem));
 1862|      0|                memcpy(pre_comp[i][1][1], y_out, sizeof(felem));
 1863|      0|                memcpy(pre_comp[i][1][2], z_out, sizeof(felem));
 1864|      0|                for (j = 2; j <= 16; ++j) {
  ------------------
  |  Branch (1864:29): [True: 0, False: 0]
  ------------------
 1865|      0|                    if (j & 1) {
  ------------------
  |  Branch (1865:25): [True: 0, False: 0]
  ------------------
 1866|      0|                        point_add(pre_comp[i][j][0],     pre_comp[i][j][1],     pre_comp[i][j][2],
 1867|      0|                                  pre_comp[i][1][0],     pre_comp[i][1][1],     pre_comp[i][1][2], 0,
 1868|      0|                                  pre_comp[i][j - 1][0], pre_comp[i][j - 1][1], pre_comp[i][j - 1][2]);
 1869|      0|                    } else {
 1870|      0|                        point_double(pre_comp[i][j][0],     pre_comp[i][j][1],     pre_comp[i][j][2],
 1871|      0|                                     pre_comp[i][j / 2][0], pre_comp[i][j / 2][1], pre_comp[i][j / 2][2]);
 1872|      0|                    }
 1873|      0|                }
 1874|      0|            }
 1875|      0|        }
 1876|      0|        if (mixed)
  ------------------
  |  Branch (1876:13): [True: 0, False: 0]
  ------------------
 1877|      0|            make_points_affine(num_points * 17, pre_comp[0], tmp_felems);
 1878|      0|    }
 1879|       |
 1880|       |    /* the scalar for the generator */
 1881|     21|    if (scalar != NULL && have_pre_comp) {
  ------------------
  |  Branch (1881:9): [True: 21, False: 0]
  |  Branch (1881:27): [True: 21, False: 0]
  ------------------
 1882|     21|        memset(g_secret, 0, sizeof(g_secret));
 1883|       |        /* reduce scalar to 0 <= scalar < 2^384 */
 1884|     21|        if ((BN_num_bits(scalar) > 384) || (BN_is_negative(scalar))) {
  ------------------
  |  Branch (1884:13): [True: 6, False: 15]
  |  Branch (1884:44): [True: 0, False: 15]
  ------------------
 1885|       |            /*
 1886|       |             * this is an unusual input, and we don't guarantee
 1887|       |             * constant-timeness
 1888|       |             */
 1889|      6|            if (!BN_nnmod(tmp_scalar, scalar, group->order, ctx)) {
  ------------------
  |  Branch (1889:17): [True: 0, False: 6]
  ------------------
 1890|      0|                ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1891|      0|                goto err;
 1892|      0|            }
 1893|      6|            num_bytes = BN_bn2lebinpad(tmp_scalar, g_secret, sizeof(g_secret));
 1894|     15|        } else {
 1895|     15|            num_bytes = BN_bn2lebinpad(scalar, g_secret, sizeof(g_secret));
 1896|     15|        }
 1897|       |        /* do the multiplication with generator precomputation */
 1898|     21|        batch_mul(x_out, y_out, z_out,
 1899|     21|                  (const felem_bytearray(*))secrets, num_points,
 1900|     21|                  g_secret,
 1901|     21|                  mixed, (const felem(*)[17][3])pre_comp,
 1902|     21|                  (const felem(*)[3])g_pre_comp);
 1903|     21|    } else {
 1904|       |        /* do the multiplication without generator precomputation */
 1905|      0|        batch_mul(x_out, y_out, z_out,
 1906|      0|                  (const felem_bytearray(*))secrets, num_points,
 1907|      0|                  NULL, mixed, (const felem(*)[17][3])pre_comp, NULL);
 1908|      0|    }
 1909|       |    /* reduce the output to its unique minimal representation */
 1910|     21|    felem_contract(x_in, x_out);
 1911|     21|    felem_contract(y_in, y_out);
 1912|     21|    felem_contract(z_in, z_out);
 1913|     21|    if ((!felem_to_BN(x, x_in)) || (!felem_to_BN(y, y_in)) ||
  ------------------
  |  Branch (1913:9): [True: 0, False: 21]
  |  Branch (1913:36): [True: 0, False: 21]
  ------------------
 1914|     21|        (!felem_to_BN(z, z_in))) {
  ------------------
  |  Branch (1914:9): [True: 0, False: 21]
  ------------------
 1915|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1916|      0|        goto err;
 1917|      0|    }
 1918|     21|    ret = ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group, r, x, y, z,
 1919|     21|                                                             ctx);
 1920|       |
 1921|     21| err:
 1922|     21|    BN_CTX_end(ctx);
 1923|     21|    EC_POINT_free(generator);
 1924|     21|    OPENSSL_free(secrets);
  ------------------
  |  |  115|     21|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     21|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     21|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1925|     21|    OPENSSL_free(pre_comp);
  ------------------
  |  |  115|     21|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     21|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     21|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1926|     21|    OPENSSL_free(tmp_felems);
  ------------------
  |  |  115|     21|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     21|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     21|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1927|     21|    return ret;
 1928|     21|}
ecp_nistp384.c:BN_to_felem:
  142|    327|{
  143|    327|    felem_bytearray b_out;
  144|    327|    int num_bytes;
  145|       |
  146|    327|    if (BN_is_negative(bn)) {
  ------------------
  |  Branch (146:9): [True: 0, False: 327]
  ------------------
  147|      0|        ERR_raise(ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  148|      0|        return 0;
  149|      0|    }
  150|    327|    num_bytes = BN_bn2lebinpad(bn, b_out, sizeof(b_out));
  151|    327|    if (num_bytes < 0) {
  ------------------
  |  Branch (151:9): [True: 0, False: 327]
  ------------------
  152|      0|        ERR_raise(ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  153|      0|        return 0;
  154|      0|    }
  155|    327|    bin48_to_felem(out, b_out);
  156|    327|    return 1;
  157|    327|}
ecp_nistp384.c:bin48_to_felem:
  117|    327|{
  118|    327|    memset(out, 0, 56);
  119|    327|    out[0] = (*((limb *) & in[0])) & bottom56bits;
  120|    327|    out[1] = (*((limb_aX *) & in[7])) & bottom56bits;
  121|    327|    out[2] = (*((limb_aX *) & in[14])) & bottom56bits;
  122|    327|    out[3] = (*((limb_aX *) & in[21])) & bottom56bits;
  123|    327|    out[4] = (*((limb_aX *) & in[28])) & bottom56bits;
  124|    327|    out[5] = (*((limb_aX *) & in[35])) & bottom56bits;
  125|    327|    memmove(&out[6], &in[42], 6);
  126|    327|}
ecp_nistp384.c:felem_inv:
  788|    109|{
  789|    109|    felem ftmp, ftmp2, ftmp3, ftmp4, ftmp5, ftmp6;
  790|    109|    unsigned int i = 0;
  791|       |
  792|    109|    felem_square_reduce(ftmp, in);      /* 2^1 */
  ------------------
  |  |  775|    109|# define felem_square_reduce felem_square_reduce_ref
  ------------------
  793|    109|    felem_mul_reduce(ftmp, ftmp, in);   /* 2^1 + 2^0 */
  ------------------
  |  |  776|    109|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  794|    109|    felem_assign(ftmp2, ftmp);
  795|       |
  796|    109|    felem_square_reduce(ftmp, ftmp);    /* 2^2 + 2^1 */
  ------------------
  |  |  775|    109|# define felem_square_reduce felem_square_reduce_ref
  ------------------
  797|    109|    felem_mul_reduce(ftmp, ftmp, in);   /* 2^2 + 2^1 * 2^0 */
  ------------------
  |  |  776|    109|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  798|    109|    felem_assign(ftmp3, ftmp);
  799|       |
  800|    436|    for (i = 0; i < 3; i++)
  ------------------
  |  Branch (800:17): [True: 327, False: 109]
  ------------------
  801|    327|        felem_square_reduce(ftmp, ftmp); /* 2^5 + 2^4 + 2^3 */
  ------------------
  |  |  775|    327|# define felem_square_reduce felem_square_reduce_ref
  ------------------
  802|    109|    felem_mul_reduce(ftmp, ftmp3, ftmp); /* 2^5 + 2^4 + 2^3 + 2^2 + 2^1 + 2^0 */
  ------------------
  |  |  776|    109|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  803|    109|    felem_assign(ftmp4, ftmp);
  804|       |
  805|    763|    for (i = 0; i < 6; i++)
  ------------------
  |  Branch (805:17): [True: 654, False: 109]
  ------------------
  806|    654|        felem_square_reduce(ftmp, ftmp); /* 2^11 + ... + 2^6 */
  ------------------
  |  |  775|    654|# define felem_square_reduce felem_square_reduce_ref
  ------------------
  807|    109|    felem_mul_reduce(ftmp, ftmp4, ftmp); /* 2^11 + ... + 2^0 */
  ------------------
  |  |  776|    109|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  808|       |
  809|    436|    for (i = 0; i < 3; i++)
  ------------------
  |  Branch (809:17): [True: 327, False: 109]
  ------------------
  810|    327|        felem_square_reduce(ftmp, ftmp); /* 2^14 + ... + 2^3 */
  ------------------
  |  |  775|    327|# define felem_square_reduce felem_square_reduce_ref
  ------------------
  811|    109|    felem_mul_reduce(ftmp, ftmp3, ftmp); /* 2^14 + ... + 2^0 */
  ------------------
  |  |  776|    109|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  812|    109|    felem_assign(ftmp5, ftmp);
  813|       |
  814|  1.74k|    for (i = 0; i < 15; i++)
  ------------------
  |  Branch (814:17): [True: 1.63k, False: 109]
  ------------------
  815|  1.63k|        felem_square_reduce(ftmp, ftmp); /* 2^29 + ... + 2^15 */
  ------------------
  |  |  775|  1.63k|# define felem_square_reduce felem_square_reduce_ref
  ------------------
  816|    109|    felem_mul_reduce(ftmp, ftmp5, ftmp); /* 2^29 + ... + 2^0 */
  ------------------
  |  |  776|    109|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  817|    109|    felem_assign(ftmp6, ftmp);
  818|       |
  819|  3.37k|    for (i = 0; i < 30; i++)
  ------------------
  |  Branch (819:17): [True: 3.27k, False: 109]
  ------------------
  820|  3.27k|        felem_square_reduce(ftmp, ftmp); /* 2^59 + ... + 2^30 */
  ------------------
  |  |  775|  3.27k|# define felem_square_reduce felem_square_reduce_ref
  ------------------
  821|    109|    felem_mul_reduce(ftmp, ftmp6, ftmp); /* 2^59 + ... + 2^0 */
  ------------------
  |  |  776|    109|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  822|    109|    felem_assign(ftmp4, ftmp);
  823|       |
  824|  6.64k|    for (i = 0; i < 60; i++)
  ------------------
  |  Branch (824:17): [True: 6.54k, False: 109]
  ------------------
  825|  6.54k|        felem_square_reduce(ftmp, ftmp); /* 2^119 + ... + 2^60 */
  ------------------
  |  |  775|  6.54k|# define felem_square_reduce felem_square_reduce_ref
  ------------------
  826|    109|    felem_mul_reduce(ftmp, ftmp4, ftmp); /* 2^119 + ... + 2^0 */
  ------------------
  |  |  776|    109|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  827|    109|    felem_assign(ftmp4, ftmp);
  828|       |
  829|  13.1k|    for (i = 0; i < 120; i++)
  ------------------
  |  Branch (829:17): [True: 13.0k, False: 109]
  ------------------
  830|  13.0k|      felem_square_reduce(ftmp, ftmp);   /* 2^239 + ... + 2^120 */
  ------------------
  |  |  775|  13.0k|# define felem_square_reduce felem_square_reduce_ref
  ------------------
  831|    109|    felem_mul_reduce(ftmp, ftmp4, ftmp); /* 2^239 + ... + 2^0 */
  ------------------
  |  |  776|    109|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  832|       |
  833|  1.74k|    for (i = 0; i < 15; i++)
  ------------------
  |  Branch (833:17): [True: 1.63k, False: 109]
  ------------------
  834|  1.63k|        felem_square_reduce(ftmp, ftmp); /* 2^254 + ... + 2^15 */
  ------------------
  |  |  775|  1.63k|# define felem_square_reduce felem_square_reduce_ref
  ------------------
  835|    109|    felem_mul_reduce(ftmp, ftmp5, ftmp); /* 2^254 + ... + 2^0 */
  ------------------
  |  |  776|    109|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  836|       |
  837|  3.48k|    for (i = 0; i < 31; i++)
  ------------------
  |  Branch (837:17): [True: 3.37k, False: 109]
  ------------------
  838|  3.37k|        felem_square_reduce(ftmp, ftmp); /* 2^285 + ... + 2^31 */
  ------------------
  |  |  775|  3.37k|# define felem_square_reduce felem_square_reduce_ref
  ------------------
  839|    109|    felem_mul_reduce(ftmp, ftmp6, ftmp); /* 2^285 + ... + 2^31 + 2^29 + ... + 2^0 */
  ------------------
  |  |  776|    109|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  840|       |
  841|    327|    for (i = 0; i < 2; i++)
  ------------------
  |  Branch (841:17): [True: 218, False: 109]
  ------------------
  842|    218|        felem_square_reduce(ftmp, ftmp); /* 2^287 + ... + 2^33 + 2^31 + ... + 2^2 */
  ------------------
  |  |  775|    218|# define felem_square_reduce felem_square_reduce_ref
  ------------------
  843|    109|    felem_mul_reduce(ftmp, ftmp2, ftmp); /* 2^287 + ... + 2^33 + 2^31 + ... + 2^0 */
  ------------------
  |  |  776|    109|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  844|       |
  845|  10.3k|    for (i = 0; i < 94; i++)
  ------------------
  |  Branch (845:17): [True: 10.2k, False: 109]
  ------------------
  846|  10.2k|        felem_square_reduce(ftmp, ftmp); /* 2^381 + ... + 2^127 + 2^125 + ... + 2^94 */
  ------------------
  |  |  775|  10.2k|# define felem_square_reduce felem_square_reduce_ref
  ------------------
  847|    109|    felem_mul_reduce(ftmp, ftmp6, ftmp); /* 2^381 + ... + 2^127 + 2^125 + ... + 2^94 + 2^29 + ... + 2^0 */
  ------------------
  |  |  776|    109|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  848|       |
  849|    327|    for (i = 0; i < 2; i++)
  ------------------
  |  Branch (849:17): [True: 218, False: 109]
  ------------------
  850|    218|        felem_square_reduce(ftmp, ftmp); /* 2^383 + ... + 2^129 + 2^127 + ... + 2^96 + 2^31 + ... + 2^2 */
  ------------------
  |  |  775|    218|# define felem_square_reduce felem_square_reduce_ref
  ------------------
  851|    109|    felem_mul_reduce(ftmp, in, ftmp);    /* 2^383 + ... + 2^129 + 2^127 + ... + 2^96 + 2^31 + ... + 2^2 + 2^0 */
  ------------------
  |  |  776|    109|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  852|       |
  853|    109|    memcpy(out, ftmp, sizeof(felem));
  854|    109|}
ecp_nistp384.c:felem_square_reduce_ref:
  688|  49.9k|{
  689|  49.9k|    widefelem tmp;
  690|       |
  691|  49.9k|    felem_square_ref(tmp, in);
  692|  49.9k|    felem_reduce_ref(out, tmp);
  693|  49.9k|}
ecp_nistp384.c:felem_mul_reduce_ref:
  696|  13.8k|{
  697|  13.8k|    widefelem tmp;
  698|       |
  699|  13.8k|    felem_mul_ref(tmp, in1, in2);
  700|  13.8k|    felem_reduce_ref(out, tmp);
  701|  13.8k|}
ecp_nistp384.c:felem_assign:
  180|  23.4k|{
  181|  23.4k|    memcpy(out, in, sizeof(felem));
  182|  23.4k|}
ecp_nistp384.c:felem_square_ref:
  385|  58.3k|{
  386|  58.3k|    felem inx2;
  387|  58.3k|    felem_scalar(inx2, in, 2);
  388|       |
  389|  58.3k|    out[0] = ((uint128_t) in[0]) * in[0];
  390|       |
  391|  58.3k|    out[1] = ((uint128_t) in[0]) * inx2[1];
  392|       |
  393|  58.3k|    out[2] = ((uint128_t) in[0]) * inx2[2]
  394|  58.3k|           + ((uint128_t) in[1]) * in[1];
  395|       |
  396|  58.3k|    out[3] = ((uint128_t) in[0]) * inx2[3]
  397|  58.3k|           + ((uint128_t) in[1]) * inx2[2];
  398|       |
  399|  58.3k|    out[4] = ((uint128_t) in[0]) * inx2[4]
  400|  58.3k|           + ((uint128_t) in[1]) * inx2[3]
  401|  58.3k|           + ((uint128_t) in[2]) * in[2];
  402|       |
  403|  58.3k|    out[5] = ((uint128_t) in[0]) * inx2[5]
  404|  58.3k|           + ((uint128_t) in[1]) * inx2[4]
  405|  58.3k|           + ((uint128_t) in[2]) * inx2[3];
  406|       |
  407|  58.3k|    out[6] = ((uint128_t) in[0]) * inx2[6]
  408|  58.3k|           + ((uint128_t) in[1]) * inx2[5]
  409|  58.3k|           + ((uint128_t) in[2]) * inx2[4]
  410|  58.3k|           + ((uint128_t) in[3]) * in[3];
  411|       |
  412|  58.3k|    out[7] = ((uint128_t) in[1]) * inx2[6]
  413|  58.3k|           + ((uint128_t) in[2]) * inx2[5]
  414|  58.3k|           + ((uint128_t) in[3]) * inx2[4];
  415|       |
  416|  58.3k|    out[8] = ((uint128_t) in[2]) * inx2[6]
  417|  58.3k|           + ((uint128_t) in[3]) * inx2[5]
  418|  58.3k|           + ((uint128_t) in[4]) * in[4];
  419|       |
  420|  58.3k|    out[9] = ((uint128_t) in[3]) * inx2[6]
  421|  58.3k|           + ((uint128_t) in[4]) * inx2[5];
  422|       |
  423|  58.3k|    out[10] = ((uint128_t) in[4]) * inx2[6]
  424|  58.3k|            + ((uint128_t) in[5]) * in[5];
  425|       |
  426|  58.3k|    out[11] = ((uint128_t) in[5]) * inx2[6];
  427|       |
  428|  58.3k|    out[12] = ((uint128_t) in[6]) * in[6];
  429|  58.3k|}
ecp_nistp384.c:felem_scalar:
  195|  60.3k|{
  196|  60.3k|    unsigned int i;
  197|       |
  198|   483k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|   483k|#define NLIMBS 7
  ------------------
  |  Branch (198:17): [True: 422k, False: 60.3k]
  ------------------
  199|   422k|        out[i] = in[i] * scalar;
  200|  60.3k|}
ecp_nistp384.c:felem_reduce_ref:
  518|  78.6k|{
  519|       |    /*
  520|       |     * In order to prevent underflow, we add a multiple of p before subtracting.
  521|       |     * Use telescopic sums to represent 2^76 * p redundantly with each limb
  522|       |     * of the form 2^124 + ...
  523|       |     */
  524|  78.6k|    static const widelimb two124m68 = (((widelimb) 1) << 124)
  525|  78.6k|                                    - (((widelimb) 1) << 68);
  526|  78.6k|    static const widelimb two124m116m68 = (((widelimb) 1) << 124)
  527|  78.6k|                                        - (((widelimb) 1) << 116)
  528|  78.6k|                                        - (((widelimb) 1) << 68);
  529|  78.6k|    static const widelimb two124p108m76 = (((widelimb) 1) << 124)
  530|  78.6k|                                        + (((widelimb) 1) << 108)
  531|  78.6k|                                        - (((widelimb) 1) << 76);
  532|  78.6k|    static const widelimb two124m92m68 = (((widelimb) 1) << 124)
  533|  78.6k|                                       - (((widelimb) 1) << 92)
  534|  78.6k|                                       - (((widelimb) 1) << 68);
  535|  78.6k|    widelimb temp, acc[9];
  536|  78.6k|    unsigned int i;
  537|       |
  538|  78.6k|    memcpy(acc, in, sizeof(widelimb) * 9);
  539|       |
  540|  78.6k|    acc[0] += two124p108m76;
  541|  78.6k|    acc[1] += two124m116m68;
  542|  78.6k|    acc[2] += two124m92m68;
  543|  78.6k|    acc[3] += two124m68;
  544|  78.6k|    acc[4] += two124m68;
  545|  78.6k|    acc[5] += two124m68;
  546|  78.6k|    acc[6] += two124m68;
  547|       |
  548|       |    /* [1]: Eliminate in[9], ..., in[12] */
  549|  78.6k|    acc[8] += in[12] >> 32;
  550|  78.6k|    acc[7] += (in[12] & 0xffffffff) << 24;
  551|  78.6k|    acc[7] += in[12] >> 8;
  552|  78.6k|    acc[6] += (in[12] & 0xff) << 48;
  553|  78.6k|    acc[6] -= in[12] >> 16;
  554|  78.6k|    acc[5] -= (in[12] & 0xffff) << 40;
  555|  78.6k|    acc[6] += in[12] >> 48;
  556|  78.6k|    acc[5] += (in[12] & 0xffffffffffff) << 8;
  557|       |
  558|  78.6k|    acc[7] += in[11] >> 32;
  559|  78.6k|    acc[6] += (in[11] & 0xffffffff) << 24;
  560|  78.6k|    acc[6] += in[11] >> 8;
  561|  78.6k|    acc[5] += (in[11] & 0xff) << 48;
  562|  78.6k|    acc[5] -= in[11] >> 16;
  563|  78.6k|    acc[4] -= (in[11] & 0xffff) << 40;
  564|  78.6k|    acc[5] += in[11] >> 48;
  565|  78.6k|    acc[4] += (in[11] & 0xffffffffffff) << 8;
  566|       |
  567|  78.6k|    acc[6] += in[10] >> 32;
  568|  78.6k|    acc[5] += (in[10] & 0xffffffff) << 24;
  569|  78.6k|    acc[5] += in[10] >> 8;
  570|  78.6k|    acc[4] += (in[10] & 0xff) << 48;
  571|  78.6k|    acc[4] -= in[10] >> 16;
  572|  78.6k|    acc[3] -= (in[10] & 0xffff) << 40;
  573|  78.6k|    acc[4] += in[10] >> 48;
  574|  78.6k|    acc[3] += (in[10] & 0xffffffffffff) << 8;
  575|       |
  576|  78.6k|    acc[5] += in[9] >> 32;
  577|  78.6k|    acc[4] += (in[9] & 0xffffffff) << 24;
  578|  78.6k|    acc[4] += in[9] >> 8;
  579|  78.6k|    acc[3] += (in[9] & 0xff) << 48;
  580|  78.6k|    acc[3] -= in[9] >> 16;
  581|  78.6k|    acc[2] -= (in[9] & 0xffff) << 40;
  582|  78.6k|    acc[3] += in[9] >> 48;
  583|  78.6k|    acc[2] += (in[9] & 0xffffffffffff) << 8;
  584|       |
  585|       |    /*
  586|       |     * [2]: Eliminate acc[7], acc[8], that is the 7 and eighth limbs, as
  587|       |     * well as the contributions made from eliminating higher limbs.
  588|       |     * acc[7] < in[7] + 2^120 + 2^56 < in[7] + 2^121
  589|       |     * acc[8] < in[8] + 2^96
  590|       |     */
  591|  78.6k|    acc[4] += acc[8] >> 32;
  592|  78.6k|    acc[3] += (acc[8] & 0xffffffff) << 24;
  593|  78.6k|    acc[3] += acc[8] >> 8;
  594|  78.6k|    acc[2] += (acc[8] & 0xff) << 48;
  595|  78.6k|    acc[2] -= acc[8] >> 16;
  596|  78.6k|    acc[1] -= (acc[8] & 0xffff) << 40;
  597|  78.6k|    acc[2] += acc[8] >> 48;
  598|  78.6k|    acc[1] += (acc[8] & 0xffffffffffff) << 8;
  599|       |
  600|  78.6k|    acc[3] += acc[7] >> 32;
  601|  78.6k|    acc[2] += (acc[7] & 0xffffffff) << 24;
  602|  78.6k|    acc[2] += acc[7] >> 8;
  603|  78.6k|    acc[1] += (acc[7] & 0xff) << 48;
  604|  78.6k|    acc[1] -= acc[7] >> 16;
  605|  78.6k|    acc[0] -= (acc[7] & 0xffff) << 40;
  606|  78.6k|    acc[1] += acc[7] >> 48;
  607|  78.6k|    acc[0] += (acc[7] & 0xffffffffffff) << 8;
  608|       |
  609|       |    /*-
  610|       |     * acc[k] < in[k] + 2^124 + 2^121
  611|       |     *        < in[k] + 2^125
  612|       |     *        < 2^128, for k <= 6
  613|       |     */
  614|       |
  615|       |    /*
  616|       |     * Carry 4 -> 5 -> 6
  617|       |     * This has the effect of ensuring that these more significant limbs
  618|       |     * will be small in value after eliminating high bits from acc[6].
  619|       |     */
  620|  78.6k|    acc[5] += acc[4] >> 56;
  621|  78.6k|    acc[4] &= 0x00ffffffffffffff;
  622|       |
  623|  78.6k|    acc[6] += acc[5] >> 56;
  624|  78.6k|    acc[5] &= 0x00ffffffffffffff;
  625|       |
  626|       |    /*-
  627|       |     * acc[6] < in[6] + 2^124 + 2^121 + 2^72 + 2^16
  628|       |     *        < in[6] + 2^125
  629|       |     *        < 2^128
  630|       |     */
  631|       |
  632|       |    /* [3]: Eliminate high bits of acc[6] */
  633|  78.6k|    temp = acc[6] >> 48;
  634|  78.6k|    acc[6] &= 0x0000ffffffffffff;
  635|       |
  636|       |    /* temp < 2^80 */
  637|       |
  638|  78.6k|    acc[3] += temp >> 40;
  639|  78.6k|    acc[2] += (temp & 0xffffffffff) << 16;
  640|  78.6k|    acc[2] += temp >> 16;
  641|  78.6k|    acc[1] += (temp & 0xffff) << 40;
  642|  78.6k|    acc[1] -= temp >> 24;
  643|  78.6k|    acc[0] -= (temp & 0xffffff) << 32;
  644|  78.6k|    acc[0] += temp;
  645|       |
  646|       |    /*-
  647|       |     * acc[k] < acc_old[k] + 2^64 + 2^56
  648|       |     *        < in[k] + 2^124 + 2^121 + 2^72 + 2^64 + 2^56 + 2^16 , k < 4
  649|       |     */
  650|       |
  651|       |    /* Carry 0 -> 1 -> 2 -> 3 -> 4 -> 5 -> 6 */
  652|  78.6k|    acc[1] += acc[0] >> 56;   /* acc[1] < acc_old[1] + 2^72 */
  653|  78.6k|    acc[0] &= 0x00ffffffffffffff;
  654|       |
  655|  78.6k|    acc[2] += acc[1] >> 56;   /* acc[2] < acc_old[2] + 2^72 + 2^16 */
  656|  78.6k|    acc[1] &= 0x00ffffffffffffff;
  657|       |
  658|  78.6k|    acc[3] += acc[2] >> 56;   /* acc[3] < acc_old[3] + 2^72 + 2^16 */
  659|  78.6k|    acc[2] &= 0x00ffffffffffffff;
  660|       |
  661|       |    /*-
  662|       |     * acc[k] < acc_old[k] + 2^72 + 2^16
  663|       |     *        < in[k] + 2^124 + 2^121 + 2^73 + 2^64 + 2^56 + 2^17
  664|       |     *        < in[k] + 2^125
  665|       |     *        < 2^128 , k < 4
  666|       |     */
  667|       |
  668|  78.6k|    acc[4] += acc[3] >> 56;   /*-
  669|       |                               * acc[4] < acc_old[4] + 2^72 + 2^16
  670|       |                               *        < 2^72 + 2^56 + 2^16
  671|       |                               */
  672|  78.6k|    acc[3] &= 0x00ffffffffffffff;
  673|       |
  674|  78.6k|    acc[5] += acc[4] >> 56;   /*-
  675|       |                               * acc[5] < acc_old[5] + 2^16 + 1
  676|       |                               *        < 2^56 + 2^16 + 1
  677|       |                               */
  678|  78.6k|    acc[4] &= 0x00ffffffffffffff;
  679|       |
  680|  78.6k|    acc[6] += acc[5] >> 56;   /* acc[6] < 2^48 + 1 <= 2^48 */
  681|  78.6k|    acc[5] &= 0x00ffffffffffffff;
  682|       |
  683|   629k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|   629k|#define NLIMBS 7
  ------------------
  |  Branch (683:17): [True: 550k, False: 78.6k]
  ------------------
  684|   550k|        out[i] = acc[i];
  685|  78.6k|}
ecp_nistp384.c:felem_mul_ref:
  432|  24.4k|{
  433|  24.4k|    out[0] = ((uint128_t) in1[0]) * in2[0];
  434|       |
  435|  24.4k|    out[1] = ((uint128_t) in1[0]) * in2[1]
  436|  24.4k|           + ((uint128_t) in1[1]) * in2[0];
  437|       |
  438|  24.4k|    out[2] = ((uint128_t) in1[0]) * in2[2]
  439|  24.4k|           + ((uint128_t) in1[1]) * in2[1]
  440|  24.4k|           + ((uint128_t) in1[2]) * in2[0];
  441|       |
  442|  24.4k|    out[3] = ((uint128_t) in1[0]) * in2[3]
  443|  24.4k|           + ((uint128_t) in1[1]) * in2[2]
  444|  24.4k|           + ((uint128_t) in1[2]) * in2[1]
  445|  24.4k|           + ((uint128_t) in1[3]) * in2[0];
  446|       |
  447|  24.4k|    out[4] = ((uint128_t) in1[0]) * in2[4]
  448|  24.4k|           + ((uint128_t) in1[1]) * in2[3]
  449|  24.4k|           + ((uint128_t) in1[2]) * in2[2]
  450|  24.4k|           + ((uint128_t) in1[3]) * in2[1]
  451|  24.4k|           + ((uint128_t) in1[4]) * in2[0];
  452|       |
  453|  24.4k|    out[5] = ((uint128_t) in1[0]) * in2[5]
  454|  24.4k|           + ((uint128_t) in1[1]) * in2[4]
  455|  24.4k|           + ((uint128_t) in1[2]) * in2[3]
  456|  24.4k|           + ((uint128_t) in1[3]) * in2[2]
  457|  24.4k|           + ((uint128_t) in1[4]) * in2[1]
  458|  24.4k|           + ((uint128_t) in1[5]) * in2[0];
  459|       |
  460|  24.4k|    out[6] = ((uint128_t) in1[0]) * in2[6]
  461|  24.4k|           + ((uint128_t) in1[1]) * in2[5]
  462|  24.4k|           + ((uint128_t) in1[2]) * in2[4]
  463|  24.4k|           + ((uint128_t) in1[3]) * in2[3]
  464|  24.4k|           + ((uint128_t) in1[4]) * in2[2]
  465|  24.4k|           + ((uint128_t) in1[5]) * in2[1]
  466|  24.4k|           + ((uint128_t) in1[6]) * in2[0];
  467|       |
  468|  24.4k|    out[7] = ((uint128_t) in1[1]) * in2[6]
  469|  24.4k|           + ((uint128_t) in1[2]) * in2[5]
  470|  24.4k|           + ((uint128_t) in1[3]) * in2[4]
  471|  24.4k|           + ((uint128_t) in1[4]) * in2[3]
  472|  24.4k|           + ((uint128_t) in1[5]) * in2[2]
  473|  24.4k|           + ((uint128_t) in1[6]) * in2[1];
  474|       |
  475|  24.4k|    out[8] = ((uint128_t) in1[2]) * in2[6]
  476|  24.4k|           + ((uint128_t) in1[3]) * in2[5]
  477|  24.4k|           + ((uint128_t) in1[4]) * in2[4]
  478|  24.4k|           + ((uint128_t) in1[5]) * in2[3]
  479|  24.4k|           + ((uint128_t) in1[6]) * in2[2];
  480|       |
  481|  24.4k|    out[9] = ((uint128_t) in1[3]) * in2[6]
  482|  24.4k|           + ((uint128_t) in1[4]) * in2[5]
  483|  24.4k|           + ((uint128_t) in1[5]) * in2[4]
  484|  24.4k|           + ((uint128_t) in1[6]) * in2[3];
  485|       |
  486|  24.4k|    out[10] = ((uint128_t) in1[4]) * in2[6]
  487|  24.4k|            + ((uint128_t) in1[5]) * in2[5]
  488|  24.4k|            + ((uint128_t) in1[6]) * in2[4];
  489|       |
  490|  24.4k|    out[11] = ((uint128_t) in1[5]) * in2[6]
  491|  24.4k|            + ((uint128_t) in1[6]) * in2[5];
  492|       |
  493|  24.4k|    out[12] = ((uint128_t) in1[6]) * in2[6];
  494|  24.4k|}
ecp_nistp384.c:felem_contract:
  892|    281|{
  893|    281|    static const int64_t two56 = ((limb) 1) << 56;
  894|       |
  895|       |    /*
  896|       |     * We know for a fact that 0 <= |in| < 2*p, for p = 2^384 - 2^128 - 2^96 + 2^32 - 1
  897|       |     * Perform two successive, idempotent subtractions to reduce if |in| >= p.
  898|       |     */
  899|       |
  900|    281|    int64_t tmp[NLIMBS], cond[5], a;
  901|    281|    unsigned int i;
  902|       |
  903|    281|    memcpy(tmp, in, sizeof(felem));
  904|       |
  905|       |    /* Case 1: a = 1 iff |in| >= 2^384 */
  906|    281|    a = (in[6] >> 48);
  907|    281|    tmp[0] += a;
  908|    281|    tmp[0] -= a << 32;
  909|    281|    tmp[1] += a << 40;
  910|    281|    tmp[2] += a << 16;
  911|    281|    tmp[6] &= 0x0000ffffffffffff;
  912|       |
  913|       |    /*
  914|       |     * eliminate negative coefficients: if tmp[0] is negative, tmp[1] must be
  915|       |     * non-zero, so we only need one step
  916|       |     */
  917|       |
  918|    281|    a = tmp[0] >> 63;
  919|    281|    tmp[0] += a & two56;
  920|    281|    tmp[1] -= a & 1;
  921|       |
  922|       |    /* Carry 1 -> 2 -> 3 -> 4 -> 5 -> 6 */
  923|    281|    tmp[2] += tmp[1] >> 56;
  924|    281|    tmp[1] &= 0x00ffffffffffffff;
  925|       |
  926|    281|    tmp[3] += tmp[2] >> 56;
  927|    281|    tmp[2] &= 0x00ffffffffffffff;
  928|       |
  929|    281|    tmp[4] += tmp[3] >> 56;
  930|    281|    tmp[3] &= 0x00ffffffffffffff;
  931|       |
  932|    281|    tmp[5] += tmp[4] >> 56;
  933|    281|    tmp[4] &= 0x00ffffffffffffff;
  934|       |
  935|    281|    tmp[6] += tmp[5] >> 56; /* tmp[6] < 2^48 */
  936|    281|    tmp[5] &= 0x00ffffffffffffff;
  937|       |
  938|       |    /*
  939|       |     * Case 2: a = all ones if p <= |in| < 2^384, 0 otherwise
  940|       |     */
  941|       |
  942|       |    /* 0 iff (2^129..2^383) are all one */
  943|    281|    cond[0] = ((tmp[6] | 0xff000000000000) & tmp[5] & tmp[4] & tmp[3] & (tmp[2] | 0x0000000001ffff)) + 1;
  944|       |    /* 0 iff 2^128 bit is one */
  945|    281|    cond[1] = (tmp[2] | ~0x00000000010000) + 1;
  946|       |    /* 0 iff (2^96..2^127) bits are all one */
  947|    281|    cond[2] = ((tmp[2] | 0xffffffffff0000) & (tmp[1] | 0x0000ffffffffff)) + 1;
  948|       |    /* 0 iff (2^32..2^95) bits are all zero */
  949|    281|    cond[3] = (tmp[1] & ~0xffff0000000000) | (tmp[0] & ~((int64_t) 0x000000ffffffff));
  950|       |    /* 0 iff (2^0..2^31) bits are all one */
  951|    281|    cond[4] = (tmp[0] | 0xffffff00000000) + 1;
  952|       |
  953|       |    /*
  954|       |     * In effect, invert our conditions, so that 0 values become all 1's,
  955|       |     * any non-zero value in the low-order 56 bits becomes all 0's
  956|       |     */
  957|  1.68k|    for (i = 0; i < 5; i++)
  ------------------
  |  Branch (957:17): [True: 1.40k, False: 281]
  ------------------
  958|  1.40k|       cond[i] = ((cond[i] & 0x00ffffffffffffff) - 1) >> 63;
  959|       |
  960|       |    /*
  961|       |     * The condition for determining whether in is greater than our
  962|       |     * prime is given by the following condition.
  963|       |     */
  964|       |
  965|       |    /* First subtract 2^384 - 2^129 cheaply */
  966|    281|    a = cond[0] & (cond[1] | (cond[2] & (~cond[3] | cond[4])));
  967|    281|    tmp[6] &= ~a;
  968|    281|    tmp[5] &= ~a;
  969|    281|    tmp[4] &= ~a;
  970|    281|    tmp[3] &= ~a;
  971|    281|    tmp[2] &= ~a | 0x0000000001ffff;
  972|       |
  973|       |    /*
  974|       |     * Subtract 2^128 - 2^96 by
  975|       |     * means of disjoint cases.
  976|       |     */
  977|       |
  978|       |    /* subtract 2^128 if that bit is present, and add 2^96 */
  979|    281|    a = cond[0] & cond[1];
  980|    281|    tmp[2] &= ~a | 0xfffffffffeffff;
  981|    281|    tmp[1] += a & ((int64_t) 1 << 40);
  982|       |
  983|       |    /* otherwise, clear bits 2^127 .. 2^96  */
  984|    281|    a = cond[0] & ~cond[1] & (cond[2] & (~cond[3] | cond[4]));
  985|    281|    tmp[2] &= ~a | 0xffffffffff0000;
  986|    281|    tmp[1] &= ~a | 0x0000ffffffffff;
  987|       |
  988|       |    /* finally, subtract the last 2^32 - 1 */
  989|    281|    a = cond[0] & (cond[1] | (cond[2] & (~cond[3] | cond[4])));
  990|    281|    tmp[0] += a & (-((int64_t) 1 << 32) + 1);
  991|       |
  992|       |    /*
  993|       |     * eliminate negative coefficients: if tmp[0] is negative, tmp[1] must be
  994|       |     * non-zero, so we only need one step
  995|       |     */
  996|    281|    a = tmp[0] >> 63;
  997|    281|    tmp[0] += a & two56;
  998|    281|    tmp[1] -= a & 1;
  999|       |
 1000|       |    /* Carry 1 -> 2 -> 3 -> 4 -> 5 -> 6 */
 1001|    281|    tmp[2] += tmp[1] >> 56;
 1002|    281|    tmp[1] &= 0x00ffffffffffffff;
 1003|       |
 1004|    281|    tmp[3] += tmp[2] >> 56;
 1005|    281|    tmp[2] &= 0x00ffffffffffffff;
 1006|       |
 1007|    281|    tmp[4] += tmp[3] >> 56;
 1008|    281|    tmp[3] &= 0x00ffffffffffffff;
 1009|       |
 1010|    281|    tmp[5] += tmp[4] >> 56;
 1011|    281|    tmp[4] &= 0x00ffffffffffffff;
 1012|       |
 1013|    281|    tmp[6] += tmp[5] >> 56;
 1014|    281|    tmp[5] &= 0x00ffffffffffffff;
 1015|       |
 1016|    281|    memcpy(out, tmp, sizeof(felem));
 1017|    281|}
ecp_nistp384.c:felem_to_BN:
  161|    344|{
  162|    344|    felem_bytearray b_out;
  163|       |
  164|    344|    felem_to_bin48(b_out, in);
  165|    344|    return BN_lebin2bn(b_out, sizeof(b_out), out);
  166|    344|}
ecp_nistp384.c:felem_to_bin48:
  129|    344|{
  130|    344|    memset(out, 0, 48);
  131|    344|    (*((limb *) & out[0]))     |= (in[0] & bottom56bits);
  132|    344|    (*((limb_aX *) & out[7]))  |= (in[1] & bottom56bits);
  133|    344|    (*((limb_aX *) & out[14])) |= (in[2] & bottom56bits);
  134|    344|    (*((limb_aX *) & out[21])) |= (in[3] & bottom56bits);
  135|    344|    (*((limb_aX *) & out[28])) |= (in[4] & bottom56bits);
  136|    344|    (*((limb_aX *) & out[35])) |= (in[5] & bottom56bits);
  137|    344|    memmove(&out[42], &in[6], 6);
  138|    344|}
ecp_nistp384.c:point_add:
 1111|  2.05k|{
 1112|  2.05k|    felem ftmp, ftmp2, ftmp3, ftmp4, ftmp5, ftmp6, x_out, y_out, z_out;
 1113|  2.05k|    widefelem tmp, tmp2;
 1114|  2.05k|    limb x_equal, y_equal, z1_is_zero, z2_is_zero;
 1115|  2.05k|    limb points_equal;
 1116|       |
 1117|  2.05k|    z1_is_zero = felem_is_zero(z1);
 1118|  2.05k|    z2_is_zero = felem_is_zero(z2);
 1119|       |
 1120|       |    /* ftmp = z1z1 = z1**2 */
 1121|  2.05k|    felem_square_reduce(ftmp, z1);      /* ftmp[i] < 2^56 */
  ------------------
  |  |  775|  2.05k|# define felem_square_reduce felem_square_reduce_ref
  ------------------
 1122|       |
 1123|  2.05k|    if (!mixed) {
  ------------------
  |  Branch (1123:9): [True: 0, False: 2.05k]
  ------------------
 1124|       |        /* ftmp2 = z2z2 = z2**2 */
 1125|      0|        felem_square_reduce(ftmp2, z2); /* ftmp2[i] < 2^56 */
  ------------------
  |  |  775|      0|# define felem_square_reduce felem_square_reduce_ref
  ------------------
 1126|       |
 1127|       |        /* u1 = ftmp3 = x1*z2z2 */
 1128|      0|        felem_mul_reduce(ftmp3, x1, ftmp2); /* ftmp3[i] < 2^56 */
  ------------------
  |  |  776|      0|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1129|       |
 1130|       |        /* ftmp5 = z1 + z2 */
 1131|      0|        felem_assign(ftmp5, z1);       /* ftmp5[i] < 2^56 */
 1132|      0|        felem_sum64(ftmp5, z2);        /* ftmp5[i] < 2^57 */
 1133|       |
 1134|       |        /* ftmp5 = (z1 + z2)**2 - z1z1 - z2z2 = 2*z1z2 */
 1135|      0|        felem_square(tmp, ftmp5);      /* tmp[i] < 2^117 */
  ------------------
  |  |  771|      0|# define felem_square felem_square_ref
  ------------------
 1136|      0|        felem_diff_128_64(tmp, ftmp);  /* tmp[i] < 2^117 + 2^64 + 2^48 */
 1137|      0|        felem_diff_128_64(tmp, ftmp2); /* tmp[i] < 2^117 + 2^65 + 2^49 */
 1138|      0|        felem_reduce(ftmp5, tmp);      /* ftmp5[i] < 2^56 */
  ------------------
  |  |  773|      0|# define felem_reduce felem_reduce_ref
  ------------------
 1139|       |
 1140|       |        /* ftmp2 = z2 * z2z2 */
 1141|      0|        felem_mul_reduce(ftmp2, ftmp2, z2); /* ftmp2[i] < 2^56 */
  ------------------
  |  |  776|      0|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1142|       |
 1143|       |        /* s1 = ftmp6 = y1 * z2**3 */
 1144|      0|        felem_mul_reduce(ftmp6, y1, ftmp2); /* ftmp6[i] < 2^56 */
  ------------------
  |  |  776|      0|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1145|  2.05k|    } else {
 1146|       |        /*
 1147|       |         * We'll assume z2 = 1 (special case z2 = 0 is handled later)
 1148|       |         */
 1149|       |
 1150|       |        /* u1 = ftmp3 = x1*z2z2 */
 1151|  2.05k|        felem_assign(ftmp3, x1);     /* ftmp3[i] < 2^56 */
 1152|       |
 1153|       |        /* ftmp5 = 2*z1z2 */
 1154|  2.05k|        felem_scalar(ftmp5, z1, 2);  /* ftmp5[i] < 2^57 */
 1155|       |
 1156|       |        /* s1 = ftmp6 = y1 * z2**3 */
 1157|  2.05k|        felem_assign(ftmp6, y1);     /* ftmp6[i] < 2^56 */
 1158|  2.05k|    }
 1159|       |    /* ftmp3[i] < 2^56, ftmp5[i] < 2^57, ftmp6[i] < 2^56 */
 1160|       |
 1161|       |    /* u2 = x2*z1z1 */
 1162|  2.05k|    felem_mul(tmp, x2, ftmp);        /* tmp[i] < 2^115 */
  ------------------
  |  |  772|  2.05k|# define felem_mul felem_mul_ref
  ------------------
 1163|       |
 1164|       |    /* h = ftmp4 = u2 - u1 */
 1165|  2.05k|    felem_diff_128_64(tmp, ftmp3);   /* tmp[i] < 2^115 + 2^64 + 2^48 */
 1166|  2.05k|    felem_reduce(ftmp4, tmp);        /* ftmp[4] < 2^56 */
  ------------------
  |  |  773|  2.05k|# define felem_reduce felem_reduce_ref
  ------------------
 1167|       |
 1168|  2.05k|    x_equal = felem_is_zero(ftmp4);
 1169|       |
 1170|       |    /* z_out = ftmp5 * h */
 1171|  2.05k|    felem_mul_reduce(z_out, ftmp5, ftmp4);  /* z_out[i] < 2^56 */
  ------------------
  |  |  776|  2.05k|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1172|       |
 1173|       |    /* ftmp = z1 * z1z1 */
 1174|  2.05k|    felem_mul_reduce(ftmp, ftmp, z1);  /* ftmp[i] < 2^56 */
  ------------------
  |  |  776|  2.05k|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1175|       |
 1176|       |    /* s2 = tmp = y2 * z1**3 */
 1177|  2.05k|    felem_mul(tmp, y2, ftmp);      /* tmp[i] < 2^115 */
  ------------------
  |  |  772|  2.05k|# define felem_mul felem_mul_ref
  ------------------
 1178|       |
 1179|       |    /* r = ftmp5 = (s2 - s1)*2 */
 1180|  2.05k|    felem_diff_128_64(tmp, ftmp6); /* tmp[i] < 2^115 + 2^64 + 2^48 */
 1181|  2.05k|    felem_reduce(ftmp5, tmp);      /* ftmp5[i] < 2^56 */
  ------------------
  |  |  773|  2.05k|# define felem_reduce felem_reduce_ref
  ------------------
 1182|  2.05k|    y_equal = felem_is_zero(ftmp5);
 1183|  2.05k|    felem_scalar64(ftmp5, 2);      /* ftmp5[i] < 2^57 */
 1184|       |
 1185|       |    /*
 1186|       |     * The formulae are incorrect if the points are equal, in affine coordinates
 1187|       |     * (X_1, Y_1) == (X_2, Y_2), so we check for this and do doubling if this
 1188|       |     * happens.
 1189|       |     *
 1190|       |     * We use bitwise operations to avoid potential side-channels introduced by
 1191|       |     * the short-circuiting behaviour of boolean operators.
 1192|       |     *
 1193|       |     * The special case of either point being the point at infinity (z1 and/or
 1194|       |     * z2 are zero), is handled separately later on in this function, so we
 1195|       |     * avoid jumping to point_double here in those special cases.
 1196|       |     *
 1197|       |     * Notice the comment below on the implications of this branching for timing
 1198|       |     * leaks and why it is considered practically irrelevant.
 1199|       |     */
 1200|  2.05k|    points_equal = (x_equal & y_equal & (~z1_is_zero) & (~z2_is_zero));
 1201|       |
 1202|  2.05k|    if (points_equal) {
  ------------------
  |  Branch (1202:9): [True: 0, False: 2.05k]
  ------------------
 1203|       |        /*
 1204|       |         * This is obviously not constant-time but it will almost-never happen
 1205|       |         * for ECDH / ECDSA.
 1206|       |         */
 1207|      0|        point_double(x3, y3, z3, x1, y1, z1);
 1208|      0|        return;
 1209|      0|    }
 1210|       |
 1211|       |    /* I = ftmp = (2h)**2 */
 1212|  2.05k|    felem_assign(ftmp, ftmp4);        /* ftmp[i] < 2^56 */
 1213|  2.05k|    felem_scalar64(ftmp, 2);          /* ftmp[i] < 2^57 */
 1214|  2.05k|    felem_square_reduce(ftmp, ftmp);  /* ftmp[i] < 2^56 */
  ------------------
  |  |  775|  2.05k|# define felem_square_reduce felem_square_reduce_ref
  ------------------
 1215|       |
 1216|       |    /* J = ftmp2 = h * I */
 1217|  2.05k|    felem_mul_reduce(ftmp2, ftmp4, ftmp); /* ftmp2[i] < 2^56 */
  ------------------
  |  |  776|  2.05k|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1218|       |
 1219|       |    /* V = ftmp4 = U1 * I */
 1220|  2.05k|    felem_mul_reduce(ftmp4, ftmp3, ftmp); /* ftmp4[i] < 2^56 */
  ------------------
  |  |  776|  2.05k|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1221|       |
 1222|       |    /* x_out = r**2 - J - 2V */
 1223|  2.05k|    felem_square(tmp, ftmp5);      /* tmp[i] < 2^117 */
  ------------------
  |  |  771|  2.05k|# define felem_square felem_square_ref
  ------------------
 1224|  2.05k|    felem_diff_128_64(tmp, ftmp2); /* tmp[i] < 2^117 + 2^64 + 2^48 */
 1225|  2.05k|    felem_assign(ftmp3, ftmp4);    /* ftmp3[i] < 2^56 */
 1226|  2.05k|    felem_scalar64(ftmp4, 2);      /* ftmp4[i] < 2^57 */
 1227|  2.05k|    felem_diff_128_64(tmp, ftmp4); /* tmp[i] < 2^117 + 2^65 + 2^49 */
 1228|  2.05k|    felem_reduce(x_out, tmp);      /* x_out[i] < 2^56 */
  ------------------
  |  |  773|  2.05k|# define felem_reduce felem_reduce_ref
  ------------------
 1229|       |
 1230|       |    /* y_out = r(V-x_out) - 2 * s1 * J */
 1231|  2.05k|    felem_diff64(ftmp3, x_out);    /* ftmp3[i] < 2^60 + 2^56 + 2^44 */
 1232|  2.05k|    felem_mul(tmp, ftmp5, ftmp3);  /* tmp[i] < 2^116 */
  ------------------
  |  |  772|  2.05k|# define felem_mul felem_mul_ref
  ------------------
 1233|  2.05k|    felem_mul(tmp2, ftmp6, ftmp2); /* tmp2[i] < 2^115 */
  ------------------
  |  |  772|  2.05k|# define felem_mul felem_mul_ref
  ------------------
 1234|  2.05k|    felem_scalar128(tmp2, 2);      /* tmp2[i] < 2^116 */
 1235|  2.05k|    felem_diff128(tmp, tmp2);      /* tmp[i] < 2^127 + 2^116 + 2^111 */
 1236|  2.05k|    felem_reduce(y_out, tmp);      /* y_out[i] < 2^56 */
  ------------------
  |  |  773|  2.05k|# define felem_reduce felem_reduce_ref
  ------------------
 1237|       |
 1238|  2.05k|    copy_conditional(x_out, x2, z1_is_zero);
 1239|  2.05k|    copy_conditional(x_out, x1, z2_is_zero);
 1240|  2.05k|    copy_conditional(y_out, y2, z1_is_zero);
 1241|  2.05k|    copy_conditional(y_out, y1, z2_is_zero);
 1242|  2.05k|    copy_conditional(z_out, z2, z1_is_zero);
 1243|  2.05k|    copy_conditional(z_out, z1, z2_is_zero);
 1244|  2.05k|    felem_assign(x3, x_out);
 1245|  2.05k|    felem_assign(y3, y_out);
 1246|  2.05k|    felem_assign(z3, z_out);
 1247|  2.05k|}
ecp_nistp384.c:felem_is_zero:
  865|  8.23k|{
  866|  8.23k|    limb zero, p384;
  867|       |
  868|  8.23k|    zero = in[0] | in[1] | in[2] | in[3] | in[4] | in[5] | in[6];
  869|  8.23k|    zero = ((int64_t) (zero) - 1) >> 63;
  870|  8.23k|    p384 = (in[0] ^ 0x000000ffffffff) | (in[1] ^ 0xffff0000000000)
  871|  8.23k|         | (in[2] ^ 0xfffffffffeffff) | (in[3] ^ 0xffffffffffffff)
  872|  8.23k|         | (in[4] ^ 0xffffffffffffff) | (in[5] ^ 0xffffffffffffff)
  873|  8.23k|         | (in[6] ^ 0xffffffffffff);
  874|  8.23k|    p384 = ((int64_t) (p384) - 1) >> 63;
  875|       |
  876|  8.23k|    return (zero | p384);
  877|  8.23k|}
ecp_nistp384.c:felem_sum64:
  186|  6.17k|{
  187|  6.17k|    unsigned int i;
  188|       |
  189|  49.3k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|  49.3k|#define NLIMBS 7
  ------------------
  |  Branch (189:17): [True: 43.2k, False: 6.17k]
  ------------------
  190|  43.2k|        out[i] += in[i];
  191|  6.17k|}
ecp_nistp384.c:felem_diff_128_64:
  306|  12.3k|{
  307|       |    /*
  308|       |     * In order to prevent underflow, we add a multiple of p before subtracting.
  309|       |     * Use telescopic sums to represent 2^16 * p redundantly with each limb
  310|       |     * of the form 2^64 + ...
  311|       |     */
  312|       |
  313|  12.3k|    static const widelimb two64m56m8 = (((widelimb) 1) << 64)
  314|  12.3k|                                     - (((widelimb) 1) << 56)
  315|  12.3k|                                     - (((widelimb) 1) << 8);
  316|  12.3k|    static const widelimb two64m32m8 = (((widelimb) 1) << 64)
  317|  12.3k|                                     - (((widelimb) 1) << 32)
  318|  12.3k|                                     - (((widelimb) 1) << 8);
  319|  12.3k|    static const widelimb two64m8 = (((widelimb) 1) << 64)
  320|  12.3k|                                  - (((widelimb) 1) << 8);
  321|  12.3k|    static const widelimb two64p48m16 = (((widelimb) 1) << 64)
  322|  12.3k|                                      + (((widelimb) 1) << 48)
  323|  12.3k|                                      - (((widelimb) 1) << 16);
  324|  12.3k|    unsigned int i;
  325|       |
  326|  12.3k|    out[0] += two64p48m16;
  327|  12.3k|    out[1] += two64m56m8;
  328|  12.3k|    out[2] += two64m32m8;
  329|  12.3k|    out[3] += two64m8;
  330|  12.3k|    out[4] += two64m8;
  331|  12.3k|    out[5] += two64m8;
  332|  12.3k|    out[6] += two64m8;
  333|       |
  334|  98.7k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|  98.7k|#define NLIMBS 7
  ------------------
  |  Branch (334:17): [True: 86.4k, False: 12.3k]
  ------------------
  335|  86.4k|        out[i] -= in[i];
  336|  12.3k|}
ecp_nistp384.c:felem_scalar64:
  204|  12.3k|{
  205|  12.3k|    unsigned int i;
  206|       |
  207|  98.7k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|  98.7k|#define NLIMBS 7
  ------------------
  |  Branch (207:17): [True: 86.4k, False: 12.3k]
  ------------------
  208|  86.4k|        out[i] *= scalar;
  209|  12.3k|}
ecp_nistp384.c:felem_diff64:
  273|  6.17k|{
  274|       |    /*
  275|       |     * In order to prevent underflow, we add a multiple of p before subtracting.
  276|       |     * Use telescopic sums to represent 2^12 * p redundantly with each limb
  277|       |     * of the form 2^60 + ...
  278|       |     */
  279|       |
  280|  6.17k|    static const limb two60m52m4 = (((limb) 1) << 60)
  281|  6.17k|                                 - (((limb) 1) << 52)
  282|  6.17k|                                 - (((limb) 1) << 4);
  283|  6.17k|    static const limb two60p44m12 = (((limb) 1) << 60)
  284|  6.17k|                                  + (((limb) 1) << 44)
  285|  6.17k|                                  - (((limb) 1) << 12);
  286|  6.17k|    static const limb two60m28m4 = (((limb) 1) << 60)
  287|  6.17k|                                 - (((limb) 1) << 28)
  288|  6.17k|                                 - (((limb) 1) << 4);
  289|  6.17k|    static const limb two60m4 = (((limb) 1) << 60)
  290|  6.17k|                              - (((limb) 1) << 4);
  291|       |
  292|  6.17k|    out[0] += two60p44m12 - in[0];
  293|  6.17k|    out[1] += two60m52m4 - in[1];
  294|  6.17k|    out[2] += two60m28m4 - in[2];
  295|  6.17k|    out[3] += two60m4 - in[3];
  296|  6.17k|    out[4] += two60m4 - in[4];
  297|  6.17k|    out[5] += two60m4 - in[5];
  298|  6.17k|    out[6] += two60m4 - in[6];
  299|  6.17k|}
ecp_nistp384.c:felem_scalar128:
  213|  4.11k|{
  214|  4.11k|    unsigned int i;
  215|       |
  216|  57.6k|    for (i = 0; i < 2*NLIMBS-1; i++)
  ------------------
  |  |  105|  57.6k|#define NLIMBS 7
  ------------------
  |  Branch (216:17): [True: 53.5k, False: 4.11k]
  ------------------
  217|  53.5k|        out[i] *= scalar;
  218|  4.11k|}
ecp_nistp384.c:felem_diff128:
  343|  4.11k|{
  344|       |    /*
  345|       |     * In order to prevent underflow, we add a multiple of p before subtracting.
  346|       |     * Use telescopic sums to represent 2^415 * p redundantly with each limb
  347|       |     * of the form 2^127 + ...
  348|       |     */
  349|       |
  350|  4.11k|    static const widelimb two127 = ((widelimb) 1) << 127;
  351|  4.11k|    static const widelimb two127m71 = (((widelimb) 1) << 127)
  352|  4.11k|                                    - (((widelimb) 1) << 71);
  353|  4.11k|    static const widelimb two127p111m79m71 = (((widelimb) 1) << 127)
  354|  4.11k|                                           + (((widelimb) 1) << 111)
  355|  4.11k|                                           - (((widelimb) 1) << 79)
  356|  4.11k|                                           - (((widelimb) 1) << 71);
  357|  4.11k|    static const widelimb two127m119m71 = (((widelimb) 1) << 127)
  358|  4.11k|                                        - (((widelimb) 1) << 119)
  359|  4.11k|                                        - (((widelimb) 1) << 71);
  360|  4.11k|    static const widelimb two127m95m71 = (((widelimb) 1) << 127)
  361|  4.11k|                                       - (((widelimb) 1) << 95)
  362|  4.11k|                                       - (((widelimb) 1) << 71);
  363|  4.11k|    unsigned int i;
  364|       |
  365|  4.11k|    out[0]  += two127;
  366|  4.11k|    out[1]  += two127m71;
  367|  4.11k|    out[2]  += two127m71;
  368|  4.11k|    out[3]  += two127m71;
  369|  4.11k|    out[4]  += two127m71;
  370|  4.11k|    out[5]  += two127m71;
  371|  4.11k|    out[6]  += two127p111m79m71;
  372|  4.11k|    out[7]  += two127m119m71;
  373|  4.11k|    out[8]  += two127m95m71;
  374|  4.11k|    out[9]  += two127m71;
  375|  4.11k|    out[10] += two127m71;
  376|  4.11k|    out[11] += two127m71;
  377|  4.11k|    out[12] += two127m71;
  378|       |
  379|  57.6k|    for (i = 0; i < 2*NLIMBS-1; i++)
  ------------------
  |  |  105|  57.6k|#define NLIMBS 7
  ------------------
  |  Branch (379:17): [True: 53.5k, False: 4.11k]
  ------------------
  380|  53.5k|        out[i] -= in[i];
  381|  4.11k|}
ecp_nistp384.c:copy_conditional:
 1089|  12.3k|{
 1090|  12.3k|    unsigned int i;
 1091|       |
 1092|  98.7k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|  98.7k|#define NLIMBS 7
  ------------------
  |  Branch (1092:17): [True: 86.4k, False: 12.3k]
  ------------------
 1093|  86.4k|        out[i] ^= mask & (in[i] ^ out[i]);
 1094|  12.3k|}
ecp_nistp384.c:point_double:
 1040|  2.05k|{
 1041|  2.05k|    widefelem tmp, tmp2;
 1042|  2.05k|    felem delta, gamma, beta, alpha, ftmp, ftmp2;
 1043|       |
 1044|  2.05k|    felem_assign(ftmp, x_in);
 1045|  2.05k|    felem_assign(ftmp2, x_in);
 1046|       |
 1047|       |    /* delta = z^2 */
 1048|  2.05k|    felem_square_reduce(delta, z_in);     /* delta[i] < 2^56 */
  ------------------
  |  |  775|  2.05k|# define felem_square_reduce felem_square_reduce_ref
  ------------------
 1049|       |
 1050|       |    /* gamma = y^2 */
 1051|  2.05k|    felem_square_reduce(gamma, y_in);     /* gamma[i] < 2^56 */
  ------------------
  |  |  775|  2.05k|# define felem_square_reduce felem_square_reduce_ref
  ------------------
 1052|       |
 1053|       |    /* beta = x*gamma */
 1054|  2.05k|    felem_mul_reduce(beta, x_in, gamma);  /* beta[i] < 2^56 */
  ------------------
  |  |  776|  2.05k|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1055|       |
 1056|       |    /* alpha = 3*(x-delta)*(x+delta) */
 1057|  2.05k|    felem_diff64(ftmp, delta);            /* ftmp[i] < 2^60 + 2^58 + 2^44 */
 1058|  2.05k|    felem_sum64(ftmp2, delta);            /* ftmp2[i] < 2^59 */
 1059|  2.05k|    felem_scalar64(ftmp2, 3);             /* ftmp2[i] < 2^61 */
 1060|  2.05k|    felem_mul_reduce(alpha, ftmp, ftmp2); /* alpha[i] < 2^56 */
  ------------------
  |  |  776|  2.05k|# define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1061|       |
 1062|       |    /* x' = alpha^2 - 8*beta */
 1063|  2.05k|    felem_square(tmp, alpha);             /* tmp[i] < 2^115 */
  ------------------
  |  |  771|  2.05k|# define felem_square felem_square_ref
  ------------------
 1064|  2.05k|    felem_assign(ftmp, beta);             /* ftmp[i] < 2^56 */
 1065|  2.05k|    felem_scalar64(ftmp, 8);              /* ftmp[i] < 2^59 */
 1066|  2.05k|    felem_diff_128_64(tmp, ftmp);         /* tmp[i] < 2^115 + 2^64 + 2^48 */
 1067|  2.05k|    felem_reduce(x_out, tmp);             /* x_out[i] < 2^56 */
  ------------------
  |  |  773|  2.05k|# define felem_reduce felem_reduce_ref
  ------------------
 1068|       |
 1069|       |    /* z' = (y + z)^2 - gamma - delta */
 1070|  2.05k|    felem_sum64(delta, gamma);     /* delta[i] < 2^57 */
 1071|  2.05k|    felem_assign(ftmp, y_in);      /* ftmp[i] < 2^56 */
 1072|  2.05k|    felem_sum64(ftmp, z_in);       /* ftmp[i] < 2^56 */
 1073|  2.05k|    felem_square(tmp, ftmp);       /* tmp[i] < 2^115 */
  ------------------
  |  |  771|  2.05k|# define felem_square felem_square_ref
  ------------------
 1074|  2.05k|    felem_diff_128_64(tmp, delta); /* tmp[i] < 2^115 + 2^64 + 2^48 */
 1075|  2.05k|    felem_reduce(z_out, tmp);      /* z_out[i] < 2^56 */
  ------------------
  |  |  773|  2.05k|# define felem_reduce felem_reduce_ref
  ------------------
 1076|       |
 1077|       |    /* y' = alpha*(4*beta - x') - 8*gamma^2 */
 1078|  2.05k|    felem_scalar64(beta, 4);       /* beta[i] < 2^58 */
 1079|  2.05k|    felem_diff64(beta, x_out);     /* beta[i] < 2^60 + 2^58 + 2^44 */
 1080|  2.05k|    felem_mul(tmp, alpha, beta);   /* tmp[i] < 2^119 */
  ------------------
  |  |  772|  2.05k|# define felem_mul felem_mul_ref
  ------------------
 1081|  2.05k|    felem_square(tmp2, gamma);     /* tmp2[i] < 2^115 */
  ------------------
  |  |  771|  2.05k|# define felem_square felem_square_ref
  ------------------
 1082|  2.05k|    felem_scalar128(tmp2, 8);      /* tmp2[i] < 2^118 */
 1083|  2.05k|    felem_diff128(tmp, tmp2);      /* tmp[i] < 2^127 + 2^119 + 2^111 */
 1084|  2.05k|    felem_reduce(y_out, tmp);      /* tmp[i] < 2^56 */
  ------------------
  |  |  773|  2.05k|# define felem_reduce felem_reduce_ref
  ------------------
 1085|  2.05k|}
ecp_nistp384.c:batch_mul:
 1414|     21|{
 1415|     21|    int i, skip;
 1416|     21|    unsigned int num, gen_mul = (g_scalar != NULL);
 1417|     21|    felem nq[3], tmp[4];
 1418|     21|    limb bits;
 1419|     21|    u8 sign, digit;
 1420|       |
 1421|       |    /* set nq to the point at infinity */
 1422|     21|    memset(nq, 0, sizeof(nq));
 1423|       |
 1424|       |    /*
 1425|       |     * Loop over all scalars msb-to-lsb, interleaving additions of multiples
 1426|       |     * of the generator (last quarter of rounds) and additions of other
 1427|       |     * points multiples (every 5th round).
 1428|       |     */
 1429|     21|    skip = 1;                   /* save two point operations in the first
 1430|       |                                 * round */
 1431|  2.10k|    for (i = (num_points ? 380 : 98); i >= 0; --i) {
  ------------------
  |  Branch (1431:15): [True: 0, False: 21]
  |  Branch (1431:39): [True: 2.07k, False: 21]
  ------------------
 1432|       |        /* double */
 1433|  2.07k|        if (!skip)
  ------------------
  |  Branch (1433:13): [True: 2.05k, False: 21]
  ------------------
 1434|  2.05k|            point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]);
 1435|       |
 1436|       |        /* add multiples of the generator */
 1437|  2.07k|        if (gen_mul && (i <= 98)) {
  ------------------
  |  Branch (1437:13): [True: 2.07k, False: 0]
  |  Branch (1437:24): [True: 2.07k, False: 0]
  ------------------
 1438|  2.07k|            bits = get_bit(g_scalar, i + 285) << 3;
 1439|  2.07k|            if (i < 95) {
  ------------------
  |  Branch (1439:17): [True: 1.99k, False: 84]
  ------------------
 1440|  1.99k|                bits |= get_bit(g_scalar, i + 190) << 2;
 1441|  1.99k|                bits |= get_bit(g_scalar, i + 95) << 1;
 1442|  1.99k|                bits |= get_bit(g_scalar, i);
 1443|  1.99k|            }
 1444|       |            /* select the point to add, in constant time */
 1445|  2.07k|            select_point(bits, 16, g_pre_comp, tmp);
 1446|  2.07k|            if (!skip) {
  ------------------
  |  Branch (1446:17): [True: 2.05k, False: 21]
  ------------------
 1447|       |                /* The 1 argument below is for "mixed" */
 1448|  2.05k|                point_add(nq[0],  nq[1],  nq[2],
 1449|  2.05k|                          nq[0],  nq[1],  nq[2], 1,
 1450|  2.05k|                          tmp[0], tmp[1], tmp[2]);
 1451|  2.05k|            } else {
 1452|     21|                memcpy(nq, tmp, 3 * sizeof(felem));
 1453|     21|                skip = 0;
 1454|     21|            }
 1455|  2.07k|        }
 1456|       |
 1457|       |        /* do other additions every 5 doublings */
 1458|  2.07k|        if (num_points && (i % 5 == 0)) {
  ------------------
  |  Branch (1458:13): [True: 0, False: 2.07k]
  |  Branch (1458:27): [True: 0, False: 0]
  ------------------
 1459|       |            /* loop over all scalars */
 1460|      0|            for (num = 0; num < num_points; ++num) {
  ------------------
  |  Branch (1460:27): [True: 0, False: 0]
  ------------------
 1461|      0|                bits = get_bit(scalars[num], i + 4) << 5;
 1462|      0|                bits |= get_bit(scalars[num], i + 3) << 4;
 1463|      0|                bits |= get_bit(scalars[num], i + 2) << 3;
 1464|      0|                bits |= get_bit(scalars[num], i + 1) << 2;
 1465|      0|                bits |= get_bit(scalars[num], i) << 1;
 1466|      0|                bits |= get_bit(scalars[num], i - 1);
 1467|      0|                ossl_ec_GFp_nistp_recode_scalar_bits(&sign, &digit, bits);
 1468|       |
 1469|       |                /*
 1470|       |                 * select the point to add or subtract, in constant time
 1471|       |                 */
 1472|      0|                select_point(digit, 17, pre_comp[num], tmp);
 1473|      0|                felem_neg(tmp[3], tmp[1]); /* (X, -Y, Z) is the negative
 1474|       |                                            * point */
 1475|      0|                copy_conditional(tmp[1], tmp[3], (-(limb) sign));
 1476|       |
 1477|      0|                if (!skip) {
  ------------------
  |  Branch (1477:21): [True: 0, False: 0]
  ------------------
 1478|      0|                    point_add(nq[0],  nq[1],  nq[2],
 1479|      0|                              nq[0],  nq[1],  nq[2], mixed,
 1480|      0|                              tmp[0], tmp[1], tmp[2]);
 1481|      0|                } else {
 1482|      0|                    memcpy(nq, tmp, 3 * sizeof(felem));
 1483|      0|                    skip = 0;
 1484|      0|                }
 1485|      0|            }
 1486|      0|        }
 1487|  2.07k|    }
 1488|     21|    felem_assign(x_out, nq[0]);
 1489|     21|    felem_assign(y_out, nq[1]);
 1490|     21|    felem_assign(z_out, nq[2]);
 1491|     21|}
ecp_nistp384.c:get_bit:
 1396|  8.06k|{
 1397|  8.06k|    if (i < 0 || i >= 384)
  ------------------
  |  Branch (1397:9): [True: 0, False: 8.06k]
  |  Branch (1397:18): [True: 0, False: 8.06k]
  ------------------
 1398|      0|        return 0;
 1399|  8.06k|    return (in[i >> 3] >> (i & 7)) & 1;
 1400|  8.06k|}
ecp_nistp384.c:select_point:
 1374|  2.07k|{
 1375|  2.07k|    unsigned int i, j;
 1376|  2.07k|    limb *outlimbs = &out[0][0];
 1377|       |
 1378|  2.07k|    memset(out, 0, sizeof(*out) * 3);
 1379|       |
 1380|  35.3k|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (1380:17): [True: 33.2k, False: 2.07k]
  ------------------
 1381|  33.2k|        const limb *inlimbs = &pre_comp[i][0][0];
 1382|  33.2k|        limb mask = i ^ idx;
 1383|       |
 1384|  33.2k|        mask |= mask >> 4;
 1385|  33.2k|        mask |= mask >> 2;
 1386|  33.2k|        mask |= mask >> 1;
 1387|  33.2k|        mask &= 1;
 1388|  33.2k|        mask--;
 1389|   731k|        for (j = 0; j < NLIMBS * 3; j++)
  ------------------
  |  |  105|   731k|#define NLIMBS 7
  ------------------
  |  Branch (1389:21): [True: 698k, False: 33.2k]
  ------------------
 1390|   698k|            outlimbs[j] |= inlimbs[j] & mask;
 1391|  33.2k|    }
 1392|  2.07k|}

EC_GFp_nistp521_method:
 1671|     83|{
 1672|     83|    static const EC_METHOD ret = {
 1673|     83|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|     83|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
 1674|     83|        NID_X9_62_prime_field,
  ------------------
  |  |  152|     83|#define NID_X9_62_prime_field           406
  ------------------
 1675|     83|        ossl_ec_GFp_nistp521_group_init,
 1676|     83|        ossl_ec_GFp_simple_group_finish,
 1677|     83|        ossl_ec_GFp_simple_group_clear_finish,
 1678|     83|        ossl_ec_GFp_nist_group_copy,
 1679|     83|        ossl_ec_GFp_nistp521_group_set_curve,
 1680|     83|        ossl_ec_GFp_simple_group_get_curve,
 1681|     83|        ossl_ec_GFp_simple_group_get_degree,
 1682|     83|        ossl_ec_group_simple_order_bits,
 1683|     83|        ossl_ec_GFp_simple_group_check_discriminant,
 1684|     83|        ossl_ec_GFp_simple_point_init,
 1685|     83|        ossl_ec_GFp_simple_point_finish,
 1686|     83|        ossl_ec_GFp_simple_point_clear_finish,
 1687|     83|        ossl_ec_GFp_simple_point_copy,
 1688|     83|        ossl_ec_GFp_simple_point_set_to_infinity,
 1689|     83|        ossl_ec_GFp_simple_point_set_affine_coordinates,
 1690|     83|        ossl_ec_GFp_nistp521_point_get_affine_coordinates,
 1691|     83|        0 /* point_set_compressed_coordinates */ ,
 1692|     83|        0 /* point2oct */ ,
 1693|     83|        0 /* oct2point */ ,
 1694|     83|        ossl_ec_GFp_simple_add,
 1695|     83|        ossl_ec_GFp_simple_dbl,
 1696|     83|        ossl_ec_GFp_simple_invert,
 1697|     83|        ossl_ec_GFp_simple_is_at_infinity,
 1698|     83|        ossl_ec_GFp_simple_is_on_curve,
 1699|     83|        ossl_ec_GFp_simple_cmp,
 1700|     83|        ossl_ec_GFp_simple_make_affine,
 1701|     83|        ossl_ec_GFp_simple_points_make_affine,
 1702|     83|        ossl_ec_GFp_nistp521_points_mul,
 1703|     83|        ossl_ec_GFp_nistp521_precompute_mult,
 1704|     83|        ossl_ec_GFp_nistp521_have_precompute_mult,
 1705|     83|        ossl_ec_GFp_nist_field_mul,
 1706|     83|        ossl_ec_GFp_nist_field_sqr,
 1707|     83|        0 /* field_div */ ,
 1708|     83|        ossl_ec_GFp_simple_field_inv,
 1709|     83|        0 /* field_encode */ ,
 1710|     83|        0 /* field_decode */ ,
 1711|     83|        0,                      /* field_set_to_one */
 1712|     83|        ossl_ec_key_simple_priv2oct,
 1713|     83|        ossl_ec_key_simple_oct2priv,
 1714|     83|        0, /* set private */
 1715|     83|        ossl_ec_key_simple_generate_key,
 1716|     83|        ossl_ec_key_simple_check_key,
 1717|     83|        ossl_ec_key_simple_generate_public_key,
 1718|     83|        0, /* keycopy */
 1719|     83|        0, /* keyfinish */
 1720|     83|        ossl_ecdh_simple_compute_key,
 1721|     83|        ossl_ecdsa_simple_sign_setup,
 1722|     83|        ossl_ecdsa_simple_sign_sig,
 1723|     83|        ossl_ecdsa_simple_verify_sig,
 1724|     83|        0, /* field_inverse_mod_ord */
 1725|     83|        0, /* blind_coordinates */
 1726|     83|        0, /* ladder_pre */
 1727|     83|        0, /* ladder_step */
 1728|     83|        0  /* ladder_post */
 1729|     83|    };
 1730|       |
 1731|     83|    return &ret;
 1732|     83|}
ossl_ec_GFp_nistp521_group_init:
 1784|    123|{
 1785|    123|    int ret;
 1786|    123|    ret = ossl_ec_GFp_simple_group_init(group);
 1787|    123|    group->a_is_minus3 = 1;
 1788|    123|    return ret;
 1789|    123|}
ossl_ec_GFp_nistp521_group_set_curve:
 1794|     83|{
 1795|     83|    int ret = 0;
 1796|     83|    BIGNUM *curve_p, *curve_a, *curve_b;
 1797|     83|#ifndef FIPS_MODULE
 1798|     83|    BN_CTX *new_ctx = NULL;
 1799|       |
 1800|     83|    if (ctx == NULL)
  ------------------
  |  Branch (1800:9): [True: 0, False: 83]
  ------------------
 1801|      0|        ctx = new_ctx = BN_CTX_new();
 1802|     83|#endif
 1803|     83|    if (ctx == NULL)
  ------------------
  |  Branch (1803:9): [True: 0, False: 83]
  ------------------
 1804|      0|        return 0;
 1805|       |
 1806|     83|    BN_CTX_start(ctx);
 1807|     83|    curve_p = BN_CTX_get(ctx);
 1808|     83|    curve_a = BN_CTX_get(ctx);
 1809|     83|    curve_b = BN_CTX_get(ctx);
 1810|     83|    if (curve_b == NULL)
  ------------------
  |  Branch (1810:9): [True: 0, False: 83]
  ------------------
 1811|      0|        goto err;
 1812|     83|    BN_bin2bn(nistp521_curve_params[0], sizeof(felem_bytearray), curve_p);
 1813|     83|    BN_bin2bn(nistp521_curve_params[1], sizeof(felem_bytearray), curve_a);
 1814|     83|    BN_bin2bn(nistp521_curve_params[2], sizeof(felem_bytearray), curve_b);
 1815|     83|    if ((BN_cmp(curve_p, p)) || (BN_cmp(curve_a, a)) || (BN_cmp(curve_b, b))) {
  ------------------
  |  Branch (1815:9): [True: 0, False: 83]
  |  Branch (1815:33): [True: 0, False: 83]
  |  Branch (1815:57): [True: 0, False: 83]
  ------------------
 1816|      0|        ERR_raise(ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1817|      0|        goto err;
 1818|      0|    }
 1819|     83|    group->field_mod_func = BN_nist_mod_521;
 1820|     83|    ret = ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
 1821|     83| err:
 1822|     83|    BN_CTX_end(ctx);
 1823|     83|#ifndef FIPS_MODULE
 1824|     83|    BN_CTX_free(new_ctx);
 1825|     83|#endif
 1826|     83|    return ret;
 1827|     83|}
ossl_ec_GFp_nistp521_point_get_affine_coordinates:
 1837|     21|{
 1838|     21|    felem z1, z2, x_in, y_in, x_out, y_out;
 1839|     21|    largefelem tmp;
 1840|       |
 1841|     21|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (1841:9): [True: 0, False: 21]
  ------------------
 1842|      0|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1843|      0|        return 0;
 1844|      0|    }
 1845|     21|    if ((!BN_to_felem(x_in, point->X)) || (!BN_to_felem(y_in, point->Y)) ||
  ------------------
  |  Branch (1845:9): [True: 0, False: 21]
  |  Branch (1845:43): [True: 0, False: 21]
  ------------------
 1846|     21|        (!BN_to_felem(z1, point->Z)))
  ------------------
  |  Branch (1846:9): [True: 0, False: 21]
  ------------------
 1847|      0|        return 0;
 1848|     21|    felem_inv(z2, z1);
 1849|     21|    felem_square(tmp, z2);
  ------------------
  |  |  725|     21|# define felem_square felem_square_ref
  ------------------
 1850|     21|    felem_reduce(z1, tmp);
 1851|     21|    felem_mul(tmp, x_in, z1);
  ------------------
  |  |  726|     21|# define felem_mul felem_mul_ref
  ------------------
 1852|     21|    felem_reduce(x_in, tmp);
 1853|     21|    felem_contract(x_out, x_in);
 1854|     21|    if (x != NULL) {
  ------------------
  |  Branch (1854:9): [True: 21, False: 0]
  ------------------
 1855|     21|        if (!felem_to_BN(x, x_out)) {
  ------------------
  |  Branch (1855:13): [True: 0, False: 21]
  ------------------
 1856|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1857|      0|            return 0;
 1858|      0|        }
 1859|     21|    }
 1860|     21|    felem_mul(tmp, z1, z2);
  ------------------
  |  |  726|     21|# define felem_mul felem_mul_ref
  ------------------
 1861|     21|    felem_reduce(z1, tmp);
 1862|     21|    felem_mul(tmp, y_in, z1);
  ------------------
  |  |  726|     21|# define felem_mul felem_mul_ref
  ------------------
 1863|     21|    felem_reduce(y_in, tmp);
 1864|     21|    felem_contract(y_out, y_in);
 1865|     21|    if (y != NULL) {
  ------------------
  |  Branch (1865:9): [True: 21, False: 0]
  ------------------
 1866|     21|        if (!felem_to_BN(y, y_out)) {
  ------------------
  |  Branch (1866:13): [True: 0, False: 21]
  ------------------
 1867|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1868|      0|            return 0;
 1869|      0|        }
 1870|     21|    }
 1871|     21|    return 1;
 1872|     21|}
ossl_ec_GFp_nistp521_points_mul:
 1912|     32|{
 1913|     32|    int ret = 0;
 1914|     32|    int j;
 1915|     32|    int mixed = 0;
 1916|     32|    BIGNUM *x, *y, *z, *tmp_scalar;
 1917|     32|    felem_bytearray g_secret;
 1918|     32|    felem_bytearray *secrets = NULL;
 1919|     32|    felem (*pre_comp)[17][3] = NULL;
 1920|     32|    felem *tmp_felems = NULL;
 1921|     32|    unsigned i;
 1922|     32|    int num_bytes;
 1923|     32|    int have_pre_comp = 0;
 1924|     32|    size_t num_points = num;
 1925|     32|    felem x_in, y_in, z_in, x_out, y_out, z_out;
 1926|     32|    NISTP521_PRE_COMP *pre = NULL;
 1927|     32|    felem(*g_pre_comp)[3] = NULL;
 1928|     32|    EC_POINT *generator = NULL;
 1929|     32|    const EC_POINT *p = NULL;
 1930|     32|    const BIGNUM *p_scalar = NULL;
 1931|       |
 1932|     32|    BN_CTX_start(ctx);
 1933|     32|    x = BN_CTX_get(ctx);
 1934|     32|    y = BN_CTX_get(ctx);
 1935|     32|    z = BN_CTX_get(ctx);
 1936|     32|    tmp_scalar = BN_CTX_get(ctx);
 1937|     32|    if (tmp_scalar == NULL)
  ------------------
  |  Branch (1937:9): [True: 0, False: 32]
  ------------------
 1938|      0|        goto err;
 1939|       |
 1940|     32|    if (scalar != NULL) {
  ------------------
  |  Branch (1940:9): [True: 32, False: 0]
  ------------------
 1941|     32|        pre = group->pre_comp.nistp521;
 1942|     32|        if (pre)
  ------------------
  |  Branch (1942:13): [True: 0, False: 32]
  ------------------
 1943|       |            /* we have precomputation, try to use it */
 1944|      0|            g_pre_comp = &pre->g_pre_comp[0];
 1945|     32|        else
 1946|       |            /* try to use the standard precomputation */
 1947|     32|            g_pre_comp = (felem(*)[3]) gmul;
 1948|     32|        generator = EC_POINT_new(group);
 1949|     32|        if (generator == NULL)
  ------------------
  |  Branch (1949:13): [True: 0, False: 32]
  ------------------
 1950|      0|            goto err;
 1951|       |        /* get the generator from precomputation */
 1952|     32|        if (!felem_to_BN(x, g_pre_comp[1][0]) ||
  ------------------
  |  Branch (1952:13): [True: 0, False: 32]
  ------------------
 1953|     32|            !felem_to_BN(y, g_pre_comp[1][1]) ||
  ------------------
  |  Branch (1953:13): [True: 0, False: 32]
  ------------------
 1954|     32|            !felem_to_BN(z, g_pre_comp[1][2])) {
  ------------------
  |  Branch (1954:13): [True: 0, False: 32]
  ------------------
 1955|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1956|      0|            goto err;
 1957|      0|        }
 1958|     32|        if (!ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group,
  ------------------
  |  Branch (1958:13): [True: 0, False: 32]
  ------------------
 1959|     32|                                                                generator,
 1960|     32|                                                                x, y, z, ctx))
 1961|      0|            goto err;
 1962|     32|        if (0 == EC_POINT_cmp(group, generator, group->generator, ctx))
  ------------------
  |  Branch (1962:13): [True: 32, False: 0]
  ------------------
 1963|       |            /* precomputation matches generator */
 1964|     32|            have_pre_comp = 1;
 1965|      0|        else
 1966|       |            /*
 1967|       |             * we don't have valid precomputation: treat the generator as a
 1968|       |             * random point
 1969|       |             */
 1970|      0|            num_points++;
 1971|     32|    }
 1972|       |
 1973|     32|    if (num_points > 0) {
  ------------------
  |  Branch (1973:9): [True: 0, False: 32]
  ------------------
 1974|      0|        if (num_points >= 2) {
  ------------------
  |  Branch (1974:13): [True: 0, False: 0]
  ------------------
 1975|       |            /*
 1976|       |             * unless we precompute multiples for just one point, converting
 1977|       |             * those into affine form is time well spent
 1978|       |             */
 1979|      0|            mixed = 1;
 1980|      0|        }
 1981|      0|        secrets = OPENSSL_zalloc(sizeof(*secrets) * num_points);
  ------------------
  |  |  104|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1982|      0|        pre_comp = OPENSSL_zalloc(sizeof(*pre_comp) * num_points);
  ------------------
  |  |  104|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1983|      0|        if (mixed)
  ------------------
  |  Branch (1983:13): [True: 0, False: 0]
  ------------------
 1984|      0|            tmp_felems =
 1985|      0|                OPENSSL_malloc(sizeof(*tmp_felems) * (num_points * 17 + 1));
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1986|      0|        if ((secrets == NULL) || (pre_comp == NULL)
  ------------------
  |  Branch (1986:13): [True: 0, False: 0]
  |  Branch (1986:34): [True: 0, False: 0]
  ------------------
 1987|      0|            || (mixed && (tmp_felems == NULL)))
  ------------------
  |  Branch (1987:17): [True: 0, False: 0]
  |  Branch (1987:26): [True: 0, False: 0]
  ------------------
 1988|      0|            goto err;
 1989|       |
 1990|       |        /*
 1991|       |         * we treat NULL scalars as 0, and NULL points as points at infinity,
 1992|       |         * i.e., they contribute nothing to the linear combination
 1993|       |         */
 1994|      0|        for (i = 0; i < num_points; ++i) {
  ------------------
  |  Branch (1994:21): [True: 0, False: 0]
  ------------------
 1995|      0|            if (i == num) {
  ------------------
  |  Branch (1995:17): [True: 0, False: 0]
  ------------------
 1996|       |                /*
 1997|       |                 * we didn't have a valid precomputation, so we pick the
 1998|       |                 * generator
 1999|       |                 */
 2000|      0|                p = EC_GROUP_get0_generator(group);
 2001|      0|                p_scalar = scalar;
 2002|      0|            } else {
 2003|       |                /* the i^th point */
 2004|      0|                p = points[i];
 2005|      0|                p_scalar = scalars[i];
 2006|      0|            }
 2007|      0|            if ((p_scalar != NULL) && (p != NULL)) {
  ------------------
  |  Branch (2007:17): [True: 0, False: 0]
  |  Branch (2007:39): [True: 0, False: 0]
  ------------------
 2008|       |                /* reduce scalar to 0 <= scalar < 2^521 */
 2009|      0|                if ((BN_num_bits(p_scalar) > 521)
  ------------------
  |  Branch (2009:21): [True: 0, False: 0]
  ------------------
 2010|      0|                    || (BN_is_negative(p_scalar))) {
  ------------------
  |  Branch (2010:24): [True: 0, False: 0]
  ------------------
 2011|       |                    /*
 2012|       |                     * this is an unusual input, and we don't guarantee
 2013|       |                     * constant-timeness
 2014|       |                     */
 2015|      0|                    if (!BN_nnmod(tmp_scalar, p_scalar, group->order, ctx)) {
  ------------------
  |  Branch (2015:25): [True: 0, False: 0]
  ------------------
 2016|      0|                        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 2017|      0|                        goto err;
 2018|      0|                    }
 2019|      0|                    num_bytes = BN_bn2lebinpad(tmp_scalar,
 2020|      0|                                               secrets[i], sizeof(secrets[i]));
 2021|      0|                } else {
 2022|      0|                    num_bytes = BN_bn2lebinpad(p_scalar,
 2023|      0|                                               secrets[i], sizeof(secrets[i]));
 2024|      0|                }
 2025|      0|                if (num_bytes < 0) {
  ------------------
  |  Branch (2025:21): [True: 0, False: 0]
  ------------------
 2026|      0|                    ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 2027|      0|                    goto err;
 2028|      0|                }
 2029|       |                /* precompute multiples */
 2030|      0|                if ((!BN_to_felem(x_out, p->X)) ||
  ------------------
  |  Branch (2030:21): [True: 0, False: 0]
  ------------------
 2031|      0|                    (!BN_to_felem(y_out, p->Y)) ||
  ------------------
  |  Branch (2031:21): [True: 0, False: 0]
  ------------------
 2032|      0|                    (!BN_to_felem(z_out, p->Z)))
  ------------------
  |  Branch (2032:21): [True: 0, False: 0]
  ------------------
 2033|      0|                    goto err;
 2034|      0|                memcpy(pre_comp[i][1][0], x_out, sizeof(felem));
 2035|      0|                memcpy(pre_comp[i][1][1], y_out, sizeof(felem));
 2036|      0|                memcpy(pre_comp[i][1][2], z_out, sizeof(felem));
 2037|      0|                for (j = 2; j <= 16; ++j) {
  ------------------
  |  Branch (2037:29): [True: 0, False: 0]
  ------------------
 2038|      0|                    if (j & 1) {
  ------------------
  |  Branch (2038:25): [True: 0, False: 0]
  ------------------
 2039|      0|                        point_add(pre_comp[i][j][0], pre_comp[i][j][1],
 2040|      0|                                  pre_comp[i][j][2], pre_comp[i][1][0],
 2041|      0|                                  pre_comp[i][1][1], pre_comp[i][1][2], 0,
 2042|      0|                                  pre_comp[i][j - 1][0],
 2043|      0|                                  pre_comp[i][j - 1][1],
 2044|      0|                                  pre_comp[i][j - 1][2]);
 2045|      0|                    } else {
 2046|      0|                        point_double(pre_comp[i][j][0], pre_comp[i][j][1],
 2047|      0|                                     pre_comp[i][j][2], pre_comp[i][j / 2][0],
 2048|      0|                                     pre_comp[i][j / 2][1],
 2049|      0|                                     pre_comp[i][j / 2][2]);
 2050|      0|                    }
 2051|      0|                }
 2052|      0|            }
 2053|      0|        }
 2054|      0|        if (mixed)
  ------------------
  |  Branch (2054:13): [True: 0, False: 0]
  ------------------
 2055|      0|            make_points_affine(num_points * 17, pre_comp[0], tmp_felems);
 2056|      0|    }
 2057|       |
 2058|       |    /* the scalar for the generator */
 2059|     32|    if ((scalar != NULL) && (have_pre_comp)) {
  ------------------
  |  Branch (2059:9): [True: 32, False: 0]
  |  Branch (2059:29): [True: 32, False: 0]
  ------------------
 2060|     32|        memset(g_secret, 0, sizeof(g_secret));
 2061|       |        /* reduce scalar to 0 <= scalar < 2^521 */
 2062|     32|        if ((BN_num_bits(scalar) > 521) || (BN_is_negative(scalar))) {
  ------------------
  |  Branch (2062:13): [True: 10, False: 22]
  |  Branch (2062:44): [True: 0, False: 22]
  ------------------
 2063|       |            /*
 2064|       |             * this is an unusual input, and we don't guarantee
 2065|       |             * constant-timeness
 2066|       |             */
 2067|     10|            if (!BN_nnmod(tmp_scalar, scalar, group->order, ctx)) {
  ------------------
  |  Branch (2067:17): [True: 0, False: 10]
  ------------------
 2068|      0|                ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 2069|      0|                goto err;
 2070|      0|            }
 2071|     10|            num_bytes = BN_bn2lebinpad(tmp_scalar, g_secret, sizeof(g_secret));
 2072|     22|        } else {
 2073|     22|            num_bytes = BN_bn2lebinpad(scalar, g_secret, sizeof(g_secret));
 2074|     22|        }
 2075|       |        /* do the multiplication with generator precomputation */
 2076|     32|        batch_mul(x_out, y_out, z_out,
 2077|     32|                  (const felem_bytearray(*))secrets, num_points,
 2078|     32|                  g_secret,
 2079|     32|                  mixed, (const felem(*)[17][3])pre_comp,
 2080|     32|                  (const felem(*)[3])g_pre_comp);
 2081|     32|    } else {
 2082|       |        /* do the multiplication without generator precomputation */
 2083|      0|        batch_mul(x_out, y_out, z_out,
 2084|      0|                  (const felem_bytearray(*))secrets, num_points,
 2085|      0|                  NULL, mixed, (const felem(*)[17][3])pre_comp, NULL);
 2086|      0|    }
 2087|       |    /* reduce the output to its unique minimal representation */
 2088|     32|    felem_contract(x_in, x_out);
 2089|     32|    felem_contract(y_in, y_out);
 2090|     32|    felem_contract(z_in, z_out);
 2091|     32|    if ((!felem_to_BN(x, x_in)) || (!felem_to_BN(y, y_in)) ||
  ------------------
  |  Branch (2091:9): [True: 0, False: 32]
  |  Branch (2091:36): [True: 0, False: 32]
  ------------------
 2092|     32|        (!felem_to_BN(z, z_in))) {
  ------------------
  |  Branch (2092:9): [True: 0, False: 32]
  ------------------
 2093|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 2094|      0|        goto err;
 2095|      0|    }
 2096|     32|    ret = ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group, r, x, y, z,
 2097|     32|                                                             ctx);
 2098|       |
 2099|     32| err:
 2100|     32|    BN_CTX_end(ctx);
 2101|     32|    EC_POINT_free(generator);
 2102|     32|    OPENSSL_free(secrets);
  ------------------
  |  |  115|     32|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     32|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     32|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2103|     32|    OPENSSL_free(pre_comp);
  ------------------
  |  |  115|     32|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     32|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     32|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2104|     32|    OPENSSL_free(tmp_felems);
  ------------------
  |  |  115|     32|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     32|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     32|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2105|     32|    return ret;
 2106|     32|}
ecp_nistp521.c:BN_to_felem:
  176|     63|{
  177|     63|    felem_bytearray b_out;
  178|     63|    int num_bytes;
  179|       |
  180|     63|    if (BN_is_negative(bn)) {
  ------------------
  |  Branch (180:9): [True: 0, False: 63]
  ------------------
  181|      0|        ERR_raise(ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  182|      0|        return 0;
  183|      0|    }
  184|     63|    num_bytes = BN_bn2lebinpad(bn, b_out, sizeof(b_out));
  185|     63|    if (num_bytes < 0) {
  ------------------
  |  Branch (185:9): [True: 0, False: 63]
  ------------------
  186|      0|        ERR_raise(ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  187|      0|        return 0;
  188|      0|    }
  189|     63|    bin66_to_felem(out, b_out);
  190|     63|    return 1;
  191|     63|}
ecp_nistp521.c:bin66_to_felem:
  144|     63|{
  145|     63|    out[0] = (*((limb *) & in[0])) & bottom58bits;
  146|     63|    out[1] = (*((limb_aX *) & in[7]) >> 2) & bottom58bits;
  147|     63|    out[2] = (*((limb_aX *) & in[14]) >> 4) & bottom58bits;
  148|     63|    out[3] = (*((limb_aX *) & in[21]) >> 6) & bottom58bits;
  149|     63|    out[4] = (*((limb_aX *) & in[29])) & bottom58bits;
  150|     63|    out[5] = (*((limb_aX *) & in[36]) >> 2) & bottom58bits;
  151|     63|    out[6] = (*((limb_aX *) & in[43]) >> 4) & bottom58bits;
  152|     63|    out[7] = (*((limb_aX *) & in[50]) >> 6) & bottom58bits;
  153|     63|    out[8] = (*((limb_aX *) & in[58])) & bottom57bits;
  154|     63|}
ecp_nistp521.c:felem_inv:
  752|     21|{
  753|     21|    felem ftmp, ftmp2, ftmp3, ftmp4;
  754|     21|    largefelem tmp;
  755|     21|    unsigned i;
  756|       |
  757|     21|    felem_square(tmp, in);
  ------------------
  |  |  725|     21|# define felem_square felem_square_ref
  ------------------
  758|     21|    felem_reduce(ftmp, tmp);    /* 2^1 */
  759|     21|    felem_mul(tmp, in, ftmp);
  ------------------
  |  |  726|     21|# define felem_mul felem_mul_ref
  ------------------
  760|     21|    felem_reduce(ftmp, tmp);    /* 2^2 - 2^0 */
  761|     21|    felem_assign(ftmp2, ftmp);
  762|     21|    felem_square(tmp, ftmp);
  ------------------
  |  |  725|     21|# define felem_square felem_square_ref
  ------------------
  763|     21|    felem_reduce(ftmp, tmp);    /* 2^3 - 2^1 */
  764|     21|    felem_mul(tmp, in, ftmp);
  ------------------
  |  |  726|     21|# define felem_mul felem_mul_ref
  ------------------
  765|     21|    felem_reduce(ftmp, tmp);    /* 2^3 - 2^0 */
  766|     21|    felem_square(tmp, ftmp);
  ------------------
  |  |  725|     21|# define felem_square felem_square_ref
  ------------------
  767|     21|    felem_reduce(ftmp, tmp);    /* 2^4 - 2^1 */
  768|       |
  769|     21|    felem_square(tmp, ftmp2);
  ------------------
  |  |  725|     21|# define felem_square felem_square_ref
  ------------------
  770|     21|    felem_reduce(ftmp3, tmp);   /* 2^3 - 2^1 */
  771|     21|    felem_square(tmp, ftmp3);
  ------------------
  |  |  725|     21|# define felem_square felem_square_ref
  ------------------
  772|     21|    felem_reduce(ftmp3, tmp);   /* 2^4 - 2^2 */
  773|     21|    felem_mul(tmp, ftmp3, ftmp2);
  ------------------
  |  |  726|     21|# define felem_mul felem_mul_ref
  ------------------
  774|     21|    felem_reduce(ftmp3, tmp);   /* 2^4 - 2^0 */
  775|       |
  776|     21|    felem_assign(ftmp2, ftmp3);
  777|     21|    felem_square(tmp, ftmp3);
  ------------------
  |  |  725|     21|# define felem_square felem_square_ref
  ------------------
  778|     21|    felem_reduce(ftmp3, tmp);   /* 2^5 - 2^1 */
  779|     21|    felem_square(tmp, ftmp3);
  ------------------
  |  |  725|     21|# define felem_square felem_square_ref
  ------------------
  780|     21|    felem_reduce(ftmp3, tmp);   /* 2^6 - 2^2 */
  781|     21|    felem_square(tmp, ftmp3);
  ------------------
  |  |  725|     21|# define felem_square felem_square_ref
  ------------------
  782|     21|    felem_reduce(ftmp3, tmp);   /* 2^7 - 2^3 */
  783|     21|    felem_square(tmp, ftmp3);
  ------------------
  |  |  725|     21|# define felem_square felem_square_ref
  ------------------
  784|     21|    felem_reduce(ftmp3, tmp);   /* 2^8 - 2^4 */
  785|     21|    felem_mul(tmp, ftmp3, ftmp);
  ------------------
  |  |  726|     21|# define felem_mul felem_mul_ref
  ------------------
  786|     21|    felem_reduce(ftmp4, tmp);   /* 2^8 - 2^1 */
  787|     21|    felem_square(tmp, ftmp4);
  ------------------
  |  |  725|     21|# define felem_square felem_square_ref
  ------------------
  788|     21|    felem_reduce(ftmp4, tmp);   /* 2^9 - 2^2 */
  789|     21|    felem_mul(tmp, ftmp3, ftmp2);
  ------------------
  |  |  726|     21|# define felem_mul felem_mul_ref
  ------------------
  790|     21|    felem_reduce(ftmp3, tmp);   /* 2^8 - 2^0 */
  791|     21|    felem_assign(ftmp2, ftmp3);
  792|       |
  793|    189|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (793:17): [True: 168, False: 21]
  ------------------
  794|    168|        felem_square(tmp, ftmp3);
  ------------------
  |  |  725|    168|# define felem_square felem_square_ref
  ------------------
  795|    168|        felem_reduce(ftmp3, tmp); /* 2^16 - 2^8 */
  796|    168|    }
  797|     21|    felem_mul(tmp, ftmp3, ftmp2);
  ------------------
  |  |  726|     21|# define felem_mul felem_mul_ref
  ------------------
  798|     21|    felem_reduce(ftmp3, tmp);   /* 2^16 - 2^0 */
  799|     21|    felem_assign(ftmp2, ftmp3);
  800|       |
  801|    357|    for (i = 0; i < 16; i++) {
  ------------------
  |  Branch (801:17): [True: 336, False: 21]
  ------------------
  802|    336|        felem_square(tmp, ftmp3);
  ------------------
  |  |  725|    336|# define felem_square felem_square_ref
  ------------------
  803|    336|        felem_reduce(ftmp3, tmp); /* 2^32 - 2^16 */
  804|    336|    }
  805|     21|    felem_mul(tmp, ftmp3, ftmp2);
  ------------------
  |  |  726|     21|# define felem_mul felem_mul_ref
  ------------------
  806|     21|    felem_reduce(ftmp3, tmp);   /* 2^32 - 2^0 */
  807|     21|    felem_assign(ftmp2, ftmp3);
  808|       |
  809|    693|    for (i = 0; i < 32; i++) {
  ------------------
  |  Branch (809:17): [True: 672, False: 21]
  ------------------
  810|    672|        felem_square(tmp, ftmp3);
  ------------------
  |  |  725|    672|# define felem_square felem_square_ref
  ------------------
  811|    672|        felem_reduce(ftmp3, tmp); /* 2^64 - 2^32 */
  812|    672|    }
  813|     21|    felem_mul(tmp, ftmp3, ftmp2);
  ------------------
  |  |  726|     21|# define felem_mul felem_mul_ref
  ------------------
  814|     21|    felem_reduce(ftmp3, tmp);   /* 2^64 - 2^0 */
  815|     21|    felem_assign(ftmp2, ftmp3);
  816|       |
  817|  1.36k|    for (i = 0; i < 64; i++) {
  ------------------
  |  Branch (817:17): [True: 1.34k, False: 21]
  ------------------
  818|  1.34k|        felem_square(tmp, ftmp3);
  ------------------
  |  |  725|  1.34k|# define felem_square felem_square_ref
  ------------------
  819|  1.34k|        felem_reduce(ftmp3, tmp); /* 2^128 - 2^64 */
  820|  1.34k|    }
  821|     21|    felem_mul(tmp, ftmp3, ftmp2);
  ------------------
  |  |  726|     21|# define felem_mul felem_mul_ref
  ------------------
  822|     21|    felem_reduce(ftmp3, tmp);   /* 2^128 - 2^0 */
  823|     21|    felem_assign(ftmp2, ftmp3);
  824|       |
  825|  2.70k|    for (i = 0; i < 128; i++) {
  ------------------
  |  Branch (825:17): [True: 2.68k, False: 21]
  ------------------
  826|  2.68k|        felem_square(tmp, ftmp3);
  ------------------
  |  |  725|  2.68k|# define felem_square felem_square_ref
  ------------------
  827|  2.68k|        felem_reduce(ftmp3, tmp); /* 2^256 - 2^128 */
  828|  2.68k|    }
  829|     21|    felem_mul(tmp, ftmp3, ftmp2);
  ------------------
  |  |  726|     21|# define felem_mul felem_mul_ref
  ------------------
  830|     21|    felem_reduce(ftmp3, tmp);   /* 2^256 - 2^0 */
  831|     21|    felem_assign(ftmp2, ftmp3);
  832|       |
  833|  5.39k|    for (i = 0; i < 256; i++) {
  ------------------
  |  Branch (833:17): [True: 5.37k, False: 21]
  ------------------
  834|  5.37k|        felem_square(tmp, ftmp3);
  ------------------
  |  |  725|  5.37k|# define felem_square felem_square_ref
  ------------------
  835|  5.37k|        felem_reduce(ftmp3, tmp); /* 2^512 - 2^256 */
  836|  5.37k|    }
  837|     21|    felem_mul(tmp, ftmp3, ftmp2);
  ------------------
  |  |  726|     21|# define felem_mul felem_mul_ref
  ------------------
  838|     21|    felem_reduce(ftmp3, tmp);   /* 2^512 - 2^0 */
  839|       |
  840|    210|    for (i = 0; i < 9; i++) {
  ------------------
  |  Branch (840:17): [True: 189, False: 21]
  ------------------
  841|    189|        felem_square(tmp, ftmp3);
  ------------------
  |  |  725|    189|# define felem_square felem_square_ref
  ------------------
  842|    189|        felem_reduce(ftmp3, tmp); /* 2^521 - 2^9 */
  843|    189|    }
  844|     21|    felem_mul(tmp, ftmp3, ftmp4);
  ------------------
  |  |  726|     21|# define felem_mul felem_mul_ref
  ------------------
  845|     21|    felem_reduce(ftmp3, tmp);   /* 2^521 - 2^2 */
  846|     21|    felem_mul(tmp, ftmp3, in);
  ------------------
  |  |  726|     21|# define felem_mul felem_mul_ref
  ------------------
  847|     21|    felem_reduce(out, tmp);     /* 2^521 - 3 */
  848|     21|}
ecp_nistp521.c:felem_assign:
  220|  62.8k|{
  221|  62.8k|    out[0] = in[0];
  222|  62.8k|    out[1] = in[1];
  223|  62.8k|    out[2] = in[2];
  224|  62.8k|    out[3] = in[3];
  225|  62.8k|    out[4] = in[4];
  226|  62.8k|    out[5] = in[5];
  227|  62.8k|    out[6] = in[6];
  228|  62.8k|    out[7] = in[7];
  229|  62.8k|    out[8] = in[8];
  230|  62.8k|}
ecp_nistp521.c:felem_square_ref:
  405|  44.2k|{
  406|  44.2k|    felem inx2, inx4;
  407|  44.2k|    felem_scalar(inx2, in, 2);
  408|  44.2k|    felem_scalar(inx4, in, 4);
  409|       |
  410|       |    /*-
  411|       |     * We have many cases were we want to do
  412|       |     *   in[x] * in[y] +
  413|       |     *   in[y] * in[x]
  414|       |     * This is obviously just
  415|       |     *   2 * in[x] * in[y]
  416|       |     * However, rather than do the doubling on the 128 bit result, we
  417|       |     * double one of the inputs to the multiplication by reading from
  418|       |     * |inx2|
  419|       |     */
  420|       |
  421|  44.2k|    out[0] = ((uint128_t) in[0]) * in[0];
  422|  44.2k|    out[1] = ((uint128_t) in[0]) * inx2[1];
  423|  44.2k|    out[2] = ((uint128_t) in[0]) * inx2[2] + ((uint128_t) in[1]) * in[1];
  424|  44.2k|    out[3] = ((uint128_t) in[0]) * inx2[3] + ((uint128_t) in[1]) * inx2[2];
  425|  44.2k|    out[4] = ((uint128_t) in[0]) * inx2[4] +
  426|  44.2k|             ((uint128_t) in[1]) * inx2[3] + ((uint128_t) in[2]) * in[2];
  427|  44.2k|    out[5] = ((uint128_t) in[0]) * inx2[5] +
  428|  44.2k|             ((uint128_t) in[1]) * inx2[4] + ((uint128_t) in[2]) * inx2[3];
  429|  44.2k|    out[6] = ((uint128_t) in[0]) * inx2[6] +
  430|  44.2k|             ((uint128_t) in[1]) * inx2[5] +
  431|  44.2k|             ((uint128_t) in[2]) * inx2[4] + ((uint128_t) in[3]) * in[3];
  432|  44.2k|    out[7] = ((uint128_t) in[0]) * inx2[7] +
  433|  44.2k|             ((uint128_t) in[1]) * inx2[6] +
  434|  44.2k|             ((uint128_t) in[2]) * inx2[5] + ((uint128_t) in[3]) * inx2[4];
  435|  44.2k|    out[8] = ((uint128_t) in[0]) * inx2[8] +
  436|  44.2k|             ((uint128_t) in[1]) * inx2[7] +
  437|  44.2k|             ((uint128_t) in[2]) * inx2[6] +
  438|  44.2k|             ((uint128_t) in[3]) * inx2[5] + ((uint128_t) in[4]) * in[4];
  439|       |
  440|       |    /*
  441|       |     * The remaining limbs fall above 2^521, with the first falling at 2^522.
  442|       |     * They correspond to locations one bit up from the limbs produced above
  443|       |     * so we would have to multiply by two to align them. Again, rather than
  444|       |     * operate on the 128-bit result, we double one of the inputs to the
  445|       |     * multiplication. If we want to double for both this reason, and the
  446|       |     * reason above, then we end up multiplying by four.
  447|       |     */
  448|       |
  449|       |    /* 9 */
  450|  44.2k|    out[0] += ((uint128_t) in[1]) * inx4[8] +
  451|  44.2k|              ((uint128_t) in[2]) * inx4[7] +
  452|  44.2k|              ((uint128_t) in[3]) * inx4[6] + ((uint128_t) in[4]) * inx4[5];
  453|       |
  454|       |    /* 10 */
  455|  44.2k|    out[1] += ((uint128_t) in[2]) * inx4[8] +
  456|  44.2k|              ((uint128_t) in[3]) * inx4[7] +
  457|  44.2k|              ((uint128_t) in[4]) * inx4[6] + ((uint128_t) in[5]) * inx2[5];
  458|       |
  459|       |    /* 11 */
  460|  44.2k|    out[2] += ((uint128_t) in[3]) * inx4[8] +
  461|  44.2k|              ((uint128_t) in[4]) * inx4[7] + ((uint128_t) in[5]) * inx4[6];
  462|       |
  463|       |    /* 12 */
  464|  44.2k|    out[3] += ((uint128_t) in[4]) * inx4[8] +
  465|  44.2k|              ((uint128_t) in[5]) * inx4[7] + ((uint128_t) in[6]) * inx2[6];
  466|       |
  467|       |    /* 13 */
  468|  44.2k|    out[4] += ((uint128_t) in[5]) * inx4[8] + ((uint128_t) in[6]) * inx4[7];
  469|       |
  470|       |    /* 14 */
  471|  44.2k|    out[5] += ((uint128_t) in[6]) * inx4[8] + ((uint128_t) in[7]) * inx2[7];
  472|       |
  473|       |    /* 15 */
  474|  44.2k|    out[6] += ((uint128_t) in[7]) * inx4[8];
  475|       |
  476|       |    /* 16 */
  477|  44.2k|    out[7] += ((uint128_t) in[8]) * inx2[8];
  478|  44.2k|}
ecp_nistp521.c:felem_scalar:
  248|   138k|{
  249|   138k|    out[0] = in[0] * scalar;
  250|   138k|    out[1] = in[1] * scalar;
  251|   138k|    out[2] = in[2] * scalar;
  252|   138k|    out[3] = in[3] * scalar;
  253|   138k|    out[4] = in[4] * scalar;
  254|   138k|    out[5] = in[5] * scalar;
  255|   138k|    out[6] = in[6] * scalar;
  256|   138k|    out[7] = in[7] * scalar;
  257|   138k|    out[8] = in[8] * scalar;
  258|   138k|}
ecp_nistp521.c:felem_reduce:
  604|  82.0k|{
  605|  82.0k|    u64 overflow1, overflow2;
  606|       |
  607|  82.0k|    out[0] = ((limb) in[0]) & bottom58bits;
  608|  82.0k|    out[1] = ((limb) in[1]) & bottom58bits;
  609|  82.0k|    out[2] = ((limb) in[2]) & bottom58bits;
  610|  82.0k|    out[3] = ((limb) in[3]) & bottom58bits;
  611|  82.0k|    out[4] = ((limb) in[4]) & bottom58bits;
  612|  82.0k|    out[5] = ((limb) in[5]) & bottom58bits;
  613|  82.0k|    out[6] = ((limb) in[6]) & bottom58bits;
  614|  82.0k|    out[7] = ((limb) in[7]) & bottom58bits;
  615|  82.0k|    out[8] = ((limb) in[8]) & bottom58bits;
  616|       |
  617|       |    /* out[i] < 2^58 */
  618|       |
  619|  82.0k|    out[1] += ((limb) in[0]) >> 58;
  620|  82.0k|    out[1] += (((limb) (in[0] >> 64)) & bottom52bits) << 6;
  621|       |    /*-
  622|       |     * out[1] < 2^58 + 2^6 + 2^58
  623|       |     *        = 2^59 + 2^6
  624|       |     */
  625|  82.0k|    out[2] += ((limb) (in[0] >> 64)) >> 52;
  626|       |
  627|  82.0k|    out[2] += ((limb) in[1]) >> 58;
  628|  82.0k|    out[2] += (((limb) (in[1] >> 64)) & bottom52bits) << 6;
  629|  82.0k|    out[3] += ((limb) (in[1] >> 64)) >> 52;
  630|       |
  631|  82.0k|    out[3] += ((limb) in[2]) >> 58;
  632|  82.0k|    out[3] += (((limb) (in[2] >> 64)) & bottom52bits) << 6;
  633|  82.0k|    out[4] += ((limb) (in[2] >> 64)) >> 52;
  634|       |
  635|  82.0k|    out[4] += ((limb) in[3]) >> 58;
  636|  82.0k|    out[4] += (((limb) (in[3] >> 64)) & bottom52bits) << 6;
  637|  82.0k|    out[5] += ((limb) (in[3] >> 64)) >> 52;
  638|       |
  639|  82.0k|    out[5] += ((limb) in[4]) >> 58;
  640|  82.0k|    out[5] += (((limb) (in[4] >> 64)) & bottom52bits) << 6;
  641|  82.0k|    out[6] += ((limb) (in[4] >> 64)) >> 52;
  642|       |
  643|  82.0k|    out[6] += ((limb) in[5]) >> 58;
  644|  82.0k|    out[6] += (((limb) (in[5] >> 64)) & bottom52bits) << 6;
  645|  82.0k|    out[7] += ((limb) (in[5] >> 64)) >> 52;
  646|       |
  647|  82.0k|    out[7] += ((limb) in[6]) >> 58;
  648|  82.0k|    out[7] += (((limb) (in[6] >> 64)) & bottom52bits) << 6;
  649|  82.0k|    out[8] += ((limb) (in[6] >> 64)) >> 52;
  650|       |
  651|  82.0k|    out[8] += ((limb) in[7]) >> 58;
  652|  82.0k|    out[8] += (((limb) (in[7] >> 64)) & bottom52bits) << 6;
  653|       |    /*-
  654|       |     * out[x > 1] < 2^58 + 2^6 + 2^58 + 2^12
  655|       |     *            < 2^59 + 2^13
  656|       |     */
  657|  82.0k|    overflow1 = ((limb) (in[7] >> 64)) >> 52;
  658|       |
  659|  82.0k|    overflow1 += ((limb) in[8]) >> 58;
  660|  82.0k|    overflow1 += (((limb) (in[8] >> 64)) & bottom52bits) << 6;
  661|  82.0k|    overflow2 = ((limb) (in[8] >> 64)) >> 52;
  662|       |
  663|  82.0k|    overflow1 <<= 1;            /* overflow1 < 2^13 + 2^7 + 2^59 */
  664|  82.0k|    overflow2 <<= 1;            /* overflow2 < 2^13 */
  665|       |
  666|  82.0k|    out[0] += overflow1;        /* out[0] < 2^60 */
  667|  82.0k|    out[1] += overflow2;        /* out[1] < 2^59 + 2^6 + 2^13 */
  668|       |
  669|  82.0k|    out[1] += out[0] >> 58;
  670|  82.0k|    out[0] &= bottom58bits;
  671|       |    /*-
  672|       |     * out[0] < 2^58
  673|       |     * out[1] < 2^59 + 2^6 + 2^13 + 2^2
  674|       |     *        < 2^59 + 2^14
  675|       |     */
  676|  82.0k|}
ecp_nistp521.c:felem_mul_ref:
  489|  46.0k|{
  490|  46.0k|    felem in2x2;
  491|  46.0k|    felem_scalar(in2x2, in2, 2);
  492|       |
  493|  46.0k|    out[0] = ((uint128_t) in1[0]) * in2[0];
  494|       |
  495|  46.0k|    out[1] = ((uint128_t) in1[0]) * in2[1] +
  496|  46.0k|             ((uint128_t) in1[1]) * in2[0];
  497|       |
  498|  46.0k|    out[2] = ((uint128_t) in1[0]) * in2[2] +
  499|  46.0k|             ((uint128_t) in1[1]) * in2[1] +
  500|  46.0k|             ((uint128_t) in1[2]) * in2[0];
  501|       |
  502|  46.0k|    out[3] = ((uint128_t) in1[0]) * in2[3] +
  503|  46.0k|             ((uint128_t) in1[1]) * in2[2] +
  504|  46.0k|             ((uint128_t) in1[2]) * in2[1] +
  505|  46.0k|             ((uint128_t) in1[3]) * in2[0];
  506|       |
  507|  46.0k|    out[4] = ((uint128_t) in1[0]) * in2[4] +
  508|  46.0k|             ((uint128_t) in1[1]) * in2[3] +
  509|  46.0k|             ((uint128_t) in1[2]) * in2[2] +
  510|  46.0k|             ((uint128_t) in1[3]) * in2[1] +
  511|  46.0k|             ((uint128_t) in1[4]) * in2[0];
  512|       |
  513|  46.0k|    out[5] = ((uint128_t) in1[0]) * in2[5] +
  514|  46.0k|             ((uint128_t) in1[1]) * in2[4] +
  515|  46.0k|             ((uint128_t) in1[2]) * in2[3] +
  516|  46.0k|             ((uint128_t) in1[3]) * in2[2] +
  517|  46.0k|             ((uint128_t) in1[4]) * in2[1] +
  518|  46.0k|             ((uint128_t) in1[5]) * in2[0];
  519|       |
  520|  46.0k|    out[6] = ((uint128_t) in1[0]) * in2[6] +
  521|  46.0k|             ((uint128_t) in1[1]) * in2[5] +
  522|  46.0k|             ((uint128_t) in1[2]) * in2[4] +
  523|  46.0k|             ((uint128_t) in1[3]) * in2[3] +
  524|  46.0k|             ((uint128_t) in1[4]) * in2[2] +
  525|  46.0k|             ((uint128_t) in1[5]) * in2[1] +
  526|  46.0k|             ((uint128_t) in1[6]) * in2[0];
  527|       |
  528|  46.0k|    out[7] = ((uint128_t) in1[0]) * in2[7] +
  529|  46.0k|             ((uint128_t) in1[1]) * in2[6] +
  530|  46.0k|             ((uint128_t) in1[2]) * in2[5] +
  531|  46.0k|             ((uint128_t) in1[3]) * in2[4] +
  532|  46.0k|             ((uint128_t) in1[4]) * in2[3] +
  533|  46.0k|             ((uint128_t) in1[5]) * in2[2] +
  534|  46.0k|             ((uint128_t) in1[6]) * in2[1] +
  535|  46.0k|             ((uint128_t) in1[7]) * in2[0];
  536|       |
  537|  46.0k|    out[8] = ((uint128_t) in1[0]) * in2[8] +
  538|  46.0k|             ((uint128_t) in1[1]) * in2[7] +
  539|  46.0k|             ((uint128_t) in1[2]) * in2[6] +
  540|  46.0k|             ((uint128_t) in1[3]) * in2[5] +
  541|  46.0k|             ((uint128_t) in1[4]) * in2[4] +
  542|  46.0k|             ((uint128_t) in1[5]) * in2[3] +
  543|  46.0k|             ((uint128_t) in1[6]) * in2[2] +
  544|  46.0k|             ((uint128_t) in1[7]) * in2[1] +
  545|  46.0k|             ((uint128_t) in1[8]) * in2[0];
  546|       |
  547|       |    /* See comment in felem_square about the use of in2x2 here */
  548|       |
  549|  46.0k|    out[0] += ((uint128_t) in1[1]) * in2x2[8] +
  550|  46.0k|              ((uint128_t) in1[2]) * in2x2[7] +
  551|  46.0k|              ((uint128_t) in1[3]) * in2x2[6] +
  552|  46.0k|              ((uint128_t) in1[4]) * in2x2[5] +
  553|  46.0k|              ((uint128_t) in1[5]) * in2x2[4] +
  554|  46.0k|              ((uint128_t) in1[6]) * in2x2[3] +
  555|  46.0k|              ((uint128_t) in1[7]) * in2x2[2] +
  556|  46.0k|              ((uint128_t) in1[8]) * in2x2[1];
  557|       |
  558|  46.0k|    out[1] += ((uint128_t) in1[2]) * in2x2[8] +
  559|  46.0k|              ((uint128_t) in1[3]) * in2x2[7] +
  560|  46.0k|              ((uint128_t) in1[4]) * in2x2[6] +
  561|  46.0k|              ((uint128_t) in1[5]) * in2x2[5] +
  562|  46.0k|              ((uint128_t) in1[6]) * in2x2[4] +
  563|  46.0k|              ((uint128_t) in1[7]) * in2x2[3] +
  564|  46.0k|              ((uint128_t) in1[8]) * in2x2[2];
  565|       |
  566|  46.0k|    out[2] += ((uint128_t) in1[3]) * in2x2[8] +
  567|  46.0k|              ((uint128_t) in1[4]) * in2x2[7] +
  568|  46.0k|              ((uint128_t) in1[5]) * in2x2[6] +
  569|  46.0k|              ((uint128_t) in1[6]) * in2x2[5] +
  570|  46.0k|              ((uint128_t) in1[7]) * in2x2[4] +
  571|  46.0k|              ((uint128_t) in1[8]) * in2x2[3];
  572|       |
  573|  46.0k|    out[3] += ((uint128_t) in1[4]) * in2x2[8] +
  574|  46.0k|              ((uint128_t) in1[5]) * in2x2[7] +
  575|  46.0k|              ((uint128_t) in1[6]) * in2x2[6] +
  576|  46.0k|              ((uint128_t) in1[7]) * in2x2[5] +
  577|  46.0k|              ((uint128_t) in1[8]) * in2x2[4];
  578|       |
  579|  46.0k|    out[4] += ((uint128_t) in1[5]) * in2x2[8] +
  580|  46.0k|              ((uint128_t) in1[6]) * in2x2[7] +
  581|  46.0k|              ((uint128_t) in1[7]) * in2x2[6] +
  582|  46.0k|              ((uint128_t) in1[8]) * in2x2[5];
  583|       |
  584|  46.0k|    out[5] += ((uint128_t) in1[6]) * in2x2[8] +
  585|  46.0k|              ((uint128_t) in1[7]) * in2x2[7] +
  586|  46.0k|              ((uint128_t) in1[8]) * in2x2[6];
  587|       |
  588|  46.0k|    out[6] += ((uint128_t) in1[7]) * in2x2[8] +
  589|  46.0k|              ((uint128_t) in1[8]) * in2x2[7];
  590|       |
  591|  46.0k|    out[7] += ((uint128_t) in1[8]) * in2x2[8];
  592|  46.0k|}
ecp_nistp521.c:felem_contract:
  942|    138|{
  943|    138|    limb is_p, is_greater, sign;
  944|    138|    static const limb two58 = ((limb) 1) << 58;
  945|       |
  946|    138|    felem_assign(out, in);
  947|       |
  948|    138|    out[0] += out[8] >> 57;
  949|    138|    out[8] &= bottom57bits;
  950|       |    /* out[8] < 2^57 */
  951|    138|    out[1] += out[0] >> 58;
  952|    138|    out[0] &= bottom58bits;
  953|    138|    out[2] += out[1] >> 58;
  954|    138|    out[1] &= bottom58bits;
  955|    138|    out[3] += out[2] >> 58;
  956|    138|    out[2] &= bottom58bits;
  957|    138|    out[4] += out[3] >> 58;
  958|    138|    out[3] &= bottom58bits;
  959|    138|    out[5] += out[4] >> 58;
  960|    138|    out[4] &= bottom58bits;
  961|    138|    out[6] += out[5] >> 58;
  962|    138|    out[5] &= bottom58bits;
  963|    138|    out[7] += out[6] >> 58;
  964|    138|    out[6] &= bottom58bits;
  965|    138|    out[8] += out[7] >> 58;
  966|    138|    out[7] &= bottom58bits;
  967|       |    /* out[8] < 2^57 + 4 */
  968|       |
  969|       |    /*
  970|       |     * If the value is greater than 2^521-1 then we have to subtract 2^521-1
  971|       |     * out. See the comments in felem_is_zero regarding why we don't test for
  972|       |     * other multiples of the prime.
  973|       |     */
  974|       |
  975|       |    /*
  976|       |     * First, if |out| is equal to 2^521-1, we subtract it out to get zero.
  977|       |     */
  978|       |
  979|    138|    is_p = out[0] ^ kPrime[0];
  980|    138|    is_p |= out[1] ^ kPrime[1];
  981|    138|    is_p |= out[2] ^ kPrime[2];
  982|    138|    is_p |= out[3] ^ kPrime[3];
  983|    138|    is_p |= out[4] ^ kPrime[4];
  984|    138|    is_p |= out[5] ^ kPrime[5];
  985|    138|    is_p |= out[6] ^ kPrime[6];
  986|    138|    is_p |= out[7] ^ kPrime[7];
  987|    138|    is_p |= out[8] ^ kPrime[8];
  988|       |
  989|    138|    is_p--;
  990|    138|    is_p &= is_p << 32;
  991|    138|    is_p &= is_p << 16;
  992|    138|    is_p &= is_p << 8;
  993|    138|    is_p &= is_p << 4;
  994|    138|    is_p &= is_p << 2;
  995|    138|    is_p &= is_p << 1;
  996|    138|    is_p = 0 - (is_p >> 63);
  997|    138|    is_p = ~is_p;
  998|       |
  999|       |    /* is_p is 0 iff |out| == 2^521-1 and all ones otherwise */
 1000|       |
 1001|    138|    out[0] &= is_p;
 1002|    138|    out[1] &= is_p;
 1003|    138|    out[2] &= is_p;
 1004|    138|    out[3] &= is_p;
 1005|    138|    out[4] &= is_p;
 1006|    138|    out[5] &= is_p;
 1007|    138|    out[6] &= is_p;
 1008|    138|    out[7] &= is_p;
 1009|    138|    out[8] &= is_p;
 1010|       |
 1011|       |    /*
 1012|       |     * In order to test that |out| >= 2^521-1 we need only test if out[8] >>
 1013|       |     * 57 is greater than zero as (2^521-1) + x >= 2^522
 1014|       |     */
 1015|    138|    is_greater = out[8] >> 57;
 1016|    138|    is_greater |= is_greater << 32;
 1017|    138|    is_greater |= is_greater << 16;
 1018|    138|    is_greater |= is_greater << 8;
 1019|    138|    is_greater |= is_greater << 4;
 1020|    138|    is_greater |= is_greater << 2;
 1021|    138|    is_greater |= is_greater << 1;
 1022|    138|    is_greater = 0 - (is_greater >> 63);
 1023|       |
 1024|    138|    out[0] -= kPrime[0] & is_greater;
 1025|    138|    out[1] -= kPrime[1] & is_greater;
 1026|    138|    out[2] -= kPrime[2] & is_greater;
 1027|    138|    out[3] -= kPrime[3] & is_greater;
 1028|    138|    out[4] -= kPrime[4] & is_greater;
 1029|    138|    out[5] -= kPrime[5] & is_greater;
 1030|    138|    out[6] -= kPrime[6] & is_greater;
 1031|    138|    out[7] -= kPrime[7] & is_greater;
 1032|    138|    out[8] -= kPrime[8] & is_greater;
 1033|       |
 1034|       |    /* Eliminate negative coefficients */
 1035|    138|    sign = -(out[0] >> 63);
 1036|    138|    out[0] += (two58 & sign);
 1037|    138|    out[1] -= (1 & sign);
 1038|    138|    sign = -(out[1] >> 63);
 1039|    138|    out[1] += (two58 & sign);
 1040|    138|    out[2] -= (1 & sign);
 1041|    138|    sign = -(out[2] >> 63);
 1042|    138|    out[2] += (two58 & sign);
 1043|    138|    out[3] -= (1 & sign);
 1044|    138|    sign = -(out[3] >> 63);
 1045|    138|    out[3] += (two58 & sign);
 1046|    138|    out[4] -= (1 & sign);
 1047|    138|    sign = -(out[4] >> 63);
 1048|    138|    out[4] += (two58 & sign);
 1049|    138|    out[5] -= (1 & sign);
 1050|    138|    sign = -(out[0] >> 63);
 1051|    138|    out[5] += (two58 & sign);
 1052|    138|    out[6] -= (1 & sign);
 1053|    138|    sign = -(out[6] >> 63);
 1054|    138|    out[6] += (two58 & sign);
 1055|    138|    out[7] -= (1 & sign);
 1056|    138|    sign = -(out[7] >> 63);
 1057|    138|    out[7] += (two58 & sign);
 1058|    138|    out[8] -= (1 & sign);
 1059|    138|    sign = -(out[5] >> 63);
 1060|    138|    out[5] += (two58 & sign);
 1061|    138|    out[6] -= (1 & sign);
 1062|    138|    sign = -(out[6] >> 63);
 1063|    138|    out[6] += (two58 & sign);
 1064|    138|    out[7] -= (1 & sign);
 1065|    138|    sign = -(out[7] >> 63);
 1066|    138|    out[7] += (two58 & sign);
 1067|    138|    out[8] -= (1 & sign);
 1068|    138|}
ecp_nistp521.c:felem_to_BN:
  195|    234|{
  196|    234|    felem_bytearray b_out;
  197|    234|    felem_to_bin66(b_out, in);
  198|    234|    return BN_lebin2bn(b_out, sizeof(b_out), out);
  199|    234|}
ecp_nistp521.c:felem_to_bin66:
  161|    234|{
  162|    234|    memset(out, 0, 66);
  163|    234|    (*((limb *) & out[0])) = in[0];
  164|    234|    (*((limb_aX *) & out[7])) |= in[1] << 2;
  165|    234|    (*((limb_aX *) & out[14])) |= in[2] << 4;
  166|    234|    (*((limb_aX *) & out[21])) |= in[3] << 6;
  167|    234|    (*((limb_aX *) & out[29])) = in[4];
  168|    234|    (*((limb_aX *) & out[36])) |= in[5] << 2;
  169|    234|    (*((limb_aX *) & out[43])) |= in[6] << 4;
  170|    234|    (*((limb_aX *) & out[50])) |= in[7] << 6;
  171|    234|    (*((limb_aX *) & out[58])) = in[8];
  172|    234|}
ecp_nistp521.c:point_add:
 1209|  4.16k|{
 1210|  4.16k|    felem ftmp, ftmp2, ftmp3, ftmp4, ftmp5, ftmp6, x_out, y_out, z_out;
 1211|  4.16k|    largefelem tmp, tmp2;
 1212|  4.16k|    limb x_equal, y_equal, z1_is_zero, z2_is_zero;
 1213|  4.16k|    limb points_equal;
 1214|       |
 1215|  4.16k|    z1_is_zero = felem_is_zero(z1);
 1216|  4.16k|    z2_is_zero = felem_is_zero(z2);
 1217|       |
 1218|       |    /* ftmp = z1z1 = z1**2 */
 1219|  4.16k|    felem_square(tmp, z1);
  ------------------
  |  |  725|  4.16k|# define felem_square felem_square_ref
  ------------------
 1220|  4.16k|    felem_reduce(ftmp, tmp);
 1221|       |
 1222|  4.16k|    if (!mixed) {
  ------------------
  |  Branch (1222:9): [True: 0, False: 4.16k]
  ------------------
 1223|       |        /* ftmp2 = z2z2 = z2**2 */
 1224|      0|        felem_square(tmp, z2);
  ------------------
  |  |  725|      0|# define felem_square felem_square_ref
  ------------------
 1225|      0|        felem_reduce(ftmp2, tmp);
 1226|       |
 1227|       |        /* u1 = ftmp3 = x1*z2z2 */
 1228|      0|        felem_mul(tmp, x1, ftmp2);
  ------------------
  |  |  726|      0|# define felem_mul felem_mul_ref
  ------------------
 1229|      0|        felem_reduce(ftmp3, tmp);
 1230|       |
 1231|       |        /* ftmp5 = z1 + z2 */
 1232|      0|        felem_assign(ftmp5, z1);
 1233|      0|        felem_sum64(ftmp5, z2);
 1234|       |        /* ftmp5[i] < 2^61 */
 1235|       |
 1236|       |        /* ftmp5 = (z1 + z2)**2 - z1z1 - z2z2 = 2*z1z2 */
 1237|      0|        felem_square(tmp, ftmp5);
  ------------------
  |  |  725|      0|# define felem_square felem_square_ref
  ------------------
 1238|       |        /* tmp[i] < 17*2^122 */
 1239|      0|        felem_diff_128_64(tmp, ftmp);
 1240|       |        /* tmp[i] < 17*2^122 + 2^63 */
 1241|      0|        felem_diff_128_64(tmp, ftmp2);
 1242|       |        /* tmp[i] < 17*2^122 + 2^64 */
 1243|      0|        felem_reduce(ftmp5, tmp);
 1244|       |
 1245|       |        /* ftmp2 = z2 * z2z2 */
 1246|      0|        felem_mul(tmp, ftmp2, z2);
  ------------------
  |  |  726|      0|# define felem_mul felem_mul_ref
  ------------------
 1247|      0|        felem_reduce(ftmp2, tmp);
 1248|       |
 1249|       |        /* s1 = ftmp6 = y1 * z2**3 */
 1250|      0|        felem_mul(tmp, y1, ftmp2);
  ------------------
  |  |  726|      0|# define felem_mul felem_mul_ref
  ------------------
 1251|      0|        felem_reduce(ftmp6, tmp);
 1252|  4.16k|    } else {
 1253|       |        /*
 1254|       |         * We'll assume z2 = 1 (special case z2 = 0 is handled later)
 1255|       |         */
 1256|       |
 1257|       |        /* u1 = ftmp3 = x1*z2z2 */
 1258|  4.16k|        felem_assign(ftmp3, x1);
 1259|       |
 1260|       |        /* ftmp5 = 2*z1z2 */
 1261|  4.16k|        felem_scalar(ftmp5, z1, 2);
 1262|       |
 1263|       |        /* s1 = ftmp6 = y1 * z2**3 */
 1264|  4.16k|        felem_assign(ftmp6, y1);
 1265|  4.16k|    }
 1266|       |
 1267|       |    /* u2 = x2*z1z1 */
 1268|  4.16k|    felem_mul(tmp, x2, ftmp);
  ------------------
  |  |  726|  4.16k|# define felem_mul felem_mul_ref
  ------------------
 1269|       |    /* tmp[i] < 17*2^120 */
 1270|       |
 1271|       |    /* h = ftmp4 = u2 - u1 */
 1272|  4.16k|    felem_diff_128_64(tmp, ftmp3);
 1273|       |    /* tmp[i] < 17*2^120 + 2^63 */
 1274|  4.16k|    felem_reduce(ftmp4, tmp);
 1275|       |
 1276|  4.16k|    x_equal = felem_is_zero(ftmp4);
 1277|       |
 1278|       |    /* z_out = ftmp5 * h */
 1279|  4.16k|    felem_mul(tmp, ftmp5, ftmp4);
  ------------------
  |  |  726|  4.16k|# define felem_mul felem_mul_ref
  ------------------
 1280|  4.16k|    felem_reduce(z_out, tmp);
 1281|       |
 1282|       |    /* ftmp = z1 * z1z1 */
 1283|  4.16k|    felem_mul(tmp, ftmp, z1);
  ------------------
  |  |  726|  4.16k|# define felem_mul felem_mul_ref
  ------------------
 1284|  4.16k|    felem_reduce(ftmp, tmp);
 1285|       |
 1286|       |    /* s2 = tmp = y2 * z1**3 */
 1287|  4.16k|    felem_mul(tmp, y2, ftmp);
  ------------------
  |  |  726|  4.16k|# define felem_mul felem_mul_ref
  ------------------
 1288|       |    /* tmp[i] < 17*2^120 */
 1289|       |
 1290|       |    /* r = ftmp5 = (s2 - s1)*2 */
 1291|  4.16k|    felem_diff_128_64(tmp, ftmp6);
 1292|       |    /* tmp[i] < 17*2^120 + 2^63 */
 1293|  4.16k|    felem_reduce(ftmp5, tmp);
 1294|  4.16k|    y_equal = felem_is_zero(ftmp5);
 1295|  4.16k|    felem_scalar64(ftmp5, 2);
 1296|       |    /* ftmp5[i] < 2^61 */
 1297|       |
 1298|       |    /*
 1299|       |     * The formulae are incorrect if the points are equal, in affine coordinates
 1300|       |     * (X_1, Y_1) == (X_2, Y_2), so we check for this and do doubling if this
 1301|       |     * happens.
 1302|       |     *
 1303|       |     * We use bitwise operations to avoid potential side-channels introduced by
 1304|       |     * the short-circuiting behaviour of boolean operators.
 1305|       |     *
 1306|       |     * The special case of either point being the point at infinity (z1 and/or
 1307|       |     * z2 are zero), is handled separately later on in this function, so we
 1308|       |     * avoid jumping to point_double here in those special cases.
 1309|       |     *
 1310|       |     * Notice the comment below on the implications of this branching for timing
 1311|       |     * leaks and why it is considered practically irrelevant.
 1312|       |     */
 1313|  4.16k|    points_equal = (x_equal & y_equal & (~z1_is_zero) & (~z2_is_zero));
 1314|       |
 1315|  4.16k|    if (points_equal) {
  ------------------
  |  Branch (1315:9): [True: 0, False: 4.16k]
  ------------------
 1316|       |        /*
 1317|       |         * This is obviously not constant-time but it will almost-never happen
 1318|       |         * for ECDH / ECDSA. The case where it can happen is during scalar-mult
 1319|       |         * where the intermediate value gets very close to the group order.
 1320|       |         * Since |ossl_ec_GFp_nistp_recode_scalar_bits| produces signed digits
 1321|       |         * for the scalar, it's possible for the intermediate value to be a small
 1322|       |         * negative multiple of the base point, and for the final signed digit
 1323|       |         * to be the same value. We believe that this only occurs for the scalar
 1324|       |         * 1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
 1325|       |         * ffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb
 1326|       |         * 71e913863f7, in that case the penultimate intermediate is -9G and
 1327|       |         * the final digit is also -9G. Since this only happens for a single
 1328|       |         * scalar, the timing leak is irrelevant. (Any attacker who wanted to
 1329|       |         * check whether a secret scalar was that exact value, can already do
 1330|       |         * so.)
 1331|       |         */
 1332|      0|        point_double(x3, y3, z3, x1, y1, z1);
 1333|      0|        return;
 1334|      0|    }
 1335|       |
 1336|       |    /* I = ftmp = (2h)**2 */
 1337|  4.16k|    felem_assign(ftmp, ftmp4);
 1338|  4.16k|    felem_scalar64(ftmp, 2);
 1339|       |    /* ftmp[i] < 2^61 */
 1340|  4.16k|    felem_square(tmp, ftmp);
  ------------------
  |  |  725|  4.16k|# define felem_square felem_square_ref
  ------------------
 1341|       |    /* tmp[i] < 17*2^122 */
 1342|  4.16k|    felem_reduce(ftmp, tmp);
 1343|       |
 1344|       |    /* J = ftmp2 = h * I */
 1345|  4.16k|    felem_mul(tmp, ftmp4, ftmp);
  ------------------
  |  |  726|  4.16k|# define felem_mul felem_mul_ref
  ------------------
 1346|  4.16k|    felem_reduce(ftmp2, tmp);
 1347|       |
 1348|       |    /* V = ftmp4 = U1 * I */
 1349|  4.16k|    felem_mul(tmp, ftmp3, ftmp);
  ------------------
  |  |  726|  4.16k|# define felem_mul felem_mul_ref
  ------------------
 1350|  4.16k|    felem_reduce(ftmp4, tmp);
 1351|       |
 1352|       |    /* x_out = r**2 - J - 2V */
 1353|  4.16k|    felem_square(tmp, ftmp5);
  ------------------
  |  |  725|  4.16k|# define felem_square felem_square_ref
  ------------------
 1354|       |    /* tmp[i] < 17*2^122 */
 1355|  4.16k|    felem_diff_128_64(tmp, ftmp2);
 1356|       |    /* tmp[i] < 17*2^122 + 2^63 */
 1357|  4.16k|    felem_assign(ftmp3, ftmp4);
 1358|  4.16k|    felem_scalar64(ftmp4, 2);
 1359|       |    /* ftmp4[i] < 2^61 */
 1360|  4.16k|    felem_diff_128_64(tmp, ftmp4);
 1361|       |    /* tmp[i] < 17*2^122 + 2^64 */
 1362|  4.16k|    felem_reduce(x_out, tmp);
 1363|       |
 1364|       |    /* y_out = r(V-x_out) - 2 * s1 * J */
 1365|  4.16k|    felem_diff64(ftmp3, x_out);
 1366|       |    /*
 1367|       |     * ftmp3[i] < 2^60 + 2^60 = 2^61
 1368|       |     */
 1369|  4.16k|    felem_mul(tmp, ftmp5, ftmp3);
  ------------------
  |  |  726|  4.16k|# define felem_mul felem_mul_ref
  ------------------
 1370|       |    /* tmp[i] < 17*2^122 */
 1371|  4.16k|    felem_mul(tmp2, ftmp6, ftmp2);
  ------------------
  |  |  726|  4.16k|# define felem_mul felem_mul_ref
  ------------------
 1372|       |    /* tmp2[i] < 17*2^120 */
 1373|  4.16k|    felem_scalar128(tmp2, 2);
 1374|       |    /* tmp2[i] < 17*2^121 */
 1375|  4.16k|    felem_diff128(tmp, tmp2);
 1376|       |        /*-
 1377|       |         * tmp[i] < 2^127 - 2^69 + 17*2^122
 1378|       |         *        = 2^126 - 2^122 - 2^6 - 2^2 - 1
 1379|       |         *        < 2^127
 1380|       |         */
 1381|  4.16k|    felem_reduce(y_out, tmp);
 1382|       |
 1383|  4.16k|    copy_conditional(x_out, x2, z1_is_zero);
 1384|  4.16k|    copy_conditional(x_out, x1, z2_is_zero);
 1385|  4.16k|    copy_conditional(y_out, y2, z1_is_zero);
 1386|  4.16k|    copy_conditional(y_out, y1, z2_is_zero);
 1387|  4.16k|    copy_conditional(z_out, z2, z1_is_zero);
 1388|  4.16k|    copy_conditional(z_out, z1, z2_is_zero);
 1389|  4.16k|    felem_assign(x3, x_out);
 1390|  4.16k|    felem_assign(y3, y_out);
 1391|  4.16k|    felem_assign(z3, z_out);
 1392|  4.16k|}
ecp_nistp521.c:felem_is_zero:
  864|  16.6k|{
  865|  16.6k|    felem ftmp;
  866|  16.6k|    limb is_zero, is_p;
  867|  16.6k|    felem_assign(ftmp, in);
  868|       |
  869|  16.6k|    ftmp[0] += ftmp[8] >> 57;
  870|  16.6k|    ftmp[8] &= bottom57bits;
  871|       |    /* ftmp[8] < 2^57 */
  872|  16.6k|    ftmp[1] += ftmp[0] >> 58;
  873|  16.6k|    ftmp[0] &= bottom58bits;
  874|  16.6k|    ftmp[2] += ftmp[1] >> 58;
  875|  16.6k|    ftmp[1] &= bottom58bits;
  876|  16.6k|    ftmp[3] += ftmp[2] >> 58;
  877|  16.6k|    ftmp[2] &= bottom58bits;
  878|  16.6k|    ftmp[4] += ftmp[3] >> 58;
  879|  16.6k|    ftmp[3] &= bottom58bits;
  880|  16.6k|    ftmp[5] += ftmp[4] >> 58;
  881|  16.6k|    ftmp[4] &= bottom58bits;
  882|  16.6k|    ftmp[6] += ftmp[5] >> 58;
  883|  16.6k|    ftmp[5] &= bottom58bits;
  884|  16.6k|    ftmp[7] += ftmp[6] >> 58;
  885|  16.6k|    ftmp[6] &= bottom58bits;
  886|  16.6k|    ftmp[8] += ftmp[7] >> 58;
  887|  16.6k|    ftmp[7] &= bottom58bits;
  888|       |    /* ftmp[8] < 2^57 + 4 */
  889|       |
  890|       |    /*
  891|       |     * The ninth limb of 2*(2^521-1) is 0x03ffffffffffffff, which is greater
  892|       |     * than our bound for ftmp[8]. Therefore we only have to check if the
  893|       |     * zero is zero or 2^521-1.
  894|       |     */
  895|       |
  896|  16.6k|    is_zero = 0;
  897|  16.6k|    is_zero |= ftmp[0];
  898|  16.6k|    is_zero |= ftmp[1];
  899|  16.6k|    is_zero |= ftmp[2];
  900|  16.6k|    is_zero |= ftmp[3];
  901|  16.6k|    is_zero |= ftmp[4];
  902|  16.6k|    is_zero |= ftmp[5];
  903|  16.6k|    is_zero |= ftmp[6];
  904|  16.6k|    is_zero |= ftmp[7];
  905|  16.6k|    is_zero |= ftmp[8];
  906|       |
  907|  16.6k|    is_zero--;
  908|       |    /*
  909|       |     * We know that ftmp[i] < 2^63, therefore the only way that the top bit
  910|       |     * can be set is if is_zero was 0 before the decrement.
  911|       |     */
  912|  16.6k|    is_zero = 0 - (is_zero >> 63);
  913|       |
  914|  16.6k|    is_p = ftmp[0] ^ kPrime[0];
  915|  16.6k|    is_p |= ftmp[1] ^ kPrime[1];
  916|  16.6k|    is_p |= ftmp[2] ^ kPrime[2];
  917|  16.6k|    is_p |= ftmp[3] ^ kPrime[3];
  918|  16.6k|    is_p |= ftmp[4] ^ kPrime[4];
  919|  16.6k|    is_p |= ftmp[5] ^ kPrime[5];
  920|  16.6k|    is_p |= ftmp[6] ^ kPrime[6];
  921|  16.6k|    is_p |= ftmp[7] ^ kPrime[7];
  922|  16.6k|    is_p |= ftmp[8] ^ kPrime[8];
  923|       |
  924|  16.6k|    is_p--;
  925|  16.6k|    is_p = 0 - (is_p >> 63);
  926|       |
  927|  16.6k|    is_zero |= is_p;
  928|  16.6k|    return is_zero;
  929|  16.6k|}
ecp_nistp521.c:felem_sum64:
  234|  12.4k|{
  235|  12.4k|    out[0] += in[0];
  236|  12.4k|    out[1] += in[1];
  237|  12.4k|    out[2] += in[2];
  238|  12.4k|    out[3] += in[3];
  239|  12.4k|    out[4] += in[4];
  240|  12.4k|    out[5] += in[5];
  241|  12.4k|    out[6] += in[6];
  242|  12.4k|    out[7] += in[7];
  243|  12.4k|    out[8] += in[8];
  244|  12.4k|}
ecp_nistp521.c:felem_diff_128_64:
  346|  24.9k|{
  347|       |    /*
  348|       |     * In order to prevent underflow, we add 64p mod p (which is equivalent
  349|       |     * to 0 mod p) before subtracting. p is 2^521 - 1, i.e. in binary a 521
  350|       |     * digit number with all bits set to 1. See "The representation of field
  351|       |     * elements" comment above for a description of how limbs are used to
  352|       |     * represent a number. 64p is represented with 8 limbs containing a number
  353|       |     * with 58 bits set and one limb with a number with 57 bits set.
  354|       |     */
  355|  24.9k|    static const limb two63m6 = (((limb) 1) << 63) - (((limb) 1) << 6);
  356|  24.9k|    static const limb two63m5 = (((limb) 1) << 63) - (((limb) 1) << 5);
  357|       |
  358|  24.9k|    out[0] += two63m6 - in[0];
  359|  24.9k|    out[1] += two63m5 - in[1];
  360|  24.9k|    out[2] += two63m5 - in[2];
  361|  24.9k|    out[3] += two63m5 - in[3];
  362|  24.9k|    out[4] += two63m5 - in[4];
  363|  24.9k|    out[5] += two63m5 - in[5];
  364|  24.9k|    out[6] += two63m5 - in[6];
  365|  24.9k|    out[7] += two63m5 - in[7];
  366|  24.9k|    out[8] += two63m5 - in[8];
  367|  24.9k|}
ecp_nistp521.c:felem_scalar64:
  262|  24.9k|{
  263|  24.9k|    out[0] *= scalar;
  264|  24.9k|    out[1] *= scalar;
  265|  24.9k|    out[2] *= scalar;
  266|  24.9k|    out[3] *= scalar;
  267|  24.9k|    out[4] *= scalar;
  268|  24.9k|    out[5] *= scalar;
  269|  24.9k|    out[6] *= scalar;
  270|  24.9k|    out[7] *= scalar;
  271|  24.9k|    out[8] *= scalar;
  272|  24.9k|}
ecp_nistp521.c:felem_diff64:
  320|  12.4k|{
  321|       |    /*
  322|       |     * In order to prevent underflow, we add 0 mod p before subtracting.
  323|       |     */
  324|  12.4k|    static const limb two62m3 = (((limb) 1) << 62) - (((limb) 1) << 5);
  325|  12.4k|    static const limb two62m2 = (((limb) 1) << 62) - (((limb) 1) << 4);
  326|       |
  327|  12.4k|    out[0] += two62m3 - in[0];
  328|  12.4k|    out[1] += two62m2 - in[1];
  329|  12.4k|    out[2] += two62m2 - in[2];
  330|  12.4k|    out[3] += two62m2 - in[3];
  331|  12.4k|    out[4] += two62m2 - in[4];
  332|  12.4k|    out[5] += two62m2 - in[5];
  333|  12.4k|    out[6] += two62m2 - in[6];
  334|  12.4k|    out[7] += two62m2 - in[7];
  335|  12.4k|    out[8] += two62m2 - in[8];
  336|  12.4k|}
ecp_nistp521.c:felem_scalar128:
  276|  8.32k|{
  277|  8.32k|    out[0] *= scalar;
  278|  8.32k|    out[1] *= scalar;
  279|  8.32k|    out[2] *= scalar;
  280|  8.32k|    out[3] *= scalar;
  281|  8.32k|    out[4] *= scalar;
  282|  8.32k|    out[5] *= scalar;
  283|  8.32k|    out[6] *= scalar;
  284|  8.32k|    out[7] *= scalar;
  285|  8.32k|    out[8] *= scalar;
  286|  8.32k|}
ecp_nistp521.c:felem_diff128:
  377|  8.32k|{
  378|       |    /*
  379|       |     * In order to prevent underflow, we add 0 mod p before subtracting.
  380|       |     */
  381|  8.32k|    static const uint128_t two127m70 =
  382|  8.32k|        (((uint128_t) 1) << 127) - (((uint128_t) 1) << 70);
  383|  8.32k|    static const uint128_t two127m69 =
  384|  8.32k|        (((uint128_t) 1) << 127) - (((uint128_t) 1) << 69);
  385|       |
  386|  8.32k|    out[0] += (two127m70 - in[0]);
  387|  8.32k|    out[1] += (two127m69 - in[1]);
  388|  8.32k|    out[2] += (two127m69 - in[2]);
  389|  8.32k|    out[3] += (two127m69 - in[3]);
  390|  8.32k|    out[4] += (two127m69 - in[4]);
  391|  8.32k|    out[5] += (two127m69 - in[5]);
  392|  8.32k|    out[6] += (two127m69 - in[6]);
  393|  8.32k|    out[7] += (two127m69 - in[7]);
  394|  8.32k|    out[8] += (two127m69 - in[8]);
  395|  8.32k|}
ecp_nistp521.c:copy_conditional:
 1186|  24.9k|{
 1187|  24.9k|    unsigned i;
 1188|   249k|    for (i = 0; i < NLIMBS; ++i) {
  ------------------
  |  |  129|   249k|#define NLIMBS 9
  ------------------
  |  Branch (1188:17): [True: 224k, False: 24.9k]
  ------------------
 1189|   224k|        const limb tmp = mask & (in[i] ^ out[i]);
 1190|   224k|        out[i] ^= tmp;
 1191|   224k|    }
 1192|  24.9k|}
ecp_nistp521.c:point_double:
 1089|  4.16k|{
 1090|  4.16k|    largefelem tmp, tmp2;
 1091|  4.16k|    felem delta, gamma, beta, alpha, ftmp, ftmp2;
 1092|       |
 1093|  4.16k|    felem_assign(ftmp, x_in);
 1094|  4.16k|    felem_assign(ftmp2, x_in);
 1095|       |
 1096|       |    /* delta = z^2 */
 1097|  4.16k|    felem_square(tmp, z_in);
  ------------------
  |  |  725|  4.16k|# define felem_square felem_square_ref
  ------------------
 1098|  4.16k|    felem_reduce(delta, tmp);   /* delta[i] < 2^59 + 2^14 */
 1099|       |
 1100|       |    /* gamma = y^2 */
 1101|  4.16k|    felem_square(tmp, y_in);
  ------------------
  |  |  725|  4.16k|# define felem_square felem_square_ref
  ------------------
 1102|  4.16k|    felem_reduce(gamma, tmp);   /* gamma[i] < 2^59 + 2^14 */
 1103|       |
 1104|       |    /* beta = x*gamma */
 1105|  4.16k|    felem_mul(tmp, x_in, gamma);
  ------------------
  |  |  726|  4.16k|# define felem_mul felem_mul_ref
  ------------------
 1106|  4.16k|    felem_reduce(beta, tmp);    /* beta[i] < 2^59 + 2^14 */
 1107|       |
 1108|       |    /* alpha = 3*(x-delta)*(x+delta) */
 1109|  4.16k|    felem_diff64(ftmp, delta);
 1110|       |    /* ftmp[i] < 2^61 */
 1111|  4.16k|    felem_sum64(ftmp2, delta);
 1112|       |    /* ftmp2[i] < 2^60 + 2^15 */
 1113|  4.16k|    felem_scalar64(ftmp2, 3);
 1114|       |    /* ftmp2[i] < 3*2^60 + 3*2^15 */
 1115|  4.16k|    felem_mul(tmp, ftmp, ftmp2);
  ------------------
  |  |  726|  4.16k|# define felem_mul felem_mul_ref
  ------------------
 1116|       |    /*-
 1117|       |     * tmp[i] < 17(3*2^121 + 3*2^76)
 1118|       |     *        = 61*2^121 + 61*2^76
 1119|       |     *        < 64*2^121 + 64*2^76
 1120|       |     *        = 2^127 + 2^82
 1121|       |     *        < 2^128
 1122|       |     */
 1123|  4.16k|    felem_reduce(alpha, tmp);
 1124|       |
 1125|       |    /* x' = alpha^2 - 8*beta */
 1126|  4.16k|    felem_square(tmp, alpha);
  ------------------
  |  |  725|  4.16k|# define felem_square felem_square_ref
  ------------------
 1127|       |    /*
 1128|       |     * tmp[i] < 17*2^120 < 2^125
 1129|       |     */
 1130|  4.16k|    felem_assign(ftmp, beta);
 1131|  4.16k|    felem_scalar64(ftmp, 8);
 1132|       |    /* ftmp[i] < 2^62 + 2^17 */
 1133|  4.16k|    felem_diff_128_64(tmp, ftmp);
 1134|       |    /* tmp[i] < 2^125 + 2^63 + 2^62 + 2^17 */
 1135|  4.16k|    felem_reduce(x_out, tmp);
 1136|       |
 1137|       |    /* z' = (y + z)^2 - gamma - delta */
 1138|  4.16k|    felem_sum64(delta, gamma);
 1139|       |    /* delta[i] < 2^60 + 2^15 */
 1140|  4.16k|    felem_assign(ftmp, y_in);
 1141|  4.16k|    felem_sum64(ftmp, z_in);
 1142|       |    /* ftmp[i] < 2^60 + 2^15 */
 1143|  4.16k|    felem_square(tmp, ftmp);
  ------------------
  |  |  725|  4.16k|# define felem_square felem_square_ref
  ------------------
 1144|       |    /*
 1145|       |     * tmp[i] < 17(2^122) < 2^127
 1146|       |     */
 1147|  4.16k|    felem_diff_128_64(tmp, delta);
 1148|       |    /* tmp[i] < 2^127 + 2^63 */
 1149|  4.16k|    felem_reduce(z_out, tmp);
 1150|       |
 1151|       |    /* y' = alpha*(4*beta - x') - 8*gamma^2 */
 1152|  4.16k|    felem_scalar64(beta, 4);
 1153|       |    /* beta[i] < 2^61 + 2^16 */
 1154|  4.16k|    felem_diff64(beta, x_out);
 1155|       |    /* beta[i] < 2^61 + 2^60 + 2^16 */
 1156|  4.16k|    felem_mul(tmp, alpha, beta);
  ------------------
  |  |  726|  4.16k|# define felem_mul felem_mul_ref
  ------------------
 1157|       |    /*-
 1158|       |     * tmp[i] < 17*((2^59 + 2^14)(2^61 + 2^60 + 2^16))
 1159|       |     *        = 17*(2^120 + 2^75 + 2^119 + 2^74 + 2^75 + 2^30)
 1160|       |     *        = 17*(2^120 + 2^119 + 2^76 + 2^74 + 2^30)
 1161|       |     *        < 2^128
 1162|       |     */
 1163|  4.16k|    felem_square(tmp2, gamma);
  ------------------
  |  |  725|  4.16k|# define felem_square felem_square_ref
  ------------------
 1164|       |    /*-
 1165|       |     * tmp2[i] < 17*(2^59 + 2^14)^2
 1166|       |     *         = 17*(2^118 + 2^74 + 2^28)
 1167|       |     */
 1168|  4.16k|    felem_scalar128(tmp2, 8);
 1169|       |    /*-
 1170|       |     * tmp2[i] < 8*17*(2^118 + 2^74 + 2^28)
 1171|       |     *         = 2^125 + 2^121 + 2^81 + 2^77 + 2^35 + 2^31
 1172|       |     *         < 2^126
 1173|       |     */
 1174|  4.16k|    felem_diff128(tmp, tmp2);
 1175|       |    /*-
 1176|       |     * tmp[i] < 2^127 - 2^69 + 17(2^120 + 2^119 + 2^76 + 2^74 + 2^30)
 1177|       |     *        = 2^127 + 2^124 + 2^122 + 2^120 + 2^118 + 2^80 + 2^78 + 2^76 +
 1178|       |     *          2^74 + 2^69 + 2^34 + 2^30
 1179|       |     *        < 2^128
 1180|       |     */
 1181|  4.16k|    felem_reduce(y_out, tmp);
 1182|  4.16k|}
ecp_nistp521.c:batch_mul:
 1586|     32|{
 1587|     32|    int i, skip;
 1588|     32|    unsigned num, gen_mul = (g_scalar != NULL);
 1589|     32|    felem nq[3], tmp[4];
 1590|     32|    limb bits;
 1591|     32|    u8 sign, digit;
 1592|       |
 1593|       |    /* set nq to the point at infinity */
 1594|     32|    memset(nq, 0, sizeof(nq));
 1595|       |
 1596|       |    /*
 1597|       |     * Loop over all scalars msb-to-lsb, interleaving additions of multiples
 1598|       |     * of the generator (last quarter of rounds) and additions of other
 1599|       |     * points multiples (every 5th round).
 1600|       |     */
 1601|     32|    skip = 1;                   /* save two point operations in the first
 1602|       |                                 * round */
 1603|  4.22k|    for (i = (num_points ? 520 : 130); i >= 0; --i) {
  ------------------
  |  Branch (1603:15): [True: 0, False: 32]
  |  Branch (1603:40): [True: 4.19k, False: 32]
  ------------------
 1604|       |        /* double */
 1605|  4.19k|        if (!skip)
  ------------------
  |  Branch (1605:13): [True: 4.16k, False: 32]
  ------------------
 1606|  4.16k|            point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]);
 1607|       |
 1608|       |        /* add multiples of the generator */
 1609|  4.19k|        if (gen_mul && (i <= 130)) {
  ------------------
  |  Branch (1609:13): [True: 4.19k, False: 0]
  |  Branch (1609:24): [True: 4.19k, False: 0]
  ------------------
 1610|  4.19k|            bits = get_bit(g_scalar, i + 390) << 3;
 1611|  4.19k|            if (i < 130) {
  ------------------
  |  Branch (1611:17): [True: 4.16k, False: 32]
  ------------------
 1612|  4.16k|                bits |= get_bit(g_scalar, i + 260) << 2;
 1613|  4.16k|                bits |= get_bit(g_scalar, i + 130) << 1;
 1614|  4.16k|                bits |= get_bit(g_scalar, i);
 1615|  4.16k|            }
 1616|       |            /* select the point to add, in constant time */
 1617|  4.19k|            select_point(bits, 16, g_pre_comp, tmp);
 1618|  4.19k|            if (!skip) {
  ------------------
  |  Branch (1618:17): [True: 4.16k, False: 32]
  ------------------
 1619|       |                /* The 1 argument below is for "mixed" */
 1620|  4.16k|                point_add(nq[0], nq[1], nq[2],
 1621|  4.16k|                          nq[0], nq[1], nq[2], 1, tmp[0], tmp[1], tmp[2]);
 1622|  4.16k|            } else {
 1623|     32|                memcpy(nq, tmp, 3 * sizeof(felem));
 1624|     32|                skip = 0;
 1625|     32|            }
 1626|  4.19k|        }
 1627|       |
 1628|       |        /* do other additions every 5 doublings */
 1629|  4.19k|        if (num_points && (i % 5 == 0)) {
  ------------------
  |  Branch (1629:13): [True: 0, False: 4.19k]
  |  Branch (1629:27): [True: 0, False: 0]
  ------------------
 1630|       |            /* loop over all scalars */
 1631|      0|            for (num = 0; num < num_points; ++num) {
  ------------------
  |  Branch (1631:27): [True: 0, False: 0]
  ------------------
 1632|      0|                bits = get_bit(scalars[num], i + 4) << 5;
 1633|      0|                bits |= get_bit(scalars[num], i + 3) << 4;
 1634|      0|                bits |= get_bit(scalars[num], i + 2) << 3;
 1635|      0|                bits |= get_bit(scalars[num], i + 1) << 2;
 1636|      0|                bits |= get_bit(scalars[num], i) << 1;
 1637|      0|                bits |= get_bit(scalars[num], i - 1);
 1638|      0|                ossl_ec_GFp_nistp_recode_scalar_bits(&sign, &digit, bits);
 1639|       |
 1640|       |                /*
 1641|       |                 * select the point to add or subtract, in constant time
 1642|       |                 */
 1643|      0|                select_point(digit, 17, pre_comp[num], tmp);
 1644|      0|                felem_neg(tmp[3], tmp[1]); /* (X, -Y, Z) is the negative
 1645|       |                                            * point */
 1646|      0|                copy_conditional(tmp[1], tmp[3], (-(limb) sign));
 1647|       |
 1648|      0|                if (!skip) {
  ------------------
  |  Branch (1648:21): [True: 0, False: 0]
  ------------------
 1649|      0|                    point_add(nq[0], nq[1], nq[2],
 1650|      0|                              nq[0], nq[1], nq[2],
 1651|      0|                              mixed, tmp[0], tmp[1], tmp[2]);
 1652|      0|                } else {
 1653|      0|                    memcpy(nq, tmp, 3 * sizeof(felem));
 1654|      0|                    skip = 0;
 1655|      0|                }
 1656|      0|            }
 1657|      0|        }
 1658|  4.19k|    }
 1659|     32|    felem_assign(x_out, nq[0]);
 1660|     32|    felem_assign(y_out, nq[1]);
 1661|     32|    felem_assign(z_out, nq[2]);
 1662|     32|}
ecp_nistp521.c:get_bit:
 1568|  16.6k|{
 1569|  16.6k|    if (i < 0)
  ------------------
  |  Branch (1569:9): [True: 0, False: 16.6k]
  ------------------
 1570|      0|        return 0;
 1571|  16.6k|    return (in[i >> 3] >> (i & 7)) & 1;
 1572|  16.6k|}
ecp_nistp521.c:select_point:
 1547|  4.19k|{
 1548|  4.19k|    unsigned i, j;
 1549|  4.19k|    limb *outlimbs = &out[0][0];
 1550|       |
 1551|  4.19k|    memset(out, 0, sizeof(*out) * 3);
 1552|       |
 1553|  71.2k|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (1553:17): [True: 67.0k, False: 4.19k]
  ------------------
 1554|  67.0k|        const limb *inlimbs = &pre_comp[i][0][0];
 1555|  67.0k|        limb mask = i ^ idx;
 1556|  67.0k|        mask |= mask >> 4;
 1557|  67.0k|        mask |= mask >> 2;
 1558|  67.0k|        mask |= mask >> 1;
 1559|  67.0k|        mask &= 1;
 1560|  67.0k|        mask--;
 1561|  1.87M|        for (j = 0; j < NLIMBS * 3; j++)
  ------------------
  |  |  129|  1.87M|#define NLIMBS 9
  ------------------
  |  Branch (1561:21): [True: 1.81M, False: 67.0k]
  ------------------
 1562|  1.81M|            outlimbs[j] |= inlimbs[j] & mask;
 1563|  67.0k|    }
 1564|  4.19k|}

EC_GFp_nistz256_method:
 1574|     49|{
 1575|     49|    static const EC_METHOD ret = {
 1576|     49|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|     49|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
 1577|     49|        NID_X9_62_prime_field,
  ------------------
  |  |  152|     49|#define NID_X9_62_prime_field           406
  ------------------
 1578|     49|        ossl_ec_GFp_mont_group_init,
 1579|     49|        ossl_ec_GFp_mont_group_finish,
 1580|     49|        ossl_ec_GFp_mont_group_clear_finish,
 1581|     49|        ossl_ec_GFp_mont_group_copy,
 1582|     49|        ossl_ec_GFp_mont_group_set_curve,
 1583|     49|        ossl_ec_GFp_simple_group_get_curve,
 1584|     49|        ossl_ec_GFp_simple_group_get_degree,
 1585|     49|        ossl_ec_group_simple_order_bits,
 1586|     49|        ossl_ec_GFp_simple_group_check_discriminant,
 1587|     49|        ossl_ec_GFp_simple_point_init,
 1588|     49|        ossl_ec_GFp_simple_point_finish,
 1589|     49|        ossl_ec_GFp_simple_point_clear_finish,
 1590|     49|        ossl_ec_GFp_simple_point_copy,
 1591|     49|        ossl_ec_GFp_simple_point_set_to_infinity,
 1592|     49|        ossl_ec_GFp_simple_point_set_affine_coordinates,
 1593|     49|        ecp_nistz256_get_affine,
 1594|     49|        0, 0, 0,
 1595|     49|        ossl_ec_GFp_simple_add,
 1596|     49|        ossl_ec_GFp_simple_dbl,
 1597|     49|        ossl_ec_GFp_simple_invert,
 1598|     49|        ossl_ec_GFp_simple_is_at_infinity,
 1599|     49|        ossl_ec_GFp_simple_is_on_curve,
 1600|     49|        ossl_ec_GFp_simple_cmp,
 1601|     49|        ossl_ec_GFp_simple_make_affine,
 1602|     49|        ossl_ec_GFp_simple_points_make_affine,
 1603|     49|        ecp_nistz256_points_mul,                    /* mul */
 1604|     49|        ecp_nistz256_mult_precompute,               /* precompute_mult */
 1605|     49|        ecp_nistz256_window_have_precompute_mult,   /* have_precompute_mult */
 1606|     49|        ossl_ec_GFp_mont_field_mul,
 1607|     49|        ossl_ec_GFp_mont_field_sqr,
 1608|     49|        0,                                          /* field_div */
 1609|     49|        ossl_ec_GFp_mont_field_inv,
 1610|     49|        ossl_ec_GFp_mont_field_encode,
 1611|     49|        ossl_ec_GFp_mont_field_decode,
 1612|     49|        ossl_ec_GFp_mont_field_set_to_one,
 1613|     49|        ossl_ec_key_simple_priv2oct,
 1614|     49|        ossl_ec_key_simple_oct2priv,
 1615|     49|        0, /* set private */
 1616|     49|        ossl_ec_key_simple_generate_key,
 1617|     49|        ossl_ec_key_simple_check_key,
 1618|     49|        ossl_ec_key_simple_generate_public_key,
 1619|     49|        0, /* keycopy */
 1620|     49|        0, /* keyfinish */
 1621|     49|        ossl_ecdh_simple_compute_key,
 1622|     49|        ossl_ecdsa_simple_sign_setup,
 1623|     49|        ossl_ecdsa_simple_sign_sig,
 1624|     49|        ossl_ecdsa_simple_verify_sig,
 1625|     49|        ecp_nistz256_inv_mod_ord,                   /* can be #define-d NULL */
 1626|     49|        0,                                          /* blind_coordinates */
 1627|     49|        0,                                          /* ladder_pre */
 1628|     49|        0,                                          /* ladder_step */
 1629|     49|        0,                                          /* ladder_post */
 1630|     49|        ecp_nistz256group_full_init
 1631|     49|    };
 1632|       |
 1633|     49|    return &ret;
 1634|     49|}
ecp_nistz256.c:ecp_nistz256_get_affine:
 1162|     25|{
 1163|     25|    BN_ULONG z_inv2[P256_LIMBS];
  ------------------
  |  |   37|     25|#  define BN_ULONG        unsigned long
  ------------------
 1164|     25|    BN_ULONG z_inv3[P256_LIMBS];
  ------------------
  |  |   37|     25|#  define BN_ULONG        unsigned long
  ------------------
 1165|     25|    BN_ULONG x_aff[P256_LIMBS];
  ------------------
  |  |   37|     25|#  define BN_ULONG        unsigned long
  ------------------
 1166|     25|    BN_ULONG y_aff[P256_LIMBS];
  ------------------
  |  |   37|     25|#  define BN_ULONG        unsigned long
  ------------------
 1167|     25|    BN_ULONG point_x[P256_LIMBS], point_y[P256_LIMBS], point_z[P256_LIMBS];
  ------------------
  |  |   37|     25|#  define BN_ULONG        unsigned long
  ------------------
 1168|     25|    BN_ULONG x_ret[P256_LIMBS], y_ret[P256_LIMBS];
  ------------------
  |  |   37|     25|#  define BN_ULONG        unsigned long
  ------------------
 1169|       |
 1170|     25|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (1170:9): [True: 0, False: 25]
  ------------------
 1171|      0|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1172|      0|        return 0;
 1173|      0|    }
 1174|       |
 1175|     25|    if (!ecp_nistz256_bignum_to_field_elem(point_x, point->X) ||
  ------------------
  |  Branch (1175:9): [True: 0, False: 25]
  ------------------
 1176|     25|        !ecp_nistz256_bignum_to_field_elem(point_y, point->Y) ||
  ------------------
  |  Branch (1176:9): [True: 0, False: 25]
  ------------------
 1177|     25|        !ecp_nistz256_bignum_to_field_elem(point_z, point->Z)) {
  ------------------
  |  Branch (1177:9): [True: 0, False: 25]
  ------------------
 1178|      0|        ERR_raise(ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1179|      0|        return 0;
 1180|      0|    }
 1181|       |
 1182|     25|    ecp_nistz256_mod_inverse(z_inv3, point_z);
 1183|     25|    ecp_nistz256_sqr_mont(z_inv2, z_inv3);
 1184|     25|    ecp_nistz256_mul_mont(x_aff, z_inv2, point_x);
 1185|       |
 1186|     25|    if (x != NULL) {
  ------------------
  |  Branch (1186:9): [True: 25, False: 0]
  ------------------
 1187|     25|        ecp_nistz256_from_mont(x_ret, x_aff);
 1188|     25|        if (!bn_set_words(x, x_ret, P256_LIMBS))
  ------------------
  |  |   41|     25|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     25|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     25|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1188:13): [True: 0, False: 25]
  ------------------
 1189|      0|            return 0;
 1190|     25|    }
 1191|       |
 1192|     25|    if (y != NULL) {
  ------------------
  |  Branch (1192:9): [True: 25, False: 0]
  ------------------
 1193|     25|        ecp_nistz256_mul_mont(z_inv3, z_inv3, z_inv2);
 1194|     25|        ecp_nistz256_mul_mont(y_aff, z_inv3, point_y);
 1195|     25|        ecp_nistz256_from_mont(y_ret, y_aff);
 1196|     25|        if (!bn_set_words(y, y_ret, P256_LIMBS))
  ------------------
  |  |   41|     25|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     25|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     25|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1196:13): [True: 0, False: 25]
  ------------------
 1197|      0|            return 0;
 1198|     25|    }
 1199|       |
 1200|     25|    return 1;
 1201|     25|}
ecp_nistz256.c:ecp_nistz256_bignum_to_field_elem:
  602|     75|{
  603|     75|    return bn_copy_words(out, in, P256_LIMBS);
  ------------------
  |  |   41|     75|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     75|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     75|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  604|     75|}
ecp_nistz256.c:ecp_nistz256_mod_inverse:
  522|     25|{
  523|       |    /*
  524|       |     * The poly is ffffffff 00000001 00000000 00000000 00000000 ffffffff
  525|       |     * ffffffff ffffffff We use FLT and used poly-2 as exponent
  526|       |     */
  527|     25|    BN_ULONG p2[P256_LIMBS];
  ------------------
  |  |   37|     25|#  define BN_ULONG        unsigned long
  ------------------
  528|     25|    BN_ULONG p4[P256_LIMBS];
  ------------------
  |  |   37|     25|#  define BN_ULONG        unsigned long
  ------------------
  529|     25|    BN_ULONG p8[P256_LIMBS];
  ------------------
  |  |   37|     25|#  define BN_ULONG        unsigned long
  ------------------
  530|     25|    BN_ULONG p16[P256_LIMBS];
  ------------------
  |  |   37|     25|#  define BN_ULONG        unsigned long
  ------------------
  531|     25|    BN_ULONG p32[P256_LIMBS];
  ------------------
  |  |   37|     25|#  define BN_ULONG        unsigned long
  ------------------
  532|     25|    BN_ULONG res[P256_LIMBS];
  ------------------
  |  |   37|     25|#  define BN_ULONG        unsigned long
  ------------------
  533|     25|    int i;
  534|       |
  535|     25|    ecp_nistz256_sqr_mont(res, in);
  536|     25|    ecp_nistz256_mul_mont(p2, res, in);         /* 3*p */
  537|       |
  538|     25|    ecp_nistz256_sqr_mont(res, p2);
  539|     25|    ecp_nistz256_sqr_mont(res, res);
  540|     25|    ecp_nistz256_mul_mont(p4, res, p2);         /* f*p */
  541|       |
  542|     25|    ecp_nistz256_sqr_mont(res, p4);
  543|     25|    ecp_nistz256_sqr_mont(res, res);
  544|     25|    ecp_nistz256_sqr_mont(res, res);
  545|     25|    ecp_nistz256_sqr_mont(res, res);
  546|     25|    ecp_nistz256_mul_mont(p8, res, p4);         /* ff*p */
  547|       |
  548|     25|    ecp_nistz256_sqr_mont(res, p8);
  549|    200|    for (i = 0; i < 7; i++)
  ------------------
  |  Branch (549:17): [True: 175, False: 25]
  ------------------
  550|    175|        ecp_nistz256_sqr_mont(res, res);
  551|     25|    ecp_nistz256_mul_mont(p16, res, p8);        /* ffff*p */
  552|       |
  553|     25|    ecp_nistz256_sqr_mont(res, p16);
  554|    400|    for (i = 0; i < 15; i++)
  ------------------
  |  Branch (554:17): [True: 375, False: 25]
  ------------------
  555|    375|        ecp_nistz256_sqr_mont(res, res);
  556|     25|    ecp_nistz256_mul_mont(p32, res, p16);       /* ffffffff*p */
  557|       |
  558|     25|    ecp_nistz256_sqr_mont(res, p32);
  559|    800|    for (i = 0; i < 31; i++)
  ------------------
  |  Branch (559:17): [True: 775, False: 25]
  ------------------
  560|    775|        ecp_nistz256_sqr_mont(res, res);
  561|     25|    ecp_nistz256_mul_mont(res, res, in);
  562|       |
  563|  3.22k|    for (i = 0; i < 32 * 4; i++)
  ------------------
  |  Branch (563:17): [True: 3.20k, False: 25]
  ------------------
  564|  3.20k|        ecp_nistz256_sqr_mont(res, res);
  565|     25|    ecp_nistz256_mul_mont(res, res, p32);
  566|       |
  567|    825|    for (i = 0; i < 32; i++)
  ------------------
  |  Branch (567:17): [True: 800, False: 25]
  ------------------
  568|    800|        ecp_nistz256_sqr_mont(res, res);
  569|     25|    ecp_nistz256_mul_mont(res, res, p32);
  570|       |
  571|    425|    for (i = 0; i < 16; i++)
  ------------------
  |  Branch (571:17): [True: 400, False: 25]
  ------------------
  572|    400|        ecp_nistz256_sqr_mont(res, res);
  573|     25|    ecp_nistz256_mul_mont(res, res, p16);
  574|       |
  575|    225|    for (i = 0; i < 8; i++)
  ------------------
  |  Branch (575:17): [True: 200, False: 25]
  ------------------
  576|    200|        ecp_nistz256_sqr_mont(res, res);
  577|     25|    ecp_nistz256_mul_mont(res, res, p8);
  578|       |
  579|     25|    ecp_nistz256_sqr_mont(res, res);
  580|     25|    ecp_nistz256_sqr_mont(res, res);
  581|     25|    ecp_nistz256_sqr_mont(res, res);
  582|     25|    ecp_nistz256_sqr_mont(res, res);
  583|     25|    ecp_nistz256_mul_mont(res, res, p4);
  584|       |
  585|     25|    ecp_nistz256_sqr_mont(res, res);
  586|     25|    ecp_nistz256_sqr_mont(res, res);
  587|     25|    ecp_nistz256_mul_mont(res, res, p2);
  588|       |
  589|     25|    ecp_nistz256_sqr_mont(res, res);
  590|     25|    ecp_nistz256_sqr_mont(res, res);
  591|     25|    ecp_nistz256_mul_mont(res, res, in);
  592|       |
  593|     25|    memcpy(r, res, sizeof(res));
  594|     25|}
ecp_nistz256.c:ecp_nistz256_points_mul:
  945|     27|{
  946|     27|    int i = 0, ret = 0, no_precomp_for_generator = 0, p_is_infinity = 0;
  947|     27|    unsigned char p_str[33] = { 0 };
  948|     27|    const PRECOMP256_ROW *preComputedTable = NULL;
  949|     27|    const NISTZ256_PRE_COMP *pre_comp = NULL;
  950|     27|    const EC_POINT *generator = NULL;
  951|     27|    const BIGNUM **new_scalars = NULL;
  952|     27|    const EC_POINT **new_points = NULL;
  953|     27|    unsigned int idx = 0;
  954|     27|    const unsigned int window_size = 7;
  955|     27|    const unsigned int mask = (1 << (window_size + 1)) - 1;
  956|     27|    unsigned int wvalue;
  957|     27|    ALIGN32 union {
  ------------------
  |  |   30|     27|#  define ALIGN32       __attribute((aligned(32)))
  ------------------
  958|     27|        P256_POINT p;
  959|     27|        P256_POINT_AFFINE a;
  960|     27|    } t, p;
  961|     27|    BIGNUM *tmp_scalar;
  962|       |
  963|     27|    if ((num + 1) == 0 || (num + 1) > OPENSSL_MALLOC_MAX_NELEMS(void *)) {
  ------------------
  |  |  148|     27|# define OPENSSL_MALLOC_MAX_NELEMS(type)  (((1U<<(sizeof(int)*8-1))-1)/sizeof(type))
  ------------------
  |  Branch (963:9): [True: 0, False: 27]
  |  Branch (963:27): [True: 0, False: 27]
  ------------------
  964|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  965|      0|        return 0;
  966|      0|    }
  967|       |
  968|     27|    memset(&p, 0, sizeof(p));
  969|     27|    BN_CTX_start(ctx);
  970|       |
  971|     27|    if (scalar) {
  ------------------
  |  Branch (971:9): [True: 27, False: 0]
  ------------------
  972|     27|        generator = EC_GROUP_get0_generator(group);
  973|     27|        if (generator == NULL) {
  ------------------
  |  Branch (973:13): [True: 0, False: 27]
  ------------------
  974|      0|            ERR_raise(ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  975|      0|            goto err;
  976|      0|        }
  977|       |
  978|       |        /* look if we can use precomputed multiples of generator */
  979|     27|        pre_comp = group->pre_comp.nistz256;
  980|       |
  981|     27|        if (pre_comp) {
  ------------------
  |  Branch (981:13): [True: 0, False: 27]
  ------------------
  982|       |            /*
  983|       |             * If there is a precomputed table for the generator, check that
  984|       |             * it was generated with the same generator.
  985|       |             */
  986|      0|            EC_POINT *pre_comp_generator = EC_POINT_new(group);
  987|      0|            if (pre_comp_generator == NULL)
  ------------------
  |  Branch (987:17): [True: 0, False: 0]
  ------------------
  988|      0|                goto err;
  989|       |
  990|      0|            ecp_nistz256_gather_w7(&p.a, pre_comp->precomp[0], 1);
  991|      0|            if (!ecp_nistz256_set_from_affine(pre_comp_generator,
  ------------------
  |  Branch (991:17): [True: 0, False: 0]
  ------------------
  992|      0|                                              group, &p.a, ctx)) {
  993|      0|                EC_POINT_free(pre_comp_generator);
  994|      0|                goto err;
  995|      0|            }
  996|       |
  997|      0|            if (0 == EC_POINT_cmp(group, generator, pre_comp_generator, ctx))
  ------------------
  |  Branch (997:17): [True: 0, False: 0]
  ------------------
  998|      0|                preComputedTable = (const PRECOMP256_ROW *)pre_comp->precomp;
  999|       |
 1000|      0|            EC_POINT_free(pre_comp_generator);
 1001|      0|        }
 1002|       |
 1003|     27|        if (preComputedTable == NULL && ecp_nistz256_is_affine_G(generator)) {
  ------------------
  |  Branch (1003:13): [True: 27, False: 0]
  |  Branch (1003:41): [True: 27, False: 0]
  ------------------
 1004|       |            /*
 1005|       |             * If there is no precomputed data, but the generator is the
 1006|       |             * default, a hardcoded table of precomputed data is used. This
 1007|       |             * is because applications, such as Apache, do not use
 1008|       |             * EC_KEY_precompute_mult.
 1009|       |             */
 1010|     27|            preComputedTable = ecp_nistz256_precomputed;
 1011|     27|        }
 1012|       |
 1013|     27|        if (preComputedTable) {
  ------------------
  |  Branch (1013:13): [True: 27, False: 0]
  ------------------
 1014|     27|            BN_ULONG infty;
  ------------------
  |  |   37|     27|#  define BN_ULONG        unsigned long
  ------------------
 1015|       |
 1016|     27|            if ((BN_num_bits(scalar) > 256)
  ------------------
  |  Branch (1016:17): [True: 4, False: 23]
  ------------------
 1017|     27|                || BN_is_negative(scalar)) {
  ------------------
  |  Branch (1017:20): [True: 0, False: 23]
  ------------------
 1018|      4|                if ((tmp_scalar = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (1018:21): [True: 0, False: 4]
  ------------------
 1019|      0|                    goto err;
 1020|       |
 1021|      4|                if (!BN_nnmod(tmp_scalar, scalar, group->order, ctx)) {
  ------------------
  |  Branch (1021:21): [True: 0, False: 4]
  ------------------
 1022|      0|                    ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1023|      0|                    goto err;
 1024|      0|                }
 1025|      4|                scalar = tmp_scalar;
 1026|      4|            }
 1027|       |
 1028|     87|            for (i = 0; i < bn_get_top(scalar) * BN_BYTES; i += BN_BYTES) {
  ------------------
  |  |   38|     87|#  define BN_BYTES        8
  ------------------
                          for (i = 0; i < bn_get_top(scalar) * BN_BYTES; i += BN_BYTES) {
  ------------------
  |  |   38|     60|#  define BN_BYTES        8
  ------------------
  |  Branch (1028:25): [True: 60, False: 27]
  ------------------
 1029|     60|                BN_ULONG d = bn_get_words(scalar)[i / BN_BYTES];
  ------------------
  |  |   37|     60|#  define BN_ULONG        unsigned long
  ------------------
                              BN_ULONG d = bn_get_words(scalar)[i / BN_BYTES];
  ------------------
  |  |   38|     60|#  define BN_BYTES        8
  ------------------
 1030|       |
 1031|     60|                p_str[i + 0] = (unsigned char)d;
 1032|     60|                p_str[i + 1] = (unsigned char)(d >> 8);
 1033|     60|                p_str[i + 2] = (unsigned char)(d >> 16);
 1034|     60|                p_str[i + 3] = (unsigned char)(d >>= 24);
 1035|     60|                if (BN_BYTES == 8) {
  ------------------
  |  |   38|     60|#  define BN_BYTES        8
  ------------------
  |  Branch (1035:21): [Folded - Ignored]
  ------------------
 1036|     60|                    d >>= 8;
 1037|     60|                    p_str[i + 4] = (unsigned char)d;
 1038|     60|                    p_str[i + 5] = (unsigned char)(d >> 8);
 1039|     60|                    p_str[i + 6] = (unsigned char)(d >> 16);
 1040|     60|                    p_str[i + 7] = (unsigned char)(d >> 24);
 1041|     60|                }
 1042|     60|            }
 1043|       |
 1044|    438|            for (; i < 33; i++)
  ------------------
  |  Branch (1044:20): [True: 411, False: 27]
  ------------------
 1045|    411|                p_str[i] = 0;
 1046|       |
 1047|       |            /* First window */
 1048|     27|            wvalue = (p_str[0] << 1) & mask;
 1049|     27|            idx += window_size;
 1050|       |
 1051|     27|            wvalue = _booth_recode_w7(wvalue);
 1052|       |
 1053|     27|            ecp_nistz256_gather_w7(&p.a, preComputedTable[0],
 1054|     27|                                   wvalue >> 1);
 1055|       |
 1056|     27|            ecp_nistz256_neg(p.p.Z, p.p.Y);
 1057|     27|            copy_conditional(p.p.Y, p.p.Z, wvalue & 1);
 1058|       |
 1059|       |            /*
 1060|       |             * Since affine infinity is encoded as (0,0) and
 1061|       |             * Jacobian is (,,0), we need to harmonize them
 1062|       |             * by assigning "one" or zero to Z.
 1063|       |             */
 1064|     27|            infty = (p.p.X[0] | p.p.X[1] | p.p.X[2] | p.p.X[3] |
 1065|     27|                     p.p.Y[0] | p.p.Y[1] | p.p.Y[2] | p.p.Y[3]);
 1066|     27|            if (P256_LIMBS == 8)
  ------------------
  |  |   41|     27|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     27|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     27|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1066:17): [Folded - Ignored]
  ------------------
 1067|      0|                infty |= (p.p.X[4] | p.p.X[5] | p.p.X[6] | p.p.X[7] |
 1068|      0|                          p.p.Y[4] | p.p.Y[5] | p.p.Y[6] | p.p.Y[7]);
 1069|       |
 1070|     27|            infty = 0 - is_zero(infty);
 1071|     27|            infty = ~infty;
 1072|       |
 1073|     27|            p.p.Z[0] = ONE[0] & infty;
 1074|     27|            p.p.Z[1] = ONE[1] & infty;
 1075|     27|            p.p.Z[2] = ONE[2] & infty;
 1076|     27|            p.p.Z[3] = ONE[3] & infty;
 1077|     27|            if (P256_LIMBS == 8) {
  ------------------
  |  |   41|     27|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     27|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     27|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1077:17): [Folded - Ignored]
  ------------------
 1078|      0|                p.p.Z[4] = ONE[4] & infty;
 1079|      0|                p.p.Z[5] = ONE[5] & infty;
 1080|      0|                p.p.Z[6] = ONE[6] & infty;
 1081|      0|                p.p.Z[7] = ONE[7] & infty;
 1082|      0|            }
 1083|       |
 1084|    999|            for (i = 1; i < 37; i++) {
  ------------------
  |  Branch (1084:25): [True: 972, False: 27]
  ------------------
 1085|    972|                unsigned int off = (idx - 1) / 8;
 1086|    972|                wvalue = p_str[off] | p_str[off + 1] << 8;
 1087|    972|                wvalue = (wvalue >> ((idx - 1) % 8)) & mask;
 1088|    972|                idx += window_size;
 1089|       |
 1090|    972|                wvalue = _booth_recode_w7(wvalue);
 1091|       |
 1092|    972|                ecp_nistz256_gather_w7(&t.a,
 1093|    972|                                       preComputedTable[i], wvalue >> 1);
 1094|       |
 1095|    972|                ecp_nistz256_neg(t.p.Z, t.a.Y);
 1096|    972|                copy_conditional(t.a.Y, t.p.Z, wvalue & 1);
 1097|       |
 1098|    972|                ecp_nistz256_point_add_affine(&p.p, &p.p, &t.a);
 1099|    972|            }
 1100|     27|        } else {
 1101|      0|            p_is_infinity = 1;
 1102|      0|            no_precomp_for_generator = 1;
 1103|      0|        }
 1104|     27|    } else
 1105|      0|        p_is_infinity = 1;
 1106|       |
 1107|     27|    if (no_precomp_for_generator) {
  ------------------
  |  Branch (1107:9): [True: 0, False: 27]
  ------------------
 1108|       |        /*
 1109|       |         * Without a precomputed table for the generator, it has to be
 1110|       |         * handled like a normal point.
 1111|       |         */
 1112|      0|        new_scalars = OPENSSL_malloc((num + 1) * sizeof(BIGNUM *));
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1113|      0|        if (new_scalars == NULL)
  ------------------
  |  Branch (1113:13): [True: 0, False: 0]
  ------------------
 1114|      0|            goto err;
 1115|       |
 1116|      0|        new_points = OPENSSL_malloc((num + 1) * sizeof(EC_POINT *));
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1117|      0|        if (new_points == NULL)
  ------------------
  |  Branch (1117:13): [True: 0, False: 0]
  ------------------
 1118|      0|            goto err;
 1119|       |
 1120|      0|        memcpy(new_scalars, scalars, num * sizeof(BIGNUM *));
 1121|      0|        new_scalars[num] = scalar;
 1122|      0|        memcpy(new_points, points, num * sizeof(EC_POINT *));
 1123|      0|        new_points[num] = generator;
 1124|       |
 1125|      0|        scalars = new_scalars;
 1126|      0|        points = new_points;
 1127|      0|        num++;
 1128|      0|    }
 1129|       |
 1130|     27|    if (num) {
  ------------------
  |  Branch (1130:9): [True: 0, False: 27]
  ------------------
 1131|      0|        P256_POINT *out = &t.p;
 1132|      0|        if (p_is_infinity)
  ------------------
  |  Branch (1132:13): [True: 0, False: 0]
  ------------------
 1133|      0|            out = &p.p;
 1134|       |
 1135|      0|        if (!ecp_nistz256_windowed_mul(group, out, scalars, points, num, ctx))
  ------------------
  |  Branch (1135:13): [True: 0, False: 0]
  ------------------
 1136|      0|            goto err;
 1137|       |
 1138|      0|        if (!p_is_infinity)
  ------------------
  |  Branch (1138:13): [True: 0, False: 0]
  ------------------
 1139|      0|            ecp_nistz256_point_add(&p.p, &p.p, out);
 1140|      0|    }
 1141|       |
 1142|       |    /* Not constant-time, but we're only operating on the public output. */
 1143|     27|    if (!bn_set_words(r->X, p.p.X, P256_LIMBS) ||
  ------------------
  |  |   41|     27|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     27|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     27|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1143:9): [True: 0, False: 27]
  ------------------
 1144|     27|        !bn_set_words(r->Y, p.p.Y, P256_LIMBS) ||
  ------------------
  |  |   41|     27|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     27|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     27|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1144:9): [True: 0, False: 27]
  ------------------
 1145|     27|        !bn_set_words(r->Z, p.p.Z, P256_LIMBS)) {
  ------------------
  |  |   41|     27|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     27|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     27|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1145:9): [True: 0, False: 27]
  ------------------
 1146|      0|        goto err;
 1147|      0|    }
 1148|     27|    r->Z_is_one = is_one(r->Z) & 1;
 1149|       |
 1150|     27|    ret = 1;
 1151|       |
 1152|     27|err:
 1153|     27|    BN_CTX_end(ctx);
 1154|     27|    OPENSSL_free(new_points);
  ------------------
  |  |  115|     27|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1155|     27|    OPENSSL_free(new_scalars);
  ------------------
  |  |  115|     27|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1156|     27|    return ret;
 1157|     27|}
ecp_nistz256.c:ecp_nistz256_is_affine_G:
  794|     27|{
  795|     27|    return (bn_get_top(generator->X) == P256_LIMBS) &&
  ------------------
  |  |   41|     27|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     27|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     27|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (795:12): [True: 27, False: 0]
  ------------------
  796|     27|        (bn_get_top(generator->Y) == P256_LIMBS) &&
  ------------------
  |  |   41|     27|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     27|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     27|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (796:9): [True: 27, False: 0]
  ------------------
  797|     27|        is_equal(bn_get_words(generator->X), def_xG) &&
  ------------------
  |  Branch (797:9): [True: 27, False: 0]
  ------------------
  798|     27|        is_equal(bn_get_words(generator->Y), def_yG) &&
  ------------------
  |  Branch (798:9): [True: 27, False: 0]
  ------------------
  799|     27|        is_one(generator->Z);
  ------------------
  |  Branch (799:9): [True: 27, False: 0]
  ------------------
  800|     27|}
ecp_nistz256.c:is_equal:
  196|     54|{
  197|     54|    BN_ULONG res;
  ------------------
  |  |   37|     54|#  define BN_ULONG        unsigned long
  ------------------
  198|       |
  199|     54|    res = a[0] ^ b[0];
  200|     54|    res |= a[1] ^ b[1];
  201|     54|    res |= a[2] ^ b[2];
  202|     54|    res |= a[3] ^ b[3];
  203|     54|    if (P256_LIMBS == 8) {
  ------------------
  |  |   41|     54|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     54|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     54|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (203:9): [Folded - Ignored]
  ------------------
  204|      0|        res |= a[4] ^ b[4];
  205|      0|        res |= a[5] ^ b[5];
  206|      0|        res |= a[6] ^ b[6];
  207|      0|        res |= a[7] ^ b[7];
  208|      0|    }
  209|       |
  210|     54|    return is_zero(res);
  211|     54|}
ecp_nistz256.c:_booth_recode_w7:
  157|    999|{
  158|    999|    unsigned int s, d;
  159|       |
  160|    999|    s = ~((in >> 7) - 1);
  161|    999|    d = (1 << 8) - in - 1;
  162|    999|    d = (d & s) | (in & ~s);
  163|    999|    d = (d >> 1) + (d & 1);
  164|       |
  165|    999|    return (d << 1) + (s & 1);
  166|    999|}
ecp_nistz256.c:copy_conditional:
  170|    999|{
  171|    999|    BN_ULONG mask1 = 0-move;
  ------------------
  |  |   37|    999|#  define BN_ULONG        unsigned long
  ------------------
  172|    999|    BN_ULONG mask2 = ~mask1;
  ------------------
  |  |   37|    999|#  define BN_ULONG        unsigned long
  ------------------
  173|       |
  174|    999|    dst[0] = (src[0] & mask1) ^ (dst[0] & mask2);
  175|    999|    dst[1] = (src[1] & mask1) ^ (dst[1] & mask2);
  176|    999|    dst[2] = (src[2] & mask1) ^ (dst[2] & mask2);
  177|    999|    dst[3] = (src[3] & mask1) ^ (dst[3] & mask2);
  178|    999|    if (P256_LIMBS == 8) {
  ------------------
  |  |   41|    999|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|    999|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    999|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (178:9): [Folded - Ignored]
  ------------------
  179|      0|        dst[4] = (src[4] & mask1) ^ (dst[4] & mask2);
  180|      0|        dst[5] = (src[5] & mask1) ^ (dst[5] & mask2);
  181|      0|        dst[6] = (src[6] & mask1) ^ (dst[6] & mask2);
  182|      0|        dst[7] = (src[7] & mask1) ^ (dst[7] & mask2);
  183|      0|    }
  184|    999|}
ecp_nistz256.c:is_zero:
  187|    129|{
  188|    129|    in |= (0 - in);
  189|    129|    in = ~in;
  190|    129|    in >>= BN_BITS2 - 1;
  ------------------
  |  |   54|    129|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|    129|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  191|    129|    return in;
  192|    129|}
ecp_nistz256.c:is_one:
  214|     54|{
  215|     54|    BN_ULONG res = 0;
  ------------------
  |  |   37|     54|#  define BN_ULONG        unsigned long
  ------------------
  216|     54|    BN_ULONG *a = bn_get_words(z);
  ------------------
  |  |   37|     54|#  define BN_ULONG        unsigned long
  ------------------
  217|       |
  218|     54|    if (bn_get_top(z) == (P256_LIMBS - P256_LIMBS / 8)) {
  ------------------
  |  |   41|     54|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     54|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     54|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (bn_get_top(z) == (P256_LIMBS - P256_LIMBS / 8)) {
  ------------------
  |  |   41|     54|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     54|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     54|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (218:9): [True: 48, False: 6]
  ------------------
  219|     48|        res = a[0] ^ ONE[0];
  220|     48|        res |= a[1] ^ ONE[1];
  221|     48|        res |= a[2] ^ ONE[2];
  222|     48|        res |= a[3] ^ ONE[3];
  223|     48|        if (P256_LIMBS == 8) {
  ------------------
  |  |   41|     48|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     48|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     48|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (223:13): [Folded - Ignored]
  ------------------
  224|      0|            res |= a[4] ^ ONE[4];
  225|      0|            res |= a[5] ^ ONE[5];
  226|      0|            res |= a[6] ^ ONE[6];
  227|       |            /*
  228|       |             * no check for a[7] (being zero) on 32-bit platforms,
  229|       |             * because value of "one" takes only 7 limbs.
  230|       |             */
  231|      0|        }
  232|     48|        res = is_zero(res);
  233|     48|    }
  234|       |
  235|     54|    return res;
  236|     54|}
ecp_nistz256.c:ecp_nistz256group_full_init:
 1449|     49|                                       const unsigned char *params) {
 1450|     49|    BN_CTX *ctx = NULL;
 1451|     49|    BN_MONT_CTX *mont = NULL, *ordmont = NULL;
 1452|     49|    const int param_len = 32;
 1453|     49|    const int seed_len = 20;
 1454|     49|    int ok = 0;
 1455|     49|    uint32_t hi_order_n = 0xccd1c8aa;
 1456|     49|    uint32_t lo_order_n = 0xee00bc4f;
 1457|     49|    BIGNUM *p = NULL, *a = NULL, *b = NULL, *x = NULL, *y = NULL, *one = NULL,
 1458|     49|        *order = NULL;
 1459|     49|    EC_POINT *P = NULL;
 1460|       |
 1461|     49|    if ((ctx = BN_CTX_new_ex(group->libctx)) == NULL) {
  ------------------
  |  Branch (1461:9): [True: 0, False: 49]
  ------------------
 1462|      0|        ERR_raise(ERR_LIB_EC, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1463|      0|        return 0;
 1464|      0|    }
 1465|       |
 1466|     49|    if (!EC_GROUP_set_seed(group, params, seed_len)) {
  ------------------
  |  Branch (1466:9): [True: 0, False: 49]
  ------------------
 1467|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1468|      0|        goto err;
 1469|      0|    }
 1470|     49|    params += seed_len;
 1471|       |
 1472|     49|    if ((p = BN_bin2bn(params + 0 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (1472:9): [True: 0, False: 49]
  ------------------
 1473|     49|        || (a = BN_bin2bn(params + 1 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (1473:12): [True: 0, False: 49]
  ------------------
 1474|     49|        || (b = BN_bin2bn(params + 2 * param_len, param_len, NULL)) == NULL) {
  ------------------
  |  Branch (1474:12): [True: 0, False: 49]
  ------------------
 1475|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1476|      0|        goto err;
 1477|      0|    }
 1478|       |
 1479|       |    /*
 1480|       |     * Set up curve params and montgomery for field
 1481|       |     * Start by setting up montgomery and one
 1482|       |     */
 1483|     49|    mont = BN_MONT_CTX_new();
 1484|     49|    if (mont == NULL)
  ------------------
  |  Branch (1484:9): [True: 0, False: 49]
  ------------------
 1485|      0|        goto err;
 1486|       |
 1487|     49|    if (!ossl_bn_mont_ctx_set(mont, p, 256, params + 6 * param_len, param_len,
  ------------------
  |  Branch (1487:9): [True: 0, False: 49]
  ------------------
 1488|     49|                              1, 0))
 1489|      0|        goto err;
 1490|       |
 1491|     49|    one = BN_new();
 1492|     49|    if (one == NULL) {
  ------------------
  |  Branch (1492:9): [True: 0, False: 49]
  ------------------
 1493|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1494|      0|        goto err;
 1495|      0|    }
 1496|     49|    if (!BN_to_montgomery(one, BN_value_one(), mont, ctx)){
  ------------------
  |  Branch (1496:9): [True: 0, False: 49]
  ------------------
 1497|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1498|      0|        goto err;
 1499|      0|    }
 1500|     49|    group->field_data1 = mont;
 1501|     49|    mont = NULL;
 1502|     49|    group->field_data2 = one;
 1503|     49|    one = NULL;
 1504|       |
 1505|     49|    if (!ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx)) {
  ------------------
  |  Branch (1505:9): [True: 0, False: 49]
  ------------------
 1506|      0|         ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1507|      0|        goto err;
 1508|      0|    }
 1509|       |
 1510|     49|    if ((P = EC_POINT_new(group)) == NULL) {
  ------------------
  |  Branch (1510:9): [True: 0, False: 49]
  ------------------
 1511|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1512|      0|        goto err;
 1513|      0|    }
 1514|       |
 1515|     49|    if ((x = BN_bin2bn(params + 3 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (1515:9): [True: 0, False: 49]
  ------------------
 1516|     49|        || (y = BN_bin2bn(params + 4 * param_len, param_len, NULL)) == NULL) {
  ------------------
  |  Branch (1516:12): [True: 0, False: 49]
  ------------------
 1517|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1518|      0|        goto err;
 1519|      0|    }
 1520|     49|    if (!EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) {
  ------------------
  |  Branch (1520:9): [True: 0, False: 49]
  ------------------
 1521|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1522|      0|        goto err;
 1523|      0|    }
 1524|     49|    if ((order = BN_bin2bn(params + 5 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (1524:9): [True: 0, False: 49]
  ------------------
 1525|     49|        || !BN_set_word(x, (BN_ULONG)1)) { /* cofactor is 1 */
  ------------------
  |  Branch (1525:12): [True: 0, False: 49]
  ------------------
 1526|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1527|      0|        goto err;
 1528|      0|    }
 1529|       |
 1530|       |    /*
 1531|       |     * Set up generator and order and montgomery data
 1532|       |     */
 1533|     49|    group->generator = EC_POINT_new(group);
 1534|     49|    if (group->generator == NULL){
  ------------------
  |  Branch (1534:9): [True: 0, False: 49]
  ------------------
 1535|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1536|      0|        goto err;
 1537|      0|    }
 1538|     49|    if (!EC_POINT_copy(group->generator, P))
  ------------------
  |  Branch (1538:9): [True: 0, False: 49]
  ------------------
 1539|      0|        goto err;
 1540|     49|    if (!BN_copy(group->order, order))
  ------------------
  |  Branch (1540:9): [True: 0, False: 49]
  ------------------
 1541|      0|        goto err;
 1542|     49|    if (!BN_set_word(group->cofactor, 1))
  ------------------
  |  Branch (1542:9): [True: 0, False: 49]
  ------------------
 1543|      0|        goto err;
 1544|       |
 1545|     49|    ordmont = BN_MONT_CTX_new();
 1546|     49|    if (ordmont  == NULL)
  ------------------
  |  Branch (1546:9): [True: 0, False: 49]
  ------------------
 1547|      0|        goto err;
 1548|     49|    if (!ossl_bn_mont_ctx_set(ordmont, order, 256, params + 7 * param_len,
  ------------------
  |  Branch (1548:9): [True: 0, False: 49]
  ------------------
 1549|     49|                              param_len, lo_order_n, hi_order_n))
 1550|      0|        goto err;
 1551|       |
 1552|     49|    group->mont_data = ordmont;
 1553|     49|    ordmont = NULL;
 1554|       |
 1555|     49|    ok = 1;
 1556|       |
 1557|     49| err:
 1558|     49|    EC_POINT_free(P);
 1559|     49|    BN_CTX_free(ctx);
 1560|     49|    BN_MONT_CTX_free(mont);
 1561|     49|    BN_MONT_CTX_free(ordmont);
 1562|     49|    BN_free(p);
 1563|     49|    BN_free(one);
 1564|     49|    BN_free(a);
 1565|     49|    BN_free(b);
 1566|     49|    BN_free(order);
 1567|     49|    BN_free(x);
 1568|     49|    BN_free(y);
 1569|       |
 1570|     49|    return ok;
 1571|     49|}

ossl_ec_GFp_simple_set_compressed_coordinates:
   26|  1.85k|{
   27|  1.85k|    BN_CTX *new_ctx = NULL;
   28|  1.85k|    BIGNUM *tmp1, *tmp2, *x, *y;
   29|  1.85k|    int ret = 0;
   30|       |
   31|  1.85k|    if (ctx == NULL) {
  ------------------
  |  Branch (31:9): [True: 0, False: 1.85k]
  ------------------
   32|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
   33|      0|        if (ctx == NULL)
  ------------------
  |  Branch (33:13): [True: 0, False: 0]
  ------------------
   34|      0|            return 0;
   35|      0|    }
   36|       |
   37|  1.85k|    y_bit = (y_bit != 0);
   38|       |
   39|  1.85k|    BN_CTX_start(ctx);
   40|  1.85k|    tmp1 = BN_CTX_get(ctx);
   41|  1.85k|    tmp2 = BN_CTX_get(ctx);
   42|  1.85k|    x = BN_CTX_get(ctx);
   43|  1.85k|    y = BN_CTX_get(ctx);
   44|  1.85k|    if (y == NULL)
  ------------------
  |  Branch (44:9): [True: 0, False: 1.85k]
  ------------------
   45|      0|        goto err;
   46|       |
   47|       |    /*-
   48|       |     * Recover y.  We have a Weierstrass equation
   49|       |     *     y^2 = x^3 + a*x + b,
   50|       |     * so  y  is one of the square roots of  x^3 + a*x + b.
   51|       |     */
   52|       |
   53|       |    /* tmp1 := x^3 */
   54|  1.85k|    if (!BN_nnmod(x, x_, group->field, ctx))
  ------------------
  |  Branch (54:9): [True: 0, False: 1.85k]
  ------------------
   55|      0|        goto err;
   56|  1.85k|    if (group->meth->field_decode == 0) {
  ------------------
  |  Branch (56:9): [True: 487, False: 1.36k]
  ------------------
   57|       |        /* field_{sqr,mul} work on standard representation */
   58|    487|        if (!group->meth->field_sqr(group, tmp2, x_, ctx))
  ------------------
  |  Branch (58:13): [True: 0, False: 487]
  ------------------
   59|      0|            goto err;
   60|    487|        if (!group->meth->field_mul(group, tmp1, tmp2, x_, ctx))
  ------------------
  |  Branch (60:13): [True: 0, False: 487]
  ------------------
   61|      0|            goto err;
   62|  1.36k|    } else {
   63|  1.36k|        if (!BN_mod_sqr(tmp2, x_, group->field, ctx))
  ------------------
  |  Branch (63:13): [True: 0, False: 1.36k]
  ------------------
   64|      0|            goto err;
   65|  1.36k|        if (!BN_mod_mul(tmp1, tmp2, x_, group->field, ctx))
  ------------------
  |  Branch (65:13): [True: 0, False: 1.36k]
  ------------------
   66|      0|            goto err;
   67|  1.36k|    }
   68|       |
   69|       |    /* tmp1 := tmp1 + a*x */
   70|  1.85k|    if (group->a_is_minus3) {
  ------------------
  |  Branch (70:9): [True: 717, False: 1.13k]
  ------------------
   71|    717|        if (!BN_mod_lshift1_quick(tmp2, x, group->field))
  ------------------
  |  Branch (71:13): [True: 0, False: 717]
  ------------------
   72|      0|            goto err;
   73|    717|        if (!BN_mod_add_quick(tmp2, tmp2, x, group->field))
  ------------------
  |  Branch (73:13): [True: 0, False: 717]
  ------------------
   74|      0|            goto err;
   75|    717|        if (!BN_mod_sub_quick(tmp1, tmp1, tmp2, group->field))
  ------------------
  |  Branch (75:13): [True: 0, False: 717]
  ------------------
   76|      0|            goto err;
   77|  1.13k|    } else {
   78|  1.13k|        if (group->meth->field_decode) {
  ------------------
  |  Branch (78:13): [True: 1.13k, False: 0]
  ------------------
   79|  1.13k|            if (!group->meth->field_decode(group, tmp2, group->a, ctx))
  ------------------
  |  Branch (79:17): [True: 0, False: 1.13k]
  ------------------
   80|      0|                goto err;
   81|  1.13k|            if (!BN_mod_mul(tmp2, tmp2, x, group->field, ctx))
  ------------------
  |  Branch (81:17): [True: 0, False: 1.13k]
  ------------------
   82|      0|                goto err;
   83|  1.13k|        } else {
   84|       |            /* field_mul works on standard representation */
   85|      0|            if (!group->meth->field_mul(group, tmp2, group->a, x, ctx))
  ------------------
  |  Branch (85:17): [True: 0, False: 0]
  ------------------
   86|      0|                goto err;
   87|      0|        }
   88|       |
   89|  1.13k|        if (!BN_mod_add_quick(tmp1, tmp1, tmp2, group->field))
  ------------------
  |  Branch (89:13): [True: 0, False: 1.13k]
  ------------------
   90|      0|            goto err;
   91|  1.13k|    }
   92|       |
   93|       |    /* tmp1 := tmp1 + b */
   94|  1.85k|    if (group->meth->field_decode) {
  ------------------
  |  Branch (94:9): [True: 1.36k, False: 487]
  ------------------
   95|  1.36k|        if (!group->meth->field_decode(group, tmp2, group->b, ctx))
  ------------------
  |  Branch (95:13): [True: 0, False: 1.36k]
  ------------------
   96|      0|            goto err;
   97|  1.36k|        if (!BN_mod_add_quick(tmp1, tmp1, tmp2, group->field))
  ------------------
  |  Branch (97:13): [True: 0, False: 1.36k]
  ------------------
   98|      0|            goto err;
   99|  1.36k|    } else {
  100|    487|        if (!BN_mod_add_quick(tmp1, tmp1, group->b, group->field))
  ------------------
  |  Branch (100:13): [True: 0, False: 487]
  ------------------
  101|      0|            goto err;
  102|    487|    }
  103|       |
  104|  1.85k|    ERR_set_mark();
  105|  1.85k|    if (!BN_mod_sqrt(y, tmp1, group->field, ctx)) {
  ------------------
  |  Branch (105:9): [True: 688, False: 1.16k]
  ------------------
  106|    688|#ifndef FIPS_MODULE
  107|    688|        unsigned long err = ERR_peek_last_error();
  108|       |
  109|    688|        if (ERR_GET_LIB(err) == ERR_LIB_BN
  ------------------
  |  |   73|  1.37k|# define ERR_LIB_BN              3
  ------------------
  |  Branch (109:13): [True: 688, False: 0]
  ------------------
  110|    688|            && ERR_GET_REASON(err) == BN_R_NOT_A_SQUARE) {
  ------------------
  |  |   36|    688|# define BN_R_NOT_A_SQUARE                                111
  ------------------
  |  Branch (110:16): [True: 643, False: 45]
  ------------------
  111|    643|            ERR_pop_to_mark();
  112|    643|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT);
  ------------------
  |  |  401|    643|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    643|    (ERR_new(),                                                 \
  |  |  |  |  404|    643|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    643|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    643|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    643|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    643|     ERR_set_error)
  |  |  ------------------
  ------------------
  113|    643|        } else
  114|     45|#endif
  115|     45|        {
  116|     45|            ERR_clear_last_mark();
  117|     45|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|     45|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     45|    (ERR_new(),                                                 \
  |  |  |  |  404|     45|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     45|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     45|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     45|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     45|     ERR_set_error)
  |  |  ------------------
  ------------------
  118|     45|        }
  119|    688|        goto err;
  120|    688|    }
  121|  1.16k|    ERR_clear_last_mark();
  122|       |
  123|  1.16k|    if (y_bit != BN_is_odd(y)) {
  ------------------
  |  Branch (123:9): [True: 564, False: 602]
  ------------------
  124|    564|        if (BN_is_zero(y)) {
  ------------------
  |  Branch (124:13): [True: 10, False: 554]
  ------------------
  125|     10|            int kron;
  126|       |
  127|     10|            kron = BN_kronecker(x, group->field, ctx);
  128|     10|            if (kron == -2)
  ------------------
  |  Branch (128:17): [True: 0, False: 10]
  ------------------
  129|      0|                goto err;
  130|       |
  131|     10|            if (kron == 1)
  ------------------
  |  Branch (131:17): [True: 0, False: 10]
  ------------------
  132|     10|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_COMPRESSION_BIT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  133|     10|            else
  134|       |                /*
  135|       |                 * BN_mod_sqrt() should have caught this error (not a square)
  136|       |                 */
  137|     10|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT);
  ------------------
  |  |  401|     10|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     10|    (ERR_new(),                                                 \
  |  |  |  |  404|     10|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     10|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     10|     ERR_set_error)
  |  |  ------------------
  ------------------
  138|     10|            goto err;
  139|     10|        }
  140|    554|        if (!BN_usub(y, group->field, y))
  ------------------
  |  Branch (140:13): [True: 0, False: 554]
  ------------------
  141|      0|            goto err;
  142|    554|    }
  143|  1.15k|    if (y_bit != BN_is_odd(y)) {
  ------------------
  |  Branch (143:9): [True: 0, False: 1.15k]
  ------------------
  144|      0|        ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  145|      0|        goto err;
  146|      0|    }
  147|       |
  148|  1.15k|    if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (148:9): [True: 0, False: 1.15k]
  ------------------
  149|      0|        goto err;
  150|       |
  151|  1.15k|    ret = 1;
  152|       |
  153|  1.85k| err:
  154|  1.85k|    BN_CTX_end(ctx);
  155|  1.85k|    BN_CTX_free(new_ctx);
  156|  1.85k|    return ret;
  157|  1.15k|}
ossl_ec_GFp_simple_point2oct:
  162|  3.40k|{
  163|  3.40k|    size_t ret;
  164|  3.40k|    BN_CTX *new_ctx = NULL;
  165|  3.40k|    int used_ctx = 0;
  166|  3.40k|    BIGNUM *x, *y;
  167|  3.40k|    size_t field_len, i, skip;
  168|       |
  169|  3.40k|    if ((form != POINT_CONVERSION_COMPRESSED)
  ------------------
  |  Branch (169:9): [True: 1.30k, False: 2.10k]
  ------------------
  170|  3.40k|        && (form != POINT_CONVERSION_UNCOMPRESSED)
  ------------------
  |  Branch (170:12): [True: 42, False: 1.25k]
  ------------------
  171|  3.40k|        && (form != POINT_CONVERSION_HYBRID)) {
  ------------------
  |  Branch (171:12): [True: 26, False: 16]
  ------------------
  172|     26|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_FORM);
  ------------------
  |  |  401|     26|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     26|    (ERR_new(),                                                 \
  |  |  |  |  404|     26|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     26|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     26|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     26|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     26|     ERR_set_error)
  |  |  ------------------
  ------------------
  173|     26|        goto err;
  174|     26|    }
  175|       |
  176|  3.38k|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (176:9): [True: 174, False: 3.20k]
  ------------------
  177|       |        /* encodes to a single 0 octet */
  178|    174|        if (buf != NULL) {
  ------------------
  |  Branch (178:13): [True: 87, False: 87]
  ------------------
  179|     87|            if (len < 1) {
  ------------------
  |  Branch (179:17): [True: 0, False: 87]
  ------------------
  180|      0|                ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  181|      0|                return 0;
  182|      0|            }
  183|     87|            buf[0] = 0;
  184|     87|        }
  185|    174|        return 1;
  186|    174|    }
  187|       |
  188|       |    /* ret := required output buffer length */
  189|  3.20k|    field_len = BN_num_bytes(group->field);
  ------------------
  |  |  189|  3.20k|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  190|  3.20k|    ret =
  191|  3.20k|        (form ==
  ------------------
  |  Branch (191:9): [True: 2.10k, False: 1.10k]
  ------------------
  192|  3.20k|         POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2 * field_len;
  193|       |
  194|       |    /* if 'buf' is NULL, just return required length */
  195|  3.20k|    if (buf != NULL) {
  ------------------
  |  Branch (195:9): [True: 1.60k, False: 1.60k]
  ------------------
  196|  1.60k|        if (len < ret) {
  ------------------
  |  Branch (196:13): [True: 0, False: 1.60k]
  ------------------
  197|      0|            ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  198|      0|            goto err;
  199|      0|        }
  200|       |
  201|  1.60k|        if (ctx == NULL) {
  ------------------
  |  Branch (201:13): [True: 1.38k, False: 219]
  ------------------
  202|  1.38k|            ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  203|  1.38k|            if (ctx == NULL)
  ------------------
  |  Branch (203:17): [True: 0, False: 1.38k]
  ------------------
  204|      0|                return 0;
  205|  1.38k|        }
  206|       |
  207|  1.60k|        BN_CTX_start(ctx);
  208|  1.60k|        used_ctx = 1;
  209|  1.60k|        x = BN_CTX_get(ctx);
  210|  1.60k|        y = BN_CTX_get(ctx);
  211|  1.60k|        if (y == NULL)
  ------------------
  |  Branch (211:13): [True: 0, False: 1.60k]
  ------------------
  212|      0|            goto err;
  213|       |
  214|  1.60k|        if (!EC_POINT_get_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (214:13): [True: 0, False: 1.60k]
  ------------------
  215|      0|            goto err;
  216|       |
  217|  1.60k|        if ((form == POINT_CONVERSION_COMPRESSED
  ------------------
  |  Branch (217:14): [True: 1.05k, False: 550]
  ------------------
  218|  1.60k|             || form == POINT_CONVERSION_HYBRID) && BN_is_odd(y))
  ------------------
  |  Branch (218:17): [True: 8, False: 542]
  |  Branch (218:53): [True: 115, False: 946]
  ------------------
  219|    115|            buf[0] = form + 1;
  220|  1.48k|        else
  221|  1.48k|            buf[0] = form;
  222|       |
  223|  1.60k|        i = 1;
  224|       |
  225|  1.60k|        skip = field_len - BN_num_bytes(x);
  ------------------
  |  |  189|  1.60k|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  226|  1.60k|        if (skip > field_len) {
  ------------------
  |  Branch (226:13): [True: 0, False: 1.60k]
  ------------------
  227|      0|            ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  228|      0|            goto err;
  229|      0|        }
  230|  6.37k|        while (skip > 0) {
  ------------------
  |  Branch (230:16): [True: 4.77k, False: 1.60k]
  ------------------
  231|  4.77k|            buf[i++] = 0;
  232|  4.77k|            skip--;
  233|  4.77k|        }
  234|  1.60k|        skip = BN_bn2bin(x, buf + i);
  235|  1.60k|        i += skip;
  236|  1.60k|        if (i != 1 + field_len) {
  ------------------
  |  Branch (236:13): [True: 0, False: 1.60k]
  ------------------
  237|      0|            ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  238|      0|            goto err;
  239|      0|        }
  240|       |
  241|  1.60k|        if (form == POINT_CONVERSION_UNCOMPRESSED
  ------------------
  |  Branch (241:13): [True: 542, False: 1.06k]
  ------------------
  242|  1.60k|            || form == POINT_CONVERSION_HYBRID) {
  ------------------
  |  Branch (242:16): [True: 8, False: 1.05k]
  ------------------
  243|    550|            skip = field_len - BN_num_bytes(y);
  ------------------
  |  |  189|    550|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  244|    550|            if (skip > field_len) {
  ------------------
  |  Branch (244:17): [True: 0, False: 550]
  ------------------
  245|      0|                ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  246|      0|                goto err;
  247|      0|            }
  248|  1.05k|            while (skip > 0) {
  ------------------
  |  Branch (248:20): [True: 507, False: 550]
  ------------------
  249|    507|                buf[i++] = 0;
  250|    507|                skip--;
  251|    507|            }
  252|    550|            skip = BN_bn2bin(y, buf + i);
  253|    550|            i += skip;
  254|    550|        }
  255|       |
  256|  1.60k|        if (i != ret) {
  ------------------
  |  Branch (256:13): [True: 0, False: 1.60k]
  ------------------
  257|      0|            ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  258|      0|            goto err;
  259|      0|        }
  260|  1.60k|    }
  261|       |
  262|  3.20k|    if (used_ctx)
  ------------------
  |  Branch (262:9): [True: 1.60k, False: 1.60k]
  ------------------
  263|  1.60k|        BN_CTX_end(ctx);
  264|  3.20k|    BN_CTX_free(new_ctx);
  265|  3.20k|    return ret;
  266|       |
  267|     26| err:
  268|     26|    if (used_ctx)
  ------------------
  |  Branch (268:9): [True: 0, False: 26]
  ------------------
  269|      0|        BN_CTX_end(ctx);
  270|     26|    BN_CTX_free(new_ctx);
  271|     26|    return 0;
  272|  3.20k|}
ossl_ec_GFp_simple_oct2point:
  277|  2.52k|{
  278|  2.52k|    point_conversion_form_t form;
  279|  2.52k|    int y_bit;
  280|  2.52k|    BN_CTX *new_ctx = NULL;
  281|  2.52k|    BIGNUM *x, *y;
  282|  2.52k|    size_t field_len, enc_len;
  283|  2.52k|    int ret = 0;
  284|       |
  285|  2.52k|    if (len == 0) {
  ------------------
  |  Branch (285:9): [True: 17, False: 2.50k]
  ------------------
  286|     17|        ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|     17|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     17|    (ERR_new(),                                                 \
  |  |  |  |  404|     17|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     17|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     17|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     17|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     17|     ERR_set_error)
  |  |  ------------------
  ------------------
  287|     17|        return 0;
  288|     17|    }
  289|  2.50k|    form = buf[0];
  290|  2.50k|    y_bit = form & 1;
  291|  2.50k|    form = form & ~1U;
  292|  2.50k|    if ((form != 0) && (form != POINT_CONVERSION_COMPRESSED)
  ------------------
  |  Branch (292:9): [True: 2.37k, False: 136]
  |  Branch (292:24): [True: 474, False: 1.89k]
  ------------------
  293|  2.50k|        && (form != POINT_CONVERSION_UNCOMPRESSED)
  ------------------
  |  Branch (293:12): [True: 362, False: 112]
  ------------------
  294|  2.50k|        && (form != POINT_CONVERSION_HYBRID)) {
  ------------------
  |  Branch (294:12): [True: 41, False: 321]
  ------------------
  295|     41|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     41|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     41|    (ERR_new(),                                                 \
  |  |  |  |  404|     41|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     41|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     41|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     41|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     41|     ERR_set_error)
  |  |  ------------------
  ------------------
  296|     41|        return 0;
  297|     41|    }
  298|  2.46k|    if ((form == 0 || form == POINT_CONVERSION_UNCOMPRESSED) && y_bit) {
  ------------------
  |  Branch (298:10): [True: 136, False: 2.33k]
  |  Branch (298:23): [True: 112, False: 2.21k]
  |  Branch (298:65): [True: 18, False: 230]
  ------------------
  299|     18|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     18|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     18|    (ERR_new(),                                                 \
  |  |  |  |  404|     18|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     18|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     18|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     18|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     18|     ERR_set_error)
  |  |  ------------------
  ------------------
  300|     18|        return 0;
  301|     18|    }
  302|       |
  303|  2.44k|    if (form == 0) {
  ------------------
  |  Branch (303:9): [True: 121, False: 2.32k]
  ------------------
  304|    121|        if (len != 1) {
  ------------------
  |  Branch (304:13): [True: 15, False: 106]
  ------------------
  305|     15|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     15|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     15|    (ERR_new(),                                                 \
  |  |  |  |  404|     15|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     15|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     15|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     15|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     15|     ERR_set_error)
  |  |  ------------------
  ------------------
  306|     15|            return 0;
  307|     15|        }
  308|       |
  309|    106|        return EC_POINT_set_to_infinity(group, point);
  310|    121|    }
  311|       |
  312|  2.32k|    field_len = BN_num_bytes(group->field);
  ------------------
  |  |  189|  2.32k|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  313|  2.32k|    enc_len =
  314|  2.32k|        (form ==
  ------------------
  |  Branch (314:9): [True: 1.89k, False: 430]
  ------------------
  315|  2.32k|         POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2 * field_len;
  316|       |
  317|  2.32k|    if (len != enc_len) {
  ------------------
  |  Branch (317:9): [True: 316, False: 2.01k]
  ------------------
  318|    316|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|    316|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    316|    (ERR_new(),                                                 \
  |  |  |  |  404|    316|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    316|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    316|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    316|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    316|     ERR_set_error)
  |  |  ------------------
  ------------------
  319|    316|        return 0;
  320|    316|    }
  321|       |
  322|  2.01k|    if (ctx == NULL) {
  ------------------
  |  Branch (322:9): [True: 2.01k, False: 0]
  ------------------
  323|  2.01k|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  324|  2.01k|        if (ctx == NULL)
  ------------------
  |  Branch (324:13): [True: 0, False: 2.01k]
  ------------------
  325|      0|            return 0;
  326|  2.01k|    }
  327|       |
  328|  2.01k|    BN_CTX_start(ctx);
  329|  2.01k|    x = BN_CTX_get(ctx);
  330|  2.01k|    y = BN_CTX_get(ctx);
  331|  2.01k|    if (y == NULL)
  ------------------
  |  Branch (331:9): [True: 0, False: 2.01k]
  ------------------
  332|      0|        goto err;
  333|       |
  334|  2.01k|    if (!BN_bin2bn(buf + 1, field_len, x))
  ------------------
  |  Branch (334:9): [True: 0, False: 2.01k]
  ------------------
  335|      0|        goto err;
  336|  2.01k|    if (BN_ucmp(x, group->field) >= 0) {
  ------------------
  |  Branch (336:9): [True: 12, False: 2.00k]
  ------------------
  337|     12|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     12|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     12|    (ERR_new(),                                                 \
  |  |  |  |  404|     12|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     12|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     12|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     12|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     12|     ERR_set_error)
  |  |  ------------------
  ------------------
  338|     12|        goto err;
  339|     12|    }
  340|       |
  341|  2.00k|    if (form == POINT_CONVERSION_COMPRESSED) {
  ------------------
  |  Branch (341:9): [True: 1.85k, False: 146]
  ------------------
  342|  1.85k|        if (!EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx))
  ------------------
  |  Branch (342:13): [True: 698, False: 1.15k]
  ------------------
  343|    698|            goto err;
  344|  1.85k|    } else {
  345|    146|        if (!BN_bin2bn(buf + 1 + field_len, field_len, y))
  ------------------
  |  Branch (345:13): [True: 0, False: 146]
  ------------------
  346|      0|            goto err;
  347|    146|        if (BN_ucmp(y, group->field) >= 0) {
  ------------------
  |  Branch (347:13): [True: 12, False: 134]
  ------------------
  348|     12|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     12|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     12|    (ERR_new(),                                                 \
  |  |  |  |  404|     12|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     12|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     12|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     12|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     12|     ERR_set_error)
  |  |  ------------------
  ------------------
  349|     12|            goto err;
  350|     12|        }
  351|    134|        if (form == POINT_CONVERSION_HYBRID) {
  ------------------
  |  Branch (351:13): [True: 30, False: 104]
  ------------------
  352|     30|            if (y_bit != BN_is_odd(y)) {
  ------------------
  |  Branch (352:17): [True: 10, False: 20]
  ------------------
  353|     10|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     10|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     10|    (ERR_new(),                                                 \
  |  |  |  |  404|     10|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     10|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     10|     ERR_set_error)
  |  |  ------------------
  ------------------
  354|     10|                goto err;
  355|     10|            }
  356|     30|        }
  357|       |
  358|       |        /*
  359|       |         * EC_POINT_set_affine_coordinates is responsible for checking that
  360|       |         * the point is on the curve.
  361|       |         */
  362|    124|        if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (362:13): [True: 53, False: 71]
  ------------------
  363|     53|            goto err;
  364|    124|    }
  365|       |
  366|  1.22k|    ret = 1;
  367|       |
  368|  2.01k| err:
  369|  2.01k|    BN_CTX_end(ctx);
  370|  2.01k|    BN_CTX_free(new_ctx);
  371|  2.01k|    return ret;
  372|  1.22k|}

ossl_ec_GFp_simple_group_init:
   99|  4.68k|{
  100|  4.68k|    group->field = BN_new();
  101|  4.68k|    group->a = BN_new();
  102|  4.68k|    group->b = BN_new();
  103|  4.68k|    if (group->field == NULL || group->a == NULL || group->b == NULL) {
  ------------------
  |  Branch (103:9): [True: 0, False: 4.68k]
  |  Branch (103:33): [True: 0, False: 4.68k]
  |  Branch (103:53): [True: 0, False: 4.68k]
  ------------------
  104|      0|        BN_free(group->field);
  105|      0|        BN_free(group->a);
  106|      0|        BN_free(group->b);
  107|      0|        return 0;
  108|      0|    }
  109|  4.68k|    group->a_is_minus3 = 0;
  110|  4.68k|    return 1;
  111|  4.68k|}
ossl_ec_GFp_simple_group_finish:
  114|  4.68k|{
  115|  4.68k|    BN_free(group->field);
  116|  4.68k|    BN_free(group->a);
  117|  4.68k|    BN_free(group->b);
  118|  4.68k|}
ossl_ec_GFp_simple_group_copy:
  128|  1.29k|{
  129|  1.29k|    if (!BN_copy(dest->field, src->field))
  ------------------
  |  Branch (129:9): [True: 0, False: 1.29k]
  ------------------
  130|      0|        return 0;
  131|  1.29k|    if (!BN_copy(dest->a, src->a))
  ------------------
  |  Branch (131:9): [True: 0, False: 1.29k]
  ------------------
  132|      0|        return 0;
  133|  1.29k|    if (!BN_copy(dest->b, src->b))
  ------------------
  |  Branch (133:9): [True: 0, False: 1.29k]
  ------------------
  134|      0|        return 0;
  135|       |
  136|  1.29k|    dest->a_is_minus3 = src->a_is_minus3;
  137|       |
  138|  1.29k|    return 1;
  139|  1.29k|}
ossl_ec_GFp_simple_group_set_curve:
  144|  3.19k|{
  145|  3.19k|    int ret = 0;
  146|  3.19k|    BN_CTX *new_ctx = NULL;
  147|  3.19k|    BIGNUM *tmp_a;
  148|       |
  149|       |    /* p must be a prime > 3 */
  150|  3.19k|    if (BN_num_bits(p) <= 2 || !BN_is_odd(p)) {
  ------------------
  |  Branch (150:9): [True: 5, False: 3.19k]
  |  Branch (150:32): [True: 0, False: 3.19k]
  ------------------
  151|      5|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_FIELD);
  ------------------
  |  |  401|      5|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      5|    (ERR_new(),                                                 \
  |  |  |  |  404|      5|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      5|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      5|     ERR_set_error)
  |  |  ------------------
  ------------------
  152|      5|        return 0;
  153|      5|    }
  154|       |
  155|  3.19k|    if (ctx == NULL) {
  ------------------
  |  Branch (155:9): [True: 0, False: 3.19k]
  ------------------
  156|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  157|      0|        if (ctx == NULL)
  ------------------
  |  Branch (157:13): [True: 0, False: 0]
  ------------------
  158|      0|            return 0;
  159|      0|    }
  160|       |
  161|  3.19k|    BN_CTX_start(ctx);
  162|  3.19k|    tmp_a = BN_CTX_get(ctx);
  163|  3.19k|    if (tmp_a == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 3.19k]
  ------------------
  164|      0|        goto err;
  165|       |
  166|       |    /* group->field */
  167|  3.19k|    if (!BN_copy(group->field, p))
  ------------------
  |  Branch (167:9): [True: 0, False: 3.19k]
  ------------------
  168|      0|        goto err;
  169|  3.19k|    BN_set_negative(group->field, 0);
  170|       |
  171|       |    /* group->a */
  172|  3.19k|    if (!BN_nnmod(tmp_a, a, p, ctx))
  ------------------
  |  Branch (172:9): [True: 0, False: 3.19k]
  ------------------
  173|      0|        goto err;
  174|  3.19k|    if (group->meth->field_encode != NULL) {
  ------------------
  |  Branch (174:9): [True: 2.48k, False: 714]
  ------------------
  175|  2.48k|        if (!group->meth->field_encode(group, group->a, tmp_a, ctx))
  ------------------
  |  Branch (175:13): [True: 0, False: 2.48k]
  ------------------
  176|      0|            goto err;
  177|  2.48k|    } else if (!BN_copy(group->a, tmp_a))
  ------------------
  |  Branch (177:16): [True: 0, False: 714]
  ------------------
  178|      0|        goto err;
  179|       |
  180|       |    /* group->b */
  181|  3.19k|    if (!BN_nnmod(group->b, b, p, ctx))
  ------------------
  |  Branch (181:9): [True: 0, False: 3.19k]
  ------------------
  182|      0|        goto err;
  183|  3.19k|    if (group->meth->field_encode != NULL)
  ------------------
  |  Branch (183:9): [True: 2.48k, False: 714]
  ------------------
  184|  2.48k|        if (!group->meth->field_encode(group, group->b, group->b, ctx))
  ------------------
  |  Branch (184:13): [True: 0, False: 2.48k]
  ------------------
  185|      0|            goto err;
  186|       |
  187|       |    /* group->a_is_minus3 */
  188|  3.19k|    if (!BN_add_word(tmp_a, 3))
  ------------------
  |  Branch (188:9): [True: 0, False: 3.19k]
  ------------------
  189|      0|        goto err;
  190|  3.19k|    group->a_is_minus3 = (0 == BN_cmp(tmp_a, group->field));
  191|       |
  192|  3.19k|    ret = 1;
  193|       |
  194|  3.19k| err:
  195|  3.19k|    BN_CTX_end(ctx);
  196|  3.19k|    BN_CTX_free(new_ctx);
  197|  3.19k|    return ret;
  198|  3.19k|}
ossl_ec_GFp_simple_group_get_curve:
  202|  1.32k|{
  203|  1.32k|    int ret = 0;
  204|  1.32k|    BN_CTX *new_ctx = NULL;
  205|       |
  206|  1.32k|    if (p != NULL) {
  ------------------
  |  Branch (206:9): [True: 1.05k, False: 269]
  ------------------
  207|  1.05k|        if (!BN_copy(p, group->field))
  ------------------
  |  Branch (207:13): [True: 0, False: 1.05k]
  ------------------
  208|      0|            return 0;
  209|  1.05k|    }
  210|       |
  211|  1.32k|    if (a != NULL || b != NULL) {
  ------------------
  |  Branch (211:9): [True: 1.05k, False: 269]
  |  Branch (211:22): [True: 0, False: 269]
  ------------------
  212|  1.05k|        if (group->meth->field_decode != NULL) {
  ------------------
  |  Branch (212:13): [True: 1.04k, False: 12]
  ------------------
  213|  1.04k|            if (ctx == NULL) {
  ------------------
  |  Branch (213:17): [True: 263, False: 777]
  ------------------
  214|    263|                ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  215|    263|                if (ctx == NULL)
  ------------------
  |  Branch (215:21): [True: 0, False: 263]
  ------------------
  216|      0|                    return 0;
  217|    263|            }
  218|  1.04k|            if (a != NULL) {
  ------------------
  |  Branch (218:17): [True: 1.04k, False: 0]
  ------------------
  219|  1.04k|                if (!group->meth->field_decode(group, a, group->a, ctx))
  ------------------
  |  Branch (219:21): [True: 0, False: 1.04k]
  ------------------
  220|      0|                    goto err;
  221|  1.04k|            }
  222|  1.04k|            if (b != NULL) {
  ------------------
  |  Branch (222:17): [True: 1.04k, False: 0]
  ------------------
  223|  1.04k|                if (!group->meth->field_decode(group, b, group->b, ctx))
  ------------------
  |  Branch (223:21): [True: 0, False: 1.04k]
  ------------------
  224|      0|                    goto err;
  225|  1.04k|            }
  226|  1.04k|        } else {
  227|     12|            if (a != NULL) {
  ------------------
  |  Branch (227:17): [True: 12, False: 0]
  ------------------
  228|     12|                if (!BN_copy(a, group->a))
  ------------------
  |  Branch (228:21): [True: 0, False: 12]
  ------------------
  229|      0|                    goto err;
  230|     12|            }
  231|     12|            if (b != NULL) {
  ------------------
  |  Branch (231:17): [True: 12, False: 0]
  ------------------
  232|     12|                if (!BN_copy(b, group->b))
  ------------------
  |  Branch (232:21): [True: 0, False: 12]
  ------------------
  233|      0|                    goto err;
  234|     12|            }
  235|     12|        }
  236|  1.05k|    }
  237|       |
  238|  1.32k|    ret = 1;
  239|       |
  240|  1.32k| err:
  241|  1.32k|    BN_CTX_free(new_ctx);
  242|  1.32k|    return ret;
  243|  1.32k|}
ossl_ec_GFp_simple_group_get_degree:
  246|    269|{
  247|    269|    return BN_num_bits(group->field);
  248|    269|}
ossl_ec_GFp_simple_point_init:
  323|  12.2k|{
  324|  12.2k|    point->X = BN_new();
  325|  12.2k|    point->Y = BN_new();
  326|  12.2k|    point->Z = BN_new();
  327|  12.2k|    point->Z_is_one = 0;
  328|       |
  329|  12.2k|    if (point->X == NULL || point->Y == NULL || point->Z == NULL) {
  ------------------
  |  Branch (329:9): [True: 0, False: 12.2k]
  |  Branch (329:29): [True: 0, False: 12.2k]
  |  Branch (329:49): [True: 0, False: 12.2k]
  ------------------
  330|      0|        BN_free(point->X);
  331|      0|        BN_free(point->Y);
  332|      0|        BN_free(point->Z);
  333|      0|        return 0;
  334|      0|    }
  335|  12.2k|    return 1;
  336|  12.2k|}
ossl_ec_GFp_simple_point_finish:
  339|  10.8k|{
  340|  10.8k|    BN_free(point->X);
  341|  10.8k|    BN_free(point->Y);
  342|  10.8k|    BN_free(point->Z);
  343|  10.8k|}
ossl_ec_GFp_simple_point_clear_finish:
  346|  1.46k|{
  347|  1.46k|    BN_clear_free(point->X);
  348|  1.46k|    BN_clear_free(point->Y);
  349|  1.46k|    BN_clear_free(point->Z);
  350|  1.46k|    point->Z_is_one = 0;
  351|  1.46k|}
ossl_ec_GFp_simple_point_copy:
  354|  7.25k|{
  355|  7.25k|    if (!BN_copy(dest->X, src->X))
  ------------------
  |  Branch (355:9): [True: 0, False: 7.25k]
  ------------------
  356|      0|        return 0;
  357|  7.25k|    if (!BN_copy(dest->Y, src->Y))
  ------------------
  |  Branch (357:9): [True: 0, False: 7.25k]
  ------------------
  358|      0|        return 0;
  359|  7.25k|    if (!BN_copy(dest->Z, src->Z))
  ------------------
  |  Branch (359:9): [True: 0, False: 7.25k]
  ------------------
  360|      0|        return 0;
  361|  7.25k|    dest->Z_is_one = src->Z_is_one;
  362|  7.25k|    dest->curve_name = src->curve_name;
  363|       |
  364|  7.25k|    return 1;
  365|  7.25k|}
ossl_ec_GFp_simple_point_set_to_infinity:
  369|    187|{
  370|    187|    point->Z_is_one = 0;
  371|    187|    BN_zero(point->Z);
  ------------------
  |  |  202|    187|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  372|    187|    return 1;
  373|    187|}
ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp:
  381|  3.82k|{
  382|  3.82k|    BN_CTX *new_ctx = NULL;
  383|  3.82k|    int ret = 0;
  384|       |
  385|  3.82k|    if (ctx == NULL) {
  ------------------
  |  Branch (385:9): [True: 0, False: 3.82k]
  ------------------
  386|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  387|      0|        if (ctx == NULL)
  ------------------
  |  Branch (387:13): [True: 0, False: 0]
  ------------------
  388|      0|            return 0;
  389|      0|    }
  390|       |
  391|  3.82k|    if (x != NULL) {
  ------------------
  |  Branch (391:9): [True: 3.82k, False: 0]
  ------------------
  392|  3.82k|        if (!BN_nnmod(point->X, x, group->field, ctx))
  ------------------
  |  Branch (392:13): [True: 0, False: 3.82k]
  ------------------
  393|      0|            goto err;
  394|  3.82k|        if (group->meth->field_encode) {
  ------------------
  |  Branch (394:13): [True: 2.45k, False: 1.37k]
  ------------------
  395|  2.45k|            if (!group->meth->field_encode(group, point->X, point->X, ctx))
  ------------------
  |  Branch (395:17): [True: 0, False: 2.45k]
  ------------------
  396|      0|                goto err;
  397|  2.45k|        }
  398|  3.82k|    }
  399|       |
  400|  3.82k|    if (y != NULL) {
  ------------------
  |  Branch (400:9): [True: 3.82k, False: 0]
  ------------------
  401|  3.82k|        if (!BN_nnmod(point->Y, y, group->field, ctx))
  ------------------
  |  Branch (401:13): [True: 0, False: 3.82k]
  ------------------
  402|      0|            goto err;
  403|  3.82k|        if (group->meth->field_encode) {
  ------------------
  |  Branch (403:13): [True: 2.45k, False: 1.37k]
  ------------------
  404|  2.45k|            if (!group->meth->field_encode(group, point->Y, point->Y, ctx))
  ------------------
  |  Branch (404:17): [True: 0, False: 2.45k]
  ------------------
  405|      0|                goto err;
  406|  2.45k|        }
  407|  3.82k|    }
  408|       |
  409|  3.82k|    if (z != NULL) {
  ------------------
  |  Branch (409:9): [True: 3.82k, False: 0]
  ------------------
  410|  3.82k|        int Z_is_one;
  411|       |
  412|  3.82k|        if (!BN_nnmod(point->Z, z, group->field, ctx))
  ------------------
  |  Branch (412:13): [True: 0, False: 3.82k]
  ------------------
  413|      0|            goto err;
  414|  3.82k|        Z_is_one = BN_is_one(point->Z);
  415|  3.82k|        if (group->meth->field_encode) {
  ------------------
  |  Branch (415:13): [True: 2.45k, False: 1.37k]
  ------------------
  416|  2.45k|            if (Z_is_one && (group->meth->field_set_to_one != 0)) {
  ------------------
  |  Branch (416:17): [True: 2.45k, False: 0]
  |  Branch (416:29): [True: 2.45k, False: 0]
  ------------------
  417|  2.45k|                if (!group->meth->field_set_to_one(group, point->Z, ctx))
  ------------------
  |  Branch (417:21): [True: 0, False: 2.45k]
  ------------------
  418|      0|                    goto err;
  419|  2.45k|            } else {
  420|      0|                if (!group->
  ------------------
  |  Branch (420:21): [True: 0, False: 0]
  ------------------
  421|      0|                    meth->field_encode(group, point->Z, point->Z, ctx))
  422|      0|                    goto err;
  423|      0|            }
  424|  2.45k|        }
  425|  3.82k|        point->Z_is_one = Z_is_one;
  426|  3.82k|    }
  427|       |
  428|  3.82k|    ret = 1;
  429|       |
  430|  3.82k| err:
  431|  3.82k|    BN_CTX_free(new_ctx);
  432|  3.82k|    return ret;
  433|  3.82k|}
ossl_ec_GFp_simple_point_set_affine_coordinates:
  488|  3.52k|{
  489|  3.52k|    if (x == NULL || y == NULL) {
  ------------------
  |  Branch (489:9): [True: 0, False: 3.52k]
  |  Branch (489:22): [True: 0, False: 3.52k]
  ------------------
  490|       |        /*
  491|       |         * unlike for projective coordinates, we do not tolerate this
  492|       |         */
  493|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  494|      0|        return 0;
  495|      0|    }
  496|       |
  497|  3.52k|    return EC_POINT_set_Jprojective_coordinates_GFp(group, point, x, y,
  498|  3.52k|                                                    BN_value_one(), ctx);
  499|  3.52k|}
ossl_ec_GFp_simple_point_get_affine_coordinates:
  505|  1.60k|{
  506|  1.60k|    BN_CTX *new_ctx = NULL;
  507|  1.60k|    BIGNUM *Z, *Z_1, *Z_2, *Z_3;
  508|  1.60k|    const BIGNUM *Z_;
  509|  1.60k|    int ret = 0;
  510|       |
  511|  1.60k|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (511:9): [True: 0, False: 1.60k]
  ------------------
  512|      0|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  513|      0|        return 0;
  514|      0|    }
  515|       |
  516|  1.60k|    if (ctx == NULL) {
  ------------------
  |  Branch (516:9): [True: 0, False: 1.60k]
  ------------------
  517|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  518|      0|        if (ctx == NULL)
  ------------------
  |  Branch (518:13): [True: 0, False: 0]
  ------------------
  519|      0|            return 0;
  520|      0|    }
  521|       |
  522|  1.60k|    BN_CTX_start(ctx);
  523|  1.60k|    Z = BN_CTX_get(ctx);
  524|  1.60k|    Z_1 = BN_CTX_get(ctx);
  525|  1.60k|    Z_2 = BN_CTX_get(ctx);
  526|  1.60k|    Z_3 = BN_CTX_get(ctx);
  527|  1.60k|    if (Z_3 == NULL)
  ------------------
  |  Branch (527:9): [True: 0, False: 1.60k]
  ------------------
  528|      0|        goto err;
  529|       |
  530|       |    /* transform  (X, Y, Z)  into  (x, y) := (X/Z^2, Y/Z^3) */
  531|       |
  532|  1.60k|    if (group->meth->field_decode != NULL) {
  ------------------
  |  Branch (532:9): [True: 1.60k, False: 0]
  ------------------
  533|  1.60k|        if (!group->meth->field_decode(group, Z, point->Z, ctx))
  ------------------
  |  Branch (533:13): [True: 0, False: 1.60k]
  ------------------
  534|      0|            goto err;
  535|  1.60k|        Z_ = Z;
  536|  1.60k|    } else {
  537|      0|        Z_ = point->Z;
  538|      0|    }
  539|       |
  540|  1.60k|    if (BN_is_one(Z_)) {
  ------------------
  |  Branch (540:9): [True: 1.50k, False: 101]
  ------------------
  541|  1.50k|        if (group->meth->field_decode != NULL) {
  ------------------
  |  Branch (541:13): [True: 1.50k, False: 0]
  ------------------
  542|  1.50k|            if (x != NULL) {
  ------------------
  |  Branch (542:17): [True: 1.50k, False: 0]
  ------------------
  543|  1.50k|                if (!group->meth->field_decode(group, x, point->X, ctx))
  ------------------
  |  Branch (543:21): [True: 0, False: 1.50k]
  ------------------
  544|      0|                    goto err;
  545|  1.50k|            }
  546|  1.50k|            if (y != NULL) {
  ------------------
  |  Branch (546:17): [True: 1.50k, False: 0]
  ------------------
  547|  1.50k|                if (!group->meth->field_decode(group, y, point->Y, ctx))
  ------------------
  |  Branch (547:21): [True: 0, False: 1.50k]
  ------------------
  548|      0|                    goto err;
  549|  1.50k|            }
  550|  1.50k|        } else {
  551|      0|            if (x != NULL) {
  ------------------
  |  Branch (551:17): [True: 0, False: 0]
  ------------------
  552|      0|                if (!BN_copy(x, point->X))
  ------------------
  |  Branch (552:21): [True: 0, False: 0]
  ------------------
  553|      0|                    goto err;
  554|      0|            }
  555|      0|            if (y != NULL) {
  ------------------
  |  Branch (555:17): [True: 0, False: 0]
  ------------------
  556|      0|                if (!BN_copy(y, point->Y))
  ------------------
  |  Branch (556:21): [True: 0, False: 0]
  ------------------
  557|      0|                    goto err;
  558|      0|            }
  559|      0|        }
  560|  1.50k|    } else {
  561|    101|        if (!group->meth->field_inv(group, Z_1, Z_, ctx)) {
  ------------------
  |  Branch (561:13): [True: 0, False: 101]
  ------------------
  562|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  563|      0|            goto err;
  564|      0|        }
  565|       |
  566|    101|        if (group->meth->field_encode == NULL) {
  ------------------
  |  Branch (566:13): [True: 0, False: 101]
  ------------------
  567|       |            /* field_sqr works on standard representation */
  568|      0|            if (!group->meth->field_sqr(group, Z_2, Z_1, ctx))
  ------------------
  |  Branch (568:17): [True: 0, False: 0]
  ------------------
  569|      0|                goto err;
  570|    101|        } else {
  571|    101|            if (!BN_mod_sqr(Z_2, Z_1, group->field, ctx))
  ------------------
  |  Branch (571:17): [True: 0, False: 101]
  ------------------
  572|      0|                goto err;
  573|    101|        }
  574|       |
  575|    101|        if (x != NULL) {
  ------------------
  |  Branch (575:13): [True: 101, False: 0]
  ------------------
  576|       |            /*
  577|       |             * in the Montgomery case, field_mul will cancel out Montgomery
  578|       |             * factor in X:
  579|       |             */
  580|    101|            if (!group->meth->field_mul(group, x, point->X, Z_2, ctx))
  ------------------
  |  Branch (580:17): [True: 0, False: 101]
  ------------------
  581|      0|                goto err;
  582|    101|        }
  583|       |
  584|    101|        if (y != NULL) {
  ------------------
  |  Branch (584:13): [True: 101, False: 0]
  ------------------
  585|    101|            if (group->meth->field_encode == NULL) {
  ------------------
  |  Branch (585:17): [True: 0, False: 101]
  ------------------
  586|       |                /*
  587|       |                 * field_mul works on standard representation
  588|       |                 */
  589|      0|                if (!group->meth->field_mul(group, Z_3, Z_2, Z_1, ctx))
  ------------------
  |  Branch (589:21): [True: 0, False: 0]
  ------------------
  590|      0|                    goto err;
  591|    101|            } else {
  592|    101|                if (!BN_mod_mul(Z_3, Z_2, Z_1, group->field, ctx))
  ------------------
  |  Branch (592:21): [True: 0, False: 101]
  ------------------
  593|      0|                    goto err;
  594|    101|            }
  595|       |
  596|       |            /*
  597|       |             * in the Montgomery case, field_mul will cancel out Montgomery
  598|       |             * factor in Y:
  599|       |             */
  600|    101|            if (!group->meth->field_mul(group, y, point->Y, Z_3, ctx))
  ------------------
  |  Branch (600:17): [True: 0, False: 101]
  ------------------
  601|      0|                goto err;
  602|    101|        }
  603|    101|    }
  604|       |
  605|  1.60k|    ret = 1;
  606|       |
  607|  1.60k| err:
  608|  1.60k|    BN_CTX_end(ctx);
  609|  1.60k|    BN_CTX_free(new_ctx);
  610|  1.60k|    return ret;
  611|  1.60k|}
ossl_ec_GFp_simple_add:
  615|  5.73k|{
  616|  5.73k|    int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *,
  617|  5.73k|                      const BIGNUM *, BN_CTX *);
  618|  5.73k|    int (*field_sqr) (const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);
  619|  5.73k|    const BIGNUM *p;
  620|  5.73k|    BN_CTX *new_ctx = NULL;
  621|  5.73k|    BIGNUM *n0, *n1, *n2, *n3, *n4, *n5, *n6;
  622|  5.73k|    int ret = 0;
  623|       |
  624|  5.73k|    if (a == b)
  ------------------
  |  Branch (624:9): [True: 0, False: 5.73k]
  ------------------
  625|      0|        return EC_POINT_dbl(group, r, a, ctx);
  626|  5.73k|    if (EC_POINT_is_at_infinity(group, a))
  ------------------
  |  Branch (626:9): [True: 1.33k, False: 4.40k]
  ------------------
  627|  1.33k|        return EC_POINT_copy(r, b);
  628|  4.40k|    if (EC_POINT_is_at_infinity(group, b))
  ------------------
  |  Branch (628:9): [True: 188, False: 4.21k]
  ------------------
  629|    188|        return EC_POINT_copy(r, a);
  630|       |
  631|  4.21k|    field_mul = group->meth->field_mul;
  632|  4.21k|    field_sqr = group->meth->field_sqr;
  633|  4.21k|    p = group->field;
  634|       |
  635|  4.21k|    if (ctx == NULL) {
  ------------------
  |  Branch (635:9): [True: 0, False: 4.21k]
  ------------------
  636|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  637|      0|        if (ctx == NULL)
  ------------------
  |  Branch (637:13): [True: 0, False: 0]
  ------------------
  638|      0|            return 0;
  639|      0|    }
  640|       |
  641|  4.21k|    BN_CTX_start(ctx);
  642|  4.21k|    n0 = BN_CTX_get(ctx);
  643|  4.21k|    n1 = BN_CTX_get(ctx);
  644|  4.21k|    n2 = BN_CTX_get(ctx);
  645|  4.21k|    n3 = BN_CTX_get(ctx);
  646|  4.21k|    n4 = BN_CTX_get(ctx);
  647|  4.21k|    n5 = BN_CTX_get(ctx);
  648|  4.21k|    n6 = BN_CTX_get(ctx);
  649|  4.21k|    if (n6 == NULL)
  ------------------
  |  Branch (649:9): [True: 0, False: 4.21k]
  ------------------
  650|      0|        goto end;
  651|       |
  652|       |    /*
  653|       |     * Note that in this function we must not read components of 'a' or 'b'
  654|       |     * once we have written the corresponding components of 'r'. ('r' might
  655|       |     * be one of 'a' or 'b'.)
  656|       |     */
  657|       |
  658|       |    /* n1, n2 */
  659|  4.21k|    if (b->Z_is_one) {
  ------------------
  |  Branch (659:9): [True: 3.73k, False: 477]
  ------------------
  660|  3.73k|        if (!BN_copy(n1, a->X))
  ------------------
  |  Branch (660:13): [True: 0, False: 3.73k]
  ------------------
  661|      0|            goto end;
  662|  3.73k|        if (!BN_copy(n2, a->Y))
  ------------------
  |  Branch (662:13): [True: 0, False: 3.73k]
  ------------------
  663|      0|            goto end;
  664|       |        /* n1 = X_a */
  665|       |        /* n2 = Y_a */
  666|  3.73k|    } else {
  667|    477|        if (!field_sqr(group, n0, b->Z, ctx))
  ------------------
  |  Branch (667:13): [True: 0, False: 477]
  ------------------
  668|      0|            goto end;
  669|    477|        if (!field_mul(group, n1, a->X, n0, ctx))
  ------------------
  |  Branch (669:13): [True: 0, False: 477]
  ------------------
  670|      0|            goto end;
  671|       |        /* n1 = X_a * Z_b^2 */
  672|       |
  673|    477|        if (!field_mul(group, n0, n0, b->Z, ctx))
  ------------------
  |  Branch (673:13): [True: 0, False: 477]
  ------------------
  674|      0|            goto end;
  675|    477|        if (!field_mul(group, n2, a->Y, n0, ctx))
  ------------------
  |  Branch (675:13): [True: 0, False: 477]
  ------------------
  676|      0|            goto end;
  677|       |        /* n2 = Y_a * Z_b^3 */
  678|    477|    }
  679|       |
  680|       |    /* n3, n4 */
  681|  4.21k|    if (a->Z_is_one) {
  ------------------
  |  Branch (681:9): [True: 97, False: 4.11k]
  ------------------
  682|     97|        if (!BN_copy(n3, b->X))
  ------------------
  |  Branch (682:13): [True: 0, False: 97]
  ------------------
  683|      0|            goto end;
  684|     97|        if (!BN_copy(n4, b->Y))
  ------------------
  |  Branch (684:13): [True: 0, False: 97]
  ------------------
  685|      0|            goto end;
  686|       |        /* n3 = X_b */
  687|       |        /* n4 = Y_b */
  688|  4.11k|    } else {
  689|  4.11k|        if (!field_sqr(group, n0, a->Z, ctx))
  ------------------
  |  Branch (689:13): [True: 0, False: 4.11k]
  ------------------
  690|      0|            goto end;
  691|  4.11k|        if (!field_mul(group, n3, b->X, n0, ctx))
  ------------------
  |  Branch (691:13): [True: 0, False: 4.11k]
  ------------------
  692|      0|            goto end;
  693|       |        /* n3 = X_b * Z_a^2 */
  694|       |
  695|  4.11k|        if (!field_mul(group, n0, n0, a->Z, ctx))
  ------------------
  |  Branch (695:13): [True: 0, False: 4.11k]
  ------------------
  696|      0|            goto end;
  697|  4.11k|        if (!field_mul(group, n4, b->Y, n0, ctx))
  ------------------
  |  Branch (697:13): [True: 0, False: 4.11k]
  ------------------
  698|      0|            goto end;
  699|       |        /* n4 = Y_b * Z_a^3 */
  700|  4.11k|    }
  701|       |
  702|       |    /* n5, n6 */
  703|  4.21k|    if (!BN_mod_sub_quick(n5, n1, n3, p))
  ------------------
  |  Branch (703:9): [True: 0, False: 4.21k]
  ------------------
  704|      0|        goto end;
  705|  4.21k|    if (!BN_mod_sub_quick(n6, n2, n4, p))
  ------------------
  |  Branch (705:9): [True: 0, False: 4.21k]
  ------------------
  706|      0|        goto end;
  707|       |    /* n5 = n1 - n3 */
  708|       |    /* n6 = n2 - n4 */
  709|       |
  710|  4.21k|    if (BN_is_zero(n5)) {
  ------------------
  |  Branch (710:9): [True: 0, False: 4.21k]
  ------------------
  711|      0|        if (BN_is_zero(n6)) {
  ------------------
  |  Branch (711:13): [True: 0, False: 0]
  ------------------
  712|       |            /* a is the same point as b */
  713|      0|            BN_CTX_end(ctx);
  714|      0|            ret = EC_POINT_dbl(group, r, a, ctx);
  715|      0|            ctx = NULL;
  716|      0|            goto end;
  717|      0|        } else {
  718|       |            /* a is the inverse of b */
  719|      0|            BN_zero(r->Z);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  720|      0|            r->Z_is_one = 0;
  721|      0|            ret = 1;
  722|      0|            goto end;
  723|      0|        }
  724|      0|    }
  725|       |
  726|       |    /* 'n7', 'n8' */
  727|  4.21k|    if (!BN_mod_add_quick(n1, n1, n3, p))
  ------------------
  |  Branch (727:9): [True: 0, False: 4.21k]
  ------------------
  728|      0|        goto end;
  729|  4.21k|    if (!BN_mod_add_quick(n2, n2, n4, p))
  ------------------
  |  Branch (729:9): [True: 0, False: 4.21k]
  ------------------
  730|      0|        goto end;
  731|       |    /* 'n7' = n1 + n3 */
  732|       |    /* 'n8' = n2 + n4 */
  733|       |
  734|       |    /* Z_r */
  735|  4.21k|    if (a->Z_is_one && b->Z_is_one) {
  ------------------
  |  Branch (735:9): [True: 97, False: 4.11k]
  |  Branch (735:24): [True: 0, False: 97]
  ------------------
  736|      0|        if (!BN_copy(r->Z, n5))
  ------------------
  |  Branch (736:13): [True: 0, False: 0]
  ------------------
  737|      0|            goto end;
  738|  4.21k|    } else {
  739|  4.21k|        if (a->Z_is_one) {
  ------------------
  |  Branch (739:13): [True: 97, False: 4.11k]
  ------------------
  740|     97|            if (!BN_copy(n0, b->Z))
  ------------------
  |  Branch (740:17): [True: 0, False: 97]
  ------------------
  741|      0|                goto end;
  742|  4.11k|        } else if (b->Z_is_one) {
  ------------------
  |  Branch (742:20): [True: 3.73k, False: 380]
  ------------------
  743|  3.73k|            if (!BN_copy(n0, a->Z))
  ------------------
  |  Branch (743:17): [True: 0, False: 3.73k]
  ------------------
  744|      0|                goto end;
  745|  3.73k|        } else {
  746|    380|            if (!field_mul(group, n0, a->Z, b->Z, ctx))
  ------------------
  |  Branch (746:17): [True: 0, False: 380]
  ------------------
  747|      0|                goto end;
  748|    380|        }
  749|  4.21k|        if (!field_mul(group, r->Z, n0, n5, ctx))
  ------------------
  |  Branch (749:13): [True: 0, False: 4.21k]
  ------------------
  750|      0|            goto end;
  751|  4.21k|    }
  752|  4.21k|    r->Z_is_one = 0;
  753|       |    /* Z_r = Z_a * Z_b * n5 */
  754|       |
  755|       |    /* X_r */
  756|  4.21k|    if (!field_sqr(group, n0, n6, ctx))
  ------------------
  |  Branch (756:9): [True: 0, False: 4.21k]
  ------------------
  757|      0|        goto end;
  758|  4.21k|    if (!field_sqr(group, n4, n5, ctx))
  ------------------
  |  Branch (758:9): [True: 0, False: 4.21k]
  ------------------
  759|      0|        goto end;
  760|  4.21k|    if (!field_mul(group, n3, n1, n4, ctx))
  ------------------
  |  Branch (760:9): [True: 0, False: 4.21k]
  ------------------
  761|      0|        goto end;
  762|  4.21k|    if (!BN_mod_sub_quick(r->X, n0, n3, p))
  ------------------
  |  Branch (762:9): [True: 0, False: 4.21k]
  ------------------
  763|      0|        goto end;
  764|       |    /* X_r = n6^2 - n5^2 * 'n7' */
  765|       |
  766|       |    /* 'n9' */
  767|  4.21k|    if (!BN_mod_lshift1_quick(n0, r->X, p))
  ------------------
  |  Branch (767:9): [True: 0, False: 4.21k]
  ------------------
  768|      0|        goto end;
  769|  4.21k|    if (!BN_mod_sub_quick(n0, n3, n0, p))
  ------------------
  |  Branch (769:9): [True: 0, False: 4.21k]
  ------------------
  770|      0|        goto end;
  771|       |    /* n9 = n5^2 * 'n7' - 2 * X_r */
  772|       |
  773|       |    /* Y_r */
  774|  4.21k|    if (!field_mul(group, n0, n0, n6, ctx))
  ------------------
  |  Branch (774:9): [True: 0, False: 4.21k]
  ------------------
  775|      0|        goto end;
  776|  4.21k|    if (!field_mul(group, n5, n4, n5, ctx))
  ------------------
  |  Branch (776:9): [True: 0, False: 4.21k]
  ------------------
  777|      0|        goto end;               /* now n5 is n5^3 */
  778|  4.21k|    if (!field_mul(group, n1, n2, n5, ctx))
  ------------------
  |  Branch (778:9): [True: 0, False: 4.21k]
  ------------------
  779|      0|        goto end;
  780|  4.21k|    if (!BN_mod_sub_quick(n0, n0, n1, p))
  ------------------
  |  Branch (780:9): [True: 0, False: 4.21k]
  ------------------
  781|      0|        goto end;
  782|  4.21k|    if (BN_is_odd(n0))
  ------------------
  |  Branch (782:9): [True: 2.12k, False: 2.09k]
  ------------------
  783|  2.12k|        if (!BN_add(n0, n0, p))
  ------------------
  |  Branch (783:13): [True: 0, False: 2.12k]
  ------------------
  784|      0|            goto end;
  785|       |    /* now  0 <= n0 < 2*p,  and n0 is even */
  786|  4.21k|    if (!BN_rshift1(r->Y, n0))
  ------------------
  |  Branch (786:9): [True: 0, False: 4.21k]
  ------------------
  787|      0|        goto end;
  788|       |    /* Y_r = (n6 * 'n9' - 'n8' * 'n5^3') / 2 */
  789|       |
  790|  4.21k|    ret = 1;
  791|       |
  792|  4.21k| end:
  793|  4.21k|    BN_CTX_end(ctx);
  794|  4.21k|    BN_CTX_free(new_ctx);
  795|  4.21k|    return ret;
  796|  4.21k|}
ossl_ec_GFp_simple_dbl:
  800|  39.1k|{
  801|  39.1k|    int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *,
  802|  39.1k|                      const BIGNUM *, BN_CTX *);
  803|  39.1k|    int (*field_sqr) (const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);
  804|  39.1k|    const BIGNUM *p;
  805|  39.1k|    BN_CTX *new_ctx = NULL;
  806|  39.1k|    BIGNUM *n0, *n1, *n2, *n3;
  807|  39.1k|    int ret = 0;
  808|       |
  809|  39.1k|    if (EC_POINT_is_at_infinity(group, a)) {
  ------------------
  |  Branch (809:9): [True: 8.99k, False: 30.1k]
  ------------------
  810|  8.99k|        BN_zero(r->Z);
  ------------------
  |  |  202|  8.99k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  811|  8.99k|        r->Z_is_one = 0;
  812|  8.99k|        return 1;
  813|  8.99k|    }
  814|       |
  815|  30.1k|    field_mul = group->meth->field_mul;
  816|  30.1k|    field_sqr = group->meth->field_sqr;
  817|  30.1k|    p = group->field;
  818|       |
  819|  30.1k|    if (ctx == NULL) {
  ------------------
  |  Branch (819:9): [True: 0, False: 30.1k]
  ------------------
  820|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  821|      0|        if (ctx == NULL)
  ------------------
  |  Branch (821:13): [True: 0, False: 0]
  ------------------
  822|      0|            return 0;
  823|      0|    }
  824|       |
  825|  30.1k|    BN_CTX_start(ctx);
  826|  30.1k|    n0 = BN_CTX_get(ctx);
  827|  30.1k|    n1 = BN_CTX_get(ctx);
  828|  30.1k|    n2 = BN_CTX_get(ctx);
  829|  30.1k|    n3 = BN_CTX_get(ctx);
  830|  30.1k|    if (n3 == NULL)
  ------------------
  |  Branch (830:9): [True: 0, False: 30.1k]
  ------------------
  831|      0|        goto err;
  832|       |
  833|       |    /*
  834|       |     * Note that in this function we must not read components of 'a' once we
  835|       |     * have written the corresponding components of 'r'. ('r' might the same
  836|       |     * as 'a'.)
  837|       |     */
  838|       |
  839|       |    /* n1 */
  840|  30.1k|    if (a->Z_is_one) {
  ------------------
  |  Branch (840:9): [True: 1.44k, False: 28.7k]
  ------------------
  841|  1.44k|        if (!field_sqr(group, n0, a->X, ctx))
  ------------------
  |  Branch (841:13): [True: 0, False: 1.44k]
  ------------------
  842|      0|            goto err;
  843|  1.44k|        if (!BN_mod_lshift1_quick(n1, n0, p))
  ------------------
  |  Branch (843:13): [True: 0, False: 1.44k]
  ------------------
  844|      0|            goto err;
  845|  1.44k|        if (!BN_mod_add_quick(n0, n0, n1, p))
  ------------------
  |  Branch (845:13): [True: 0, False: 1.44k]
  ------------------
  846|      0|            goto err;
  847|  1.44k|        if (!BN_mod_add_quick(n1, n0, group->a, p))
  ------------------
  |  Branch (847:13): [True: 0, False: 1.44k]
  ------------------
  848|      0|            goto err;
  849|       |        /* n1 = 3 * X_a^2 + a_curve */
  850|  28.7k|    } else if (group->a_is_minus3) {
  ------------------
  |  Branch (850:16): [True: 315, False: 28.4k]
  ------------------
  851|    315|        if (!field_sqr(group, n1, a->Z, ctx))
  ------------------
  |  Branch (851:13): [True: 0, False: 315]
  ------------------
  852|      0|            goto err;
  853|    315|        if (!BN_mod_add_quick(n0, a->X, n1, p))
  ------------------
  |  Branch (853:13): [True: 0, False: 315]
  ------------------
  854|      0|            goto err;
  855|    315|        if (!BN_mod_sub_quick(n2, a->X, n1, p))
  ------------------
  |  Branch (855:13): [True: 0, False: 315]
  ------------------
  856|      0|            goto err;
  857|    315|        if (!field_mul(group, n1, n0, n2, ctx))
  ------------------
  |  Branch (857:13): [True: 0, False: 315]
  ------------------
  858|      0|            goto err;
  859|    315|        if (!BN_mod_lshift1_quick(n0, n1, p))
  ------------------
  |  Branch (859:13): [True: 0, False: 315]
  ------------------
  860|      0|            goto err;
  861|    315|        if (!BN_mod_add_quick(n1, n0, n1, p))
  ------------------
  |  Branch (861:13): [True: 0, False: 315]
  ------------------
  862|      0|            goto err;
  863|       |        /*-
  864|       |         * n1 = 3 * (X_a + Z_a^2) * (X_a - Z_a^2)
  865|       |         *    = 3 * X_a^2 - 3 * Z_a^4
  866|       |         */
  867|  28.4k|    } else {
  868|  28.4k|        if (!field_sqr(group, n0, a->X, ctx))
  ------------------
  |  Branch (868:13): [True: 0, False: 28.4k]
  ------------------
  869|      0|            goto err;
  870|  28.4k|        if (!BN_mod_lshift1_quick(n1, n0, p))
  ------------------
  |  Branch (870:13): [True: 0, False: 28.4k]
  ------------------
  871|      0|            goto err;
  872|  28.4k|        if (!BN_mod_add_quick(n0, n0, n1, p))
  ------------------
  |  Branch (872:13): [True: 0, False: 28.4k]
  ------------------
  873|      0|            goto err;
  874|  28.4k|        if (!field_sqr(group, n1, a->Z, ctx))
  ------------------
  |  Branch (874:13): [True: 0, False: 28.4k]
  ------------------
  875|      0|            goto err;
  876|  28.4k|        if (!field_sqr(group, n1, n1, ctx))
  ------------------
  |  Branch (876:13): [True: 0, False: 28.4k]
  ------------------
  877|      0|            goto err;
  878|  28.4k|        if (!field_mul(group, n1, n1, group->a, ctx))
  ------------------
  |  Branch (878:13): [True: 0, False: 28.4k]
  ------------------
  879|      0|            goto err;
  880|  28.4k|        if (!BN_mod_add_quick(n1, n1, n0, p))
  ------------------
  |  Branch (880:13): [True: 0, False: 28.4k]
  ------------------
  881|      0|            goto err;
  882|       |        /* n1 = 3 * X_a^2 + a_curve * Z_a^4 */
  883|  28.4k|    }
  884|       |
  885|       |    /* Z_r */
  886|  30.1k|    if (a->Z_is_one) {
  ------------------
  |  Branch (886:9): [True: 1.44k, False: 28.7k]
  ------------------
  887|  1.44k|        if (!BN_copy(n0, a->Y))
  ------------------
  |  Branch (887:13): [True: 0, False: 1.44k]
  ------------------
  888|      0|            goto err;
  889|  28.7k|    } else {
  890|  28.7k|        if (!field_mul(group, n0, a->Y, a->Z, ctx))
  ------------------
  |  Branch (890:13): [True: 0, False: 28.7k]
  ------------------
  891|      0|            goto err;
  892|  28.7k|    }
  893|  30.1k|    if (!BN_mod_lshift1_quick(r->Z, n0, p))
  ------------------
  |  Branch (893:9): [True: 0, False: 30.1k]
  ------------------
  894|      0|        goto err;
  895|  30.1k|    r->Z_is_one = 0;
  896|       |    /* Z_r = 2 * Y_a * Z_a */
  897|       |
  898|       |    /* n2 */
  899|  30.1k|    if (!field_sqr(group, n3, a->Y, ctx))
  ------------------
  |  Branch (899:9): [True: 0, False: 30.1k]
  ------------------
  900|      0|        goto err;
  901|  30.1k|    if (!field_mul(group, n2, a->X, n3, ctx))
  ------------------
  |  Branch (901:9): [True: 0, False: 30.1k]
  ------------------
  902|      0|        goto err;
  903|  30.1k|    if (!BN_mod_lshift_quick(n2, n2, 2, p))
  ------------------
  |  Branch (903:9): [True: 0, False: 30.1k]
  ------------------
  904|      0|        goto err;
  905|       |    /* n2 = 4 * X_a * Y_a^2 */
  906|       |
  907|       |    /* X_r */
  908|  30.1k|    if (!BN_mod_lshift1_quick(n0, n2, p))
  ------------------
  |  Branch (908:9): [True: 0, False: 30.1k]
  ------------------
  909|      0|        goto err;
  910|  30.1k|    if (!field_sqr(group, r->X, n1, ctx))
  ------------------
  |  Branch (910:9): [True: 0, False: 30.1k]
  ------------------
  911|      0|        goto err;
  912|  30.1k|    if (!BN_mod_sub_quick(r->X, r->X, n0, p))
  ------------------
  |  Branch (912:9): [True: 0, False: 30.1k]
  ------------------
  913|      0|        goto err;
  914|       |    /* X_r = n1^2 - 2 * n2 */
  915|       |
  916|       |    /* n3 */
  917|  30.1k|    if (!field_sqr(group, n0, n3, ctx))
  ------------------
  |  Branch (917:9): [True: 0, False: 30.1k]
  ------------------
  918|      0|        goto err;
  919|  30.1k|    if (!BN_mod_lshift_quick(n3, n0, 3, p))
  ------------------
  |  Branch (919:9): [True: 0, False: 30.1k]
  ------------------
  920|      0|        goto err;
  921|       |    /* n3 = 8 * Y_a^4 */
  922|       |
  923|       |    /* Y_r */
  924|  30.1k|    if (!BN_mod_sub_quick(n0, n2, r->X, p))
  ------------------
  |  Branch (924:9): [True: 0, False: 30.1k]
  ------------------
  925|      0|        goto err;
  926|  30.1k|    if (!field_mul(group, n0, n1, n0, ctx))
  ------------------
  |  Branch (926:9): [True: 0, False: 30.1k]
  ------------------
  927|      0|        goto err;
  928|  30.1k|    if (!BN_mod_sub_quick(r->Y, n0, n3, p))
  ------------------
  |  Branch (928:9): [True: 0, False: 30.1k]
  ------------------
  929|      0|        goto err;
  930|       |    /* Y_r = n1 * (n2 - X_r) - n3 */
  931|       |
  932|  30.1k|    ret = 1;
  933|       |
  934|  30.1k| err:
  935|  30.1k|    BN_CTX_end(ctx);
  936|  30.1k|    BN_CTX_free(new_ctx);
  937|  30.1k|    return ret;
  938|  30.1k|}
ossl_ec_GFp_simple_invert:
  942|  2.21k|{
  943|  2.21k|    if (EC_POINT_is_at_infinity(group, point) || BN_is_zero(point->Y))
  ------------------
  |  Branch (943:9): [True: 606, False: 1.61k]
  |  Branch (943:50): [True: 21, False: 1.59k]
  ------------------
  944|       |        /* point is its own inverse */
  945|    627|        return 1;
  946|       |
  947|  1.59k|    return BN_usub(point->Y, group->field, point->Y);
  948|  2.21k|}
ossl_ec_GFp_simple_is_at_infinity:
  952|  63.0k|{
  953|  63.0k|    return BN_is_zero(point->Z);
  954|  63.0k|}
ossl_ec_GFp_simple_is_on_curve:
  958|  3.52k|{
  959|  3.52k|    int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *,
  960|  3.52k|                      const BIGNUM *, BN_CTX *);
  961|  3.52k|    int (*field_sqr) (const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);
  962|  3.52k|    const BIGNUM *p;
  963|  3.52k|    BN_CTX *new_ctx = NULL;
  964|  3.52k|    BIGNUM *rh, *tmp, *Z4, *Z6;
  965|  3.52k|    int ret = -1;
  966|       |
  967|  3.52k|    if (EC_POINT_is_at_infinity(group, point))
  ------------------
  |  Branch (967:9): [True: 0, False: 3.52k]
  ------------------
  968|      0|        return 1;
  969|       |
  970|  3.52k|    field_mul = group->meth->field_mul;
  971|  3.52k|    field_sqr = group->meth->field_sqr;
  972|  3.52k|    p = group->field;
  973|       |
  974|  3.52k|    if (ctx == NULL) {
  ------------------
  |  Branch (974:9): [True: 0, False: 3.52k]
  ------------------
  975|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  976|      0|        if (ctx == NULL)
  ------------------
  |  Branch (976:13): [True: 0, False: 0]
  ------------------
  977|      0|            return -1;
  978|      0|    }
  979|       |
  980|  3.52k|    BN_CTX_start(ctx);
  981|  3.52k|    rh = BN_CTX_get(ctx);
  982|  3.52k|    tmp = BN_CTX_get(ctx);
  983|  3.52k|    Z4 = BN_CTX_get(ctx);
  984|  3.52k|    Z6 = BN_CTX_get(ctx);
  985|  3.52k|    if (Z6 == NULL)
  ------------------
  |  Branch (985:9): [True: 0, False: 3.52k]
  ------------------
  986|      0|        goto err;
  987|       |
  988|       |    /*-
  989|       |     * We have a curve defined by a Weierstrass equation
  990|       |     *      y^2 = x^3 + a*x + b.
  991|       |     * The point to consider is given in Jacobian projective coordinates
  992|       |     * where  (X, Y, Z)  represents  (x, y) = (X/Z^2, Y/Z^3).
  993|       |     * Substituting this and multiplying by  Z^6  transforms the above equation into
  994|       |     *      Y^2 = X^3 + a*X*Z^4 + b*Z^6.
  995|       |     * To test this, we add up the right-hand side in 'rh'.
  996|       |     */
  997|       |
  998|       |    /* rh := X^2 */
  999|  3.52k|    if (!field_sqr(group, rh, point->X, ctx))
  ------------------
  |  Branch (999:9): [True: 0, False: 3.52k]
  ------------------
 1000|      0|        goto err;
 1001|       |
 1002|  3.52k|    if (!point->Z_is_one) {
  ------------------
  |  Branch (1002:9): [True: 0, False: 3.52k]
  ------------------
 1003|      0|        if (!field_sqr(group, tmp, point->Z, ctx))
  ------------------
  |  Branch (1003:13): [True: 0, False: 0]
  ------------------
 1004|      0|            goto err;
 1005|      0|        if (!field_sqr(group, Z4, tmp, ctx))
  ------------------
  |  Branch (1005:13): [True: 0, False: 0]
  ------------------
 1006|      0|            goto err;
 1007|      0|        if (!field_mul(group, Z6, Z4, tmp, ctx))
  ------------------
  |  Branch (1007:13): [True: 0, False: 0]
  ------------------
 1008|      0|            goto err;
 1009|       |
 1010|       |        /* rh := (rh + a*Z^4)*X */
 1011|      0|        if (group->a_is_minus3) {
  ------------------
  |  Branch (1011:13): [True: 0, False: 0]
  ------------------
 1012|      0|            if (!BN_mod_lshift1_quick(tmp, Z4, p))
  ------------------
  |  Branch (1012:17): [True: 0, False: 0]
  ------------------
 1013|      0|                goto err;
 1014|      0|            if (!BN_mod_add_quick(tmp, tmp, Z4, p))
  ------------------
  |  Branch (1014:17): [True: 0, False: 0]
  ------------------
 1015|      0|                goto err;
 1016|      0|            if (!BN_mod_sub_quick(rh, rh, tmp, p))
  ------------------
  |  Branch (1016:17): [True: 0, False: 0]
  ------------------
 1017|      0|                goto err;
 1018|      0|            if (!field_mul(group, rh, rh, point->X, ctx))
  ------------------
  |  Branch (1018:17): [True: 0, False: 0]
  ------------------
 1019|      0|                goto err;
 1020|      0|        } else {
 1021|      0|            if (!field_mul(group, tmp, Z4, group->a, ctx))
  ------------------
  |  Branch (1021:17): [True: 0, False: 0]
  ------------------
 1022|      0|                goto err;
 1023|      0|            if (!BN_mod_add_quick(rh, rh, tmp, p))
  ------------------
  |  Branch (1023:17): [True: 0, False: 0]
  ------------------
 1024|      0|                goto err;
 1025|      0|            if (!field_mul(group, rh, rh, point->X, ctx))
  ------------------
  |  Branch (1025:17): [True: 0, False: 0]
  ------------------
 1026|      0|                goto err;
 1027|      0|        }
 1028|       |
 1029|       |        /* rh := rh + b*Z^6 */
 1030|      0|        if (!field_mul(group, tmp, group->b, Z6, ctx))
  ------------------
  |  Branch (1030:13): [True: 0, False: 0]
  ------------------
 1031|      0|            goto err;
 1032|      0|        if (!BN_mod_add_quick(rh, rh, tmp, p))
  ------------------
  |  Branch (1032:13): [True: 0, False: 0]
  ------------------
 1033|      0|            goto err;
 1034|  3.52k|    } else {
 1035|       |        /* point->Z_is_one */
 1036|       |
 1037|       |        /* rh := (rh + a)*X */
 1038|  3.52k|        if (!BN_mod_add_quick(rh, rh, group->a, p))
  ------------------
  |  Branch (1038:13): [True: 0, False: 3.52k]
  ------------------
 1039|      0|            goto err;
 1040|  3.52k|        if (!field_mul(group, rh, rh, point->X, ctx))
  ------------------
  |  Branch (1040:13): [True: 0, False: 3.52k]
  ------------------
 1041|      0|            goto err;
 1042|       |        /* rh := rh + b */
 1043|  3.52k|        if (!BN_mod_add_quick(rh, rh, group->b, p))
  ------------------
  |  Branch (1043:13): [True: 0, False: 3.52k]
  ------------------
 1044|      0|            goto err;
 1045|  3.52k|    }
 1046|       |
 1047|       |    /* 'lh' := Y^2 */
 1048|  3.52k|    if (!field_sqr(group, tmp, point->Y, ctx))
  ------------------
  |  Branch (1048:9): [True: 0, False: 3.52k]
  ------------------
 1049|      0|        goto err;
 1050|       |
 1051|  3.52k|    ret = (0 == BN_ucmp(tmp, rh));
 1052|       |
 1053|  3.52k| err:
 1054|  3.52k|    BN_CTX_end(ctx);
 1055|  3.52k|    BN_CTX_free(new_ctx);
 1056|  3.52k|    return ret;
 1057|  3.52k|}
ossl_ec_GFp_simple_cmp:
 1061|    150|{
 1062|       |    /*-
 1063|       |     * return values:
 1064|       |     *  -1   error
 1065|       |     *   0   equal (in affine coordinates)
 1066|       |     *   1   not equal
 1067|       |     */
 1068|       |
 1069|    150|    int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *,
 1070|    150|                      const BIGNUM *, BN_CTX *);
 1071|    150|    int (*field_sqr) (const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);
 1072|    150|    BN_CTX *new_ctx = NULL;
 1073|    150|    BIGNUM *tmp1, *tmp2, *Za23, *Zb23;
 1074|    150|    const BIGNUM *tmp1_, *tmp2_;
 1075|    150|    int ret = -1;
 1076|       |
 1077|    150|    if (EC_POINT_is_at_infinity(group, a)) {
  ------------------
  |  Branch (1077:9): [True: 0, False: 150]
  ------------------
 1078|      0|        return EC_POINT_is_at_infinity(group, b) ? 0 : 1;
  ------------------
  |  Branch (1078:16): [True: 0, False: 0]
  ------------------
 1079|      0|    }
 1080|       |
 1081|    150|    if (EC_POINT_is_at_infinity(group, b))
  ------------------
  |  Branch (1081:9): [True: 0, False: 150]
  ------------------
 1082|      0|        return 1;
 1083|       |
 1084|    150|    if (a->Z_is_one && b->Z_is_one) {
  ------------------
  |  Branch (1084:9): [True: 150, False: 0]
  |  Branch (1084:24): [True: 150, False: 0]
  ------------------
 1085|    150|        return ((BN_cmp(a->X, b->X) == 0) && BN_cmp(a->Y, b->Y) == 0) ? 0 : 1;
  ------------------
  |  Branch (1085:17): [True: 150, False: 0]
  |  Branch (1085:46): [True: 150, False: 0]
  ------------------
 1086|    150|    }
 1087|       |
 1088|      0|    field_mul = group->meth->field_mul;
 1089|      0|    field_sqr = group->meth->field_sqr;
 1090|       |
 1091|      0|    if (ctx == NULL) {
  ------------------
  |  Branch (1091:9): [True: 0, False: 0]
  ------------------
 1092|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
 1093|      0|        if (ctx == NULL)
  ------------------
  |  Branch (1093:13): [True: 0, False: 0]
  ------------------
 1094|      0|            return -1;
 1095|      0|    }
 1096|       |
 1097|      0|    BN_CTX_start(ctx);
 1098|      0|    tmp1 = BN_CTX_get(ctx);
 1099|      0|    tmp2 = BN_CTX_get(ctx);
 1100|      0|    Za23 = BN_CTX_get(ctx);
 1101|      0|    Zb23 = BN_CTX_get(ctx);
 1102|      0|    if (Zb23 == NULL)
  ------------------
  |  Branch (1102:9): [True: 0, False: 0]
  ------------------
 1103|      0|        goto end;
 1104|       |
 1105|       |    /*-
 1106|       |     * We have to decide whether
 1107|       |     *     (X_a/Z_a^2, Y_a/Z_a^3) = (X_b/Z_b^2, Y_b/Z_b^3),
 1108|       |     * or equivalently, whether
 1109|       |     *     (X_a*Z_b^2, Y_a*Z_b^3) = (X_b*Z_a^2, Y_b*Z_a^3).
 1110|       |     */
 1111|       |
 1112|      0|    if (!b->Z_is_one) {
  ------------------
  |  Branch (1112:9): [True: 0, False: 0]
  ------------------
 1113|      0|        if (!field_sqr(group, Zb23, b->Z, ctx))
  ------------------
  |  Branch (1113:13): [True: 0, False: 0]
  ------------------
 1114|      0|            goto end;
 1115|      0|        if (!field_mul(group, tmp1, a->X, Zb23, ctx))
  ------------------
  |  Branch (1115:13): [True: 0, False: 0]
  ------------------
 1116|      0|            goto end;
 1117|      0|        tmp1_ = tmp1;
 1118|      0|    } else
 1119|      0|        tmp1_ = a->X;
 1120|      0|    if (!a->Z_is_one) {
  ------------------
  |  Branch (1120:9): [True: 0, False: 0]
  ------------------
 1121|      0|        if (!field_sqr(group, Za23, a->Z, ctx))
  ------------------
  |  Branch (1121:13): [True: 0, False: 0]
  ------------------
 1122|      0|            goto end;
 1123|      0|        if (!field_mul(group, tmp2, b->X, Za23, ctx))
  ------------------
  |  Branch (1123:13): [True: 0, False: 0]
  ------------------
 1124|      0|            goto end;
 1125|      0|        tmp2_ = tmp2;
 1126|      0|    } else
 1127|      0|        tmp2_ = b->X;
 1128|       |
 1129|       |    /* compare  X_a*Z_b^2  with  X_b*Z_a^2 */
 1130|      0|    if (BN_cmp(tmp1_, tmp2_) != 0) {
  ------------------
  |  Branch (1130:9): [True: 0, False: 0]
  ------------------
 1131|      0|        ret = 1;                /* points differ */
 1132|      0|        goto end;
 1133|      0|    }
 1134|       |
 1135|      0|    if (!b->Z_is_one) {
  ------------------
  |  Branch (1135:9): [True: 0, False: 0]
  ------------------
 1136|      0|        if (!field_mul(group, Zb23, Zb23, b->Z, ctx))
  ------------------
  |  Branch (1136:13): [True: 0, False: 0]
  ------------------
 1137|      0|            goto end;
 1138|      0|        if (!field_mul(group, tmp1, a->Y, Zb23, ctx))
  ------------------
  |  Branch (1138:13): [True: 0, False: 0]
  ------------------
 1139|      0|            goto end;
 1140|       |        /* tmp1_ = tmp1 */
 1141|      0|    } else
 1142|      0|        tmp1_ = a->Y;
 1143|      0|    if (!a->Z_is_one) {
  ------------------
  |  Branch (1143:9): [True: 0, False: 0]
  ------------------
 1144|      0|        if (!field_mul(group, Za23, Za23, a->Z, ctx))
  ------------------
  |  Branch (1144:13): [True: 0, False: 0]
  ------------------
 1145|      0|            goto end;
 1146|      0|        if (!field_mul(group, tmp2, b->Y, Za23, ctx))
  ------------------
  |  Branch (1146:13): [True: 0, False: 0]
  ------------------
 1147|      0|            goto end;
 1148|       |        /* tmp2_ = tmp2 */
 1149|      0|    } else
 1150|      0|        tmp2_ = b->Y;
 1151|       |
 1152|       |    /* compare  Y_a*Z_b^3  with  Y_b*Z_a^3 */
 1153|      0|    if (BN_cmp(tmp1_, tmp2_) != 0) {
  ------------------
  |  Branch (1153:9): [True: 0, False: 0]
  ------------------
 1154|      0|        ret = 1;                /* points differ */
 1155|      0|        goto end;
 1156|      0|    }
 1157|       |
 1158|       |    /* points are equal */
 1159|      0|    ret = 0;
 1160|       |
 1161|      0| end:
 1162|      0|    BN_CTX_end(ctx);
 1163|      0|    BN_CTX_free(new_ctx);
 1164|      0|    return ret;
 1165|      0|}
ossl_ec_GFp_simple_points_make_affine:
 1208|    269|{
 1209|    269|    BN_CTX *new_ctx = NULL;
 1210|    269|    BIGNUM *tmp, *tmp_Z;
 1211|    269|    BIGNUM **prod_Z = NULL;
 1212|    269|    size_t i;
 1213|    269|    int ret = 0;
 1214|       |
 1215|    269|    if (num == 0)
  ------------------
  |  Branch (1215:9): [True: 0, False: 269]
  ------------------
 1216|      0|        return 1;
 1217|       |
 1218|    269|    if (ctx == NULL) {
  ------------------
  |  Branch (1218:9): [True: 0, False: 269]
  ------------------
 1219|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
 1220|      0|        if (ctx == NULL)
  ------------------
  |  Branch (1220:13): [True: 0, False: 0]
  ------------------
 1221|      0|            return 0;
 1222|      0|    }
 1223|       |
 1224|    269|    BN_CTX_start(ctx);
 1225|    269|    tmp = BN_CTX_get(ctx);
 1226|    269|    tmp_Z = BN_CTX_get(ctx);
 1227|    269|    if (tmp_Z == NULL)
  ------------------
  |  Branch (1227:9): [True: 0, False: 269]
  ------------------
 1228|      0|        goto err;
 1229|       |
 1230|    269|    prod_Z = OPENSSL_malloc(num * sizeof(prod_Z[0]));
  ------------------
  |  |  102|    269|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1231|    269|    if (prod_Z == NULL)
  ------------------
  |  Branch (1231:9): [True: 0, False: 269]
  ------------------
 1232|      0|        goto err;
 1233|  1.20k|    for (i = 0; i < num; i++) {
  ------------------
  |  Branch (1233:17): [True: 934, False: 269]
  ------------------
 1234|    934|        prod_Z[i] = BN_new();
 1235|    934|        if (prod_Z[i] == NULL)
  ------------------
  |  Branch (1235:13): [True: 0, False: 934]
  ------------------
 1236|      0|            goto err;
 1237|    934|    }
 1238|       |
 1239|       |    /*
 1240|       |     * Set each prod_Z[i] to the product of points[0]->Z .. points[i]->Z,
 1241|       |     * skipping any zero-valued inputs (pretend that they're 1).
 1242|       |     */
 1243|       |
 1244|    269|    if (!BN_is_zero(points[0]->Z)) {
  ------------------
  |  Branch (1244:9): [True: 269, False: 0]
  ------------------
 1245|    269|        if (!BN_copy(prod_Z[0], points[0]->Z))
  ------------------
  |  Branch (1245:13): [True: 0, False: 269]
  ------------------
 1246|      0|            goto err;
 1247|    269|    } else {
 1248|      0|        if (group->meth->field_set_to_one != 0) {
  ------------------
  |  Branch (1248:13): [True: 0, False: 0]
  ------------------
 1249|      0|            if (!group->meth->field_set_to_one(group, prod_Z[0], ctx))
  ------------------
  |  Branch (1249:17): [True: 0, False: 0]
  ------------------
 1250|      0|                goto err;
 1251|      0|        } else {
 1252|      0|            if (!BN_one(prod_Z[0]))
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (1252:17): [True: 0, False: 0]
  ------------------
 1253|      0|                goto err;
 1254|      0|        }
 1255|      0|    }
 1256|       |
 1257|    934|    for (i = 1; i < num; i++) {
  ------------------
  |  Branch (1257:17): [True: 665, False: 269]
  ------------------
 1258|    665|        if (!BN_is_zero(points[i]->Z)) {
  ------------------
  |  Branch (1258:13): [True: 665, False: 0]
  ------------------
 1259|    665|            if (!group->
  ------------------
  |  Branch (1259:17): [True: 0, False: 665]
  ------------------
 1260|    665|                meth->field_mul(group, prod_Z[i], prod_Z[i - 1], points[i]->Z,
 1261|    665|                                ctx))
 1262|      0|                goto err;
 1263|    665|        } else {
 1264|      0|            if (!BN_copy(prod_Z[i], prod_Z[i - 1]))
  ------------------
  |  Branch (1264:17): [True: 0, False: 0]
  ------------------
 1265|      0|                goto err;
 1266|      0|        }
 1267|    665|    }
 1268|       |
 1269|       |    /*
 1270|       |     * Now use a single explicit inversion to replace every non-zero
 1271|       |     * points[i]->Z by its inverse.
 1272|       |     */
 1273|       |
 1274|    269|    if (!group->meth->field_inv(group, tmp, prod_Z[num - 1], ctx)) {
  ------------------
  |  Branch (1274:9): [True: 0, False: 269]
  ------------------
 1275|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1276|      0|        goto err;
 1277|      0|    }
 1278|    269|    if (group->meth->field_encode != NULL) {
  ------------------
  |  Branch (1278:9): [True: 269, False: 0]
  ------------------
 1279|       |        /*
 1280|       |         * In the Montgomery case, we just turned R*H (representing H) into
 1281|       |         * 1/(R*H), but we need R*(1/H) (representing 1/H); i.e. we need to
 1282|       |         * multiply by the Montgomery factor twice.
 1283|       |         */
 1284|    269|        if (!group->meth->field_encode(group, tmp, tmp, ctx))
  ------------------
  |  Branch (1284:13): [True: 0, False: 269]
  ------------------
 1285|      0|            goto err;
 1286|    269|        if (!group->meth->field_encode(group, tmp, tmp, ctx))
  ------------------
  |  Branch (1286:13): [True: 0, False: 269]
  ------------------
 1287|      0|            goto err;
 1288|    269|    }
 1289|       |
 1290|    934|    for (i = num - 1; i > 0; --i) {
  ------------------
  |  Branch (1290:23): [True: 665, False: 269]
  ------------------
 1291|       |        /*
 1292|       |         * Loop invariant: tmp is the product of the inverses of points[0]->Z
 1293|       |         * .. points[i]->Z (zero-valued inputs skipped).
 1294|       |         */
 1295|    665|        if (!BN_is_zero(points[i]->Z)) {
  ------------------
  |  Branch (1295:13): [True: 665, False: 0]
  ------------------
 1296|       |            /*
 1297|       |             * Set tmp_Z to the inverse of points[i]->Z (as product of Z
 1298|       |             * inverses 0 .. i, Z values 0 .. i - 1).
 1299|       |             */
 1300|    665|            if (!group->
  ------------------
  |  Branch (1300:17): [True: 0, False: 665]
  ------------------
 1301|    665|                meth->field_mul(group, tmp_Z, prod_Z[i - 1], tmp, ctx))
 1302|      0|                goto err;
 1303|       |            /*
 1304|       |             * Update tmp to satisfy the loop invariant for i - 1.
 1305|       |             */
 1306|    665|            if (!group->meth->field_mul(group, tmp, tmp, points[i]->Z, ctx))
  ------------------
  |  Branch (1306:17): [True: 0, False: 665]
  ------------------
 1307|      0|                goto err;
 1308|       |            /* Replace points[i]->Z by its inverse. */
 1309|    665|            if (!BN_copy(points[i]->Z, tmp_Z))
  ------------------
  |  Branch (1309:17): [True: 0, False: 665]
  ------------------
 1310|      0|                goto err;
 1311|    665|        }
 1312|    665|    }
 1313|       |
 1314|    269|    if (!BN_is_zero(points[0]->Z)) {
  ------------------
  |  Branch (1314:9): [True: 269, False: 0]
  ------------------
 1315|       |        /* Replace points[0]->Z by its inverse. */
 1316|    269|        if (!BN_copy(points[0]->Z, tmp))
  ------------------
  |  Branch (1316:13): [True: 0, False: 269]
  ------------------
 1317|      0|            goto err;
 1318|    269|    }
 1319|       |
 1320|       |    /* Finally, fix up the X and Y coordinates for all points. */
 1321|       |
 1322|  1.20k|    for (i = 0; i < num; i++) {
  ------------------
  |  Branch (1322:17): [True: 934, False: 269]
  ------------------
 1323|    934|        EC_POINT *p = points[i];
 1324|       |
 1325|    934|        if (!BN_is_zero(p->Z)) {
  ------------------
  |  Branch (1325:13): [True: 934, False: 0]
  ------------------
 1326|       |            /* turn  (X, Y, 1/Z)  into  (X/Z^2, Y/Z^3, 1) */
 1327|       |
 1328|    934|            if (!group->meth->field_sqr(group, tmp, p->Z, ctx))
  ------------------
  |  Branch (1328:17): [True: 0, False: 934]
  ------------------
 1329|      0|                goto err;
 1330|    934|            if (!group->meth->field_mul(group, p->X, p->X, tmp, ctx))
  ------------------
  |  Branch (1330:17): [True: 0, False: 934]
  ------------------
 1331|      0|                goto err;
 1332|       |
 1333|    934|            if (!group->meth->field_mul(group, tmp, tmp, p->Z, ctx))
  ------------------
  |  Branch (1333:17): [True: 0, False: 934]
  ------------------
 1334|      0|                goto err;
 1335|    934|            if (!group->meth->field_mul(group, p->Y, p->Y, tmp, ctx))
  ------------------
  |  Branch (1335:17): [True: 0, False: 934]
  ------------------
 1336|      0|                goto err;
 1337|       |
 1338|    934|            if (group->meth->field_set_to_one != 0) {
  ------------------
  |  Branch (1338:17): [True: 934, False: 0]
  ------------------
 1339|    934|                if (!group->meth->field_set_to_one(group, p->Z, ctx))
  ------------------
  |  Branch (1339:21): [True: 0, False: 934]
  ------------------
 1340|      0|                    goto err;
 1341|    934|            } else {
 1342|      0|                if (!BN_one(p->Z))
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (1342:21): [True: 0, False: 0]
  ------------------
 1343|      0|                    goto err;
 1344|      0|            }
 1345|    934|            p->Z_is_one = 1;
 1346|    934|        }
 1347|    934|    }
 1348|       |
 1349|    269|    ret = 1;
 1350|       |
 1351|    269| err:
 1352|    269|    BN_CTX_end(ctx);
 1353|    269|    BN_CTX_free(new_ctx);
 1354|    269|    if (prod_Z != NULL) {
  ------------------
  |  Branch (1354:9): [True: 269, False: 0]
  ------------------
 1355|  1.20k|        for (i = 0; i < num; i++) {
  ------------------
  |  Branch (1355:21): [True: 934, False: 269]
  ------------------
 1356|    934|            if (prod_Z[i] == NULL)
  ------------------
  |  Branch (1356:17): [True: 0, False: 934]
  ------------------
 1357|      0|                break;
 1358|    934|            BN_clear_free(prod_Z[i]);
 1359|    934|        }
 1360|    269|        OPENSSL_free(prod_Z);
  ------------------
  |  |  115|    269|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1361|    269|    }
 1362|    269|    return ret;
 1363|    269|}
ossl_ec_GFp_simple_blind_coordinates:
 1432|    251|{
 1433|    251|    int ret = 0;
 1434|    251|    BIGNUM *lambda = NULL;
 1435|    251|    BIGNUM *temp = NULL;
 1436|       |
 1437|    251|    BN_CTX_start(ctx);
 1438|    251|    lambda = BN_CTX_get(ctx);
 1439|    251|    temp = BN_CTX_get(ctx);
 1440|    251|    if (temp == NULL) {
  ------------------
  |  Branch (1440:9): [True: 0, False: 251]
  ------------------
 1441|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1442|      0|        goto end;
 1443|      0|    }
 1444|       |
 1445|       |    /*-
 1446|       |     * Make sure lambda is not zero.
 1447|       |     * If the RNG fails, we cannot blind but nevertheless want
 1448|       |     * code to continue smoothly and not clobber the error stack.
 1449|       |     */
 1450|    251|    do {
 1451|    251|        ERR_set_mark();
 1452|    251|        ret = BN_priv_rand_range_ex(lambda, group->field, 0, ctx);
 1453|    251|        ERR_pop_to_mark();
 1454|    251|        if (ret == 0) {
  ------------------
  |  Branch (1454:13): [True: 0, False: 251]
  ------------------
 1455|      0|            ret = 1;
 1456|      0|            goto end;
 1457|      0|        }
 1458|    251|    } while (BN_is_zero(lambda));
  ------------------
  |  Branch (1458:14): [True: 0, False: 251]
  ------------------
 1459|       |
 1460|       |    /* if field_encode defined convert between representations */
 1461|    251|    if ((group->meth->field_encode != NULL
  ------------------
  |  Branch (1461:10): [True: 251, False: 0]
  ------------------
 1462|    251|         && !group->meth->field_encode(group, lambda, lambda, ctx))
  ------------------
  |  Branch (1462:13): [True: 0, False: 251]
  ------------------
 1463|    251|        || !group->meth->field_mul(group, p->Z, p->Z, lambda, ctx)
  ------------------
  |  Branch (1463:12): [True: 0, False: 251]
  ------------------
 1464|    251|        || !group->meth->field_sqr(group, temp, lambda, ctx)
  ------------------
  |  Branch (1464:12): [True: 0, False: 251]
  ------------------
 1465|    251|        || !group->meth->field_mul(group, p->X, p->X, temp, ctx)
  ------------------
  |  Branch (1465:12): [True: 0, False: 251]
  ------------------
 1466|    251|        || !group->meth->field_mul(group, temp, temp, lambda, ctx)
  ------------------
  |  Branch (1466:12): [True: 0, False: 251]
  ------------------
 1467|    251|        || !group->meth->field_mul(group, p->Y, p->Y, temp, ctx))
  ------------------
  |  Branch (1467:12): [True: 0, False: 251]
  ------------------
 1468|      0|        goto end;
 1469|       |
 1470|    251|    p->Z_is_one = 0;
 1471|    251|    ret = 1;
 1472|       |
 1473|    251| end:
 1474|    251|    BN_CTX_end(ctx);
 1475|    251|    return ret;
 1476|    251|}
ossl_ec_GFp_simple_ladder_pre:
 1496|    526|{
 1497|    526|    BIGNUM *t1, *t2, *t3, *t4, *t5 = NULL;
 1498|       |
 1499|    526|    t1 = s->Z;
 1500|    526|    t2 = r->Z;
 1501|    526|    t3 = s->X;
 1502|    526|    t4 = r->X;
 1503|    526|    t5 = s->Y;
 1504|       |
 1505|    526|    if (!p->Z_is_one /* r := 2p */
  ------------------
  |  Branch (1505:9): [True: 0, False: 526]
  ------------------
 1506|    526|        || !group->meth->field_sqr(group, t3, p->X, ctx)
  ------------------
  |  Branch (1506:12): [True: 0, False: 526]
  ------------------
 1507|    526|        || !BN_mod_sub_quick(t4, t3, group->a, group->field)
  ------------------
  |  Branch (1507:12): [True: 0, False: 526]
  ------------------
 1508|    526|        || !group->meth->field_sqr(group, t4, t4, ctx)
  ------------------
  |  Branch (1508:12): [True: 0, False: 526]
  ------------------
 1509|    526|        || !group->meth->field_mul(group, t5, p->X, group->b, ctx)
  ------------------
  |  Branch (1509:12): [True: 0, False: 526]
  ------------------
 1510|    526|        || !BN_mod_lshift_quick(t5, t5, 3, group->field)
  ------------------
  |  Branch (1510:12): [True: 0, False: 526]
  ------------------
 1511|       |        /* r->X coord output */
 1512|    526|        || !BN_mod_sub_quick(r->X, t4, t5, group->field)
  ------------------
  |  Branch (1512:12): [True: 0, False: 526]
  ------------------
 1513|    526|        || !BN_mod_add_quick(t1, t3, group->a, group->field)
  ------------------
  |  Branch (1513:12): [True: 0, False: 526]
  ------------------
 1514|    526|        || !group->meth->field_mul(group, t2, p->X, t1, ctx)
  ------------------
  |  Branch (1514:12): [True: 0, False: 526]
  ------------------
 1515|    526|        || !BN_mod_add_quick(t2, group->b, t2, group->field)
  ------------------
  |  Branch (1515:12): [True: 0, False: 526]
  ------------------
 1516|       |        /* r->Z coord output */
 1517|    526|        || !BN_mod_lshift_quick(r->Z, t2, 2, group->field))
  ------------------
  |  Branch (1517:12): [True: 0, False: 526]
  ------------------
 1518|      0|        return 0;
 1519|       |
 1520|       |    /* make sure lambda (r->Y here for storage) is not zero */
 1521|    526|    do {
 1522|    526|        if (!BN_priv_rand_range_ex(r->Y, group->field, 0, ctx))
  ------------------
  |  Branch (1522:13): [True: 0, False: 526]
  ------------------
 1523|      0|            return 0;
 1524|    526|    } while (BN_is_zero(r->Y));
  ------------------
  |  Branch (1524:14): [True: 0, False: 526]
  ------------------
 1525|       |
 1526|       |    /* make sure lambda (s->Z here for storage) is not zero */
 1527|    526|    do {
 1528|    526|        if (!BN_priv_rand_range_ex(s->Z, group->field, 0, ctx))
  ------------------
  |  Branch (1528:13): [True: 0, False: 526]
  ------------------
 1529|      0|            return 0;
 1530|    526|    } while (BN_is_zero(s->Z));
  ------------------
  |  Branch (1530:14): [True: 0, False: 526]
  ------------------
 1531|       |
 1532|       |    /* if field_encode defined convert between representations */
 1533|    526|    if (group->meth->field_encode != NULL
  ------------------
  |  Branch (1533:9): [True: 526, False: 0]
  ------------------
 1534|    526|        && (!group->meth->field_encode(group, r->Y, r->Y, ctx)
  ------------------
  |  Branch (1534:13): [True: 0, False: 526]
  ------------------
 1535|    526|            || !group->meth->field_encode(group, s->Z, s->Z, ctx)))
  ------------------
  |  Branch (1535:16): [True: 0, False: 526]
  ------------------
 1536|      0|        return 0;
 1537|       |
 1538|       |    /* blind r and s independently */
 1539|    526|    if (!group->meth->field_mul(group, r->Z, r->Z, r->Y, ctx)
  ------------------
  |  Branch (1539:9): [True: 0, False: 526]
  ------------------
 1540|    526|        || !group->meth->field_mul(group, r->X, r->X, r->Y, ctx)
  ------------------
  |  Branch (1540:12): [True: 0, False: 526]
  ------------------
 1541|    526|        || !group->meth->field_mul(group, s->X, p->X, s->Z, ctx)) /* s := p */
  ------------------
  |  Branch (1541:12): [True: 0, False: 526]
  ------------------
 1542|      0|        return 0;
 1543|       |
 1544|    526|    r->Z_is_one = 0;
 1545|    526|    s->Z_is_one = 0;
 1546|       |
 1547|    526|    return 1;
 1548|    526|}
ossl_ec_GFp_simple_ladder_step:
 1566|   141k|{
 1567|   141k|    int ret = 0;
 1568|   141k|    BIGNUM *t0, *t1, *t2, *t3, *t4, *t5, *t6 = NULL;
 1569|       |
 1570|   141k|    BN_CTX_start(ctx);
 1571|   141k|    t0 = BN_CTX_get(ctx);
 1572|   141k|    t1 = BN_CTX_get(ctx);
 1573|   141k|    t2 = BN_CTX_get(ctx);
 1574|   141k|    t3 = BN_CTX_get(ctx);
 1575|   141k|    t4 = BN_CTX_get(ctx);
 1576|   141k|    t5 = BN_CTX_get(ctx);
 1577|   141k|    t6 = BN_CTX_get(ctx);
 1578|       |
 1579|   141k|    if (t6 == NULL
  ------------------
  |  Branch (1579:9): [True: 0, False: 141k]
  ------------------
 1580|   141k|        || !group->meth->field_mul(group, t6, r->X, s->X, ctx)
  ------------------
  |  Branch (1580:12): [True: 0, False: 141k]
  ------------------
 1581|   141k|        || !group->meth->field_mul(group, t0, r->Z, s->Z, ctx)
  ------------------
  |  Branch (1581:12): [True: 0, False: 141k]
  ------------------
 1582|   141k|        || !group->meth->field_mul(group, t4, r->X, s->Z, ctx)
  ------------------
  |  Branch (1582:12): [True: 0, False: 141k]
  ------------------
 1583|   141k|        || !group->meth->field_mul(group, t3, r->Z, s->X, ctx)
  ------------------
  |  Branch (1583:12): [True: 0, False: 141k]
  ------------------
 1584|   141k|        || !group->meth->field_mul(group, t5, group->a, t0, ctx)
  ------------------
  |  Branch (1584:12): [True: 0, False: 141k]
  ------------------
 1585|   141k|        || !BN_mod_add_quick(t5, t6, t5, group->field)
  ------------------
  |  Branch (1585:12): [True: 0, False: 141k]
  ------------------
 1586|   141k|        || !BN_mod_add_quick(t6, t3, t4, group->field)
  ------------------
  |  Branch (1586:12): [True: 0, False: 141k]
  ------------------
 1587|   141k|        || !group->meth->field_mul(group, t5, t6, t5, ctx)
  ------------------
  |  Branch (1587:12): [True: 0, False: 141k]
  ------------------
 1588|   141k|        || !group->meth->field_sqr(group, t0, t0, ctx)
  ------------------
  |  Branch (1588:12): [True: 0, False: 141k]
  ------------------
 1589|   141k|        || !BN_mod_lshift_quick(t2, group->b, 2, group->field)
  ------------------
  |  Branch (1589:12): [True: 0, False: 141k]
  ------------------
 1590|   141k|        || !group->meth->field_mul(group, t0, t2, t0, ctx)
  ------------------
  |  Branch (1590:12): [True: 0, False: 141k]
  ------------------
 1591|   141k|        || !BN_mod_lshift1_quick(t5, t5, group->field)
  ------------------
  |  Branch (1591:12): [True: 0, False: 141k]
  ------------------
 1592|   141k|        || !BN_mod_sub_quick(t3, t4, t3, group->field)
  ------------------
  |  Branch (1592:12): [True: 0, False: 141k]
  ------------------
 1593|       |        /* s->Z coord output */
 1594|   141k|        || !group->meth->field_sqr(group, s->Z, t3, ctx)
  ------------------
  |  Branch (1594:12): [True: 0, False: 141k]
  ------------------
 1595|   141k|        || !group->meth->field_mul(group, t4, s->Z, p->X, ctx)
  ------------------
  |  Branch (1595:12): [True: 0, False: 141k]
  ------------------
 1596|   141k|        || !BN_mod_add_quick(t0, t0, t5, group->field)
  ------------------
  |  Branch (1596:12): [True: 0, False: 141k]
  ------------------
 1597|       |        /* s->X coord output */
 1598|   141k|        || !BN_mod_sub_quick(s->X, t0, t4, group->field)
  ------------------
  |  Branch (1598:12): [True: 0, False: 141k]
  ------------------
 1599|   141k|        || !group->meth->field_sqr(group, t4, r->X, ctx)
  ------------------
  |  Branch (1599:12): [True: 0, False: 141k]
  ------------------
 1600|   141k|        || !group->meth->field_sqr(group, t5, r->Z, ctx)
  ------------------
  |  Branch (1600:12): [True: 0, False: 141k]
  ------------------
 1601|   141k|        || !group->meth->field_mul(group, t6, t5, group->a, ctx)
  ------------------
  |  Branch (1601:12): [True: 0, False: 141k]
  ------------------
 1602|   141k|        || !BN_mod_add_quick(t1, r->X, r->Z, group->field)
  ------------------
  |  Branch (1602:12): [True: 0, False: 141k]
  ------------------
 1603|   141k|        || !group->meth->field_sqr(group, t1, t1, ctx)
  ------------------
  |  Branch (1603:12): [True: 0, False: 141k]
  ------------------
 1604|   141k|        || !BN_mod_sub_quick(t1, t1, t4, group->field)
  ------------------
  |  Branch (1604:12): [True: 0, False: 141k]
  ------------------
 1605|   141k|        || !BN_mod_sub_quick(t1, t1, t5, group->field)
  ------------------
  |  Branch (1605:12): [True: 0, False: 141k]
  ------------------
 1606|   141k|        || !BN_mod_sub_quick(t3, t4, t6, group->field)
  ------------------
  |  Branch (1606:12): [True: 0, False: 141k]
  ------------------
 1607|   141k|        || !group->meth->field_sqr(group, t3, t3, ctx)
  ------------------
  |  Branch (1607:12): [True: 0, False: 141k]
  ------------------
 1608|   141k|        || !group->meth->field_mul(group, t0, t5, t1, ctx)
  ------------------
  |  Branch (1608:12): [True: 0, False: 141k]
  ------------------
 1609|   141k|        || !group->meth->field_mul(group, t0, t2, t0, ctx)
  ------------------
  |  Branch (1609:12): [True: 0, False: 141k]
  ------------------
 1610|       |        /* r->X coord output */
 1611|   141k|        || !BN_mod_sub_quick(r->X, t3, t0, group->field)
  ------------------
  |  Branch (1611:12): [True: 0, False: 141k]
  ------------------
 1612|   141k|        || !BN_mod_add_quick(t3, t4, t6, group->field)
  ------------------
  |  Branch (1612:12): [True: 0, False: 141k]
  ------------------
 1613|   141k|        || !group->meth->field_sqr(group, t4, t5, ctx)
  ------------------
  |  Branch (1613:12): [True: 0, False: 141k]
  ------------------
 1614|   141k|        || !group->meth->field_mul(group, t4, t4, t2, ctx)
  ------------------
  |  Branch (1614:12): [True: 0, False: 141k]
  ------------------
 1615|   141k|        || !group->meth->field_mul(group, t1, t1, t3, ctx)
  ------------------
  |  Branch (1615:12): [True: 0, False: 141k]
  ------------------
 1616|   141k|        || !BN_mod_lshift1_quick(t1, t1, group->field)
  ------------------
  |  Branch (1616:12): [True: 0, False: 141k]
  ------------------
 1617|       |        /* r->Z coord output */
 1618|   141k|        || !BN_mod_add_quick(r->Z, t4, t1, group->field))
  ------------------
  |  Branch (1618:12): [True: 0, False: 141k]
  ------------------
 1619|      0|        goto err;
 1620|       |
 1621|   141k|    ret = 1;
 1622|       |
 1623|   141k| err:
 1624|   141k|    BN_CTX_end(ctx);
 1625|   141k|    return ret;
 1626|   141k|}
ossl_ec_GFp_simple_ladder_post:
 1654|    526|{
 1655|    526|    int ret = 0;
 1656|    526|    BIGNUM *t0, *t1, *t2, *t3, *t4, *t5, *t6 = NULL;
 1657|       |
 1658|    526|    if (BN_is_zero(r->Z))
  ------------------
  |  Branch (1658:9): [True: 63, False: 463]
  ------------------
 1659|     63|        return EC_POINT_set_to_infinity(group, r);
 1660|       |
 1661|    463|    if (BN_is_zero(s->Z)) {
  ------------------
  |  Branch (1661:9): [True: 7, False: 456]
  ------------------
 1662|      7|        if (!EC_POINT_copy(r, p)
  ------------------
  |  Branch (1662:13): [True: 0, False: 7]
  ------------------
 1663|      7|            || !EC_POINT_invert(group, r, ctx))
  ------------------
  |  Branch (1663:16): [True: 0, False: 7]
  ------------------
 1664|      0|            return 0;
 1665|      7|        return 1;
 1666|      7|    }
 1667|       |
 1668|    456|    BN_CTX_start(ctx);
 1669|    456|    t0 = BN_CTX_get(ctx);
 1670|    456|    t1 = BN_CTX_get(ctx);
 1671|    456|    t2 = BN_CTX_get(ctx);
 1672|    456|    t3 = BN_CTX_get(ctx);
 1673|    456|    t4 = BN_CTX_get(ctx);
 1674|    456|    t5 = BN_CTX_get(ctx);
 1675|    456|    t6 = BN_CTX_get(ctx);
 1676|       |
 1677|    456|    if (t6 == NULL
  ------------------
  |  Branch (1677:9): [True: 0, False: 456]
  ------------------
 1678|    456|        || !BN_mod_lshift1_quick(t4, p->Y, group->field)
  ------------------
  |  Branch (1678:12): [True: 0, False: 456]
  ------------------
 1679|    456|        || !group->meth->field_mul(group, t6, r->X, t4, ctx)
  ------------------
  |  Branch (1679:12): [True: 0, False: 456]
  ------------------
 1680|    456|        || !group->meth->field_mul(group, t6, s->Z, t6, ctx)
  ------------------
  |  Branch (1680:12): [True: 0, False: 456]
  ------------------
 1681|    456|        || !group->meth->field_mul(group, t5, r->Z, t6, ctx)
  ------------------
  |  Branch (1681:12): [True: 0, False: 456]
  ------------------
 1682|    456|        || !BN_mod_lshift1_quick(t1, group->b, group->field)
  ------------------
  |  Branch (1682:12): [True: 0, False: 456]
  ------------------
 1683|    456|        || !group->meth->field_mul(group, t1, s->Z, t1, ctx)
  ------------------
  |  Branch (1683:12): [True: 0, False: 456]
  ------------------
 1684|    456|        || !group->meth->field_sqr(group, t3, r->Z, ctx)
  ------------------
  |  Branch (1684:12): [True: 0, False: 456]
  ------------------
 1685|    456|        || !group->meth->field_mul(group, t2, t3, t1, ctx)
  ------------------
  |  Branch (1685:12): [True: 0, False: 456]
  ------------------
 1686|    456|        || !group->meth->field_mul(group, t6, r->Z, group->a, ctx)
  ------------------
  |  Branch (1686:12): [True: 0, False: 456]
  ------------------
 1687|    456|        || !group->meth->field_mul(group, t1, p->X, r->X, ctx)
  ------------------
  |  Branch (1687:12): [True: 0, False: 456]
  ------------------
 1688|    456|        || !BN_mod_add_quick(t1, t1, t6, group->field)
  ------------------
  |  Branch (1688:12): [True: 0, False: 456]
  ------------------
 1689|    456|        || !group->meth->field_mul(group, t1, s->Z, t1, ctx)
  ------------------
  |  Branch (1689:12): [True: 0, False: 456]
  ------------------
 1690|    456|        || !group->meth->field_mul(group, t0, p->X, r->Z, ctx)
  ------------------
  |  Branch (1690:12): [True: 0, False: 456]
  ------------------
 1691|    456|        || !BN_mod_add_quick(t6, r->X, t0, group->field)
  ------------------
  |  Branch (1691:12): [True: 0, False: 456]
  ------------------
 1692|    456|        || !group->meth->field_mul(group, t6, t6, t1, ctx)
  ------------------
  |  Branch (1692:12): [True: 0, False: 456]
  ------------------
 1693|    456|        || !BN_mod_add_quick(t6, t6, t2, group->field)
  ------------------
  |  Branch (1693:12): [True: 0, False: 456]
  ------------------
 1694|    456|        || !BN_mod_sub_quick(t0, t0, r->X, group->field)
  ------------------
  |  Branch (1694:12): [True: 0, False: 456]
  ------------------
 1695|    456|        || !group->meth->field_sqr(group, t0, t0, ctx)
  ------------------
  |  Branch (1695:12): [True: 0, False: 456]
  ------------------
 1696|    456|        || !group->meth->field_mul(group, t0, t0, s->X, ctx)
  ------------------
  |  Branch (1696:12): [True: 0, False: 456]
  ------------------
 1697|    456|        || !BN_mod_sub_quick(t0, t6, t0, group->field)
  ------------------
  |  Branch (1697:12): [True: 0, False: 456]
  ------------------
 1698|    456|        || !group->meth->field_mul(group, t1, s->Z, t4, ctx)
  ------------------
  |  Branch (1698:12): [True: 0, False: 456]
  ------------------
 1699|    456|        || !group->meth->field_mul(group, t1, t3, t1, ctx)
  ------------------
  |  Branch (1699:12): [True: 0, False: 456]
  ------------------
 1700|    456|        || (group->meth->field_decode != NULL
  ------------------
  |  Branch (1700:13): [True: 456, False: 0]
  ------------------
 1701|    456|            && !group->meth->field_decode(group, t1, t1, ctx))
  ------------------
  |  Branch (1701:16): [True: 0, False: 456]
  ------------------
 1702|    456|        || !group->meth->field_inv(group, t1, t1, ctx)
  ------------------
  |  Branch (1702:12): [True: 0, False: 456]
  ------------------
 1703|    456|        || (group->meth->field_encode != NULL
  ------------------
  |  Branch (1703:13): [True: 456, False: 0]
  ------------------
 1704|    456|            && !group->meth->field_encode(group, t1, t1, ctx))
  ------------------
  |  Branch (1704:16): [True: 0, False: 456]
  ------------------
 1705|    456|        || !group->meth->field_mul(group, r->X, t5, t1, ctx)
  ------------------
  |  Branch (1705:12): [True: 0, False: 456]
  ------------------
 1706|    456|        || !group->meth->field_mul(group, r->Y, t0, t1, ctx))
  ------------------
  |  Branch (1706:12): [True: 0, False: 456]
  ------------------
 1707|      0|        goto err;
 1708|       |
 1709|    456|    if (group->meth->field_set_to_one != NULL) {
  ------------------
  |  Branch (1709:9): [True: 456, False: 0]
  ------------------
 1710|    456|        if (!group->meth->field_set_to_one(group, r->Z, ctx))
  ------------------
  |  Branch (1710:13): [True: 0, False: 456]
  ------------------
 1711|      0|            goto err;
 1712|    456|    } else {
 1713|      0|        if (!BN_one(r->Z))
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (1713:13): [True: 0, False: 0]
  ------------------
 1714|      0|            goto err;
 1715|      0|    }
 1716|       |
 1717|    456|    r->Z_is_one = 1;
 1718|    456|    ret = 1;
 1719|       |
 1720|    456| err:
 1721|    456|    BN_CTX_end(ctx);
 1722|    456|    return ret;
 1723|    456|}

ossl_ecx_public_from_private:
   29|      6|{
   30|      6|    switch (key->type) {
  ------------------
  |  Branch (30:13): [True: 0, False: 6]
  ------------------
   31|      2|    case ECX_KEY_TYPE_X25519:
  ------------------
  |  Branch (31:5): [True: 2, False: 4]
  ------------------
   32|      2|        ossl_x25519_public_from_private(key->pubkey, key->privkey);
   33|      2|        break;
   34|      4|    case ECX_KEY_TYPE_ED25519:
  ------------------
  |  Branch (34:5): [True: 4, False: 2]
  ------------------
   35|      4|        if (!ossl_ed25519_public_from_private(key->libctx, key->pubkey,
  ------------------
  |  Branch (35:13): [True: 0, False: 4]
  ------------------
   36|      4|                                              key->privkey, key->propq)) {
   37|      0|            ERR_raise(ERR_LIB_EC, EC_R_FAILED_MAKING_PUBLIC_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   38|      0|            return 0;
   39|      0|        }
   40|      4|        break;
   41|      4|    case ECX_KEY_TYPE_X448:
  ------------------
  |  Branch (41:5): [True: 0, False: 6]
  ------------------
   42|      0|        ossl_x448_public_from_private(key->pubkey, key->privkey);
   43|      0|        break;
   44|      0|    case ECX_KEY_TYPE_ED448:
  ------------------
  |  Branch (44:5): [True: 0, False: 6]
  ------------------
   45|      0|        if (!ossl_ed448_public_from_private(key->libctx, key->pubkey,
  ------------------
  |  Branch (45:13): [True: 0, False: 0]
  ------------------
   46|      0|                                            key->privkey, key->propq)) {
   47|      0|            ERR_raise(ERR_LIB_EC, EC_R_FAILED_MAKING_PUBLIC_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   48|      0|            return 0;
   49|      0|        }
   50|      0|        break;
   51|      6|    }
   52|      6|    return 1;
   53|      6|}
ossl_ecx_key_op:
  158|     57|{
  159|     57|    ECX_KEY *key = NULL;
  160|     57|    unsigned char *privkey, *pubkey;
  161|       |
  162|     57|    if (op != KEY_OP_KEYGEN) {
  ------------------
  |  Branch (162:9): [True: 57, False: 0]
  ------------------
  163|     57|        if (palg != NULL) {
  ------------------
  |  Branch (163:13): [True: 57, False: 0]
  ------------------
  164|     57|            int ptype;
  165|       |
  166|       |            /* Algorithm parameters must be absent */
  167|     57|            X509_ALGOR_get0(NULL, &ptype, NULL, palg);
  168|     57|            if (ptype != V_ASN1_UNDEF) {
  ------------------
  |  |   60|     57|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (168:17): [True: 9, False: 48]
  ------------------
  169|      9|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|      9|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      9|    (ERR_new(),                                                 \
  |  |  |  |  404|      9|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      9|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      9|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      9|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      9|     ERR_set_error)
  |  |  ------------------
  ------------------
  170|      9|                return 0;
  171|      9|            }
  172|     48|            if (id == EVP_PKEY_NONE)
  ------------------
  |  |   62|     48|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|     48|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (172:17): [True: 26, False: 22]
  ------------------
  173|     26|                id = OBJ_obj2nid(palg->algorithm);
  174|     22|            else if (id != OBJ_obj2nid(palg->algorithm)) {
  ------------------
  |  Branch (174:22): [True: 0, False: 22]
  ------------------
  175|      0|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  176|      0|                return 0;
  177|      0|            }
  178|     48|        }
  179|       |
  180|     48|        if (p == NULL || id == EVP_PKEY_NONE || plen != KEYLENID(id)) {
  ------------------
  |  |   62|     22|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|     70|#define NID_undef                       0
  |  |  ------------------
  ------------------
                      if (p == NULL || id == EVP_PKEY_NONE || plen != KEYLENID(id)) {
  ------------------
  |  |   12|     22|#define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  ------------------
  |  |  |  |   11|     22|#define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|     22|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5696|     44|#define NID_X25519              1034
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|     16|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5704|     16|#define NID_ED25519             1087
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (11:26): [True: 6, False: 16]
  |  |  |  |  |  Branch (11:53): [True: 8, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  ------------------
  |  |  |  |   26|     14|#  define X25519_KEYLEN         32
  |  |  ------------------
  |  |   13|     22|                                     : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  ------------------
  |  |  |  |   84|      8|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  ------------------
  |  |  |  |  |  | 5700|      8|#define NID_X448                1035
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                                                    : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  ------------------
  |  |  |  |   27|      5|#  define X448_KEYLEN           56
  |  |  ------------------
  |  |  |  Branch (13:41): [True: 5, False: 3]
  |  |  ------------------
  |  |   14|      8|                                                              : ED448_KEYLEN))
  |  |  ------------------
  |  |  |  |   29|      3|#  define ED448_KEYLEN          57
  |  |  ------------------
  ------------------
  |  Branch (180:13): [True: 26, False: 22]
  |  Branch (180:26): [True: 0, False: 22]
  |  Branch (180:49): [True: 12, False: 10]
  ------------------
  181|     38|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     38|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     38|    (ERR_new(),                                                 \
  |  |  |  |  404|     38|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     38|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     38|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     38|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     38|     ERR_set_error)
  |  |  ------------------
  ------------------
  182|     38|            return 0;
  183|     38|        }
  184|     48|    }
  185|       |
  186|     10|    key = ossl_ecx_key_new(libctx, KEYNID2TYPE(id), 1, propq);
  ------------------
  |  |   16|     10|    (IS25519(id) ? ((id) == EVP_PKEY_X25519 ? ECX_KEY_TYPE_X25519 \
  |  |  ------------------
  |  |  |  |   11|     10|#define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|     10|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5696|     20|#define NID_X25519              1034
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      7|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5704|      7|#define NID_ED25519             1087
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (11:26): [True: 3, False: 7]
  |  |  |  |  |  Branch (11:53): [True: 5, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (IS25519(id) ? ((id) == EVP_PKEY_X25519 ? ECX_KEY_TYPE_X25519 \
  |  |  ------------------
  |  |  |  |   82|      8|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  ------------------
  |  |  |  |  |  | 5696|      8|#define NID_X25519              1034
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (16:21): [True: 3, False: 5]
  |  |  ------------------
  |  |   17|      8|                                            : ECX_KEY_TYPE_ED25519) \
  |  |   18|     10|                 : ((id) == EVP_PKEY_X448 ? ECX_KEY_TYPE_X448 \
  |  |  ------------------
  |  |  |  |   84|      2|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  ------------------
  |  |  |  |  |  | 5700|      2|#define NID_X448                1035
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (18:21): [True: 1, False: 1]
  |  |  ------------------
  |  |   19|      2|                                          : ECX_KEY_TYPE_ED448))
  ------------------
  187|     10|    if (key == NULL) {
  ------------------
  |  Branch (187:9): [True: 0, False: 10]
  ------------------
  188|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  189|      0|        return 0;
  190|      0|    }
  191|     10|    pubkey = key->pubkey;
  192|       |
  193|     10|    if (op == KEY_OP_PUBLIC) {
  ------------------
  |  Branch (193:9): [True: 4, False: 6]
  ------------------
  194|      4|        memcpy(pubkey, p, plen);
  195|      6|    } else {
  196|      6|        privkey = ossl_ecx_key_allocate_privkey(key);
  197|      6|        if (privkey == NULL) {
  ------------------
  |  Branch (197:13): [True: 0, False: 6]
  ------------------
  198|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  199|      0|            goto err;
  200|      0|        }
  201|      6|        if (op == KEY_OP_KEYGEN) {
  ------------------
  |  Branch (201:13): [True: 0, False: 6]
  ------------------
  202|      0|            if (id != EVP_PKEY_NONE) {
  ------------------
  |  |   62|      0|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|      0|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (202:17): [True: 0, False: 0]
  ------------------
  203|      0|                if (RAND_priv_bytes_ex(libctx, privkey, KEYLENID(id), 0) <= 0)
  ------------------
  |  |   12|      0|#define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  ------------------
  |  |  |  |   11|      0|#define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|      0|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5696|      0|#define NID_X25519              1034
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5704|      0|#define NID_ED25519             1087
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (11:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (11:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  ------------------
  |  |  |  |   26|      0|#  define X25519_KEYLEN         32
  |  |  ------------------
  |  |   13|      0|                                     : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  ------------------
  |  |  |  |   84|      0|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  ------------------
  |  |  |  |  |  | 5700|      0|#define NID_X448                1035
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                                                    : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  ------------------
  |  |  |  |   27|      0|#  define X448_KEYLEN           56
  |  |  ------------------
  |  |  |  Branch (13:41): [True: 0, False: 0]
  |  |  ------------------
  |  |   14|      0|                                                              : ED448_KEYLEN))
  |  |  ------------------
  |  |  |  |   29|      0|#  define ED448_KEYLEN          57
  |  |  ------------------
  ------------------
  |  Branch (203:21): [True: 0, False: 0]
  ------------------
  204|      0|                    goto err;
  205|      0|                if (id == EVP_PKEY_X25519) {
  ------------------
  |  |   82|      0|# define EVP_PKEY_X25519 NID_X25519
  |  |  ------------------
  |  |  |  | 5696|      0|#define NID_X25519              1034
  |  |  ------------------
  ------------------
  |  Branch (205:21): [True: 0, False: 0]
  ------------------
  206|      0|                    privkey[0] &= 248;
  207|      0|                    privkey[X25519_KEYLEN - 1] &= 127;
  ------------------
  |  |   26|      0|#  define X25519_KEYLEN         32
  ------------------
  208|      0|                    privkey[X25519_KEYLEN - 1] |= 64;
  ------------------
  |  |   26|      0|#  define X25519_KEYLEN         32
  ------------------
  209|      0|                } else if (id == EVP_PKEY_X448) {
  ------------------
  |  |   84|      0|# define EVP_PKEY_X448 NID_X448
  |  |  ------------------
  |  |  |  | 5700|      0|#define NID_X448                1035
  |  |  ------------------
  ------------------
  |  Branch (209:28): [True: 0, False: 0]
  ------------------
  210|      0|                    privkey[0] &= 252;
  211|      0|                    privkey[X448_KEYLEN - 1] |= 128;
  ------------------
  |  |   27|      0|#  define X448_KEYLEN           56
  ------------------
  212|      0|                }
  213|      0|            }
  214|      6|        } else {
  215|      6|            memcpy(privkey, p, KEYLENID(id));
  ------------------
  |  |   12|      6|#define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  ------------------
  |  |  |  |   11|      6|#define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|      6|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5696|     12|#define NID_X25519              1034
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      4|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5704|      4|#define NID_ED25519             1087
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (11:26): [True: 2, False: 4]
  |  |  |  |  |  Branch (11:53): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  ------------------
  |  |  |  |   26|      6|#  define X25519_KEYLEN         32
  |  |  ------------------
  |  |   13|      6|                                     : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  ------------------
  |  |  |  |   84|      0|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  ------------------
  |  |  |  |  |  | 5700|      0|#define NID_X448                1035
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                                                    : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  ------------------
  |  |  |  |   27|      0|#  define X448_KEYLEN           56
  |  |  ------------------
  |  |  |  Branch (13:41): [True: 0, False: 0]
  |  |  ------------------
  |  |   14|      0|                                                              : ED448_KEYLEN))
  |  |  ------------------
  |  |  |  |   29|      0|#  define ED448_KEYLEN          57
  |  |  ------------------
  ------------------
  216|      6|        }
  217|      6|        if (!ossl_ecx_public_from_private(key)) {
  ------------------
  |  Branch (217:13): [True: 0, False: 6]
  ------------------
  218|      0|            ERR_raise(ERR_LIB_EC, EC_R_FAILED_MAKING_PUBLIC_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  219|      0|            goto err;
  220|      0|        }
  221|      6|    }
  222|       |
  223|     10|    return key;
  224|      0| err:
  225|      0|    ossl_ecx_key_free(key);
  226|      0|    return NULL;
  227|     10|}
ossl_ecx_key_from_pkcs8:
  231|     29|{
  232|     29|    ECX_KEY *ecx = NULL;
  233|     29|    const unsigned char *p;
  234|     29|    int plen;
  235|     29|    ASN1_OCTET_STRING *oct = NULL;
  236|     29|    const X509_ALGOR *palg;
  237|       |
  238|     29|    if (!PKCS8_pkey_get0(NULL, &p, &plen, &palg, p8inf))
  ------------------
  |  Branch (238:9): [True: 0, False: 29]
  ------------------
  239|      0|        return 0;
  240|       |
  241|     29|    oct = d2i_ASN1_OCTET_STRING(NULL, &p, plen);
  242|     29|    if (oct == NULL) {
  ------------------
  |  Branch (242:9): [True: 17, False: 12]
  ------------------
  243|     17|        p = NULL;
  244|     17|        plen = 0;
  245|     17|    } else {
  246|     12|        p = ASN1_STRING_get0_data(oct);
  247|     12|        plen = ASN1_STRING_length(oct);
  248|     12|    }
  249|       |
  250|       |    /*
  251|       |     * EVP_PKEY_NONE means that ecx_key_op() has to figure out the key type
  252|       |     * on its own.
  253|       |     */
  254|     29|    ecx = ossl_ecx_key_op(palg, p, plen, EVP_PKEY_NONE, KEY_OP_PRIVATE,
  ------------------
  |  |   62|     29|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|     29|#define NID_undef                       0
  |  |  ------------------
  ------------------
  255|     29|                          libctx, propq);
  256|     29|    ASN1_OCTET_STRING_free(oct);
  257|     29|    return ecx;
  258|     29|}

ossl_ecx_key_new:
   22|     10|{
   23|     10|    ECX_KEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|     10|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   24|       |
   25|     10|    if (ret == NULL)
  ------------------
  |  Branch (25:9): [True: 0, False: 10]
  ------------------
   26|      0|        return NULL;
   27|       |
   28|     10|    ret->libctx = libctx;
   29|     10|    ret->haspubkey = haspubkey;
   30|     10|    switch (type) {
  ------------------
  |  Branch (30:13): [True: 0, False: 10]
  ------------------
   31|      3|    case ECX_KEY_TYPE_X25519:
  ------------------
  |  Branch (31:5): [True: 3, False: 7]
  ------------------
   32|      3|        ret->keylen = X25519_KEYLEN;
  ------------------
  |  |   26|      3|#  define X25519_KEYLEN         32
  ------------------
   33|      3|        break;
   34|      1|    case ECX_KEY_TYPE_X448:
  ------------------
  |  Branch (34:5): [True: 1, False: 9]
  ------------------
   35|      1|        ret->keylen = X448_KEYLEN;
  ------------------
  |  |   27|      1|#  define X448_KEYLEN           56
  ------------------
   36|      1|        break;
   37|      5|    case ECX_KEY_TYPE_ED25519:
  ------------------
  |  Branch (37:5): [True: 5, False: 5]
  ------------------
   38|      5|        ret->keylen = ED25519_KEYLEN;
  ------------------
  |  |   28|      5|#  define ED25519_KEYLEN        32
  ------------------
   39|      5|        break;
   40|      1|    case ECX_KEY_TYPE_ED448:
  ------------------
  |  Branch (40:5): [True: 1, False: 9]
  ------------------
   41|      1|        ret->keylen = ED448_KEYLEN;
  ------------------
  |  |   29|      1|#  define ED448_KEYLEN          57
  ------------------
   42|      1|        break;
   43|     10|    }
   44|     10|    ret->type = type;
   45|       |
   46|     10|    if (!CRYPTO_NEW_REF(&ret->references, 1))
  ------------------
  |  Branch (46:9): [True: 0, False: 10]
  ------------------
   47|      0|        goto err;
   48|       |
   49|     10|    if (propq != NULL) {
  ------------------
  |  Branch (49:9): [True: 3, False: 7]
  ------------------
   50|      3|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  119|      3|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   51|      3|        if (ret->propq == NULL)
  ------------------
  |  Branch (51:13): [True: 0, False: 3]
  ------------------
   52|      0|            goto err;
   53|      3|    }
   54|     10|    return ret;
   55|      0|err:
   56|      0|    if (ret != NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 0]
  ------------------
   57|      0|        OPENSSL_free(ret->propq);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   58|      0|        CRYPTO_FREE_REF(&ret->references);
   59|      0|    }
   60|      0|    OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|      0|    return NULL;
   62|     10|}
ossl_ecx_key_free:
   65|  45.4k|{
   66|  45.4k|    int i;
   67|       |
   68|  45.4k|    if (key == NULL)
  ------------------
  |  Branch (68:9): [True: 45.4k, False: 14]
  ------------------
   69|  45.4k|        return;
   70|       |
   71|     14|    CRYPTO_DOWN_REF(&key->references, &i);
   72|     14|    REF_PRINT_COUNT("ECX_KEY", i, key);
  ------------------
  |  |  301|     14|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|     14|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|     14|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|     14|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   73|     14|    if (i > 0)
  ------------------
  |  Branch (73:9): [True: 4, False: 10]
  ------------------
   74|      4|        return;
   75|     10|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|     10|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 10]
  |  |  ------------------
  ------------------
   76|       |
   77|     10|    OPENSSL_free(key->propq);
  ------------------
  |  |  115|     10|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   78|       |#ifdef OPENSSL_PEDANTIC_ZEROIZATION
   79|       |    OPENSSL_cleanse(&key->pubkey, sizeof(key->pubkey));
   80|       |#endif
   81|     10|    OPENSSL_secure_clear_free(key->privkey, key->keylen);
  ------------------
  |  |  129|     10|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   82|     10|    CRYPTO_FREE_REF(&key->references);
   83|     10|    OPENSSL_free(key);
  ------------------
  |  |  115|     10|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   84|     10|}
ossl_ecx_key_set0_libctx:
   87|      7|{
   88|      7|    key->libctx = libctx;
   89|      7|}
ossl_ecx_key_up_ref:
   92|      4|{
   93|      4|    int i;
   94|       |
   95|      4|    if (CRYPTO_UP_REF(&key->references, &i) <= 0)
  ------------------
  |  Branch (95:9): [True: 0, False: 4]
  ------------------
   96|      0|        return 0;
   97|       |
   98|      4|    REF_PRINT_COUNT("ECX_KEY", i, key);
  ------------------
  |  |  301|      4|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|      4|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|      4|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|      4|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   99|      4|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|      4|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 4]
  |  |  ------------------
  ------------------
  100|      4|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (100:13): [True: 4, False: 0]
  ------------------
  101|      4|}
ossl_ecx_key_allocate_privkey:
  104|      6|{
  105|      6|    key->privkey = OPENSSL_secure_zalloc(key->keylen);
  ------------------
  |  |  125|      6|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  106|       |
  107|      6|    return key->privkey;
  108|      6|}

ecx_meth.c:ecx_pub_decode:
   55|     28|{
   56|     28|    const unsigned char *p;
   57|     28|    int pklen;
   58|     28|    X509_ALGOR *palg;
   59|     28|    ECX_KEY *ecx;
   60|     28|    int ret = 0;
   61|       |
   62|     28|    if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey))
  ------------------
  |  Branch (62:9): [True: 0, False: 28]
  ------------------
   63|      0|        return 0;
   64|     28|    ecx = ossl_ecx_key_op(palg, p, pklen, pkey->ameth->pkey_id,
   65|     28|                          KEY_OP_PUBLIC, NULL, NULL);
   66|     28|    if (ecx != NULL) {
  ------------------
  |  Branch (66:9): [True: 4, False: 24]
  ------------------
   67|      4|        ret = 1;
   68|      4|        EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, ecx);
   69|      4|    }
   70|     28|    return ret;
   71|     28|}
ecx_meth.c:ecx_key_print:
  168|      2|{
  169|      2|    const ECX_KEY *ecxkey = pkey->pkey.ecx;
  170|      2|    const char *nm = OBJ_nid2ln(pkey->ameth->pkey_id);
  171|       |
  172|      2|    if (op == KEY_OP_PRIVATE) {
  ------------------
  |  Branch (172:9): [True: 2, False: 0]
  ------------------
  173|      2|        if (ecxkey == NULL || ecxkey->privkey == NULL) {
  ------------------
  |  Branch (173:13): [True: 0, False: 2]
  |  Branch (173:31): [True: 0, False: 2]
  ------------------
  174|      0|            if (BIO_printf(bp, "%*s<INVALID PRIVATE KEY>\n", indent, "") <= 0)
  ------------------
  |  Branch (174:17): [True: 0, False: 0]
  ------------------
  175|      0|                return 0;
  176|      0|            return 1;
  177|      0|        }
  178|      2|        if (BIO_printf(bp, "%*s%s Private-Key:\n", indent, "", nm) <= 0)
  ------------------
  |  Branch (178:13): [True: 0, False: 2]
  ------------------
  179|      0|            return 0;
  180|      2|        if (BIO_printf(bp, "%*spriv:\n", indent, "") <= 0)
  ------------------
  |  Branch (180:13): [True: 0, False: 2]
  ------------------
  181|      0|            return 0;
  182|      2|        if (ASN1_buf_print(bp, ecxkey->privkey, KEYLEN(pkey),
  ------------------
  |  |   20|      2|#define KEYLEN(p)       KEYLENID((p)->ameth->pkey_id)
  |  |  ------------------
  |  |  |  |   12|      2|#define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      2|#define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   82|      2|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 5696|      4|#define NID_X25519              1034
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|      1|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 5704|      1|#define NID_ED25519             1087
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (11:26): [True: 1, False: 1]
  |  |  |  |  |  |  |  Branch (11:53): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  |  |  ------------------
  |  |  |  |  |  |   26|      2|#  define X25519_KEYLEN         32
  |  |  |  |  ------------------
  |  |  |  |   13|      2|                                     : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|      0|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5700|      0|#define NID_X448                1035
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                                                    : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#  define X448_KEYLEN           56
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (13:41): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   14|      0|                                                              : ED448_KEYLEN))
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|      0|#  define ED448_KEYLEN          57
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (182:13): [True: 0, False: 2]
  ------------------
  183|      2|                           indent + 4) == 0)
  184|      0|            return 0;
  185|      2|    } else {
  186|      0|        if (ecxkey == NULL) {
  ------------------
  |  Branch (186:13): [True: 0, False: 0]
  ------------------
  187|      0|            if (BIO_printf(bp, "%*s<INVALID PUBLIC KEY>\n", indent, "") <= 0)
  ------------------
  |  Branch (187:17): [True: 0, False: 0]
  ------------------
  188|      0|                return 0;
  189|      0|            return 1;
  190|      0|        }
  191|      0|        if (BIO_printf(bp, "%*s%s Public-Key:\n", indent, "", nm) <= 0)
  ------------------
  |  Branch (191:13): [True: 0, False: 0]
  ------------------
  192|      0|            return 0;
  193|      0|    }
  194|      2|    if (BIO_printf(bp, "%*spub:\n", indent, "") <= 0)
  ------------------
  |  Branch (194:9): [True: 0, False: 2]
  ------------------
  195|      0|        return 0;
  196|       |
  197|      2|    if (ASN1_buf_print(bp, ecxkey->pubkey, KEYLEN(pkey),
  ------------------
  |  |   20|      2|#define KEYLEN(p)       KEYLENID((p)->ameth->pkey_id)
  |  |  ------------------
  |  |  |  |   12|      2|#define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      2|#define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   82|      2|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 5696|      4|#define NID_X25519              1034
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|      1|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 5704|      1|#define NID_ED25519             1087
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (11:26): [True: 1, False: 1]
  |  |  |  |  |  |  |  Branch (11:53): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  |  |  ------------------
  |  |  |  |  |  |   26|      2|#  define X25519_KEYLEN         32
  |  |  |  |  ------------------
  |  |  |  |   13|      2|                                     : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|      0|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5700|      0|#define NID_X448                1035
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                                                    : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#  define X448_KEYLEN           56
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (13:41): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   14|      0|                                                              : ED448_KEYLEN))
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|      0|#  define ED448_KEYLEN          57
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (197:9): [True: 0, False: 2]
  ------------------
  198|      2|                       indent + 4) == 0)
  199|      0|        return 0;
  200|      2|    return 1;
  201|      2|}
ecx_meth.c:ecx_priv_encode:
   99|      2|{
  100|      2|    const ECX_KEY *ecxkey = pkey->pkey.ecx;
  101|      2|    ASN1_OCTET_STRING oct;
  102|      2|    unsigned char *penc = NULL;
  103|      2|    int penclen;
  104|       |
  105|      2|    if (ecxkey == NULL || ecxkey->privkey == NULL) {
  ------------------
  |  Branch (105:9): [True: 0, False: 2]
  |  Branch (105:27): [True: 0, False: 2]
  ------------------
  106|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_PRIVATE_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  107|      0|        return 0;
  108|      0|    }
  109|       |
  110|      2|    oct.data = ecxkey->privkey;
  111|      2|    oct.length = KEYLEN(pkey);
  ------------------
  |  |   20|      2|#define KEYLEN(p)       KEYLENID((p)->ameth->pkey_id)
  |  |  ------------------
  |  |  |  |   12|      2|#define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      2|#define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   82|      2|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 5696|      4|#define NID_X25519              1034
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|      1|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 5704|      1|#define NID_ED25519             1087
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (11:26): [True: 1, False: 1]
  |  |  |  |  |  |  |  Branch (11:53): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  |  |  ------------------
  |  |  |  |  |  |   26|      2|#  define X25519_KEYLEN         32
  |  |  |  |  ------------------
  |  |  |  |   13|      2|                                     : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|      0|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5700|      0|#define NID_X448                1035
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                                                    : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#  define X448_KEYLEN           56
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (13:41): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   14|      0|                                                              : ED448_KEYLEN))
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|      0|#  define ED448_KEYLEN          57
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  112|      2|    oct.flags = 0;
  113|       |
  114|      2|    penclen = i2d_ASN1_OCTET_STRING(&oct, &penc);
  115|      2|    if (penclen < 0) {
  ------------------
  |  Branch (115:9): [True: 0, False: 2]
  ------------------
  116|      0|        ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  117|      0|        return 0;
  118|      0|    }
  119|       |
  120|      2|    if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(pkey->ameth->pkey_id), 0,
  ------------------
  |  Branch (120:9): [True: 0, False: 2]
  ------------------
  121|      2|                         V_ASN1_UNDEF, NULL, penc, penclen)) {
  ------------------
  |  |   60|      2|# define V_ASN1_UNDEF                    -1
  ------------------
  122|      0|        OPENSSL_clear_free(penc, penclen);
  ------------------
  |  |  113|      0|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  123|      0|        ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  124|      0|        return 0;
  125|      0|    }
  126|       |
  127|      2|    return 1;
  128|      2|}
ecx_meth.c:ecx_priv_print:
  205|      2|{
  206|      2|    return ecx_key_print(bp, pkey, indent, ctx, KEY_OP_PRIVATE);
  207|      2|}
ecx_meth.c:ecx_free:
  156|     43|{
  157|     43|    ossl_ecx_key_free(pkey->pkey.ecx);
  158|     43|}
ecx_meth.c:ecx_priv_decode_ex:
   86|     15|{
   87|     15|    int ret = 0;
   88|     15|    ECX_KEY *ecx = ossl_ecx_key_from_pkcs8(p8, libctx, propq);
   89|       |
   90|     15|    if (ecx != NULL) {
  ------------------
  |  Branch (90:9): [True: 3, False: 12]
  ------------------
   91|      3|        ret = 1;
   92|      3|        EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, ecx);
   93|      3|    }
   94|       |
   95|     15|    return ret;
   96|     15|}

OSSL_DECODER_from_bio:
   48|  40.3k|{
   49|  40.3k|    struct decoder_process_data_st data;
   50|  40.3k|    int ok = 0;
   51|  40.3k|    BIO *new_bio = NULL;
   52|  40.3k|    unsigned long lasterr;
   53|       |
   54|  40.3k|    if (in == NULL) {
  ------------------
  |  Branch (54:9): [True: 0, False: 40.3k]
  ------------------
   55|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   56|      0|        return 0;
   57|      0|    }
   58|       |
   59|  40.3k|    if (OSSL_DECODER_CTX_get_num_decoders(ctx) == 0) {
  ------------------
  |  Branch (59:9): [True: 2.74k, False: 37.6k]
  ------------------
   60|  2.74k|        ERR_raise_data(ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_DECODER_NOT_FOUND,
  ------------------
  |  |  403|  2.74k|    (ERR_new(),                                                 \
  |  |  404|  2.74k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|  2.74k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|  2.74k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|  2.74k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|  2.74k|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_DECODER_NOT_FOUND,
  ------------------
  |  |  121|  2.74k|# define ERR_LIB_OSSL_DECODER    60
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_DECODER_NOT_FOUND,
  ------------------
  |  |   25|  2.74k|# define OSSL_DECODER_R_DECODER_NOT_FOUND                 102
  ------------------
   61|  2.74k|                       "No decoders were found. For standard decoders you need "
   62|  2.74k|                       "at least one of the default or base providers "
   63|  2.74k|                       "available. Did you forget to load them?");
   64|  2.74k|        return 0;
   65|  2.74k|    }
   66|       |
   67|  37.6k|    lasterr = ERR_peek_last_error();
   68|       |
   69|  37.6k|    if (BIO_tell(in) < 0) {
  ------------------
  |  |  570|  37.6k|# define BIO_tell(b)     (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
  |  |  ------------------
  |  |  |  |  465|  37.6k|# define BIO_C_FILE_TELL                         133
  |  |  ------------------
  ------------------
  |  Branch (69:9): [True: 0, False: 37.6k]
  ------------------
   70|      0|        new_bio = BIO_new(BIO_f_readbuffer());
   71|      0|        if (new_bio == NULL)
  ------------------
  |  Branch (71:13): [True: 0, False: 0]
  ------------------
   72|      0|            return 0;
   73|      0|        in = BIO_push(new_bio, in);
   74|      0|    }
   75|  37.6k|    memset(&data, 0, sizeof(data));
   76|  37.6k|    data.ctx = ctx;
   77|  37.6k|    data.bio = in;
   78|       |
   79|       |    /* Enable passphrase caching */
   80|  37.6k|    (void)ossl_pw_enable_passphrase_caching(&ctx->pwdata);
   81|       |
   82|  37.6k|    ok = decoder_process(NULL, &data);
   83|       |
   84|  37.6k|    if (!data.flag_construct_called) {
  ------------------
  |  Branch (84:9): [True: 29.3k, False: 8.30k]
  ------------------
   85|  29.3k|        const char *spaces
   86|  29.3k|            = ctx->start_input_type != NULL && ctx->input_structure != NULL
  ------------------
  |  Branch (86:15): [True: 29.3k, False: 0]
  |  Branch (86:48): [True: 29.3k, False: 0]
  ------------------
   87|  29.3k|            ? " " : "";
   88|  29.3k|        const char *input_type_label
   89|  29.3k|            = ctx->start_input_type != NULL ? "Input type: " : "";
  ------------------
  |  Branch (89:15): [True: 29.3k, False: 0]
  ------------------
   90|  29.3k|        const char *input_structure_label
   91|  29.3k|            = ctx->input_structure != NULL ? "Input structure: " : "";
  ------------------
  |  Branch (91:15): [True: 29.3k, False: 0]
  ------------------
   92|  29.3k|        const char *comma
   93|  29.3k|            = ctx->start_input_type != NULL && ctx->input_structure != NULL
  ------------------
  |  Branch (93:15): [True: 29.3k, False: 0]
  |  Branch (93:48): [True: 29.3k, False: 0]
  ------------------
   94|  29.3k|            ? ", " : "";
   95|  29.3k|        const char *input_type
   96|  29.3k|            = ctx->start_input_type != NULL ? ctx->start_input_type : "";
  ------------------
  |  Branch (96:15): [True: 29.3k, False: 0]
  ------------------
   97|  29.3k|        const char *input_structure
   98|  29.3k|            = ctx->input_structure != NULL ? ctx->input_structure : "";
  ------------------
  |  Branch (98:15): [True: 29.3k, False: 0]
  ------------------
   99|       |
  100|  29.3k|        if (ERR_peek_last_error() == lasterr || ERR_peek_error() == 0)
  ------------------
  |  Branch (100:13): [True: 25.1k, False: 4.13k]
  |  Branch (100:49): [True: 4.11k, False: 19]
  ------------------
  101|       |            /* Prevent spurious decoding error but add at least something */
  102|  29.3k|            ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_UNSUPPORTED,
  ------------------
  |  |  403|  29.3k|    (ERR_new(),                                                 \
  |  |  404|  29.3k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|  29.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|  29.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|  29.3k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|  29.3k|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_UNSUPPORTED,
  ------------------
  |  |  121|  29.3k|# define ERR_LIB_OSSL_DECODER    60
  ------------------
                          ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_UNSUPPORTED,
  ------------------
  |  |  363|  29.3k|# define ERR_R_UNSUPPORTED                       (268|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|  29.3k|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|  29.3k|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  103|  29.3k|                           "No supported data to decode. %s%s%s%s%s%s",
  104|  29.3k|                           spaces, input_type_label, input_type, comma,
  105|  29.3k|                           input_structure_label, input_structure);
  106|  29.3k|        ok = 0;
  107|  29.3k|    }
  108|       |
  109|       |    /* Clear any internally cached passphrase */
  110|  37.6k|    (void)ossl_pw_clear_passphrase_cache(&ctx->pwdata);
  111|       |
  112|  37.6k|    if (new_bio != NULL) {
  ------------------
  |  Branch (112:9): [True: 0, False: 37.6k]
  ------------------
  113|      0|        BIO_pop(new_bio);
  114|      0|        BIO_free(new_bio);
  115|      0|    }
  116|  37.6k|    return ok;
  117|  37.6k|}
OSSL_DECODER_from_data:
  147|  40.3k|{
  148|  40.3k|    BIO *membio;
  149|  40.3k|    int ret = 0;
  150|       |
  151|  40.3k|    if (pdata == NULL || *pdata == NULL || pdata_len == NULL) {
  ------------------
  |  Branch (151:9): [True: 0, False: 40.3k]
  |  Branch (151:26): [True: 0, False: 40.3k]
  |  Branch (151:44): [True: 0, False: 40.3k]
  ------------------
  152|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  153|      0|        return 0;
  154|      0|    }
  155|       |
  156|  40.3k|    membio = BIO_new_mem_buf(*pdata, (int)*pdata_len);
  157|  40.3k|    if (OSSL_DECODER_from_bio(ctx, membio)) {
  ------------------
  |  Branch (157:9): [True: 8.30k, False: 32.0k]
  ------------------
  158|  8.30k|        *pdata_len = (size_t)BIO_get_mem_data(membio, pdata);
  ------------------
  |  |  612|  8.30k|# define BIO_get_mem_data(b,pp)  BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)(pp))
  |  |  ------------------
  |  |  |  |   90|  8.30k|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  |  |  ------------------
  ------------------
  159|  8.30k|        ret = 1;
  160|  8.30k|    }
  161|  40.3k|    BIO_free(membio);
  162|       |
  163|  40.3k|    return ret;
  164|  40.3k|}
OSSL_DECODER_CTX_set_selection:
  167|    223|{
  168|    223|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|    223|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    223|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (168:9): [True: 0, False: 223]
  ------------------
  169|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  170|      0|        return 0;
  171|      0|    }
  172|       |
  173|       |    /*
  174|       |     * 0 is a valid selection, and means that the caller leaves
  175|       |     * it to code to discover what the selection is.
  176|       |     */
  177|    223|    ctx->selection = selection;
  178|    223|    return 1;
  179|    223|}
OSSL_DECODER_CTX_set_input_type:
  183|  40.5k|{
  184|  40.5k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  40.5k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  40.5k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (184:9): [True: 0, False: 40.5k]
  ------------------
  185|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  186|      0|        return 0;
  187|      0|    }
  188|       |
  189|       |    /*
  190|       |     * NULL is a valid starting input type, and means that the caller leaves
  191|       |     * it to code to discover what the starting input type is.
  192|       |     */
  193|  40.5k|    ctx->start_input_type = input_type;
  194|  40.5k|    return 1;
  195|  40.5k|}
OSSL_DECODER_CTX_set_input_structure:
  199|  40.5k|{
  200|  40.5k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  40.5k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  40.5k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (200:9): [True: 0, False: 40.5k]
  ------------------
  201|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  202|      0|        return 0;
  203|      0|    }
  204|       |
  205|       |    /*
  206|       |     * NULL is a valid starting input structure, and means that the caller
  207|       |     * leaves it to code to discover what the starting input structure is.
  208|       |     */
  209|  40.5k|    ctx->input_structure = input_structure;
  210|  40.5k|    return 1;
  211|  40.5k|}
ossl_decoder_instance_new:
  243|    342|{
  244|    342|    OSSL_DECODER_INSTANCE *decoder_inst = NULL;
  245|    342|    const OSSL_PROVIDER *prov;
  246|    342|    OSSL_LIB_CTX *libctx;
  247|    342|    const OSSL_PROPERTY_LIST *props;
  248|    342|    const OSSL_PROPERTY_DEFINITION *prop;
  249|       |
  250|    342|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|    342|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    342|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (250:9): [True: 0, False: 342]
  ------------------
  251|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  252|      0|        return 0;
  253|      0|    }
  254|       |
  255|    342|    if ((decoder_inst = OPENSSL_zalloc(sizeof(*decoder_inst))) == NULL)
  ------------------
  |  |  104|    342|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    342|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    342|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (255:9): [True: 0, False: 342]
  ------------------
  256|      0|        return 0;
  257|       |
  258|    342|    prov = OSSL_DECODER_get0_provider(decoder);
  259|    342|    libctx = ossl_provider_libctx(prov);
  260|    342|    props = ossl_decoder_parsed_properties(decoder);
  261|    342|    if (props == NULL) {
  ------------------
  |  Branch (261:9): [True: 0, False: 342]
  ------------------
  262|      0|        ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  121|      0|# define ERR_LIB_OSSL_DECODER    60
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  365|      0|# define ERR_R_INVALID_PROPERTY_DEFINITION       (270|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  263|      0|                       "there are no property definitions with decoder %s",
  264|      0|                       OSSL_DECODER_get0_name(decoder));
  265|      0|        goto err;
  266|      0|    }
  267|       |
  268|       |    /* The "input" property is mandatory */
  269|    342|    prop = ossl_property_find_property(props, libctx, "input");
  270|    342|    decoder_inst->input_type = ossl_property_get_string_value(libctx, prop);
  271|    342|    decoder_inst->input_type_id = 0;
  272|    342|    if (decoder_inst->input_type == NULL) {
  ------------------
  |  Branch (272:9): [True: 0, False: 342]
  ------------------
  273|      0|        ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  121|      0|# define ERR_LIB_OSSL_DECODER    60
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  365|      0|# define ERR_R_INVALID_PROPERTY_DEFINITION       (270|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  274|      0|                       "the mandatory 'input' property is missing "
  275|      0|                       "for decoder %s (properties: %s)",
  276|      0|                       OSSL_DECODER_get0_name(decoder),
  277|      0|                       OSSL_DECODER_get0_properties(decoder));
  278|      0|        goto err;
  279|      0|    }
  280|       |
  281|       |    /* The "structure" property is optional */
  282|    342|    prop = ossl_property_find_property(props, libctx, "structure");
  283|    342|    if (prop != NULL) {
  ------------------
  |  Branch (283:9): [True: 187, False: 155]
  ------------------
  284|    187|        decoder_inst->input_structure
  285|    187|            = ossl_property_get_string_value(libctx, prop);
  286|    187|    }
  287|       |
  288|    342|    if (!OSSL_DECODER_up_ref(decoder)) {
  ------------------
  |  Branch (288:9): [True: 0, False: 342]
  ------------------
  289|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  290|      0|        goto err;
  291|      0|    }
  292|    342|    decoder_inst->decoder = decoder;
  293|    342|    decoder_inst->decoderctx = decoderctx;
  294|    342|    return decoder_inst;
  295|      0| err:
  296|      0|    ossl_decoder_instance_free(decoder_inst);
  297|      0|    return NULL;
  298|    342|}
ossl_decoder_instance_free:
  301|   601k|{
  302|   601k|    if (decoder_inst != NULL) {
  ------------------
  |  Branch (302:9): [True: 601k, False: 0]
  ------------------
  303|   601k|        if (decoder_inst->decoder != NULL)
  ------------------
  |  Branch (303:13): [True: 601k, False: 0]
  ------------------
  304|   601k|            decoder_inst->decoder->freectx(decoder_inst->decoderctx);
  305|   601k|        decoder_inst->decoderctx = NULL;
  306|   601k|        OSSL_DECODER_free(decoder_inst->decoder);
  307|   601k|        decoder_inst->decoder = NULL;
  308|   601k|        OPENSSL_free(decoder_inst);
  ------------------
  |  |  115|   601k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   601k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   601k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  309|   601k|    }
  310|   601k|}
ossl_decoder_instance_dup:
  313|   601k|{
  314|   601k|    OSSL_DECODER_INSTANCE *dest;
  315|   601k|    const OSSL_PROVIDER *prov;
  316|   601k|    void *provctx;
  317|       |
  318|   601k|    if ((dest = OPENSSL_zalloc(sizeof(*dest))) == NULL)
  ------------------
  |  |  104|   601k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   601k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   601k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (318:9): [True: 0, False: 601k]
  ------------------
  319|      0|        return NULL;
  320|       |
  321|   601k|    *dest = *src;
  322|   601k|    if (!OSSL_DECODER_up_ref(dest->decoder)) {
  ------------------
  |  Branch (322:9): [True: 0, False: 601k]
  ------------------
  323|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  324|      0|        goto err;
  325|      0|    }
  326|   601k|    prov = OSSL_DECODER_get0_provider(dest->decoder);
  327|   601k|    provctx = OSSL_PROVIDER_get0_provider_ctx(prov);
  328|       |
  329|   601k|    dest->decoderctx = dest->decoder->newctx(provctx);
  330|   601k|    if (dest->decoderctx == NULL) {
  ------------------
  |  Branch (330:9): [True: 0, False: 601k]
  ------------------
  331|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  332|      0|        OSSL_DECODER_free(dest->decoder);
  333|      0|        goto err;
  334|      0|    }
  335|       |
  336|   601k|    return dest;
  337|       |
  338|      0| err:
  339|      0|    OPENSSL_free(dest);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  340|      0|    return NULL;
  341|   601k|}
ossl_decoder_ctx_add_decoder_inst:
  355|    232|{
  356|    232|    int ok;
  357|       |
  358|    232|    if (ctx->decoder_insts == NULL
  ------------------
  |  Branch (358:9): [True: 45, False: 187]
  ------------------
  359|    232|        && (ctx->decoder_insts =
  ------------------
  |  Branch (359:12): [True: 0, False: 45]
  ------------------
  360|     45|            sk_OSSL_DECODER_INSTANCE_new_null()) == NULL) {
  361|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  362|      0|        return 0;
  363|      0|    }
  364|       |
  365|    232|    ok = (sk_OSSL_DECODER_INSTANCE_push(ctx->decoder_insts, di) > 0);
  366|    232|    if (ok) {
  ------------------
  |  Branch (366:9): [True: 232, False: 0]
  ------------------
  367|    232|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|    232|    do {                                        \
  |  |  221|    232|        BIO *trc_out = NULL;                    \
  |  |  222|    232|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  368|      0|            BIO_printf(trc_out,
  369|      0|                       "(ctx %p) Added decoder instance %p for decoder %p\n"
  370|      0|                       "    %s with %s\n",
  371|      0|                       (void *)ctx, (void *)di, (void *)di->decoder,
  372|      0|                       OSSL_DECODER_get0_name(di->decoder),
  373|      0|                       OSSL_DECODER_get0_properties(di->decoder));
  374|    232|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|    232|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  375|    232|    }
  376|    232|    return ok;
  377|    232|}
OSSL_DECODER_CTX_add_extra:
  542|    223|{
  543|       |    /*
  544|       |     * This function goes through existing decoder methods in
  545|       |     * |ctx->decoder_insts|, and tries to fetch new decoders that produce
  546|       |     * what the existing ones want as input, and push those newly fetched
  547|       |     * decoders on top of the same stack.
  548|       |     * Then it does the same again, but looping over the newly fetched
  549|       |     * decoders, until there are no more decoders to be fetched, or
  550|       |     * when we have done this 10 times.
  551|       |     *
  552|       |     * we do this with sliding windows on the stack by keeping track of indexes
  553|       |     * and of the end.
  554|       |     *
  555|       |     * +----------------+
  556|       |     * |   DER to RSA   | <--- w_prev_start
  557|       |     * +----------------+
  558|       |     * |   DER to DSA   |
  559|       |     * +----------------+
  560|       |     * |   DER to DH    |
  561|       |     * +----------------+
  562|       |     * |   PEM to DER   | <--- w_prev_end, w_new_start
  563|       |     * +----------------+
  564|       |     *                    <--- w_new_end
  565|       |     */
  566|    223|    struct collect_extra_decoder_data_st data;
  567|    223|    size_t depth = 0; /* Counts the number of iterations */
  568|    223|    size_t count; /* Calculates how many were added in each iteration */
  569|    223|    size_t numdecoders;
  570|    223|    STACK_OF(OSSL_DECODER) *skdecoders;
  ------------------
  |  |   31|    223|# define STACK_OF(type) struct stack_st_##type
  ------------------
  571|       |
  572|    223|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|    223|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    223|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (572:9): [True: 0, False: 223]
  ------------------
  573|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  574|      0|        return 0;
  575|      0|    }
  576|       |
  577|       |    /*
  578|       |     * If there is no stack of OSSL_DECODER_INSTANCE, we have nothing
  579|       |     * more to add.  That's fine.
  580|       |     */
  581|    223|    if (ctx->decoder_insts == NULL)
  ------------------
  |  Branch (581:9): [True: 178, False: 45]
  ------------------
  582|    178|        return 1;
  583|       |
  584|     45|    OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|     45|    do {                                        \
  |  |  221|     45|        BIO *trc_out = NULL;                    \
  |  |  222|     45|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  585|      0|        BIO_printf(trc_out, "(ctx %p) Looking for extra decoders\n",
  586|      0|                   (void *)ctx);
  587|     45|    } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|     45|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  588|       |
  589|       |
  590|     45|    skdecoders = sk_OSSL_DECODER_new_null();
  591|     45|    if (skdecoders == NULL) {
  ------------------
  |  Branch (591:9): [True: 0, False: 45]
  ------------------
  592|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  593|      0|        return 0;
  594|      0|    }
  595|     45|    OSSL_DECODER_do_all_provided(libctx, collect_all_decoders, skdecoders);
  596|     45|    numdecoders = sk_OSSL_DECODER_num(skdecoders);
  597|       |
  598|     45|    memset(&data, 0, sizeof(data));
  599|     45|    data.ctx = ctx;
  600|     45|    data.w_prev_start = 0;
  601|     45|    data.w_prev_end = sk_OSSL_DECODER_INSTANCE_num(ctx->decoder_insts);
  602|     90|    do {
  603|     90|        size_t i, j;
  604|       |
  605|     90|        data.w_new_start = data.w_new_end = data.w_prev_end;
  606|       |
  607|       |        /*
  608|       |         * Two iterations:
  609|       |         * 0.  All decoders that have the same name as their input type.
  610|       |         *     This allows for decoders that unwrap some data in a specific
  611|       |         *     encoding, and pass the result on with the same encoding.
  612|       |         * 1.  All decoders that a different name than their input type.
  613|       |         */
  614|     90|        for (data.type_check = IS_SAME;
  615|    270|             data.type_check <= IS_DIFFERENT;
  ------------------
  |  Branch (615:14): [True: 180, False: 90]
  ------------------
  616|    180|             data.type_check++) {
  617|    644|            for (i = data.w_prev_start; i < data.w_prev_end; i++) {
  ------------------
  |  Branch (617:41): [True: 464, False: 180]
  ------------------
  618|    464|                OSSL_DECODER_INSTANCE *decoder_inst =
  619|    464|                    sk_OSSL_DECODER_INSTANCE_value(ctx->decoder_insts, i);
  620|       |
  621|    464|                data.output_type
  622|    464|                    = OSSL_DECODER_INSTANCE_get_input_type(decoder_inst);
  623|       |
  624|    464|                data.output_type_id = 0;
  625|       |
  626|  35.7k|                for (j = 0; j < numdecoders; j++)
  ------------------
  |  Branch (626:29): [True: 35.2k, False: 464]
  ------------------
  627|  35.2k|                    collect_extra_decoder(sk_OSSL_DECODER_value(skdecoders, j),
  628|  35.2k|                                          &data);
  629|    464|            }
  630|    180|        }
  631|       |        /* How many were added in this iteration */
  632|     90|        count = data.w_new_end - data.w_new_start;
  633|       |
  634|       |        /* Slide the "previous decoder" windows */
  635|     90|        data.w_prev_start = data.w_new_start;
  636|     90|        data.w_prev_end = data.w_new_end;
  637|       |
  638|     90|        depth++;
  639|     90|    } while (count != 0 && depth <= 10);
  ------------------
  |  Branch (639:14): [True: 45, False: 45]
  |  Branch (639:28): [True: 45, False: 0]
  ------------------
  640|       |
  641|     45|    sk_OSSL_DECODER_pop_free(skdecoders, OSSL_DECODER_free);
  642|     45|    return 1;
  643|     45|}
OSSL_DECODER_CTX_get_num_decoders:
  646|  78.2k|{
  647|  78.2k|    if (ctx == NULL || ctx->decoder_insts == NULL)
  ------------------
  |  Branch (647:9): [True: 0, False: 78.2k]
  |  Branch (647:24): [True: 2.92k, False: 75.2k]
  ------------------
  648|  2.92k|        return 0;
  649|  75.2k|    return sk_OSSL_DECODER_INSTANCE_num(ctx->decoder_insts);
  650|  78.2k|}
OSSL_DECODER_CTX_set_construct:
  654|  40.4k|{
  655|  40.4k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  40.4k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  40.4k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (655:9): [True: 0, False: 40.4k]
  ------------------
  656|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  657|      0|        return 0;
  658|      0|    }
  659|  40.4k|    ctx->construct = construct;
  660|  40.4k|    return 1;
  661|  40.4k|}
OSSL_DECODER_CTX_set_construct_data:
  665|  37.6k|{
  666|  37.6k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  37.6k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  37.6k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (666:9): [True: 0, False: 37.6k]
  ------------------
  667|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  668|      0|        return 0;
  669|      0|    }
  670|  37.6k|    ctx->construct_data = construct_data;
  671|  37.6k|    return 1;
  672|  37.6k|}
OSSL_DECODER_CTX_set_cleanup:
  676|  40.4k|{
  677|  40.4k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  40.4k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  40.4k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (677:9): [True: 0, False: 40.4k]
  ------------------
  678|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  679|      0|        return 0;
  680|      0|    }
  681|  40.4k|    ctx->cleanup = cleanup;
  682|  40.4k|    return 1;
  683|  40.4k|}
OSSL_DECODER_CTX_get_construct:
  687|  40.3k|{
  688|  40.3k|    if (ctx == NULL)
  ------------------
  |  Branch (688:9): [True: 0, False: 40.3k]
  ------------------
  689|      0|        return NULL;
  690|  40.3k|    return ctx->construct;
  691|  40.3k|}
OSSL_DECODER_CTX_get_construct_data:
  694|  40.3k|{
  695|  40.3k|    if (ctx == NULL)
  ------------------
  |  Branch (695:9): [True: 0, False: 40.3k]
  ------------------
  696|      0|        return NULL;
  697|  40.3k|    return ctx->construct_data;
  698|  40.3k|}
OSSL_DECODER_CTX_get_cleanup:
  702|  40.3k|{
  703|  40.3k|    if (ctx == NULL)
  ------------------
  |  Branch (703:9): [True: 0, False: 40.3k]
  ------------------
  704|      0|        return NULL;
  705|  40.3k|    return ctx->cleanup;
  706|  40.3k|}
OSSL_DECODER_INSTANCE_get_decoder:
  731|   662k|{
  732|   662k|    if (decoder_inst == NULL)
  ------------------
  |  Branch (732:9): [True: 0, False: 662k]
  ------------------
  733|      0|        return NULL;
  734|   662k|    return decoder_inst->decoder;
  735|   662k|}
OSSL_DECODER_INSTANCE_get_decoder_ctx:
  739|   628k|{
  740|   628k|    if (decoder_inst == NULL)
  ------------------
  |  Branch (740:9): [True: 0, False: 628k]
  ------------------
  741|      0|        return NULL;
  742|   628k|    return decoder_inst->decoderctx;
  743|   628k|}
OSSL_DECODER_INSTANCE_get_input_type:
  747|   595k|{
  748|   595k|    if (decoder_inst == NULL)
  ------------------
  |  Branch (748:9): [True: 0, False: 595k]
  ------------------
  749|      0|        return NULL;
  750|   595k|    return decoder_inst->input_type;
  751|   595k|}
OSSL_DECODER_INSTANCE_get_input_structure:
  756|   594k|{
  757|   594k|    if (decoder_inst == NULL)
  ------------------
  |  Branch (757:9): [True: 0, False: 594k]
  ------------------
  758|      0|        return NULL;
  759|   594k|    *was_set = decoder_inst->flag_input_structure_was_set;
  760|   594k|    return decoder_inst->input_structure;
  761|   594k|}
decoder_lib.c:collect_all_decoders:
  429|  3.42k|{
  430|  3.42k|    STACK_OF(OSSL_DECODER) *skdecoders = arg;
  ------------------
  |  |   31|  3.42k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  431|       |
  432|  3.42k|    if (OSSL_DECODER_up_ref(decoder)
  ------------------
  |  Branch (432:9): [True: 3.42k, False: 0]
  ------------------
  433|  3.42k|            && !sk_OSSL_DECODER_push(skdecoders, decoder))
  ------------------
  |  Branch (433:16): [True: 0, False: 3.42k]
  ------------------
  434|      0|        OSSL_DECODER_free(decoder);
  435|  3.42k|}
decoder_lib.c:collect_extra_decoder:
  438|  35.2k|{
  439|  35.2k|    struct collect_extra_decoder_data_st *data = arg;
  440|  35.2k|    size_t j;
  441|  35.2k|    const OSSL_PROVIDER *prov = OSSL_DECODER_get0_provider(decoder);
  442|  35.2k|    void *provctx = OSSL_PROVIDER_get0_provider_ctx(prov);
  443|       |
  444|  35.2k|    if (ossl_decoder_fast_is_a(decoder, data->output_type, &data->output_type_id)) {
  ------------------
  |  Branch (444:9): [True: 1.12k, False: 34.1k]
  ------------------
  445|  1.12k|        void *decoderctx = NULL;
  446|  1.12k|        OSSL_DECODER_INSTANCE *di = NULL;
  447|       |
  448|  1.12k|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|  1.12k|    do {                                        \
  |  |  221|  1.12k|        BIO *trc_out = NULL;                    \
  |  |  222|  1.12k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  449|      0|            BIO_printf(trc_out,
  450|      0|                       "(ctx %p) [%d] Checking out decoder %p:\n"
  451|      0|                       "    %s with %s\n",
  452|      0|                       (void *)data->ctx, data->type_check, (void *)decoder,
  453|      0|                       OSSL_DECODER_get0_name(decoder),
  454|      0|                       OSSL_DECODER_get0_properties(decoder));
  455|  1.12k|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|  1.12k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  456|       |
  457|       |        /*
  458|       |         * Check that we don't already have this decoder in our stack,
  459|       |         * starting with the previous windows but also looking at what
  460|       |         * we have added in the current window.
  461|       |         */
  462|  10.6k|        for (j = data->w_prev_start; j < data->w_new_end; j++) {
  ------------------
  |  Branch (462:38): [True: 10.4k, False: 232]
  ------------------
  463|  10.4k|            OSSL_DECODER_INSTANCE *check_inst =
  464|  10.4k|                sk_OSSL_DECODER_INSTANCE_value(data->ctx->decoder_insts, j);
  465|       |
  466|  10.4k|            if (decoder->base.algodef == check_inst->decoder->base.algodef) {
  ------------------
  |  Branch (466:17): [True: 890, False: 9.56k]
  ------------------
  467|       |                /* We found it, so don't do anything more */
  468|    890|                OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|    890|    do {                                        \
  |  |  221|    890|        BIO *trc_out = NULL;                    \
  |  |  222|    890|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  469|      0|                    BIO_printf(trc_out,
  470|      0|                               "    REJECTED: already exists in the chain\n");
  471|    890|                } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|    890|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  472|    890|                return;
  473|    890|            }
  474|  10.4k|        }
  475|       |
  476|    232|        if ((decoderctx = decoder->newctx(provctx)) == NULL)
  ------------------
  |  Branch (476:13): [True: 0, False: 232]
  ------------------
  477|      0|            return;
  478|       |
  479|    232|        if (decoder->set_ctx_params != NULL
  ------------------
  |  Branch (479:13): [True: 232, False: 0]
  ------------------
  480|    232|            && data->ctx->input_structure != NULL) {
  ------------------
  |  Branch (480:16): [True: 232, False: 0]
  ------------------
  481|    232|            OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|    232|    { NULL, 0, NULL, 0, 0 }
  ------------------
                          OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|    232|    { NULL, 0, NULL, 0, 0 }
  ------------------
  482|    232|            const char *str = data->ctx->input_structure;
  483|       |
  484|    232|            params[0] =
  485|    232|                OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_STRUCTURE,
  ------------------
  |  |  351|    232|# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure"
  ------------------
  486|    232|                                                 (char *)str, 0);
  487|    232|            if (!decoder->set_ctx_params(decoderctx, params)) {
  ------------------
  |  Branch (487:17): [True: 0, False: 232]
  ------------------
  488|      0|                decoder->freectx(decoderctx);
  489|      0|                return;
  490|      0|            }
  491|    232|        }
  492|       |
  493|    232|        if ((di = ossl_decoder_instance_new(decoder, decoderctx)) == NULL) {
  ------------------
  |  Branch (493:13): [True: 0, False: 232]
  ------------------
  494|      0|            decoder->freectx(decoderctx);
  495|      0|            return;
  496|      0|        }
  497|       |
  498|    232|        switch (data->type_check) {
  ------------------
  |  Branch (498:17): [True: 0, False: 232]
  ------------------
  499|    187|        case IS_SAME:
  ------------------
  |  Branch (499:9): [True: 187, False: 45]
  ------------------
  500|       |            /* If it differs, this is not a decoder to add for now. */
  501|    187|            if (!ossl_decoder_fast_is_a(decoder,
  ------------------
  |  Branch (501:17): [True: 97, False: 90]
  ------------------
  502|    187|                                        OSSL_DECODER_INSTANCE_get_input_type(di),
  503|    187|                                        &di->input_type_id)) {
  504|     97|                ossl_decoder_instance_free(di);
  505|     97|                OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|     97|    do {                                        \
  |  |  221|     97|        BIO *trc_out = NULL;                    \
  |  |  222|     97|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  506|      0|                    BIO_printf(trc_out,
  507|      0|                               "    REJECTED: input type doesn't match output type\n");
  508|     97|                } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|     97|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  509|     97|                return;
  510|     97|            }
  511|     90|            break;
  512|     90|        case IS_DIFFERENT:
  ------------------
  |  Branch (512:9): [True: 45, False: 187]
  ------------------
  513|       |            /* If it's the same, this is not a decoder to add for now. */
  514|     45|            if (ossl_decoder_fast_is_a(decoder,
  ------------------
  |  Branch (514:17): [True: 0, False: 45]
  ------------------
  515|     45|                                       OSSL_DECODER_INSTANCE_get_input_type(di),
  516|     45|                                       &di->input_type_id)) {
  517|      0|                ossl_decoder_instance_free(di);
  518|      0|                OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|      0|    do {                                        \
  |  |  221|      0|        BIO *trc_out = NULL;                    \
  |  |  222|      0|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  519|      0|                    BIO_printf(trc_out,
  520|      0|                               "    REJECTED: input type matches output type\n");
  521|      0|                } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  522|      0|                return;
  523|      0|            }
  524|     45|            break;
  525|    232|        }
  526|       |
  527|       |        /*
  528|       |         * Apart from keeping w_new_end up to date, We don't care about
  529|       |         * errors here.  If it doesn't collect, then it doesn't...
  530|       |         */
  531|    135|        if (!ossl_decoder_ctx_add_decoder_inst(data->ctx, di)) {
  ------------------
  |  Branch (531:13): [True: 0, False: 135]
  ------------------
  532|      0|            ossl_decoder_instance_free(di);
  533|      0|            return;
  534|      0|        }
  535|       |
  536|    135|        data->w_new_end++;
  537|    135|    }
  538|  35.2k|}
decoder_lib.c:decoder_process:
  764|  71.5k|{
  765|  71.5k|    struct decoder_process_data_st *data = arg;
  766|  71.5k|    OSSL_DECODER_CTX *ctx = data->ctx;
  767|  71.5k|    OSSL_DECODER_INSTANCE *decoder_inst = NULL;
  768|  71.5k|    OSSL_DECODER *decoder = NULL;
  769|  71.5k|    OSSL_CORE_BIO *cbio = NULL;
  770|  71.5k|    BIO *bio = data->bio;
  771|  71.5k|    long loc;
  772|  71.5k|    size_t i;
  773|  71.5k|    int ok = 0;
  774|       |    /* For recursions */
  775|  71.5k|    struct decoder_process_data_st new_data;
  776|  71.5k|    const char *data_type = NULL;
  777|  71.5k|    const char *data_structure = NULL;
  778|       |    /* Saved to restore on return, mutated in PEM->DER transition. */
  779|  71.5k|    const char *start_input_type = ctx->start_input_type;
  780|       |
  781|       |    /*
  782|       |     * This is an indicator up the call stack that something was indeed
  783|       |     * decoded, leading to a recursive call of this function.
  784|       |     */
  785|  71.5k|    data->flag_next_level_called = 1;
  786|       |
  787|  71.5k|    memset(&new_data, 0, sizeof(new_data));
  788|  71.5k|    new_data.ctx = data->ctx;
  789|  71.5k|    new_data.recursion = data->recursion + 1;
  790|       |
  791|  71.5k|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  792|  71.5k|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  793|  71.5k|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  794|  71.5k|               : LEVEL_STR "...")
  795|       |
  796|  71.5k|    if (params == NULL) {
  ------------------
  |  Branch (796:9): [True: 37.6k, False: 33.9k]
  ------------------
  797|       |        /* First iteration, where we prepare for what is to come */
  798|       |
  799|  37.6k|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|  37.6k|    do {                                        \
  |  |  221|  37.6k|        BIO *trc_out = NULL;                    \
  |  |  222|  37.6k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  800|      0|            BIO_printf(trc_out,
  801|      0|                       "(ctx %p) starting to walk the decoder chain\n",
  802|      0|                       (void *)new_data.ctx);
  803|  37.6k|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|  37.6k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  804|       |
  805|  37.6k|        data->current_decoder_inst_index =
  806|  37.6k|            OSSL_DECODER_CTX_get_num_decoders(ctx);
  807|       |
  808|  37.6k|        bio = data->bio;
  809|  37.6k|    } else {
  810|  33.9k|        const OSSL_PARAM *p;
  811|  33.9k|        const char *trace_data_structure;
  812|       |
  813|  33.9k|        decoder_inst =
  814|  33.9k|            sk_OSSL_DECODER_INSTANCE_value(ctx->decoder_insts,
  815|  33.9k|                                           data->current_decoder_inst_index);
  816|  33.9k|        decoder = OSSL_DECODER_INSTANCE_get_decoder(decoder_inst);
  817|       |
  818|  33.9k|        data->flag_construct_called = 0;
  819|  33.9k|        if (ctx->construct != NULL) {
  ------------------
  |  Branch (819:13): [True: 33.9k, False: 0]
  ------------------
  820|  33.9k|            int rv;
  821|       |
  822|  33.9k|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|  33.9k|    do {                                        \
  |  |  221|  33.9k|        BIO *trc_out = NULL;                    \
  |  |  222|  33.9k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  823|      0|                BIO_printf(trc_out,
  824|      0|                           "(ctx %p) %s Running constructor\n",
  825|      0|                           (void *)new_data.ctx, LEVEL);
  ------------------
  |  |  792|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (792:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  793|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  794|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  826|  33.9k|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|  33.9k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  827|       |
  828|  33.9k|            rv = ctx->construct(decoder_inst, params, ctx->construct_data);
  829|       |
  830|  33.9k|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|  33.9k|    do {                                        \
  |  |  221|  33.9k|        BIO *trc_out = NULL;                    \
  |  |  222|  33.9k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  831|      0|                BIO_printf(trc_out,
  832|      0|                           "(ctx %p) %s Running constructor => %d\n",
  833|      0|                           (void *)new_data.ctx, LEVEL, rv);
  ------------------
  |  |  792|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (792:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  793|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  794|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  834|  33.9k|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|  33.9k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  835|       |
  836|  33.9k|            ok = (rv > 0);
  837|  33.9k|            if (ok) {
  ------------------
  |  Branch (837:17): [True: 8.30k, False: 25.6k]
  ------------------
  838|  8.30k|                data->flag_construct_called = 1;
  839|  8.30k|                goto end;
  840|  8.30k|            }
  841|  33.9k|        }
  842|       |
  843|       |        /* The constructor didn't return success */
  844|       |
  845|       |        /*
  846|       |         * so we try to use the object we got and feed it to any next
  847|       |         * decoder that will take it.  Object references are not
  848|       |         * allowed for this.
  849|       |         * If this data isn't present, decoding has failed.
  850|       |         */
  851|       |
  852|  25.6k|        p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA);
  ------------------
  |  |  350|  25.6k|# define OSSL_OBJECT_PARAM_DATA "data"
  ------------------
  853|  25.6k|        if (p == NULL || p->data_type != OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|  25.6k|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (853:13): [True: 0, False: 25.6k]
  |  Branch (853:26): [True: 0, False: 25.6k]
  ------------------
  854|      0|            goto end;
  855|  25.6k|        new_data.bio = BIO_new_mem_buf(p->data, (int)p->data_size);
  856|  25.6k|        if (new_data.bio == NULL)
  ------------------
  |  Branch (856:13): [True: 0, False: 25.6k]
  ------------------
  857|      0|            goto end;
  858|  25.6k|        bio = new_data.bio;
  859|       |
  860|       |        /* Get the data type if there is one */
  861|  25.6k|        p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA_TYPE);
  ------------------
  |  |  352|  25.6k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  862|  25.6k|        if (p != NULL && !OSSL_PARAM_get_utf8_string_ptr(p, &data_type))
  ------------------
  |  Branch (862:13): [True: 25.6k, False: 0]
  |  Branch (862:26): [True: 0, False: 25.6k]
  ------------------
  863|      0|            goto end;
  864|       |
  865|       |        /* Get the data structure if there is one */
  866|  25.6k|        p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA_STRUCTURE);
  ------------------
  |  |  351|  25.6k|# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure"
  ------------------
  867|  25.6k|        if (p != NULL && !OSSL_PARAM_get_utf8_string_ptr(p, &data_structure))
  ------------------
  |  Branch (867:13): [True: 25.6k, False: 0]
  |  Branch (867:26): [True: 0, False: 25.6k]
  ------------------
  868|      0|            goto end;
  869|       |
  870|       |        /* Get the new input type if there is one */
  871|  25.6k|        p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_INPUT_TYPE);
  ------------------
  |  |  354|  25.6k|# define OSSL_OBJECT_PARAM_INPUT_TYPE "input-type"
  ------------------
  872|  25.6k|        if (p != NULL) {
  ------------------
  |  Branch (872:13): [True: 25.6k, False: 0]
  ------------------
  873|  25.6k|            if (!OSSL_PARAM_get_utf8_string_ptr(p, &ctx->start_input_type))
  ------------------
  |  Branch (873:17): [True: 0, False: 25.6k]
  ------------------
  874|      0|                goto end;
  875|       |            /*
  876|       |             * When switching PKCS8 from PEM to DER we decrypt the data if needed
  877|       |             * and then determine the algorithm OID.  Likewise, with SPKI, only
  878|       |             * this time sans decryption.
  879|       |             */
  880|  25.6k|            if (ctx->input_structure != NULL
  ------------------
  |  Branch (880:17): [True: 25.6k, False: 0]
  ------------------
  881|  25.6k|                && (OPENSSL_strcasecmp(ctx->input_structure, "SubjectPublicKeyInfo") == 0
  ------------------
  |  Branch (881:21): [True: 24.8k, False: 766]
  ------------------
  882|  25.6k|                    || OPENSSL_strcasecmp(data_structure, "PrivateKeyInfo") == 0
  ------------------
  |  Branch (882:24): [True: 0, False: 766]
  ------------------
  883|  25.6k|                    || OPENSSL_strcasecmp(ctx->input_structure, "PrivateKeyInfo") == 0))
  ------------------
  |  Branch (883:24): [True: 0, False: 766]
  ------------------
  884|  24.8k|                data->flag_input_structure_checked = 1;
  885|  25.6k|        }
  886|       |
  887|       |        /*
  888|       |         * If the data structure is "type-specific" and the data type is
  889|       |         * given, we drop the data structure.  The reasoning is that the
  890|       |         * data type is already enough to find the applicable next decoder,
  891|       |         * so an additional "type-specific" data structure is extraneous.
  892|       |         *
  893|       |         * Furthermore, if the OSSL_DECODER caller asked for a type specific
  894|       |         * structure under another name, such as "DH", we get a mismatch
  895|       |         * if the data structure we just received is "type-specific".
  896|       |         * There's only so much you can do without infusing this code with
  897|       |         * too special knowledge.
  898|       |         */
  899|  25.6k|        trace_data_structure = data_structure;
  900|  25.6k|        if (data_type != NULL && data_structure != NULL
  ------------------
  |  Branch (900:13): [True: 25.6k, False: 0]
  |  Branch (900:34): [True: 25.6k, False: 0]
  ------------------
  901|  25.6k|            && OPENSSL_strcasecmp(data_structure, "type-specific") == 0)
  ------------------
  |  Branch (901:16): [True: 0, False: 25.6k]
  ------------------
  902|      0|            data_structure = NULL;
  903|       |
  904|  25.6k|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|  25.6k|    do {                                        \
  |  |  221|  25.6k|        BIO *trc_out = NULL;                    \
  |  |  222|  25.6k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  905|      0|            BIO_printf(trc_out,
  906|      0|                       "(ctx %p) %s incoming from previous decoder (%p):\n"
  907|      0|                       "    data type: %s, data structure: %s%s\n",
  908|      0|                       (void *)new_data.ctx, LEVEL, (void *)decoder,
  ------------------
  |  |  792|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (792:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  793|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  794|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  909|      0|                       data_type, trace_data_structure,
  910|      0|                       (trace_data_structure == data_structure
  ------------------
  |  Branch (910:25): [True: 0, False: 0]
  ------------------
  911|      0|                        ? "" : " (dropped)"));
  912|  25.6k|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|  25.6k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  913|  25.6k|    }
  914|       |
  915|       |    /*
  916|       |     * If we have no more decoders to look through at this point,
  917|       |     * we failed
  918|       |     */
  919|  63.2k|    if (data->current_decoder_inst_index == 0)
  ------------------
  |  Branch (919:9): [True: 0, False: 63.2k]
  ------------------
  920|      0|        goto end;
  921|       |
  922|  63.2k|    if ((loc = BIO_tell(bio)) < 0) {
  ------------------
  |  |  570|  63.2k|# define BIO_tell(b)     (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
  |  |  ------------------
  |  |  |  |  465|  63.2k|# define BIO_C_FILE_TELL                         133
  |  |  ------------------
  ------------------
  |  Branch (922:9): [True: 0, False: 63.2k]
  ------------------
  923|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_BIO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  924|      0|        goto end;
  925|      0|    }
  926|       |
  927|  63.2k|    if ((cbio = ossl_core_bio_new_from_bio(bio)) == NULL) {
  ------------------
  |  Branch (927:9): [True: 0, False: 63.2k]
  ------------------
  928|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_BIO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  929|      0|        goto end;
  930|      0|    }
  931|       |
  932|   624k|    for (i = data->current_decoder_inst_index; i-- > 0;) {
  ------------------
  |  Branch (932:48): [True: 594k, False: 29.3k]
  ------------------
  933|   594k|        OSSL_DECODER_INSTANCE *new_decoder_inst =
  934|   594k|            sk_OSSL_DECODER_INSTANCE_value(ctx->decoder_insts, i);
  935|   594k|        OSSL_DECODER *new_decoder =
  936|   594k|            OSSL_DECODER_INSTANCE_get_decoder(new_decoder_inst);
  937|   594k|        const char *new_decoder_name = NULL;
  938|   594k|        void *new_decoderctx =
  939|   594k|            OSSL_DECODER_INSTANCE_get_decoder_ctx(new_decoder_inst);
  940|   594k|        const char *new_input_type =
  941|   594k|            OSSL_DECODER_INSTANCE_get_input_type(new_decoder_inst);
  942|   594k|        int n_i_s_was_set = 0;   /* We don't care here */
  943|   594k|        const char *new_input_structure =
  944|   594k|            OSSL_DECODER_INSTANCE_get_input_structure(new_decoder_inst,
  945|   594k|                                                      &n_i_s_was_set);
  946|       |
  947|   594k|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|   594k|    do {                                        \
  |  |  221|   594k|        BIO *trc_out = NULL;                    \
  |  |  222|   594k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  948|      0|            new_decoder_name = OSSL_DECODER_get0_name(new_decoder);
  949|      0|            BIO_printf(trc_out,
  950|      0|                       "(ctx %p) %s [%u] Considering decoder instance %p (decoder %p):\n"
  951|      0|                       "    %s with %s\n",
  952|      0|                       (void *)new_data.ctx, LEVEL, (unsigned int)i,
  ------------------
  |  |  792|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (792:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  793|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  794|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  953|      0|                       (void *)new_decoder_inst, (void *)new_decoder,
  954|      0|                       new_decoder_name,
  955|      0|                       OSSL_DECODER_get0_properties(new_decoder));
  956|   594k|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|   594k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  957|       |
  958|       |        /*
  959|       |         * If |decoder| is NULL, it means we've just started, and the caller
  960|       |         * may have specified what it expects the initial input to be.  If
  961|       |         * that's the case, we do this extra check.
  962|       |         */
  963|   594k|        if (decoder == NULL && ctx->start_input_type != NULL
  ------------------
  |  Branch (963:13): [True: 516k, False: 78.3k]
  |  Branch (963:32): [True: 516k, False: 0]
  ------------------
  964|   594k|            && OPENSSL_strcasecmp(ctx->start_input_type, new_input_type) != 0) {
  ------------------
  |  Branch (964:16): [True: 37.6k, False: 478k]
  ------------------
  965|  37.6k|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|  37.6k|    do {                                        \
  |  |  221|  37.6k|        BIO *trc_out = NULL;                    \
  |  |  222|  37.6k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  966|      0|                BIO_printf(trc_out,
  967|      0|                           "(ctx %p) %s [%u] the start input type '%s' doesn't match the input type of the considered decoder, skipping...\n",
  968|      0|                           (void *)new_data.ctx, LEVEL, (unsigned int)i,
  ------------------
  |  |  792|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (792:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  793|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  794|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  969|      0|                           ctx->start_input_type);
  970|  37.6k|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|  37.6k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  971|  37.6k|            continue;
  972|  37.6k|        }
  973|       |
  974|       |        /*
  975|       |         * If we have a previous decoder, we check that the input type
  976|       |         * of the next to be used matches the type of this previous one.
  977|       |         * |new_input_type| holds the value of the "input-type" parameter
  978|       |         * for the decoder we're currently considering.
  979|       |         */
  980|   557k|        if (decoder != NULL && !ossl_decoder_fast_is_a(decoder, new_input_type,
  ------------------
  |  Branch (980:13): [True: 78.3k, False: 478k]
  |  Branch (980:32): [True: 0, False: 78.3k]
  ------------------
  981|  78.3k|                                                       &new_decoder_inst->input_type_id)) {
  982|      0|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|      0|    do {                                        \
  |  |  221|      0|        BIO *trc_out = NULL;                    \
  |  |  222|      0|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  983|      0|                BIO_printf(trc_out,
  984|      0|                           "(ctx %p) %s [%u] the input type doesn't match the name of the previous decoder (%p), skipping...\n",
  985|      0|                           (void *)new_data.ctx, LEVEL, (unsigned int)i,
  ------------------
  |  |  792|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (792:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  793|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  794|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  986|      0|                           (void *)decoder);
  987|      0|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  988|      0|            continue;
  989|      0|        }
  990|       |
  991|       |        /*
  992|       |         * If the previous decoder gave us a data type, we check to see
  993|       |         * if that matches the decoder we're currently considering.
  994|       |         */
  995|   557k|        if (data_type != NULL && !OSSL_DECODER_is_a(new_decoder, data_type)) {
  ------------------
  |  Branch (995:13): [True: 78.3k, False: 478k]
  |  Branch (995:34): [True: 49.2k, False: 29.0k]
  ------------------
  996|  49.2k|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|  49.2k|    do {                                        \
  |  |  221|  49.2k|        BIO *trc_out = NULL;                    \
  |  |  222|  49.2k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  997|      0|                BIO_printf(trc_out,
  998|      0|                           "(ctx %p) %s [%u] the previous decoder's data type doesn't match the name of the considered decoder, skipping...\n",
  999|      0|                           (void *)new_data.ctx, LEVEL, (unsigned int)i);
  ------------------
  |  |  792|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (792:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  793|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  794|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
 1000|  49.2k|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|  49.2k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1001|  49.2k|            continue;
 1002|  49.2k|        }
 1003|       |
 1004|       |        /*
 1005|       |         * If the previous decoder gave us a data structure name, we check
 1006|       |         * to see that it matches the input data structure of the decoder
 1007|       |         * we're currently considering.
 1008|       |         */
 1009|   507k|        if (data_structure != NULL
  ------------------
  |  Branch (1009:13): [True: 29.0k, False: 478k]
  ------------------
 1010|   507k|            && (new_input_structure == NULL
  ------------------
  |  Branch (1010:17): [True: 0, False: 29.0k]
  ------------------
 1011|  29.0k|                || OPENSSL_strcasecmp(data_structure,
  ------------------
  |  Branch (1011:20): [True: 4.11k, False: 24.8k]
  ------------------
 1012|  29.0k|                                      new_input_structure) != 0)) {
 1013|  4.11k|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|  4.11k|    do {                                        \
  |  |  221|  4.11k|        BIO *trc_out = NULL;                    \
  |  |  222|  4.11k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1014|      0|                BIO_printf(trc_out,
 1015|      0|                           "(ctx %p) %s [%u] the previous decoder's data structure doesn't match the input structure of the considered decoder, skipping...\n",
 1016|      0|                           (void *)new_data.ctx, LEVEL, (unsigned int)i);
  ------------------
  |  |  792|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (792:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  793|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  794|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
 1017|  4.11k|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|  4.11k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1018|  4.11k|            continue;
 1019|  4.11k|        }
 1020|       |
 1021|       |        /*
 1022|       |         * If the decoder we're currently considering specifies a structure,
 1023|       |         * and this check hasn't already been done earlier in this chain of
 1024|       |         * decoder_process() calls, check that it matches the user provided
 1025|       |         * input structure, if one is given.
 1026|       |         */
 1027|   503k|        if (!data->flag_input_structure_checked
  ------------------
  |  Branch (1027:13): [True: 37.6k, False: 466k]
  ------------------
 1028|   503k|            && ctx->input_structure != NULL
  ------------------
  |  Branch (1028:16): [True: 37.6k, False: 0]
  ------------------
 1029|   503k|            && new_input_structure != NULL) {
  ------------------
  |  Branch (1029:16): [True: 37.6k, False: 0]
  ------------------
 1030|  37.6k|            data->flag_input_structure_checked = 1;
 1031|  37.6k|            if (OPENSSL_strcasecmp(new_input_structure,
  ------------------
  |  Branch (1031:17): [True: 37.6k, False: 0]
  ------------------
 1032|  37.6k|                                   ctx->input_structure) != 0) {
 1033|  37.6k|                OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|  37.6k|    do {                                        \
  |  |  221|  37.6k|        BIO *trc_out = NULL;                    \
  |  |  222|  37.6k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1034|      0|                    BIO_printf(trc_out,
 1035|      0|                               "(ctx %p) %s [%u] the previous decoder's data structure doesn't match the input structure given by the user, skipping...\n",
 1036|      0|                               (void *)new_data.ctx, LEVEL, (unsigned int)i);
  ------------------
  |  |  792|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (792:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  793|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  794|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
 1037|  37.6k|                } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|  37.6k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1038|  37.6k|                continue;
 1039|  37.6k|            }
 1040|  37.6k|        }
 1041|       |
 1042|       |        /*
 1043|       |         * Checking the return value of BIO_reset() or BIO_seek() is unsafe.
 1044|       |         * Furthermore, BIO_reset() is unsafe to use if the source BIO happens
 1045|       |         * to be a BIO_s_mem(), because the earlier BIO_tell() gives us zero
 1046|       |         * no matter where we are in the underlying buffer we're reading from.
 1047|       |         *
 1048|       |         * So, we simply do a BIO_seek(), and use BIO_tell() that we're back
 1049|       |         * at the same position.  This is a best effort attempt, but BIO_seek()
 1050|       |         * and BIO_tell() should come as a pair...
 1051|       |         */
 1052|   466k|        (void)BIO_seek(bio, loc);
  ------------------
  |  |  569|   466k|# define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)
  |  |  ------------------
  |  |  |  |  459|   466k|# define BIO_C_FILE_SEEK                         128
  |  |  ------------------
  ------------------
 1053|   466k|        if (BIO_tell(bio) != loc)
  ------------------
  |  |  570|   466k|# define BIO_tell(b)     (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
  |  |  ------------------
  |  |  |  |  465|   466k|# define BIO_C_FILE_TELL                         133
  |  |  ------------------
  ------------------
  |  Branch (1053:13): [True: 0, False: 466k]
  ------------------
 1054|      0|            goto end;
 1055|       |
 1056|       |        /* Recurse */
 1057|   466k|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|   466k|    do {                                        \
  |  |  221|   466k|        BIO *trc_out = NULL;                    \
  |  |  222|   466k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1058|      0|            BIO_printf(trc_out,
 1059|      0|                       "(ctx %p) %s [%u] Running decoder instance %s (%p)\n",
 1060|      0|                       (void *)new_data.ctx, LEVEL, (unsigned int)i,
  ------------------
  |  |  792|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (792:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  793|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  794|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
 1061|      0|                       new_decoder_name, (void *)new_decoder_inst);
 1062|   466k|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|   466k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1063|       |
 1064|       |        /*
 1065|       |         * We only care about errors reported from decoder implementations
 1066|       |         * if it returns false (i.e. there was a fatal error).
 1067|       |         */
 1068|   466k|        ERR_set_mark();
 1069|       |
 1070|   466k|        new_data.current_decoder_inst_index = i;
 1071|   466k|        new_data.flag_input_structure_checked
 1072|   466k|            = data->flag_input_structure_checked;
 1073|   466k|        ok = new_decoder->decode(new_decoderctx, cbio,
 1074|   466k|                                 new_data.ctx->selection,
 1075|   466k|                                 decoder_process, &new_data,
 1076|   466k|                                 ossl_pw_passphrase_callback_dec,
 1077|   466k|                                 &new_data.ctx->pwdata);
 1078|       |
 1079|   466k|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|   466k|    do {                                        \
  |  |  221|   466k|        BIO *trc_out = NULL;                    \
  |  |  222|   466k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1080|      0|            BIO_printf(trc_out,
 1081|      0|                       "(ctx %p) %s [%u] Running decoder instance %s (%p) => %d"
 1082|      0|                       " (recursed further: %s, construct called: %s)\n",
 1083|      0|                       (void *)new_data.ctx, LEVEL, (unsigned int)i,
  ------------------
  |  |  792|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (792:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  793|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  794|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  791|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
 1084|      0|                       new_decoder_name, (void *)new_decoder_inst, ok,
 1085|      0|                       new_data.flag_next_level_called ? "yes" : "no",
  ------------------
  |  Branch (1085:24): [True: 0, False: 0]
  ------------------
 1086|      0|                       new_data.flag_construct_called ? "yes" : "no");
  ------------------
  |  Branch (1086:24): [True: 0, False: 0]
  ------------------
 1087|   466k|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|   466k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1088|       |
 1089|   466k|        data->flag_construct_called = new_data.flag_construct_called;
 1090|       |
 1091|       |        /* Break on error or if we tried to construct an object already */
 1092|   466k|        if (!ok || data->flag_construct_called) {
  ------------------
  |  Branch (1092:13): [True: 766, False: 465k]
  |  Branch (1092:20): [True: 15.1k, False: 450k]
  ------------------
 1093|  15.9k|            ERR_clear_last_mark();
 1094|  15.9k|            break;
 1095|  15.9k|        }
 1096|   450k|        ERR_pop_to_mark();
 1097|       |
 1098|       |        /*
 1099|       |         * Break if the decoder implementation that we called recursed, since
 1100|       |         * that indicates that it successfully decoded something.
 1101|       |         */
 1102|   450k|        if (new_data.flag_next_level_called)
  ------------------
  |  Branch (1102:13): [True: 18.0k, False: 432k]
  ------------------
 1103|  18.0k|            break;
 1104|   450k|    }
 1105|       |
 1106|  71.5k| end:
 1107|  71.5k|    ossl_core_bio_free(cbio);
 1108|  71.5k|    BIO_free(new_data.bio);
 1109|  71.5k|    ctx->start_input_type = start_input_type;
 1110|  71.5k|    return ok;
 1111|  63.2k|}

OSSL_DECODER_up_ref:
   53|   605k|{
   54|   605k|    int ref = 0;
   55|       |
   56|   605k|    CRYPTO_UP_REF(&decoder->base.refcnt, &ref);
   57|   605k|    return 1;
   58|   605k|}
OSSL_DECODER_free:
   61|   605k|{
   62|   605k|    int ref = 0;
   63|       |
   64|   605k|    if (decoder == NULL)
  ------------------
  |  Branch (64:9): [True: 0, False: 605k]
  ------------------
   65|      0|        return;
   66|       |
   67|   605k|    CRYPTO_DOWN_REF(&decoder->base.refcnt, &ref);
   68|   605k|    if (ref > 0)
  ------------------
  |  Branch (68:9): [True: 605k, False: 76]
  ------------------
   69|   605k|        return;
   70|     76|    OPENSSL_free(decoder->base.name);
  ------------------
  |  |  115|     76|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     76|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     76|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   71|     76|    ossl_property_free(decoder->base.parsed_propdef);
   72|     76|    ossl_provider_free(decoder->base.prov);
   73|     76|    CRYPTO_FREE_REF(&decoder->base.refcnt);
   74|     76|    OPENSSL_free(decoder);
  ------------------
  |  |  115|     76|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     76|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     76|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   75|     76|}
ossl_decoder_from_algorithm:
  211|     76|{
  212|     76|    OSSL_DECODER *decoder = NULL;
  213|     76|    const OSSL_DISPATCH *fns = algodef->implementation;
  214|     76|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  215|       |
  216|     76|    if ((decoder = ossl_decoder_new()) == NULL)
  ------------------
  |  Branch (216:9): [True: 0, False: 76]
  ------------------
  217|      0|        return NULL;
  218|     76|    decoder->base.id = id;
  219|     76|    if ((decoder->base.name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (219:9): [True: 0, False: 76]
  ------------------
  220|      0|        OSSL_DECODER_free(decoder);
  221|      0|        return NULL;
  222|      0|    }
  223|     76|    decoder->base.algodef = algodef;
  224|     76|    if ((decoder->base.parsed_propdef
  ------------------
  |  Branch (224:9): [True: 0, False: 76]
  ------------------
  225|     76|         = ossl_parse_property(libctx, algodef->property_definition)) == NULL) {
  226|      0|        OSSL_DECODER_free(decoder);
  227|      0|        return NULL;
  228|      0|    }
  229|       |
  230|    598|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (230:12): [True: 522, False: 76]
  ------------------
  231|    522|        switch (fns->function_id) {
  ------------------
  |  Branch (231:17): [True: 0, False: 522]
  ------------------
  232|     76|        case OSSL_FUNC_DECODER_NEWCTX:
  ------------------
  |  | 1064|     76|# define OSSL_FUNC_DECODER_NEWCTX                      1
  ------------------
  |  Branch (232:9): [True: 76, False: 446]
  ------------------
  233|     76|            if (decoder->newctx == NULL)
  ------------------
  |  Branch (233:17): [True: 76, False: 0]
  ------------------
  234|     76|                decoder->newctx = OSSL_FUNC_decoder_newctx(fns);
  235|     76|            break;
  236|     76|        case OSSL_FUNC_DECODER_FREECTX:
  ------------------
  |  | 1065|     76|# define OSSL_FUNC_DECODER_FREECTX                     2
  ------------------
  |  Branch (236:9): [True: 76, False: 446]
  ------------------
  237|     76|            if (decoder->freectx == NULL)
  ------------------
  |  Branch (237:17): [True: 76, False: 0]
  ------------------
  238|     76|                decoder->freectx = OSSL_FUNC_decoder_freectx(fns);
  239|     76|            break;
  240|      0|        case OSSL_FUNC_DECODER_GET_PARAMS:
  ------------------
  |  | 1066|      0|# define OSSL_FUNC_DECODER_GET_PARAMS                  3
  ------------------
  |  Branch (240:9): [True: 0, False: 522]
  ------------------
  241|      0|            if (decoder->get_params == NULL)
  ------------------
  |  Branch (241:17): [True: 0, False: 0]
  ------------------
  242|      0|                decoder->get_params =
  243|      0|                    OSSL_FUNC_decoder_get_params(fns);
  244|      0|            break;
  245|      0|        case OSSL_FUNC_DECODER_GETTABLE_PARAMS:
  ------------------
  |  | 1067|      0|# define OSSL_FUNC_DECODER_GETTABLE_PARAMS             4
  ------------------
  |  Branch (245:9): [True: 0, False: 522]
  ------------------
  246|      0|            if (decoder->gettable_params == NULL)
  ------------------
  |  Branch (246:17): [True: 0, False: 0]
  ------------------
  247|      0|                decoder->gettable_params =
  248|      0|                    OSSL_FUNC_decoder_gettable_params(fns);
  249|      0|            break;
  250|     74|        case OSSL_FUNC_DECODER_SET_CTX_PARAMS:
  ------------------
  |  | 1068|     74|# define OSSL_FUNC_DECODER_SET_CTX_PARAMS              5
  ------------------
  |  Branch (250:9): [True: 74, False: 448]
  ------------------
  251|     74|            if (decoder->set_ctx_params == NULL)
  ------------------
  |  Branch (251:17): [True: 74, False: 0]
  ------------------
  252|     74|                decoder->set_ctx_params =
  253|     74|                    OSSL_FUNC_decoder_set_ctx_params(fns);
  254|     74|            break;
  255|     74|        case OSSL_FUNC_DECODER_SETTABLE_CTX_PARAMS:
  ------------------
  |  | 1069|     74|# define OSSL_FUNC_DECODER_SETTABLE_CTX_PARAMS         6
  ------------------
  |  Branch (255:9): [True: 74, False: 448]
  ------------------
  256|     74|            if (decoder->settable_ctx_params == NULL)
  ------------------
  |  Branch (256:17): [True: 74, False: 0]
  ------------------
  257|     74|                decoder->settable_ctx_params =
  258|     74|                    OSSL_FUNC_decoder_settable_ctx_params(fns);
  259|     74|            break;
  260|     73|        case OSSL_FUNC_DECODER_DOES_SELECTION:
  ------------------
  |  | 1070|     73|# define OSSL_FUNC_DECODER_DOES_SELECTION             10
  ------------------
  |  Branch (260:9): [True: 73, False: 449]
  ------------------
  261|     73|            if (decoder->does_selection == NULL)
  ------------------
  |  Branch (261:17): [True: 73, False: 0]
  ------------------
  262|     73|                decoder->does_selection =
  263|     73|                    OSSL_FUNC_decoder_does_selection(fns);
  264|     73|            break;
  265|     76|        case OSSL_FUNC_DECODER_DECODE:
  ------------------
  |  | 1071|     76|# define OSSL_FUNC_DECODER_DECODE                     11
  ------------------
  |  Branch (265:9): [True: 76, False: 446]
  ------------------
  266|     76|            if (decoder->decode == NULL)
  ------------------
  |  Branch (266:17): [True: 76, False: 0]
  ------------------
  267|     76|                decoder->decode = OSSL_FUNC_decoder_decode(fns);
  268|     76|            break;
  269|     73|        case OSSL_FUNC_DECODER_EXPORT_OBJECT:
  ------------------
  |  | 1072|     73|# define OSSL_FUNC_DECODER_EXPORT_OBJECT              20
  ------------------
  |  Branch (269:9): [True: 73, False: 449]
  ------------------
  270|     73|            if (decoder->export_object == NULL)
  ------------------
  |  Branch (270:17): [True: 73, False: 0]
  ------------------
  271|     73|                decoder->export_object = OSSL_FUNC_decoder_export_object(fns);
  272|     73|            break;
  273|    522|        }
  274|    522|    }
  275|       |    /*
  276|       |     * Try to check that the method is sensible.
  277|       |     * If you have a constructor, you must have a destructor and vice versa.
  278|       |     * You must have at least one of the encoding driver functions.
  279|       |     */
  280|     76|    if (!((decoder->newctx == NULL && decoder->freectx == NULL)
  ------------------
  |  Branch (280:12): [True: 0, False: 76]
  |  Branch (280:39): [True: 0, False: 0]
  ------------------
  281|     76|          || (decoder->newctx != NULL && decoder->freectx != NULL))
  ------------------
  |  Branch (281:15): [True: 76, False: 0]
  |  Branch (281:42): [True: 76, False: 0]
  ------------------
  282|     76|        || decoder->decode == NULL) {
  ------------------
  |  Branch (282:12): [True: 0, False: 76]
  ------------------
  283|      0|        OSSL_DECODER_free(decoder);
  284|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  285|      0|        return NULL;
  286|      0|    }
  287|       |
  288|     76|    if (prov != NULL && !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (288:9): [True: 76, False: 0]
  |  Branch (288:25): [True: 0, False: 76]
  ------------------
  289|      0|        OSSL_DECODER_free(decoder);
  290|      0|        return NULL;
  291|      0|    }
  292|       |
  293|     76|    decoder->base.prov = prov;
  294|     76|    return decoder;
  295|     76|}
ossl_decoder_store_cache_flush:
  442|      2|{
  443|      2|    OSSL_METHOD_STORE *store = get_decoder_store(libctx);
  444|       |
  445|      2|    if (store != NULL)
  ------------------
  |  Branch (445:9): [True: 2, False: 0]
  ------------------
  446|      2|        return ossl_method_store_cache_flush_all(store);
  447|      0|    return 1;
  448|      2|}
OSSL_DECODER_get0_provider:
  465|   688k|{
  466|   688k|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|   688k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   688k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (466:9): [True: 0, False: 688k]
  ------------------
  467|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  468|      0|        return 0;
  469|      0|    }
  470|       |
  471|   688k|    return decoder->base.prov;
  472|   688k|}
ossl_decoder_parsed_properties:
  486|    342|{
  487|    342|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|    342|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    342|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (487:9): [True: 0, False: 342]
  ------------------
  488|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  489|      0|        return 0;
  490|      0|    }
  491|       |
  492|    342|    return decoder->base.parsed_propdef;
  493|    342|}
ossl_decoder_get_number:
  496|   106k|{
  497|   106k|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|   106k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   106k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (497:9): [True: 0, False: 106k]
  ------------------
  498|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  499|      0|        return 0;
  500|      0|    }
  501|       |
  502|   106k|    return decoder->base.id;
  503|   106k|}
OSSL_DECODER_is_a:
  516|  78.3k|{
  517|  78.3k|    if (decoder->base.prov != NULL) {
  ------------------
  |  Branch (517:9): [True: 78.3k, False: 0]
  ------------------
  518|  78.3k|        OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov);
  519|  78.3k|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  520|       |
  521|  78.3k|        return ossl_namemap_name2num(namemap, name) == decoder->base.id;
  522|  78.3k|    }
  523|      0|    return 0;
  524|  78.3k|}
ossl_decoder_fast_is_a:
  535|   113k|{
  536|   113k|    int id = *id_cache;
  537|       |
  538|   113k|    if (id <= 0)
  ------------------
  |  Branch (538:9): [True: 85.7k, False: 28.0k]
  ------------------
  539|  85.7k|        *id_cache = id = resolve_name(decoder, name);
  540|       |
  541|   113k|    return id > 0 && ossl_decoder_get_number(decoder) == id;
  ------------------
  |  Branch (541:12): [True: 106k, False: 6.98k]
  |  Branch (541:22): [True: 79.5k, False: 27.3k]
  ------------------
  542|   113k|}
OSSL_DECODER_do_all_provided:
  560|    268|{
  561|    268|    struct decoder_data_st methdata;
  562|    268|    struct do_one_data_st data;
  563|       |
  564|    268|    methdata.libctx = libctx;
  565|    268|    methdata.tmp_store = NULL;
  566|    268|    (void)inner_ossl_decoder_fetch(&methdata, NULL, NULL /* properties */);
  567|       |
  568|    268|    data.user_fn = user_fn;
  569|    268|    data.user_arg = user_arg;
  570|    268|    if (methdata.tmp_store != NULL)
  ------------------
  |  Branch (570:9): [True: 0, False: 268]
  ------------------
  571|      0|        ossl_method_store_do_all(methdata.tmp_store, &do_one, &data);
  572|    268|    ossl_method_store_do_all(get_decoder_store(libctx), &do_one, &data);
  573|    268|    dealloc_tmp_decoder_store(methdata.tmp_store);
  574|    268|}
OSSL_DECODER_CTX_new:
  633|  40.5k|{
  634|  40.5k|    OSSL_DECODER_CTX *ctx;
  635|       |
  636|  40.5k|    ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|  40.5k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  40.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  40.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  637|  40.5k|    return ctx;
  638|  40.5k|}
OSSL_DECODER_CTX_free:
  673|  65.4k|{
  674|  65.4k|    if (ctx != NULL) {
  ------------------
  |  Branch (674:9): [True: 40.5k, False: 24.8k]
  ------------------
  675|  40.5k|        if (ctx->cleanup != NULL)
  ------------------
  |  Branch (675:13): [True: 37.6k, False: 2.92k]
  ------------------
  676|  37.6k|            ctx->cleanup(ctx->construct_data);
  677|  40.5k|        sk_OSSL_DECODER_INSTANCE_pop_free(ctx->decoder_insts,
  678|  40.5k|                                          ossl_decoder_instance_free);
  679|  40.5k|        ossl_pw_clear_passphrase_data(&ctx->pwdata);
  680|  40.5k|        OPENSSL_free(ctx);
  ------------------
  |  |  115|  40.5k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  40.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  40.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  681|  40.5k|    }
  682|  65.4k|}
decoder_meth.c:ossl_decoder_new:
   39|     76|{
   40|     76|    OSSL_DECODER *decoder = NULL;
   41|       |
   42|     76|    if ((decoder = OPENSSL_zalloc(sizeof(*decoder))) == NULL)
  ------------------
  |  |  104|     76|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     76|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     76|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (42:9): [True: 0, False: 76]
  ------------------
   43|      0|        return NULL;
   44|     76|    if (!CRYPTO_NEW_REF(&decoder->base.refcnt, 1)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 76]
  ------------------
   45|      0|        OSSL_DECODER_free(decoder);
   46|      0|        return NULL;
   47|      0|    }
   48|       |
   49|     76|    return decoder;
   50|     76|}
decoder_meth.c:inner_ossl_decoder_fetch:
  353|    268|{
  354|    268|    OSSL_METHOD_STORE *store = get_decoder_store(methdata->libctx);
  355|    268|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  356|    268|    const char *const propq = properties != NULL ? properties : "";
  ------------------
  |  Branch (356:31): [True: 0, False: 268]
  ------------------
  357|    268|    void *method = NULL;
  358|    268|    int unsupported, id;
  359|       |
  360|    268|    if (store == NULL || namemap == NULL) {
  ------------------
  |  Branch (360:9): [True: 0, False: 268]
  |  Branch (360:26): [True: 0, False: 268]
  ------------------
  361|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  362|      0|        return NULL;
  363|      0|    }
  364|       |
  365|    268|    id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
  ------------------
  |  Branch (365:10): [True: 0, False: 268]
  ------------------
  366|       |
  367|       |    /*
  368|       |     * If we haven't found the name yet, chances are that the algorithm to
  369|       |     * be fetched is unsupported.
  370|       |     */
  371|    268|    unsupported = id == 0;
  372|       |
  373|    268|    if (id == 0
  ------------------
  |  Branch (373:9): [True: 268, False: 0]
  ------------------
  374|    268|        || !ossl_method_store_cache_get(store, NULL, id, propq, &method)) {
  ------------------
  |  Branch (374:12): [True: 0, False: 0]
  ------------------
  375|    268|        OSSL_METHOD_CONSTRUCT_METHOD mcm = {
  376|    268|            get_tmp_decoder_store,
  377|    268|            reserve_decoder_store,
  378|    268|            unreserve_decoder_store,
  379|    268|            get_decoder_from_store,
  380|    268|            put_decoder_in_store,
  381|    268|            construct_decoder,
  382|    268|            destruct_decoder
  383|    268|        };
  384|    268|        OSSL_PROVIDER *prov = NULL;
  385|       |
  386|    268|        methdata->id = id;
  387|    268|        methdata->names = name;
  388|    268|        methdata->propquery = propq;
  389|    268|        methdata->flag_construct_error_occurred = 0;
  390|    268|        if ((method = ossl_method_construct(methdata->libctx, OSSL_OP_DECODER,
  ------------------
  |  |  323|    268|# define OSSL_OP_DECODER                            21
  ------------------
  |  Branch (390:13): [True: 0, False: 268]
  ------------------
  391|    268|                                            &prov, 0 /* !force_cache */,
  392|    268|                                            &mcm, methdata)) != NULL) {
  393|       |            /*
  394|       |             * If construction did create a method for us, we know that
  395|       |             * there is a correct name_id and meth_id, since those have
  396|       |             * already been calculated in get_decoder_from_store() and
  397|       |             * put_decoder_in_store() above.
  398|       |             */
  399|      0|            if (id == 0 && name != NULL)
  ------------------
  |  Branch (399:17): [True: 0, False: 0]
  |  Branch (399:28): [True: 0, False: 0]
  ------------------
  400|      0|                id = ossl_namemap_name2num(namemap, name);
  401|      0|            if (id != 0)
  ------------------
  |  Branch (401:17): [True: 0, False: 0]
  ------------------
  402|      0|                ossl_method_store_cache_set(store, prov, id, propq, method,
  403|      0|                                            up_ref_decoder, free_decoder);
  404|      0|        }
  405|       |
  406|       |        /*
  407|       |         * If we never were in the constructor, the algorithm to be fetched
  408|       |         * is unsupported.
  409|       |         */
  410|    268|        unsupported = !methdata->flag_construct_error_occurred;
  411|    268|    }
  412|       |
  413|    268|    if ((id != 0 || name != NULL) && method == NULL) {
  ------------------
  |  Branch (413:10): [True: 0, False: 268]
  |  Branch (413:21): [True: 0, False: 268]
  |  Branch (413:38): [True: 0, False: 0]
  ------------------
  414|      0|        int code = unsupported ? ERR_R_UNSUPPORTED : ERR_R_FETCH_FAILED;
  ------------------
  |  |  363|      0|# define ERR_R_UNSUPPORTED                       (268|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      int code = unsupported ? ERR_R_UNSUPPORTED : ERR_R_FETCH_FAILED;
  ------------------
  |  |  364|      0|# define ERR_R_FETCH_FAILED                      (269|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (414:20): [True: 0, False: 0]
  ------------------
  415|       |
  416|      0|        if (name == NULL)
  ------------------
  |  Branch (416:13): [True: 0, False: 0]
  ------------------
  417|      0|            name = ossl_namemap_num2name(namemap, id, 0);
  418|      0|        ERR_raise_data(ERR_LIB_OSSL_DECODER, code,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, code,
  ------------------
  |  |  121|      0|# define ERR_LIB_OSSL_DECODER    60
  ------------------
  419|      0|                       "%s, Name (%s : %d), Properties (%s)",
  420|      0|                       ossl_lib_ctx_get_descriptor(methdata->libctx),
  421|      0|                       name == NULL ? "<null>" : name, id,
  ------------------
  |  Branch (421:24): [True: 0, False: 0]
  ------------------
  422|      0|                       properties == NULL ? "<null>" : properties);
  ------------------
  |  Branch (422:24): [True: 0, False: 0]
  ------------------
  423|      0|    }
  424|       |
  425|    268|    return method;
  426|    268|}
decoder_meth.c:reserve_decoder_store:
  117|    536|{
  118|    536|    struct decoder_data_st *methdata = data;
  119|       |
  120|    536|    if (store == NULL
  ------------------
  |  Branch (120:9): [True: 536, False: 0]
  ------------------
  121|    536|        && (store = get_decoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (121:12): [True: 0, False: 536]
  ------------------
  122|      0|        return 0;
  123|       |
  124|    536|    return ossl_method_lock_store(store);
  125|    536|}
decoder_meth.c:unreserve_decoder_store:
  128|    536|{
  129|    536|    struct decoder_data_st *methdata = data;
  130|       |
  131|    536|    if (store == NULL
  ------------------
  |  Branch (131:9): [True: 536, False: 0]
  ------------------
  132|    536|        && (store = get_decoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (132:12): [True: 0, False: 536]
  ------------------
  133|      0|        return 0;
  134|       |
  135|    536|    return ossl_method_unlock_store(store);
  136|    536|}
decoder_meth.c:get_decoder_from_store:
  141|    268|{
  142|    268|    struct decoder_data_st *methdata = data;
  143|    268|    void *method = NULL;
  144|    268|    int id;
  145|       |
  146|       |    /*
  147|       |     * get_decoder_from_store() is only called to try and get the method
  148|       |     * that OSSL_DECODER_fetch() is asking for, and the name or name id are
  149|       |     * passed via methdata.
  150|       |     */
  151|    268|    if ((id = methdata->id) == 0 && methdata->names != NULL) {
  ------------------
  |  Branch (151:9): [True: 268, False: 0]
  |  Branch (151:37): [True: 0, False: 268]
  ------------------
  152|      0|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  153|      0|        const char *names = methdata->names;
  154|      0|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   25|      0|#define NAME_SEPARATOR ':'
  ------------------
  155|      0|        size_t l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (155:21): [True: 0, False: 0]
  ------------------
  156|       |
  157|      0|        if (namemap == 0)
  ------------------
  |  Branch (157:13): [True: 0, False: 0]
  ------------------
  158|      0|            return NULL;
  159|      0|        id = ossl_namemap_name2num_n(namemap, names, l);
  160|      0|    }
  161|       |
  162|    268|    if (id == 0)
  ------------------
  |  Branch (162:9): [True: 268, False: 0]
  ------------------
  163|    268|        return NULL;
  164|       |
  165|      0|    if (store == NULL
  ------------------
  |  Branch (165:9): [True: 0, False: 0]
  ------------------
  166|      0|        && (store = get_decoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (166:12): [True: 0, False: 0]
  ------------------
  167|      0|        return NULL;
  168|       |
  169|      0|    if (!ossl_method_store_fetch(store, id, methdata->propquery, prov, &method))
  ------------------
  |  Branch (169:9): [True: 0, False: 0]
  ------------------
  170|      0|        return NULL;
  171|      0|    return method;
  172|      0|}
decoder_meth.c:put_decoder_in_store:
  178|     76|{
  179|     76|    struct decoder_data_st *methdata = data;
  180|     76|    OSSL_NAMEMAP *namemap;
  181|     76|    int id;
  182|     76|    size_t l = 0;
  183|       |
  184|       |    /*
  185|       |     * put_decoder_in_store() is only called with an OSSL_DECODER method that
  186|       |     * was successfully created by construct_decoder() below, which means that
  187|       |     * all the names should already be stored in the namemap with the same
  188|       |     * numeric identity, so just use the first to get that identity.
  189|       |     */
  190|     76|    if (names != NULL) {
  ------------------
  |  Branch (190:9): [True: 76, False: 0]
  ------------------
  191|     76|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   25|     76|#define NAME_SEPARATOR ':'
  ------------------
  192|       |
  193|     76|        l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (193:14): [True: 76, False: 0]
  ------------------
  194|     76|    }
  195|       |
  196|     76|    if ((namemap = ossl_namemap_stored(methdata->libctx)) == NULL
  ------------------
  |  Branch (196:9): [True: 0, False: 76]
  ------------------
  197|     76|        || (id = ossl_namemap_name2num_n(namemap, names, l)) == 0)
  ------------------
  |  Branch (197:12): [True: 0, False: 76]
  ------------------
  198|      0|        return 0;
  199|       |
  200|     76|    if (store == NULL && (store = get_decoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (200:9): [True: 76, False: 0]
  |  Branch (200:26): [True: 0, False: 76]
  ------------------
  201|      0|        return 0;
  202|       |
  203|     76|    return ossl_method_store_add(store, prov, id, propdef, method,
  204|     76|                                 ossl_decoder_up_ref,
  205|     76|                                 ossl_decoder_free);
  206|     76|}
decoder_meth.c:ossl_decoder_up_ref:
   33|     76|{
   34|     76|    return OSSL_DECODER_up_ref(data);
   35|     76|}
decoder_meth.c:ossl_decoder_free:
   28|     76|{
   29|     76|    OSSL_DECODER_free(data);
   30|     76|}
decoder_meth.c:construct_decoder:
  305|     76|{
  306|       |    /*
  307|       |     * This function is only called if get_decoder_from_store() returned
  308|       |     * NULL, so it's safe to say that of all the spots to create a new
  309|       |     * namemap entry, this is it.  Should the name already exist there, we
  310|       |     * know that ossl_namemap_add() will return its corresponding number.
  311|       |     */
  312|     76|    struct decoder_data_st *methdata = data;
  313|     76|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  314|     76|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  315|     76|    const char *names = algodef->algorithm_names;
  316|     76|    int id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
  ------------------
  |  |   25|     76|#define NAME_SEPARATOR ':'
  ------------------
  317|     76|    void *method = NULL;
  318|       |
  319|     76|    if (id != 0)
  ------------------
  |  Branch (319:9): [True: 76, False: 0]
  ------------------
  320|     76|        method = ossl_decoder_from_algorithm(id, algodef, prov);
  321|       |
  322|       |    /*
  323|       |     * Flag to indicate that there was actual construction errors.  This
  324|       |     * helps inner_evp_generic_fetch() determine what error it should
  325|       |     * record on inaccessible algorithms.
  326|       |     */
  327|     76|    if (method == NULL)
  ------------------
  |  Branch (327:9): [True: 0, False: 76]
  ------------------
  328|      0|        methdata->flag_construct_error_occurred = 1;
  329|       |
  330|     76|    return method;
  331|     76|}
decoder_meth.c:destruct_decoder:
  335|     76|{
  336|     76|    OSSL_DECODER_free(method);
  337|     76|}
decoder_meth.c:dealloc_tmp_decoder_store:
  105|    268|{
  106|    268|    if (store != NULL)
  ------------------
  |  Branch (106:9): [True: 0, False: 268]
  ------------------
  107|      0|        ossl_method_store_free(store);
  108|    268|}
decoder_meth.c:get_decoder_store:
  112|  1.68k|{
  113|  1.68k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_STORE_INDEX);
  ------------------
  |  |  111|  1.68k|# define OSSL_LIB_CTX_DECODER_STORE_INDEX           11
  ------------------
  114|  1.68k|}
decoder_meth.c:resolve_name:
  527|  85.7k|{
  528|  85.7k|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov);
  529|  85.7k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  530|       |
  531|  85.7k|    return ossl_namemap_name2num(namemap, name);
  532|  85.7k|}
decoder_meth.c:do_one:
  550|  20.3k|{
  551|  20.3k|    struct do_one_data_st *data = arg;
  552|       |
  553|  20.3k|    data->user_fn(method, data->user_arg);
  554|  20.3k|}

ossl_decoder_cache_new:
  703|      4|{
  704|      4|    DECODER_CACHE *cache = OPENSSL_malloc(sizeof(*cache));
  ------------------
  |  |  102|      4|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  705|       |
  706|      4|    if (cache == NULL)
  ------------------
  |  Branch (706:9): [True: 0, False: 4]
  ------------------
  707|      0|        return NULL;
  708|       |
  709|      4|    cache->lock = CRYPTO_THREAD_lock_new();
  710|      4|    if (cache->lock == NULL) {
  ------------------
  |  Branch (710:9): [True: 0, False: 4]
  ------------------
  711|      0|        OPENSSL_free(cache);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  712|      0|        return NULL;
  713|      0|    }
  714|      4|    cache->hashtable = lh_DECODER_CACHE_ENTRY_new(decoder_cache_entry_hash,
  715|      4|                                                  decoder_cache_entry_cmp);
  716|      4|    if (cache->hashtable == NULL) {
  ------------------
  |  Branch (716:9): [True: 0, False: 4]
  ------------------
  717|      0|        CRYPTO_THREAD_lock_free(cache->lock);
  718|      0|        OPENSSL_free(cache);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  719|      0|        return NULL;
  720|      0|    }
  721|       |
  722|      4|    return cache;
  723|      4|}
ossl_decoder_cache_free:
  726|      2|{
  727|      2|    DECODER_CACHE *cache = (DECODER_CACHE *)vcache;
  728|       |
  729|      2|    lh_DECODER_CACHE_ENTRY_doall(cache->hashtable, decoder_cache_entry_free);
  730|      2|    lh_DECODER_CACHE_ENTRY_free(cache->hashtable);
  731|      2|    CRYPTO_THREAD_lock_free(cache->lock);
  732|      2|    OPENSSL_free(cache);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  733|      2|}
ossl_decoder_cache_flush:
  740|      5|{
  741|      5|    DECODER_CACHE *cache
  742|      5|        = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_CACHE_INDEX);
  ------------------
  |  |  120|      5|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  743|       |
  744|      5|    if (cache == NULL)
  ------------------
  |  Branch (744:9): [True: 3, False: 2]
  ------------------
  745|      3|        return 0;
  746|       |
  747|       |
  748|      2|    if (!CRYPTO_THREAD_write_lock(cache->lock)) {
  ------------------
  |  Branch (748:9): [True: 0, False: 2]
  ------------------
  749|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  750|      0|        return 0;
  751|      0|    }
  752|       |
  753|      2|    lh_DECODER_CACHE_ENTRY_doall(cache->hashtable, decoder_cache_entry_free);
  754|      2|    lh_DECODER_CACHE_ENTRY_flush(cache->hashtable);
  755|       |
  756|      2|    CRYPTO_THREAD_unlock(cache->lock);
  757|      2|    return 1;
  758|      2|}
OSSL_DECODER_CTX_new_for_pkey:
  766|  40.3k|{
  767|  40.3k|    OSSL_DECODER_CTX *ctx = NULL;
  768|  40.3k|    OSSL_PARAM decoder_params[] = {
  769|  40.3k|        OSSL_PARAM_END,
  ------------------
  |  |   25|  40.3k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  770|  40.3k|        OSSL_PARAM_END,
  ------------------
  |  |   25|  40.3k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  771|  40.3k|        OSSL_PARAM_END
  ------------------
  |  |   25|  40.3k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  772|  40.3k|    };
  773|  40.3k|    DECODER_CACHE *cache
  774|  40.3k|        = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_CACHE_INDEX);
  ------------------
  |  |  120|  40.3k|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  775|  40.3k|    DECODER_CACHE_ENTRY cacheent, *res, *newcache = NULL;
  776|  40.3k|    int i = 0;
  777|       |
  778|  40.3k|    if (cache == NULL) {
  ------------------
  |  Branch (778:9): [True: 0, False: 40.3k]
  ------------------
  779|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  780|      0|        return NULL;
  781|      0|    }
  782|  40.3k|    if (input_structure != NULL)
  ------------------
  |  Branch (782:9): [True: 40.3k, False: 0]
  ------------------
  783|  40.3k|        decoder_params[i++] =
  784|  40.3k|            OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_STRUCTURE,
  ------------------
  |  |  351|  40.3k|# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure"
  ------------------
  785|  40.3k|                                             (char *)input_structure, 0);
  786|  40.3k|    if (propquery != NULL)
  ------------------
  |  Branch (786:9): [True: 0, False: 40.3k]
  ------------------
  787|      0|        decoder_params[i++] =
  788|      0|            OSSL_PARAM_construct_utf8_string(OSSL_DECODER_PARAM_PROPERTIES,
  ------------------
  |  |  218|      0|# define OSSL_DECODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  126|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  789|      0|                                             (char *)propquery, 0);
  790|       |
  791|       |    /* It is safe to cast away the const here */
  792|  40.3k|    cacheent.input_type = (char *)input_type;
  793|  40.3k|    cacheent.input_structure = (char *)input_structure;
  794|  40.3k|    cacheent.keytype = (char *)keytype;
  795|  40.3k|    cacheent.selection = selection;
  796|  40.3k|    cacheent.propquery = (char *)propquery;
  797|       |
  798|  40.3k|    if (!CRYPTO_THREAD_read_lock(cache->lock)) {
  ------------------
  |  Branch (798:9): [True: 0, False: 40.3k]
  ------------------
  799|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  800|      0|        return NULL;
  801|      0|    }
  802|       |
  803|       |    /* First see if we have a template OSSL_DECODER_CTX */
  804|  40.3k|    res = lh_DECODER_CACHE_ENTRY_retrieve(cache->hashtable, &cacheent);
  805|       |
  806|  40.3k|    if (res == NULL) {
  ------------------
  |  Branch (806:9): [True: 223, False: 40.1k]
  ------------------
  807|       |        /*
  808|       |         * There is no template so we will have to construct one. This will be
  809|       |         * time consuming so release the lock and we will later upgrade it to a
  810|       |         * write lock.
  811|       |         */
  812|    223|        CRYPTO_THREAD_unlock(cache->lock);
  813|       |
  814|    223|        if ((ctx = OSSL_DECODER_CTX_new()) == NULL) {
  ------------------
  |  Branch (814:13): [True: 0, False: 223]
  ------------------
  815|      0|            ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  816|      0|            return NULL;
  817|      0|        }
  818|       |
  819|    223|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|    223|    do {                                        \
  |  |  221|    223|        BIO *trc_out = NULL;                    \
  |  |  222|    223|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  820|      0|            BIO_printf(trc_out,
  821|      0|                    "(ctx %p) Looking for %s decoders with selection %d\n",
  822|      0|                    (void *)ctx, keytype, selection);
  823|      0|            BIO_printf(trc_out, "    input type: %s, input structure: %s\n",
  824|      0|                    input_type, input_structure);
  825|    223|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|    223|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  826|       |
  827|    223|        if (OSSL_DECODER_CTX_set_input_type(ctx, input_type)
  ------------------
  |  Branch (827:13): [True: 223, False: 0]
  ------------------
  828|    223|            && OSSL_DECODER_CTX_set_input_structure(ctx, input_structure)
  ------------------
  |  Branch (828:16): [True: 223, False: 0]
  ------------------
  829|    223|            && OSSL_DECODER_CTX_set_selection(ctx, selection)
  ------------------
  |  Branch (829:16): [True: 223, False: 0]
  ------------------
  830|    223|            && ossl_decoder_ctx_setup_for_pkey(ctx, keytype, libctx, propquery)
  ------------------
  |  Branch (830:16): [True: 223, False: 0]
  ------------------
  831|    223|            && OSSL_DECODER_CTX_add_extra(ctx, libctx, propquery)
  ------------------
  |  Branch (831:16): [True: 223, False: 0]
  ------------------
  832|    223|            && (propquery == NULL
  ------------------
  |  Branch (832:17): [True: 223, False: 0]
  ------------------
  833|    223|                || OSSL_DECODER_CTX_set_params(ctx, decoder_params))) {
  ------------------
  |  Branch (833:20): [True: 0, False: 0]
  ------------------
  834|    223|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|    223|    do {                                        \
  |  |  221|    223|        BIO *trc_out = NULL;                    \
  |  |  222|    223|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  835|      0|                BIO_printf(trc_out, "(ctx %p) Got %d decoders\n",
  836|      0|                        (void *)ctx, OSSL_DECODER_CTX_get_num_decoders(ctx));
  837|    223|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|    223|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  838|    223|        } else {
  839|      0|            ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  840|      0|            OSSL_DECODER_CTX_free(ctx);
  841|      0|            return NULL;
  842|      0|        }
  843|       |
  844|    223|        newcache = OPENSSL_zalloc(sizeof(*newcache));
  ------------------
  |  |  104|    223|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    223|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    223|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  845|    223|        if (newcache == NULL) {
  ------------------
  |  Branch (845:13): [True: 0, False: 223]
  ------------------
  846|      0|            OSSL_DECODER_CTX_free(ctx);
  847|      0|            return NULL;
  848|      0|        }
  849|       |
  850|    223|        if (input_type != NULL) {
  ------------------
  |  Branch (850:13): [True: 223, False: 0]
  ------------------
  851|    223|            newcache->input_type = OPENSSL_strdup(input_type);
  ------------------
  |  |  119|    223|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    223|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    223|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  852|    223|            if (newcache->input_type == NULL)
  ------------------
  |  Branch (852:17): [True: 0, False: 223]
  ------------------
  853|      0|                goto err;
  854|    223|        }
  855|    223|        if (input_structure != NULL) {
  ------------------
  |  Branch (855:13): [True: 223, False: 0]
  ------------------
  856|    223|            newcache->input_structure = OPENSSL_strdup(input_structure);
  ------------------
  |  |  119|    223|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    223|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    223|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  857|    223|            if (newcache->input_structure == NULL)
  ------------------
  |  Branch (857:17): [True: 0, False: 223]
  ------------------
  858|      0|                goto err;
  859|    223|        }
  860|    223|        if (keytype != NULL) {
  ------------------
  |  Branch (860:13): [True: 222, False: 1]
  ------------------
  861|    222|            newcache->keytype = OPENSSL_strdup(keytype);
  ------------------
  |  |  119|    222|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    222|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    222|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  862|    222|            if (newcache->keytype == NULL)
  ------------------
  |  Branch (862:17): [True: 0, False: 222]
  ------------------
  863|      0|                goto err;
  864|    222|        }
  865|    223|        if (propquery != NULL) {
  ------------------
  |  Branch (865:13): [True: 0, False: 223]
  ------------------
  866|      0|            newcache->propquery = OPENSSL_strdup(propquery);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  867|      0|            if (newcache->propquery == NULL)
  ------------------
  |  Branch (867:17): [True: 0, False: 0]
  ------------------
  868|      0|                goto err;
  869|      0|        }
  870|    223|        newcache->selection = selection;
  871|    223|        newcache->template = ctx;
  872|       |
  873|    223|        if (!CRYPTO_THREAD_write_lock(cache->lock)) {
  ------------------
  |  Branch (873:13): [True: 0, False: 223]
  ------------------
  874|      0|            ctx = NULL;
  875|      0|            ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  876|      0|            goto err;
  877|      0|        }
  878|    223|        res = lh_DECODER_CACHE_ENTRY_retrieve(cache->hashtable, &cacheent);
  879|    223|        if (res == NULL) {
  ------------------
  |  Branch (879:13): [True: 223, False: 0]
  ------------------
  880|    223|            (void)lh_DECODER_CACHE_ENTRY_insert(cache->hashtable, newcache);
  881|    223|            if (lh_DECODER_CACHE_ENTRY_error(cache->hashtable)) {
  ------------------
  |  Branch (881:17): [True: 0, False: 223]
  ------------------
  882|      0|                ctx = NULL;
  883|      0|                ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  884|      0|                goto err;
  885|      0|            }
  886|    223|        } else {
  887|       |            /*
  888|       |             * We raced with another thread to construct this and lost. Free
  889|       |             * what we just created and use the entry from the hashtable instead
  890|       |             */
  891|      0|            decoder_cache_entry_free(newcache);
  892|      0|            ctx = res->template;
  893|      0|        }
  894|  40.1k|    } else {
  895|  40.1k|        ctx = res->template;
  896|  40.1k|    }
  897|       |
  898|  40.3k|    ctx = ossl_decoder_ctx_for_pkey_dup(ctx, pkey, input_type, input_structure);
  899|  40.3k|    CRYPTO_THREAD_unlock(cache->lock);
  900|       |
  901|  40.3k|    return ctx;
  902|      0| err:
  903|      0|    decoder_cache_entry_free(newcache);
  904|      0|    OSSL_DECODER_CTX_free(ctx);
  905|      0|    return NULL;
  906|  40.3k|}
decoder_pkey.c:decoder_cache_entry_hash:
  637|  40.8k|{
  638|  40.8k|    unsigned long hash = 17;
  639|       |
  640|  40.8k|    hash = (hash * 23)
  641|  40.8k|           + (cache->propquery == NULL
  ------------------
  |  Branch (641:15): [True: 40.8k, False: 0]
  ------------------
  642|  40.8k|              ? 0 : ossl_lh_strcasehash(cache->propquery));
  643|  40.8k|    hash = (hash * 23)
  644|  40.8k|           + (cache->input_structure == NULL
  ------------------
  |  Branch (644:15): [True: 0, False: 40.8k]
  ------------------
  645|  40.8k|              ? 0  : ossl_lh_strcasehash(cache->input_structure));
  646|  40.8k|    hash = (hash * 23)
  647|  40.8k|           + (cache->input_type == NULL
  ------------------
  |  Branch (647:15): [True: 0, False: 40.8k]
  ------------------
  648|  40.8k|              ? 0  : ossl_lh_strcasehash(cache->input_type));
  649|  40.8k|    hash = (hash * 23)
  650|  40.8k|           + (cache->keytype == NULL
  ------------------
  |  Branch (650:15): [True: 12.1k, False: 28.7k]
  ------------------
  651|  40.8k|              ? 0  : ossl_lh_strcasehash(cache->keytype));
  652|       |
  653|  40.8k|    hash ^= cache->selection;
  654|       |
  655|  40.8k|    return hash;
  656|  40.8k|}
decoder_pkey.c:decoder_cache_entry_cmp:
  679|  40.1k|{
  680|  40.1k|    int cmp;
  681|       |
  682|  40.1k|    if (a->selection != b->selection)
  ------------------
  |  Branch (682:9): [True: 0, False: 40.1k]
  ------------------
  683|      0|        return (a->selection < b->selection) ? -1 : 1;
  ------------------
  |  Branch (683:16): [True: 0, False: 0]
  ------------------
  684|       |
  685|  40.1k|    cmp = nullstrcmp(a->keytype, b->keytype, 1);
  686|  40.1k|    if (cmp != 0)
  ------------------
  |  Branch (686:9): [True: 0, False: 40.1k]
  ------------------
  687|      0|        return cmp;
  688|       |
  689|  40.1k|    cmp = nullstrcmp(a->input_type, b->input_type, 1);
  690|  40.1k|    if (cmp != 0)
  ------------------
  |  Branch (690:9): [True: 0, False: 40.1k]
  ------------------
  691|      0|        return cmp;
  692|       |
  693|  40.1k|    cmp = nullstrcmp(a->input_structure, b->input_structure, 1);
  694|  40.1k|    if (cmp != 0)
  ------------------
  |  Branch (694:9): [True: 0, False: 40.1k]
  ------------------
  695|      0|        return cmp;
  696|       |
  697|  40.1k|    cmp = nullstrcmp(a->propquery, b->propquery, 0);
  698|       |
  699|  40.1k|    return cmp;
  700|  40.1k|}
decoder_pkey.c:nullstrcmp:
  659|   160k|{
  660|   160k|    if (a == NULL || b == NULL) {
  ------------------
  |  Branch (660:9): [True: 52.2k, False: 108k]
  |  Branch (660:22): [True: 0, False: 108k]
  ------------------
  661|  52.2k|        if (a == NULL) {
  ------------------
  |  Branch (661:13): [True: 52.2k, False: 0]
  ------------------
  662|  52.2k|            if (b == NULL)
  ------------------
  |  Branch (662:17): [True: 52.2k, False: 0]
  ------------------
  663|  52.2k|                return 0;
  664|      0|            else
  665|      0|                return 1;
  666|  52.2k|        } else {
  667|      0|            return -1;
  668|      0|        }
  669|   108k|    } else {
  670|   108k|        if (casecmp)
  ------------------
  |  Branch (670:13): [True: 108k, False: 0]
  ------------------
  671|   108k|            return OPENSSL_strcasecmp(a, b);
  672|      0|        else
  673|      0|            return strcmp(a, b);
  674|   108k|    }
  675|   160k|}
decoder_pkey.c:decoder_cache_entry_free:
  625|    223|{
  626|    223|    if (entry == NULL)
  ------------------
  |  Branch (626:9): [True: 0, False: 223]
  ------------------
  627|      0|        return;
  628|    223|    OPENSSL_free(entry->input_type);
  ------------------
  |  |  115|    223|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    223|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    223|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  629|    223|    OPENSSL_free(entry->input_structure);
  ------------------
  |  |  115|    223|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    223|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    223|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  630|    223|    OPENSSL_free(entry->keytype);
  ------------------
  |  |  115|    223|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    223|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    223|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  631|    223|    OPENSSL_free(entry->propquery);
  ------------------
  |  |  115|    223|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    223|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    223|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  632|    223|    OSSL_DECODER_CTX_free(entry->template);
  633|    223|    OPENSSL_free(entry);
  ------------------
  |  |  115|    223|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    223|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    223|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  634|    223|}
decoder_pkey.c:ossl_decoder_ctx_setup_for_pkey:
  405|    223|{
  406|    223|    int ok = 0;
  407|    223|    struct decoder_pkey_data_st *process_data = NULL;
  408|    223|    struct collect_data_st collect_data = { NULL };
  409|    223|    STACK_OF(EVP_KEYMGMT) *keymgmts = NULL;
  ------------------
  |  |   31|    223|# define STACK_OF(type) struct stack_st_##type
  ------------------
  410|       |
  411|    223|    OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|    223|    do {                                        \
  |  |  221|    223|        BIO *trc_out = NULL;                    \
  |  |  222|    223|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  412|      0|        const char *input_type = ctx->start_input_type;
  413|      0|        const char *input_structure = ctx->input_structure;
  414|       |
  415|      0|        BIO_printf(trc_out,
  416|      0|                   "(ctx %p) Looking for decoders producing %s%s%s%s%s%s\n",
  417|      0|                   (void *)ctx,
  418|      0|                   keytype != NULL ? keytype : "",
  ------------------
  |  Branch (418:20): [True: 0, False: 0]
  ------------------
  419|      0|                   keytype != NULL ? " keys" : "keys of any type",
  ------------------
  |  Branch (419:20): [True: 0, False: 0]
  ------------------
  420|      0|                   input_type != NULL ? " from " : "",
  ------------------
  |  Branch (420:20): [True: 0, False: 0]
  ------------------
  421|      0|                   input_type != NULL ? input_type : "",
  ------------------
  |  Branch (421:20): [True: 0, False: 0]
  ------------------
  422|      0|                   input_structure != NULL ? " with " : "",
  ------------------
  |  Branch (422:20): [True: 0, False: 0]
  ------------------
  423|      0|                   input_structure != NULL ? input_structure : "");
  ------------------
  |  Branch (423:20): [True: 0, False: 0]
  ------------------
  424|    223|    } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|    223|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  425|       |
  426|       |    /* Allocate data. */
  427|    223|    if ((process_data = OPENSSL_zalloc(sizeof(*process_data))) == NULL)
  ------------------
  |  |  104|    223|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    223|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    223|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (427:9): [True: 0, False: 223]
  ------------------
  428|      0|        goto err;
  429|    223|    if ((propquery != NULL
  ------------------
  |  Branch (429:10): [True: 0, False: 223]
  ------------------
  430|    223|            && (process_data->propq = OPENSSL_strdup(propquery)) == NULL))
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (430:16): [True: 0, False: 0]
  ------------------
  431|      0|        goto err;
  432|       |
  433|       |    /* Allocate our list of EVP_KEYMGMTs. */
  434|    223|    keymgmts = sk_EVP_KEYMGMT_new_null();
  435|    223|    if (keymgmts == NULL) {
  ------------------
  |  Branch (435:9): [True: 0, False: 223]
  ------------------
  436|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  437|      0|        goto err;
  438|      0|    }
  439|       |
  440|    223|    process_data->object    = NULL;
  441|    223|    process_data->libctx    = libctx;
  442|    223|    process_data->selection = ctx->selection;
  443|    223|    process_data->keymgmts  = keymgmts;
  444|       |
  445|       |    /*
  446|       |     * Enumerate all keymgmts into a stack.
  447|       |     *
  448|       |     * We could nest EVP_KEYMGMT_do_all_provided inside
  449|       |     * OSSL_DECODER_do_all_provided or vice versa but these functions become
  450|       |     * bottlenecks if called repeatedly, which is why we collect the
  451|       |     * EVP_KEYMGMTs into a stack here and call both functions only once.
  452|       |     *
  453|       |     * We resolve the keytype string to a name ID so we don't have to resolve it
  454|       |     * multiple times, avoiding repeated calls to EVP_KEYMGMT_is_a, which is a
  455|       |     * performance bottleneck. However, we do this lazily on the first call to
  456|       |     * collect_keymgmt made by EVP_KEYMGMT_do_all_provided, rather than do it
  457|       |     * upfront, as this ensures that the names for all loaded providers have
  458|       |     * been registered by the time we try to resolve the keytype string.
  459|       |     */
  460|    223|    collect_data.ctx        = ctx;
  461|    223|    collect_data.libctx     = libctx;
  462|    223|    collect_data.keymgmts   = keymgmts;
  463|    223|    collect_data.keytype    = keytype;
  464|    223|    EVP_KEYMGMT_do_all_provided(libctx, collect_keymgmt, &collect_data);
  465|       |
  466|    223|    if (collect_data.error_occurred)
  ------------------
  |  Branch (466:9): [True: 0, False: 223]
  ------------------
  467|      0|        goto err;
  468|       |
  469|       |    /* Enumerate all matching decoders. */
  470|    223|    OSSL_DECODER_do_all_provided(libctx, collect_decoder, &collect_data);
  471|       |
  472|    223|    if (collect_data.error_occurred)
  ------------------
  |  Branch (472:9): [True: 0, False: 223]
  ------------------
  473|      0|        goto err;
  474|       |
  475|    223|    OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|    223|    do {                                        \
  |  |  221|    223|        BIO *trc_out = NULL;                    \
  |  |  222|    223|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  476|      0|        BIO_printf(trc_out,
  477|      0|                   "(ctx %p) Got %d decoders producing keys\n",
  478|      0|                   (void *)ctx, collect_data.total);
  479|    223|    } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|    223|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  480|       |
  481|       |    /*
  482|       |     * Finish initializing the decoder context. If one or more decoders matched
  483|       |     * above then the number of decoders attached to the OSSL_DECODER_CTX will
  484|       |     * be nonzero. Else nothing was found and we do nothing.
  485|       |     */
  486|    223|    if (OSSL_DECODER_CTX_get_num_decoders(ctx) != 0) {
  ------------------
  |  Branch (486:9): [True: 45, False: 178]
  ------------------
  487|     45|        if (!OSSL_DECODER_CTX_set_construct(ctx, decoder_construct_pkey)
  ------------------
  |  Branch (487:13): [True: 0, False: 45]
  ------------------
  488|     45|            || !OSSL_DECODER_CTX_set_construct_data(ctx, process_data)
  ------------------
  |  Branch (488:16): [True: 0, False: 45]
  ------------------
  489|     45|            || !OSSL_DECODER_CTX_set_cleanup(ctx,
  ------------------
  |  Branch (489:16): [True: 0, False: 45]
  ------------------
  490|     45|                                             decoder_clean_pkey_construct_arg))
  491|      0|            goto err;
  492|       |
  493|     45|        process_data = NULL; /* Avoid it being freed */
  494|     45|    }
  495|       |
  496|    223|    ok = 1;
  497|    223| err:
  498|    223|    decoder_clean_pkey_construct_arg(process_data);
  499|    223|    return ok;
  500|    223|}
decoder_pkey.c:collect_keymgmt:
  374|  8.92k|{
  375|  8.92k|    struct collect_data_st *data = arg;
  376|       |
  377|  8.92k|    if (!check_keymgmt(keymgmt, data))
  ------------------
  |  Branch (377:9): [True: 8.83k, False: 86]
  ------------------
  378|  8.83k|        return;
  379|       |
  380|       |    /*
  381|       |     * We have to ref EVP_KEYMGMT here because in the success case,
  382|       |     * data->keymgmts is referenced by the constructor we register in the
  383|       |     * OSSL_DECODER_CTX. The registered cleanup function
  384|       |     * (decoder_clean_pkey_construct_arg) unrefs every element of the stack and
  385|       |     * frees it.
  386|       |     */
  387|     86|    if (!EVP_KEYMGMT_up_ref(keymgmt))
  ------------------
  |  Branch (387:9): [True: 0, False: 86]
  ------------------
  388|      0|        return;
  389|       |
  390|     86|    if (sk_EVP_KEYMGMT_push(data->keymgmts, keymgmt) <= 0) {
  ------------------
  |  Branch (390:9): [True: 0, False: 86]
  ------------------
  391|      0|        EVP_KEYMGMT_free(keymgmt);
  392|      0|        data->error_occurred = 1;
  393|      0|    }
  394|     86|}
decoder_pkey.c:check_keymgmt:
  335|  8.92k|{
  336|       |    /* If no keytype was specified, everything matches. */
  337|  8.92k|    if (data->keytype == NULL)
  ------------------
  |  Branch (337:9): [True: 40, False: 8.88k]
  ------------------
  338|     40|        return 1;
  339|       |
  340|  8.88k|    if (!data->keytype_resolved) {
  ------------------
  |  Branch (340:9): [True: 222, False: 8.65k]
  ------------------
  341|       |        /* We haven't cached the IDs from the keytype string yet. */
  342|    222|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(data->libctx);
  343|    222|        data->keytype_id = ossl_namemap_name2num(namemap, data->keytype);
  344|       |
  345|       |        /*
  346|       |         * If keytype is a value ambiguously used for both EC and SM2,
  347|       |         * collect the ID for SM2 as well.
  348|       |         */
  349|    222|        if (data->keytype_id != 0
  ------------------
  |  Branch (349:13): [True: 47, False: 175]
  ------------------
  350|    222|            && (strcmp(data->keytype, "id-ecPublicKey") == 0
  ------------------
  |  Branch (350:17): [True: 2, False: 45]
  ------------------
  351|     47|                || strcmp(data->keytype, "1.2.840.10045.2.1") == 0))
  ------------------
  |  Branch (351:20): [True: 0, False: 45]
  ------------------
  352|      2|            data->sm2_id = ossl_namemap_name2num(namemap, "SM2");
  353|       |
  354|       |        /*
  355|       |         * If keytype_id is zero the name was not found, but we still
  356|       |         * set keytype_resolved to avoid trying all this again.
  357|       |         */
  358|    222|        data->keytype_resolved = 1;
  359|    222|    }
  360|       |
  361|       |    /* Specified keytype could not be resolved, so nothing matches. */
  362|  8.88k|    if (data->keytype_id == 0)
  ------------------
  |  Branch (362:9): [True: 7.00k, False: 1.88k]
  ------------------
  363|  7.00k|        return 0;
  364|       |
  365|       |    /* Does not match the keytype specified, so skip. */
  366|  1.88k|    if (keymgmt->name_id != data->keytype_id
  ------------------
  |  Branch (366:9): [True: 1.83k, False: 44]
  ------------------
  367|  1.88k|        && keymgmt->name_id != data->sm2_id)
  ------------------
  |  Branch (367:12): [True: 1.83k, False: 2]
  ------------------
  368|  1.83k|        return 0;
  369|       |
  370|     46|    return 1;
  371|  1.88k|}
decoder_pkey.c:collect_decoder:
  288|  16.9k|{
  289|  16.9k|    struct collect_data_st *data = arg;
  290|  16.9k|    STACK_OF(EVP_KEYMGMT) *keymgmts = data->keymgmts;
  ------------------
  |  |   31|  16.9k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  291|  16.9k|    int i, end_i;
  292|  16.9k|    EVP_KEYMGMT *keymgmt;
  293|  16.9k|    const OSSL_PROVIDER *prov;
  294|  16.9k|    void *provctx;
  295|       |
  296|  16.9k|    if (data->error_occurred)
  ------------------
  |  Branch (296:9): [True: 0, False: 16.9k]
  ------------------
  297|      0|        return;
  298|       |
  299|  16.9k|    prov = OSSL_DECODER_get0_provider(decoder);
  300|  16.9k|    provctx = OSSL_PROVIDER_get0_provider_ctx(prov);
  301|       |
  302|       |    /*
  303|       |     * Either the caller didn't give us a selection, or if they did, the decoder
  304|       |     * must tell us if it supports that selection to be accepted. If the decoder
  305|       |     * doesn't have |does_selection|, it's seen as taking anything.
  306|       |     */
  307|  16.9k|    if (decoder->does_selection != NULL
  ------------------
  |  Branch (307:9): [True: 16.2k, False: 669]
  ------------------
  308|  16.9k|            && !decoder->does_selection(provctx, data->ctx->selection))
  ------------------
  |  Branch (308:16): [True: 8.34k, False: 7.93k]
  ------------------
  309|  8.34k|        return;
  310|       |
  311|  8.60k|    OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|  8.60k|    do {                                        \
  |  |  221|  8.60k|        BIO *trc_out = NULL;                    \
  |  |  222|  8.60k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  312|      0|        BIO_printf(trc_out,
  313|      0|                   "(ctx %p) Checking out decoder %p:\n"
  314|      0|                   "    %s with %s\n",
  315|      0|                   (void *)data->ctx, (void *)decoder,
  316|      0|                   OSSL_DECODER_get0_name(decoder),
  317|      0|                   OSSL_DECODER_get0_properties(decoder));
  318|  8.60k|    } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|  8.60k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  319|       |
  320|  8.60k|    end_i = sk_EVP_KEYMGMT_num(keymgmts);
  321|  12.1k|    for (i = 0; i < end_i; ++i) {
  ------------------
  |  Branch (321:17): [True: 3.54k, False: 8.60k]
  ------------------
  322|  3.54k|        keymgmt = sk_EVP_KEYMGMT_value(keymgmts, i);
  323|       |
  324|  3.54k|        collect_decoder_keymgmt(keymgmt, decoder, provctx, data);
  325|  3.54k|        if (data->error_occurred)
  ------------------
  |  Branch (325:13): [True: 0, False: 3.54k]
  ------------------
  326|      0|            return;
  327|  3.54k|    }
  328|  8.60k|}
decoder_pkey.c:collect_decoder_keymgmt:
  231|  3.54k|{
  232|  3.54k|    void *decoderctx = NULL;
  233|  3.54k|    OSSL_DECODER_INSTANCE *di = NULL;
  234|       |
  235|       |    /*
  236|       |     * We already checked the EVP_KEYMGMT is applicable in check_keymgmt so we
  237|       |     * don't check it again here.
  238|       |     */
  239|       |
  240|  3.54k|    if (keymgmt->name_id != decoder->base.id)
  ------------------
  |  Branch (240:9): [True: 3.43k, False: 110]
  ------------------
  241|       |        /* Mismatch is not an error, continue. */
  242|  3.43k|        return;
  243|       |
  244|    110|    if ((decoderctx = decoder->newctx(provctx)) == NULL) {
  ------------------
  |  Branch (244:9): [True: 0, False: 110]
  ------------------
  245|      0|        data->error_occurred = 1;
  246|      0|        return;
  247|      0|    }
  248|       |
  249|    110|    if ((di = ossl_decoder_instance_new(decoder, decoderctx)) == NULL) {
  ------------------
  |  Branch (249:9): [True: 0, False: 110]
  ------------------
  250|      0|        decoder->freectx(decoderctx);
  251|      0|        data->error_occurred = 1;
  252|      0|        return;
  253|      0|    }
  254|       |
  255|       |    /*
  256|       |     * Input types must be compatible, but we must accept DER encoders when the
  257|       |     * start input type is "PEM".
  258|       |     */
  259|    110|    if (data->ctx->start_input_type != NULL
  ------------------
  |  Branch (259:9): [True: 110, False: 0]
  ------------------
  260|    110|        && di->input_type != NULL
  ------------------
  |  Branch (260:12): [True: 110, False: 0]
  ------------------
  261|    110|        && OPENSSL_strcasecmp(di->input_type, data->ctx->start_input_type) != 0
  ------------------
  |  Branch (261:12): [True: 13, False: 97]
  ------------------
  262|    110|        && (OPENSSL_strcasecmp(di->input_type, "DER") != 0
  ------------------
  |  Branch (262:13): [True: 13, False: 0]
  ------------------
  263|     13|            || OPENSSL_strcasecmp(data->ctx->start_input_type, "PEM") != 0)) {
  ------------------
  |  Branch (263:16): [True: 0, False: 0]
  ------------------
  264|       |        /* Mismatch is not an error, continue. */
  265|     13|        ossl_decoder_instance_free(di);
  266|     13|        return;
  267|     13|    }
  268|       |
  269|     97|    OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  220|     97|    do {                                        \
  |  |  221|     97|        BIO *trc_out = NULL;                    \
  |  |  222|     97|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  270|      0|        BIO_printf(trc_out,
  271|      0|                   "(ctx %p) Checking out decoder %p:\n"
  272|      0|                   "    %s with %s\n",
  273|      0|                   (void *)data->ctx, (void *)decoder,
  274|      0|                   OSSL_DECODER_get0_name(decoder),
  275|      0|                   OSSL_DECODER_get0_properties(decoder));
  276|     97|    } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  225|     97|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  277|       |
  278|     97|    if (!ossl_decoder_ctx_add_decoder_inst(data->ctx, di)) {
  ------------------
  |  Branch (278:9): [True: 0, False: 97]
  ------------------
  279|      0|        ossl_decoder_instance_free(di);
  280|      0|        data->error_occurred = 1;
  281|      0|        return;
  282|      0|    }
  283|       |
  284|     97|    ++data->total;
  285|     97|}
decoder_pkey.c:decoder_construct_pkey:
   74|  33.9k|{
   75|  33.9k|    struct decoder_pkey_data_st *data = construct_data;
   76|  33.9k|    OSSL_DECODER *decoder = OSSL_DECODER_INSTANCE_get_decoder(decoder_inst);
   77|  33.9k|    void *decoderctx = OSSL_DECODER_INSTANCE_get_decoder_ctx(decoder_inst);
   78|  33.9k|    const OSSL_PROVIDER *decoder_prov = OSSL_DECODER_get0_provider(decoder);
   79|  33.9k|    EVP_KEYMGMT *keymgmt = NULL;
   80|  33.9k|    const OSSL_PROVIDER *keymgmt_prov = NULL;
   81|  33.9k|    int i, end;
   82|       |    /*
   83|       |     * |object_ref| points to a provider reference to an object, its exact
   84|       |     * contents entirely opaque to us, but may be passed to any provider
   85|       |     * function that expects this (such as OSSL_FUNC_keymgmt_load().
   86|       |     *
   87|       |     * This pointer is considered volatile, i.e. whatever it points at
   88|       |     * is assumed to be freed as soon as this function returns.
   89|       |     */
   90|  33.9k|    void *object_ref = NULL;
   91|  33.9k|    size_t object_ref_sz = 0;
   92|  33.9k|    const OSSL_PARAM *p;
   93|       |
   94|  33.9k|    p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA_TYPE);
  ------------------
  |  |  352|  33.9k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
   95|  33.9k|    if (p != NULL) {
  ------------------
  |  Branch (95:9): [True: 33.9k, False: 0]
  ------------------
   96|  33.9k|        char *object_type = NULL;
   97|       |
   98|  33.9k|        if (!OSSL_PARAM_get_utf8_string(p, &object_type, 0))
  ------------------
  |  Branch (98:13): [True: 0, False: 33.9k]
  ------------------
   99|      0|            return 0;
  100|  33.9k|        OPENSSL_free(data->object_type);
  ------------------
  |  |  115|  33.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  33.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  33.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  101|  33.9k|        data->object_type = object_type;
  102|  33.9k|    }
  103|       |
  104|       |    /*
  105|       |     * For stuff that should end up in an EVP_PKEY, we only accept an object
  106|       |     * reference for the moment.  This enforces that the key data itself
  107|       |     * remains with the provider.
  108|       |     */
  109|  33.9k|    p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_REFERENCE);
  ------------------
  |  |  355|  33.9k|# define OSSL_OBJECT_PARAM_REFERENCE "reference"
  ------------------
  110|  33.9k|    if (p == NULL || p->data_type != OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|  8.30k|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (110:9): [True: 25.6k, False: 8.30k]
  |  Branch (110:22): [True: 0, False: 8.30k]
  ------------------
  111|  25.6k|        return 0;
  112|  8.30k|    object_ref = p->data;
  113|  8.30k|    object_ref_sz = p->data_size;
  114|       |
  115|       |    /*
  116|       |     * First, we try to find a keymgmt that comes from the same provider as
  117|       |     * the decoder that passed the params.
  118|       |     */
  119|  8.30k|    end = sk_EVP_KEYMGMT_num(data->keymgmts);
  120|  10.5k|    for (i = 0; i < end; i++) {
  ------------------
  |  Branch (120:17): [True: 10.5k, False: 0]
  ------------------
  121|  10.5k|        keymgmt = sk_EVP_KEYMGMT_value(data->keymgmts, i);
  122|  10.5k|        keymgmt_prov = EVP_KEYMGMT_get0_provider(keymgmt);
  123|       |
  124|  10.5k|        if (keymgmt_prov == decoder_prov
  ------------------
  |  Branch (124:13): [True: 10.5k, False: 0]
  ------------------
  125|  10.5k|            && evp_keymgmt_has_load(keymgmt)
  ------------------
  |  Branch (125:16): [True: 10.5k, False: 0]
  ------------------
  126|  10.5k|            && EVP_KEYMGMT_is_a(keymgmt, data->object_type))
  ------------------
  |  Branch (126:16): [True: 8.30k, False: 2.24k]
  ------------------
  127|  8.30k|            break;
  128|  10.5k|    }
  129|  8.30k|    if (i < end) {
  ------------------
  |  Branch (129:9): [True: 8.30k, False: 0]
  ------------------
  130|       |        /* To allow it to be freed further down */
  131|  8.30k|        if (!EVP_KEYMGMT_up_ref(keymgmt))
  ------------------
  |  Branch (131:13): [True: 0, False: 8.30k]
  ------------------
  132|      0|            return 0;
  133|  8.30k|    } else if ((keymgmt = EVP_KEYMGMT_fetch(data->libctx,
  ------------------
  |  Branch (133:16): [True: 0, False: 0]
  ------------------
  134|      0|                                            data->object_type,
  135|      0|                                            data->propq)) != NULL) {
  136|      0|        keymgmt_prov = EVP_KEYMGMT_get0_provider(keymgmt);
  137|      0|    }
  138|       |
  139|  8.30k|    if (keymgmt != NULL) {
  ------------------
  |  Branch (139:9): [True: 8.30k, False: 0]
  ------------------
  140|  8.30k|        EVP_PKEY *pkey = NULL;
  141|  8.30k|        void *keydata = NULL;
  142|       |
  143|       |        /*
  144|       |         * If the EVP_KEYMGMT and the OSSL_DECODER are from the
  145|       |         * same provider, we assume that the KEYMGMT has a key loading
  146|       |         * function that can handle the provider reference we hold.
  147|       |         *
  148|       |         * Otherwise, we export from the decoder and import the
  149|       |         * result in the keymgmt.
  150|       |         */
  151|  8.30k|        if (keymgmt_prov == decoder_prov) {
  ------------------
  |  Branch (151:13): [True: 8.30k, False: 0]
  ------------------
  152|  8.30k|            keydata = evp_keymgmt_load(keymgmt, object_ref, object_ref_sz);
  153|  8.30k|        } else {
  154|      0|            struct evp_keymgmt_util_try_import_data_st import_data;
  155|       |
  156|      0|            import_data.keymgmt = keymgmt;
  157|      0|            import_data.keydata = NULL;
  158|      0|            if (data->selection == 0)
  ------------------
  |  Branch (158:17): [True: 0, False: 0]
  ------------------
  159|       |                /* import/export functions do not tolerate 0 selection */
  160|      0|                import_data.selection = OSSL_KEYMGMT_SELECT_ALL;
  ------------------
  |  |  652|      0|    ( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  ------------------
  |  |  |  |  650|      0|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  640|      0|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  |  |  ------------------
  |  |  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|      0|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  ------------------
  |  |  |  |  647|      0|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  642|      0|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  ------------------
  |  |  |  |  648|      0|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  643|      0|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  161|      0|            else
  162|      0|                import_data.selection = data->selection;
  163|       |
  164|       |            /*
  165|       |             * No need to check for errors here, the value of
  166|       |             * |import_data.keydata| is as much an indicator.
  167|       |             */
  168|      0|            (void)decoder->export_object(decoderctx,
  169|      0|                                         object_ref, object_ref_sz,
  170|      0|                                         &evp_keymgmt_util_try_import,
  171|      0|                                         &import_data);
  172|      0|            keydata = import_data.keydata;
  173|      0|            import_data.keydata = NULL;
  174|      0|        }
  175|       |        /*
  176|       |         * When load or import fails, because this is not an acceptable key
  177|       |         * (despite the provided key material being syntactically valid), the
  178|       |         * reason why the key is rejected would be lost, unless we signal a
  179|       |         * hard error, and suppress resetting for another try.
  180|       |         */
  181|  8.30k|        if (keydata == NULL)
  ------------------
  |  Branch (181:13): [True: 0, False: 8.30k]
  ------------------
  182|      0|            ossl_decoder_ctx_set_harderr(data->ctx);
  183|       |
  184|  8.30k|        if (keydata != NULL
  ------------------
  |  Branch (184:13): [True: 8.30k, False: 0]
  ------------------
  185|  8.30k|            && (pkey = evp_keymgmt_util_make_pkey(keymgmt, keydata)) == NULL)
  ------------------
  |  Branch (185:16): [True: 0, False: 8.30k]
  ------------------
  186|      0|            evp_keymgmt_freedata(keymgmt, keydata);
  187|       |
  188|  8.30k|        *data->object = pkey;
  189|       |
  190|       |        /*
  191|       |         * evp_keymgmt_util_make_pkey() increments the reference count when
  192|       |         * assigning the EVP_PKEY, so we can free the keymgmt here.
  193|       |         */
  194|  8.30k|        EVP_KEYMGMT_free(keymgmt);
  195|  8.30k|    }
  196|       |    /*
  197|       |     * We successfully looked through, |*ctx->object| determines if we
  198|       |     * actually found something.
  199|       |     */
  200|  8.30k|    return (*data->object != NULL);
  201|  8.30k|}
decoder_pkey.c:decoder_clean_pkey_construct_arg:
  204|  37.8k|{
  205|  37.8k|    struct decoder_pkey_data_st *data = construct_data;
  206|       |
  207|  37.8k|    if (data != NULL) {
  ------------------
  |  Branch (207:9): [True: 37.8k, False: 45]
  ------------------
  208|  37.8k|        sk_EVP_KEYMGMT_pop_free(data->keymgmts, EVP_KEYMGMT_free);
  209|  37.8k|        OPENSSL_free(data->propq);
  ------------------
  |  |  115|  37.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  37.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  37.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  210|  37.8k|        OPENSSL_free(data->object_type);
  ------------------
  |  |  115|  37.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  37.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  37.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  211|  37.8k|        OPENSSL_free(data);
  ------------------
  |  |  115|  37.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  37.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  37.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  212|  37.8k|    }
  213|  37.8k|}
decoder_pkey.c:ossl_decoder_ctx_for_pkey_dup:
  522|  40.3k|{
  523|  40.3k|    OSSL_DECODER_CTX *dest;
  524|  40.3k|    struct decoder_pkey_data_st *process_data_src, *process_data_dest = NULL;
  525|       |
  526|  40.3k|    if (src == NULL)
  ------------------
  |  Branch (526:9): [True: 0, False: 40.3k]
  ------------------
  527|      0|        return NULL;
  528|       |
  529|  40.3k|    if ((dest = OSSL_DECODER_CTX_new()) == NULL) {
  ------------------
  |  Branch (529:9): [True: 0, False: 40.3k]
  ------------------
  530|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  531|      0|        return NULL;
  532|      0|    }
  533|       |
  534|  40.3k|    if (!OSSL_DECODER_CTX_set_input_type(dest, input_type)
  ------------------
  |  Branch (534:9): [True: 0, False: 40.3k]
  ------------------
  535|  40.3k|            || !OSSL_DECODER_CTX_set_input_structure(dest, input_structure)) {
  ------------------
  |  Branch (535:16): [True: 0, False: 40.3k]
  ------------------
  536|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  537|      0|        goto err;
  538|      0|    }
  539|  40.3k|    dest->selection = src->selection;
  540|       |
  541|  40.3k|    if (src->decoder_insts != NULL) {
  ------------------
  |  Branch (541:9): [True: 37.6k, False: 2.74k]
  ------------------
  542|  37.6k|        dest->decoder_insts
  543|  37.6k|            = sk_OSSL_DECODER_INSTANCE_deep_copy(src->decoder_insts,
  544|  37.6k|                                                 ossl_decoder_instance_dup,
  545|  37.6k|                                                 ossl_decoder_instance_free);
  546|  37.6k|        if (dest->decoder_insts == NULL) {
  ------------------
  |  Branch (546:13): [True: 0, False: 37.6k]
  ------------------
  547|      0|            ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  548|      0|            goto err;
  549|      0|        }
  550|  37.6k|    }
  551|       |
  552|  40.3k|    if (!OSSL_DECODER_CTX_set_construct(dest,
  ------------------
  |  Branch (552:9): [True: 0, False: 40.3k]
  ------------------
  553|  40.3k|                                        OSSL_DECODER_CTX_get_construct(src))) {
  554|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  555|      0|        goto err;
  556|      0|    }
  557|       |
  558|  40.3k|    process_data_src = OSSL_DECODER_CTX_get_construct_data(src);
  559|  40.3k|    if (process_data_src != NULL) {
  ------------------
  |  Branch (559:9): [True: 37.6k, False: 2.74k]
  ------------------
  560|  37.6k|        process_data_dest = OPENSSL_zalloc(sizeof(*process_data_dest));
  ------------------
  |  |  104|  37.6k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  37.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  37.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  561|  37.6k|        if (process_data_dest == NULL) {
  ------------------
  |  Branch (561:13): [True: 0, False: 37.6k]
  ------------------
  562|      0|            ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  563|      0|            goto err;
  564|      0|        }
  565|  37.6k|        if (process_data_src->propq != NULL) {
  ------------------
  |  Branch (565:13): [True: 0, False: 37.6k]
  ------------------
  566|      0|            process_data_dest->propq = OPENSSL_strdup(process_data_src->propq);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  567|      0|            if (process_data_dest->propq == NULL) {
  ------------------
  |  Branch (567:17): [True: 0, False: 0]
  ------------------
  568|      0|                ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  569|      0|                goto err;
  570|      0|            }
  571|      0|        }
  572|       |
  573|  37.6k|        if (process_data_src->keymgmts != NULL) {
  ------------------
  |  Branch (573:13): [True: 37.6k, False: 0]
  ------------------
  574|  37.6k|            process_data_dest->keymgmts
  575|  37.6k|                = sk_EVP_KEYMGMT_deep_copy(process_data_src->keymgmts,
  576|  37.6k|                                           keymgmt_dup,
  577|  37.6k|                                           EVP_KEYMGMT_free);
  578|  37.6k|            if (process_data_dest->keymgmts == NULL) {
  ------------------
  |  Branch (578:17): [True: 0, False: 37.6k]
  ------------------
  579|      0|                ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  580|      0|                goto err;
  581|      0|            }
  582|  37.6k|        }
  583|       |
  584|  37.6k|        process_data_dest->object    = (void **)pkey;
  585|  37.6k|        process_data_dest->libctx    = process_data_src->libctx;
  586|  37.6k|        process_data_dest->selection = process_data_src->selection;
  587|  37.6k|        process_data_dest->ctx       = dest;
  588|  37.6k|        if (!OSSL_DECODER_CTX_set_construct_data(dest, process_data_dest)) {
  ------------------
  |  Branch (588:13): [True: 0, False: 37.6k]
  ------------------
  589|      0|            ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  590|      0|            goto err;
  591|      0|        }
  592|  37.6k|        process_data_dest = NULL;
  593|  37.6k|    }
  594|       |
  595|  40.3k|    if (!OSSL_DECODER_CTX_set_cleanup(dest,
  ------------------
  |  Branch (595:9): [True: 0, False: 40.3k]
  ------------------
  596|  40.3k|                                      OSSL_DECODER_CTX_get_cleanup(src))) {
  597|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  598|      0|        goto err;
  599|      0|    }
  600|       |
  601|  40.3k|    return dest;
  602|      0| err:
  603|      0|    decoder_clean_pkey_construct_arg(process_data_dest);
  604|      0|    OSSL_DECODER_CTX_free(dest);
  605|      0|    return NULL;
  606|  40.3k|}
decoder_pkey.c:keymgmt_dup:
  504|   533k|{
  505|   533k|    if (!EVP_KEYMGMT_up_ref((EVP_KEYMGMT *)keymgmt))
  ------------------
  |  Branch (505:9): [True: 0, False: 533k]
  ------------------
  506|      0|        return NULL;
  507|       |
  508|   533k|    return (EVP_KEYMGMT *)keymgmt;
  509|   533k|}

OSSL_ENCODER_to_bio:
   69|  3.05k|{
   70|  3.05k|    struct encoder_process_data_st data;
   71|       |
   72|  3.05k|    memset(&data, 0, sizeof(data));
   73|  3.05k|    data.ctx = ctx;
   74|  3.05k|    data.bio = out;
   75|  3.05k|    data.current_encoder_inst_index = OSSL_ENCODER_CTX_get_num_encoders(ctx);
   76|       |
   77|  3.05k|    if (data.current_encoder_inst_index == 0) {
  ------------------
  |  Branch (77:9): [True: 0, False: 3.05k]
  ------------------
   78|      0|        ERR_raise_data(ERR_LIB_OSSL_ENCODER, OSSL_ENCODER_R_ENCODER_NOT_FOUND,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_ENCODER, OSSL_ENCODER_R_ENCODER_NOT_FOUND,
  ------------------
  |  |  120|      0|# define ERR_LIB_OSSL_ENCODER    59
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_ENCODER, OSSL_ENCODER_R_ENCODER_NOT_FOUND,
  ------------------
  |  |   24|      0|# define OSSL_ENCODER_R_ENCODER_NOT_FOUND                 101
  ------------------
   79|      0|                       "No encoders were found. For standard encoders you need "
   80|      0|                       "at least one of the default or base providers "
   81|      0|                       "available. Did you forget to load them?");
   82|      0|        return 0;
   83|      0|    }
   84|       |
   85|  3.05k|    if (ctx->cleanup == NULL || ctx->construct == NULL) {
  ------------------
  |  Branch (85:9): [True: 0, False: 3.05k]
  |  Branch (85:33): [True: 0, False: 3.05k]
  ------------------
   86|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   87|      0|        return 0;
   88|      0|    }
   89|       |
   90|  3.05k|    return encoder_process(&data) > 0;
   91|  3.05k|}
OSSL_ENCODER_to_data:
  121|  1.64k|{
  122|  1.64k|    BIO *out;
  123|  1.64k|    BUF_MEM *buf = NULL;
  124|  1.64k|    int ret = 0;
  125|       |
  126|  1.64k|    if (pdata_len == NULL) {
  ------------------
  |  Branch (126:9): [True: 0, False: 1.64k]
  ------------------
  127|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  128|      0|        return 0;
  129|      0|    }
  130|       |
  131|  1.64k|    out = BIO_new(BIO_s_mem());
  132|       |
  133|  1.64k|    if (out != NULL
  ------------------
  |  Branch (133:9): [True: 1.64k, False: 0]
  ------------------
  134|  1.64k|        && OSSL_ENCODER_to_bio(ctx, out)
  ------------------
  |  Branch (134:12): [True: 1.19k, False: 447]
  ------------------
  135|  1.64k|        && BIO_get_mem_ptr(out, &buf) > 0) {
  ------------------
  |  |  614|  1.19k|# define BIO_get_mem_ptr(b,pp)   BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0, \
  |  |  ------------------
  |  |  |  |  446|  1.19k|# define BIO_C_GET_BUF_MEM_PTR                   115
  |  |  ------------------
  |  |  615|  1.19k|                                          (char *)(pp))
  ------------------
  |  Branch (135:12): [True: 1.19k, False: 0]
  ------------------
  136|  1.19k|        ret = 1; /* Hope for the best. A too small buffer will clear this */
  137|       |
  138|  1.19k|        if (pdata != NULL && *pdata != NULL) {
  ------------------
  |  Branch (138:13): [True: 1.19k, False: 0]
  |  Branch (138:30): [True: 0, False: 1.19k]
  ------------------
  139|      0|            if (*pdata_len < buf->length)
  ------------------
  |  Branch (139:17): [True: 0, False: 0]
  ------------------
  140|       |                /*
  141|       |                 * It's tempting to do |*pdata_len = (size_t)buf->length|
  142|       |                 * However, it's believed to be confusing more than helpful,
  143|       |                 * so we don't.
  144|       |                 */
  145|      0|                ret = 0;
  146|      0|            else
  147|      0|                *pdata_len -= buf->length;
  148|  1.19k|        } else {
  149|       |            /* The buffer with the right size is already allocated for us */
  150|  1.19k|            *pdata_len = (size_t)buf->length;
  151|  1.19k|        }
  152|       |
  153|  1.19k|        if (ret) {
  ------------------
  |  Branch (153:13): [True: 1.19k, False: 0]
  ------------------
  154|  1.19k|            if (pdata != NULL) {
  ------------------
  |  Branch (154:17): [True: 1.19k, False: 0]
  ------------------
  155|  1.19k|                if (*pdata != NULL) {
  ------------------
  |  Branch (155:21): [True: 0, False: 1.19k]
  ------------------
  156|      0|                    memcpy(*pdata, buf->data, buf->length);
  157|      0|                    *pdata += buf->length;
  158|  1.19k|                } else {
  159|       |                    /* In this case, we steal the data from BIO_s_mem() */
  160|  1.19k|                    *pdata = (unsigned char *)buf->data;
  161|  1.19k|                    buf->data = NULL;
  162|  1.19k|                }
  163|  1.19k|            }
  164|  1.19k|        }
  165|  1.19k|    }
  166|  1.64k|    BIO_free(out);
  167|  1.64k|    return ret;
  168|  1.64k|}
OSSL_ENCODER_CTX_set_selection:
  171|  3.43k|{
  172|  3.43k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  3.43k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.43k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (172:9): [True: 0, False: 3.43k]
  ------------------
  173|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  174|      0|        return 0;
  175|      0|    }
  176|       |
  177|  3.43k|    if (!ossl_assert(selection != 0)) {
  ------------------
  |  |   52|  3.43k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.43k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (177:9): [True: 0, False: 3.43k]
  ------------------
  178|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  179|      0|        return 0;
  180|      0|    }
  181|       |
  182|  3.43k|    ctx->selection = selection;
  183|  3.43k|    return 1;
  184|  3.43k|}
OSSL_ENCODER_CTX_set_output_type:
  188|  3.43k|{
  189|  3.43k|    if (!ossl_assert(ctx != NULL) || !ossl_assert(output_type != NULL)) {
  ------------------
  |  |   52|  6.86k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  6.86k|                                         __FILE__, __LINE__)
  ------------------
                  if (!ossl_assert(ctx != NULL) || !ossl_assert(output_type != NULL)) {
  ------------------
  |  |   52|  3.43k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.43k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (189:9): [True: 0, False: 3.43k]
  |  Branch (189:38): [True: 0, False: 3.43k]
  ------------------
  190|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  191|      0|        return 0;
  192|      0|    }
  193|       |
  194|  3.43k|    ctx->output_type = output_type;
  195|  3.43k|    return 1;
  196|  3.43k|}
OSSL_ENCODER_CTX_set_output_structure:
  200|  1.64k|{
  201|  1.64k|    if (!ossl_assert(ctx != NULL) || !ossl_assert(output_structure != NULL)) {
  ------------------
  |  |   52|  3.28k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.28k|                                         __FILE__, __LINE__)
  ------------------
                  if (!ossl_assert(ctx != NULL) || !ossl_assert(output_structure != NULL)) {
  ------------------
  |  |   52|  1.64k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  1.64k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (201:9): [True: 0, False: 1.64k]
  |  Branch (201:38): [True: 0, False: 1.64k]
  ------------------
  202|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  203|      0|        return 0;
  204|      0|    }
  205|       |
  206|  1.64k|    ctx->output_structure = output_structure;
  207|  1.64k|    return 1;
  208|  1.64k|}
ossl_encoder_instance_free:
  269|  33.6k|{
  270|  33.6k|    if (encoder_inst != NULL) {
  ------------------
  |  Branch (270:9): [True: 33.6k, False: 0]
  ------------------
  271|  33.6k|        if (encoder_inst->encoder != NULL)
  ------------------
  |  Branch (271:13): [True: 33.6k, False: 0]
  ------------------
  272|  33.6k|            encoder_inst->encoder->freectx(encoder_inst->encoderctx);
  273|  33.6k|        encoder_inst->encoderctx = NULL;
  274|  33.6k|        OSSL_ENCODER_free(encoder_inst->encoder);
  275|  33.6k|        encoder_inst->encoder = NULL;
  276|  33.6k|        OPENSSL_free(encoder_inst);
  ------------------
  |  |  115|  33.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  33.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  33.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  277|  33.6k|    }
  278|  33.6k|}
OSSL_ENCODER_CTX_add_encoder:
  307|  33.6k|{
  308|  33.6k|    OSSL_ENCODER_INSTANCE *encoder_inst = NULL;
  309|  33.6k|    const OSSL_PROVIDER *prov = NULL;
  310|  33.6k|    void *encoderctx = NULL;
  311|  33.6k|    void *provctx = NULL;
  312|       |
  313|  33.6k|    if (!ossl_assert(ctx != NULL) || !ossl_assert(encoder != NULL)) {
  ------------------
  |  |   52|  67.3k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  67.3k|                                         __FILE__, __LINE__)
  ------------------
                  if (!ossl_assert(ctx != NULL) || !ossl_assert(encoder != NULL)) {
  ------------------
  |  |   52|  33.6k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  33.6k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (313:9): [True: 0, False: 33.6k]
  |  Branch (313:38): [True: 0, False: 33.6k]
  ------------------
  314|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  315|      0|        return 0;
  316|      0|    }
  317|       |
  318|  33.6k|    prov = OSSL_ENCODER_get0_provider(encoder);
  319|  33.6k|    provctx = OSSL_PROVIDER_get0_provider_ctx(prov);
  320|       |
  321|  33.6k|    if ((encoderctx = encoder->newctx(provctx)) == NULL
  ------------------
  |  Branch (321:9): [True: 0, False: 33.6k]
  ------------------
  322|  33.6k|        || (encoder_inst =
  ------------------
  |  Branch (322:12): [True: 0, False: 33.6k]
  ------------------
  323|  33.6k|            ossl_encoder_instance_new(encoder, encoderctx)) == NULL)
  324|      0|        goto err;
  325|       |    /* Avoid double free of encoderctx on further errors */
  326|  33.6k|    encoderctx = NULL;
  327|       |
  328|  33.6k|    if (!ossl_encoder_ctx_add_encoder_inst(ctx, encoder_inst))
  ------------------
  |  Branch (328:9): [True: 0, False: 33.6k]
  ------------------
  329|      0|        goto err;
  330|       |
  331|  33.6k|    return 1;
  332|      0| err:
  333|      0|    ossl_encoder_instance_free(encoder_inst);
  334|      0|    if (encoderctx != NULL)
  ------------------
  |  Branch (334:9): [True: 0, False: 0]
  ------------------
  335|      0|        encoder->freectx(encoderctx);
  336|      0|    return 0;
  337|  33.6k|}
OSSL_ENCODER_CTX_add_extra:
  341|  3.43k|{
  342|  3.43k|    return 1;
  343|  3.43k|}
OSSL_ENCODER_CTX_get_num_encoders:
  346|  10.9k|{
  347|  10.9k|    if (ctx == NULL || ctx->encoder_insts == NULL)
  ------------------
  |  Branch (347:9): [True: 0, False: 10.9k]
  |  Branch (347:24): [True: 379, False: 10.5k]
  ------------------
  348|    379|        return 0;
  349|  10.5k|    return sk_OSSL_ENCODER_INSTANCE_num(ctx->encoder_insts);
  350|  10.9k|}
OSSL_ENCODER_CTX_set_construct:
  354|  3.05k|{
  355|  3.05k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  3.05k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.05k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (355:9): [True: 0, False: 3.05k]
  ------------------
  356|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  357|      0|        return 0;
  358|      0|    }
  359|  3.05k|    ctx->construct = construct;
  360|  3.05k|    return 1;
  361|  3.05k|}
OSSL_ENCODER_CTX_set_construct_data:
  365|  3.05k|{
  366|  3.05k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  3.05k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.05k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (366:9): [True: 0, False: 3.05k]
  ------------------
  367|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  368|      0|        return 0;
  369|      0|    }
  370|  3.05k|    ctx->construct_data = construct_data;
  371|  3.05k|    return 1;
  372|  3.05k|}
OSSL_ENCODER_CTX_set_cleanup:
  376|  3.05k|{
  377|  3.05k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  3.05k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.05k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (377:9): [True: 0, False: 3.05k]
  ------------------
  378|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  379|      0|        return 0;
  380|      0|    }
  381|  3.05k|    ctx->cleanup = cleanup;
  382|  3.05k|    return 1;
  383|  3.05k|}
OSSL_ENCODER_INSTANCE_get_encoder:
  387|  72.9k|{
  388|  72.9k|    if (encoder_inst == NULL)
  ------------------
  |  Branch (388:9): [True: 0, False: 72.9k]
  ------------------
  389|      0|        return NULL;
  390|  72.9k|    return encoder_inst->encoder;
  391|  72.9k|}
OSSL_ENCODER_INSTANCE_get_encoder_ctx:
  395|  67.3k|{
  396|  67.3k|    if (encoder_inst == NULL)
  ------------------
  |  Branch (396:9): [True: 0, False: 67.3k]
  ------------------
  397|      0|        return NULL;
  398|  67.3k|    return encoder_inst->encoderctx;
  399|  67.3k|}
OSSL_ENCODER_INSTANCE_get_output_type:
  403|  33.6k|{
  404|  33.6k|    if (encoder_inst == NULL)
  ------------------
  |  Branch (404:9): [True: 0, False: 33.6k]
  ------------------
  405|      0|        return NULL;
  406|  33.6k|    return encoder_inst->output_type;
  407|  33.6k|}
OSSL_ENCODER_INSTANCE_get_output_structure:
  411|  33.6k|{
  412|  33.6k|    if (encoder_inst == NULL)
  ------------------
  |  Branch (412:9): [True: 0, False: 33.6k]
  ------------------
  413|      0|        return NULL;
  414|  33.6k|    return encoder_inst->output_structure;
  415|  33.6k|}
ossl_bio_print_labeled_bignum:
  703|  8.06k|{
  704|  8.06k|    int ret = 0, use_sep = 0;
  705|  8.06k|    char *hex_str = NULL, *p;
  706|  8.06k|    const char spaces[] = "    ";
  707|  8.06k|    const char *post_label_spc = " ";
  708|       |
  709|  8.06k|    const char *neg = "";
  710|  8.06k|    int bytes;
  711|       |
  712|  8.06k|    if (bn == NULL)
  ------------------
  |  Branch (712:9): [True: 0, False: 8.06k]
  ------------------
  713|      0|        return 0;
  714|  8.06k|    if (label == NULL) {
  ------------------
  |  Branch (714:9): [True: 3.90k, False: 4.16k]
  ------------------
  715|  3.90k|        label = "";
  716|  3.90k|        post_label_spc = "";
  717|  3.90k|    }
  718|       |
  719|  8.06k|    if (BN_is_zero(bn))
  ------------------
  |  Branch (719:9): [True: 2.96k, False: 5.10k]
  ------------------
  720|  2.96k|        return BIO_printf(out, "%s%s0\n", label, post_label_spc);
  721|       |
  722|  5.10k|    if (BN_num_bytes(bn) <= BN_BYTES) {
  ------------------
  |  |  189|  5.10k|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
                  if (BN_num_bytes(bn) <= BN_BYTES) {
  ------------------
  |  |   38|  5.10k|#  define BN_BYTES        8
  ------------------
  |  Branch (722:9): [True: 3.41k, False: 1.69k]
  ------------------
  723|  3.41k|        BN_ULONG *words = bn_get_words(bn);
  ------------------
  |  |   37|  3.41k|#  define BN_ULONG        unsigned long
  ------------------
  724|       |
  725|  3.41k|        if (BN_is_negative(bn))
  ------------------
  |  Branch (725:13): [True: 8, False: 3.40k]
  ------------------
  726|      8|            neg = "-";
  727|       |
  728|  3.41k|        return BIO_printf(out, "%s%s%s" BN_FMTu " (%s0x" BN_FMTx ")\n",
  729|  3.41k|                          label, post_label_spc, neg, words[0], neg, words[0]);
  730|  3.41k|    }
  731|       |
  732|  1.69k|    hex_str = BN_bn2hex(bn);
  733|  1.69k|    if (hex_str == NULL)
  ------------------
  |  Branch (733:9): [True: 0, False: 1.69k]
  ------------------
  734|      0|        return 0;
  735|       |
  736|  1.69k|    p = hex_str;
  737|  1.69k|    if (*p == '-') {
  ------------------
  |  Branch (737:9): [True: 3, False: 1.69k]
  ------------------
  738|      3|        ++p;
  739|      3|        neg = " (Negative)";
  740|      3|    }
  741|  1.69k|    if (BIO_printf(out, "%s%s\n", label, neg) <= 0)
  ------------------
  |  Branch (741:9): [True: 0, False: 1.69k]
  ------------------
  742|      0|        goto err;
  743|       |
  744|       |    /* Keep track of how many bytes we have printed out so far */
  745|  1.69k|    bytes = 0;
  746|       |
  747|  1.69k|    if (BIO_printf(out, "%s", spaces) <= 0)
  ------------------
  |  Branch (747:9): [True: 0, False: 1.69k]
  ------------------
  748|      0|        goto err;
  749|       |
  750|       |    /* Add a leading 00 if the top bit is set */
  751|  1.69k|    if (*p >= '8') {
  ------------------
  |  Branch (751:9): [True: 554, False: 1.14k]
  ------------------
  752|    554|        if (BIO_printf(out, "%02x", 0) <= 0)
  ------------------
  |  Branch (752:13): [True: 0, False: 554]
  ------------------
  753|      0|            goto err;
  754|    554|        ++bytes;
  755|    554|        use_sep = 1;
  756|    554|    }
  757|   529k|    while (*p != '\0') {
  ------------------
  |  Branch (757:12): [True: 527k, False: 1.69k]
  ------------------
  758|       |        /* Do a newline after every 15 hex bytes + add the space indent */
  759|   527k|        if ((bytes % 15) == 0 && bytes > 0) {
  ------------------
  |  Branch (759:13): [True: 35.4k, False: 492k]
  |  Branch (759:34): [True: 34.3k, False: 1.14k]
  ------------------
  760|  34.3k|            if (BIO_printf(out, ":\n%s", spaces) <= 0)
  ------------------
  |  Branch (760:17): [True: 0, False: 34.3k]
  ------------------
  761|      0|                goto err;
  762|  34.3k|            use_sep = 0; /* The first byte on the next line doesn't have a : */
  763|  34.3k|        }
  764|   527k|        if (BIO_printf(out, "%s%c%c", use_sep ? ":" : "",
  ------------------
  |  Branch (764:13): [True: 0, False: 527k]
  |  Branch (764:39): [True: 492k, False: 35.4k]
  ------------------
  765|   527k|                       tolower((unsigned char)p[0]),
  766|   527k|                       tolower((unsigned char)p[1])) <= 0)
  767|      0|            goto err;
  768|   527k|        ++bytes;
  769|   527k|        p += 2;
  770|   527k|        use_sep = 1;
  771|   527k|    }
  772|  1.69k|    if (BIO_printf(out, "\n") <= 0)
  ------------------
  |  Branch (772:9): [True: 0, False: 1.69k]
  ------------------
  773|      0|        goto err;
  774|  1.69k|    ret = 1;
  775|  1.69k|err:
  776|  1.69k|    OPENSSL_free(hex_str);
  ------------------
  |  |  115|  1.69k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.69k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.69k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  777|  1.69k|    return ret;
  778|  1.69k|}
ossl_bio_print_labeled_buf:
  782|  1.13k|{
  783|  1.13k|    size_t i;
  784|       |
  785|  1.13k|    if (BIO_printf(out, "%s\n", label) <= 0)
  ------------------
  |  Branch (785:9): [True: 0, False: 1.13k]
  ------------------
  786|      0|        return 0;
  787|       |
  788|  42.8k|    for (i = 0; i < buflen; i++) {
  ------------------
  |  Branch (788:17): [True: 41.7k, False: 1.13k]
  ------------------
  789|  41.7k|        if ((i % LABELED_BUF_PRINT_WIDTH) == 0) {
  ------------------
  |  |   27|  41.7k|#define LABELED_BUF_PRINT_WIDTH    15
  ------------------
  |  Branch (789:13): [True: 3.23k, False: 38.5k]
  ------------------
  790|  3.23k|            if (i > 0 && BIO_printf(out, "\n") <= 0)
  ------------------
  |  Branch (790:17): [True: 2.09k, False: 1.13k]
  |  Branch (790:26): [True: 0, False: 2.09k]
  ------------------
  791|      0|                return 0;
  792|  3.23k|            if (BIO_printf(out, "    ") <= 0)
  ------------------
  |  Branch (792:17): [True: 0, False: 3.23k]
  ------------------
  793|      0|                return 0;
  794|  3.23k|        }
  795|       |
  796|  41.7k|        if (BIO_printf(out, "%02x%s", buf[i],
  ------------------
  |  Branch (796:13): [True: 0, False: 41.7k]
  ------------------
  797|  41.7k|                                 (i == buflen - 1) ? "" : ":") <= 0)
  ------------------
  |  Branch (797:34): [True: 1.13k, False: 40.6k]
  ------------------
  798|      0|            return 0;
  799|  41.7k|    }
  800|  1.13k|    if (BIO_printf(out, "\n") <= 0)
  ------------------
  |  Branch (800:9): [True: 0, False: 1.13k]
  ------------------
  801|      0|        return 0;
  802|       |
  803|  1.13k|    return 1;
  804|  1.13k|}
ossl_bio_print_ffc_params:
  808|    535|{
  809|    535|    if (ffc->nid != NID_undef) {
  ------------------
  |  |   18|    535|#define NID_undef                       0
  ------------------
  |  Branch (809:9): [True: 0, False: 535]
  ------------------
  810|      0|#ifndef OPENSSL_NO_DH
  811|      0|        const DH_NAMED_GROUP *group = ossl_ffc_uid_to_dh_named_group(ffc->nid);
  812|      0|        const char *name = ossl_ffc_named_group_get_name(group);
  813|       |
  814|      0|        if (name == NULL)
  ------------------
  |  Branch (814:13): [True: 0, False: 0]
  ------------------
  815|      0|            goto err;
  816|      0|        if (BIO_printf(out, "GROUP: %s\n", name) <= 0)
  ------------------
  |  Branch (816:13): [True: 0, False: 0]
  ------------------
  817|      0|            goto err;
  818|      0|        return 1;
  819|       |#else
  820|       |        /* How could this be? We should not have a nid in a no-dh build. */
  821|       |        goto err;
  822|       |#endif
  823|      0|    }
  824|       |
  825|    535|    if (!ossl_bio_print_labeled_bignum(out, "P:   ", ffc->p))
  ------------------
  |  Branch (825:9): [True: 0, False: 535]
  ------------------
  826|      0|        goto err;
  827|    535|    if (ffc->q != NULL) {
  ------------------
  |  Branch (827:9): [True: 535, False: 0]
  ------------------
  828|    535|        if (!ossl_bio_print_labeled_bignum(out, "Q:   ", ffc->q))
  ------------------
  |  Branch (828:13): [True: 0, False: 535]
  ------------------
  829|      0|            goto err;
  830|    535|    }
  831|    535|    if (!ossl_bio_print_labeled_bignum(out, "G:   ", ffc->g))
  ------------------
  |  Branch (831:9): [True: 0, False: 535]
  ------------------
  832|      0|        goto err;
  833|    535|    if (ffc->j != NULL) {
  ------------------
  |  Branch (833:9): [True: 15, False: 520]
  ------------------
  834|     15|        if (!ossl_bio_print_labeled_bignum(out, "J:   ", ffc->j))
  ------------------
  |  Branch (834:13): [True: 0, False: 15]
  ------------------
  835|      0|            goto err;
  836|     15|    }
  837|    535|    if (ffc->seed != NULL) {
  ------------------
  |  Branch (837:9): [True: 0, False: 535]
  ------------------
  838|      0|        if (!ossl_bio_print_labeled_buf(out, "SEED:", ffc->seed, ffc->seedlen))
  ------------------
  |  Branch (838:13): [True: 0, False: 0]
  ------------------
  839|      0|            goto err;
  840|      0|    }
  841|    535|    if (ffc->gindex != -1) {
  ------------------
  |  Branch (841:9): [True: 0, False: 535]
  ------------------
  842|      0|        if (BIO_printf(out, "gindex: %d\n", ffc->gindex) <= 0)
  ------------------
  |  Branch (842:13): [True: 0, False: 0]
  ------------------
  843|      0|            goto err;
  844|      0|    }
  845|    535|    if (ffc->pcounter != -1) {
  ------------------
  |  Branch (845:9): [True: 0, False: 535]
  ------------------
  846|      0|        if (BIO_printf(out, "pcounter: %d\n", ffc->pcounter) <= 0)
  ------------------
  |  Branch (846:13): [True: 0, False: 0]
  ------------------
  847|      0|            goto err;
  848|      0|    }
  849|    535|    if (ffc->h != 0) {
  ------------------
  |  Branch (849:9): [True: 0, False: 535]
  ------------------
  850|      0|        if (BIO_printf(out, "h: %d\n", ffc->h) <= 0)
  ------------------
  |  Branch (850:13): [True: 0, False: 0]
  ------------------
  851|      0|            goto err;
  852|      0|    }
  853|    535|    return 1;
  854|      0|err:
  855|      0|    return 0;
  856|    535|}
encoder_lib.c:ossl_encoder_instance_new:
  212|  33.6k|{
  213|  33.6k|    OSSL_ENCODER_INSTANCE *encoder_inst = NULL;
  214|  33.6k|    const OSSL_PROVIDER *prov;
  215|  33.6k|    OSSL_LIB_CTX *libctx;
  216|  33.6k|    const OSSL_PROPERTY_LIST *props;
  217|  33.6k|    const OSSL_PROPERTY_DEFINITION *prop;
  218|       |
  219|  33.6k|    if (!ossl_assert(encoder != NULL)) {
  ------------------
  |  |   52|  33.6k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  33.6k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (219:9): [True: 0, False: 33.6k]
  ------------------
  220|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  221|      0|        return 0;
  222|      0|    }
  223|       |
  224|  33.6k|    if ((encoder_inst = OPENSSL_zalloc(sizeof(*encoder_inst))) == NULL)
  ------------------
  |  |  104|  33.6k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  33.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  33.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (224:9): [True: 0, False: 33.6k]
  ------------------
  225|      0|        return 0;
  226|       |
  227|  33.6k|    if (!OSSL_ENCODER_up_ref(encoder)) {
  ------------------
  |  Branch (227:9): [True: 0, False: 33.6k]
  ------------------
  228|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  229|      0|        goto err;
  230|      0|    }
  231|       |
  232|  33.6k|    prov = OSSL_ENCODER_get0_provider(encoder);
  233|  33.6k|    libctx = ossl_provider_libctx(prov);
  234|  33.6k|    props = ossl_encoder_parsed_properties(encoder);
  235|  33.6k|    if (props == NULL) {
  ------------------
  |  Branch (235:9): [True: 0, False: 33.6k]
  ------------------
  236|      0|        ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  121|      0|# define ERR_LIB_OSSL_DECODER    60
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  365|      0|# define ERR_R_INVALID_PROPERTY_DEFINITION       (270|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  237|      0|                       "there are no property definitions with encoder %s",
  238|      0|                       OSSL_ENCODER_get0_name(encoder));
  239|      0|        goto err;
  240|      0|    }
  241|       |
  242|       |    /* The "output" property is mandatory */
  243|  33.6k|    prop = ossl_property_find_property(props, libctx, "output");
  244|  33.6k|    encoder_inst->output_type = ossl_property_get_string_value(libctx, prop);
  245|  33.6k|    if (encoder_inst->output_type == NULL) {
  ------------------
  |  Branch (245:9): [True: 0, False: 33.6k]
  ------------------
  246|      0|        ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  121|      0|# define ERR_LIB_OSSL_DECODER    60
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  365|      0|# define ERR_R_INVALID_PROPERTY_DEFINITION       (270|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  247|      0|                       "the mandatory 'output' property is missing "
  248|      0|                       "for encoder %s (properties: %s)",
  249|      0|                       OSSL_ENCODER_get0_name(encoder),
  250|      0|                       OSSL_ENCODER_get0_properties(encoder));
  251|      0|        goto err;
  252|      0|    }
  253|       |
  254|       |    /* The "structure" property is optional */
  255|  33.6k|    prop = ossl_property_find_property(props, libctx, "structure");
  256|  33.6k|    if (prop != NULL)
  ------------------
  |  Branch (256:9): [True: 28.0k, False: 5.67k]
  ------------------
  257|  28.0k|        encoder_inst->output_structure
  258|  28.0k|            = ossl_property_get_string_value(libctx, prop);
  259|       |
  260|  33.6k|    encoder_inst->encoder = encoder;
  261|  33.6k|    encoder_inst->encoderctx = encoderctx;
  262|  33.6k|    return encoder_inst;
  263|      0| err:
  264|      0|    ossl_encoder_instance_free(encoder_inst);
  265|      0|    return NULL;
  266|  33.6k|}
encoder_lib.c:ossl_encoder_ctx_add_encoder_inst:
  282|  33.6k|{
  283|  33.6k|    int ok;
  284|       |
  285|  33.6k|    if (ctx->encoder_insts == NULL
  ------------------
  |  Branch (285:9): [True: 3.05k, False: 30.6k]
  ------------------
  286|  33.6k|        && (ctx->encoder_insts =
  ------------------
  |  Branch (286:12): [True: 0, False: 3.05k]
  ------------------
  287|  3.05k|            sk_OSSL_ENCODER_INSTANCE_new_null()) == NULL) {
  288|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  289|      0|        return 0;
  290|      0|    }
  291|       |
  292|  33.6k|    ok = (sk_OSSL_ENCODER_INSTANCE_push(ctx->encoder_insts, ei) > 0);
  293|  33.6k|    if (ok) {
  ------------------
  |  Branch (293:9): [True: 33.6k, False: 0]
  ------------------
  294|  33.6k|        OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  220|  33.6k|    do {                                        \
  |  |  221|  33.6k|        BIO *trc_out = NULL;                    \
  |  |  222|  33.6k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  295|      0|            BIO_printf(trc_out,
  296|      0|                       "(ctx %p) Added encoder instance %p (encoder %p):\n"
  297|      0|                       "    %s with %s\n",
  298|      0|                       (void *)ctx, (void *)ei, (void *)ei->encoder,
  299|      0|                       OSSL_ENCODER_get0_name(ei->encoder),
  300|      0|                       OSSL_ENCODER_get0_properties(ei->encoder));
  301|  33.6k|        } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  225|  33.6k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  302|  33.6k|    }
  303|  33.6k|    return ok;
  304|  33.6k|}
encoder_lib.c:encoder_process:
  418|  6.08k|{
  419|  6.08k|    OSSL_ENCODER_INSTANCE *current_encoder_inst = NULL;
  420|  6.08k|    OSSL_ENCODER *current_encoder = NULL;
  421|  6.08k|    OSSL_ENCODER_CTX *current_encoder_ctx = NULL;
  422|  6.08k|    BIO *allocated_out = NULL;
  423|  6.08k|    const void *original_data = NULL;
  424|  6.08k|    OSSL_PARAM abstract[10];
  425|  6.08k|    const OSSL_PARAM *current_abstract = NULL;
  426|  6.08k|    int i;
  427|  6.08k|    int ok = -1;  /* -1 signifies that the lookup loop gave nothing */
  428|  6.08k|    int top = 0;
  429|       |
  430|  6.08k|    if (data->next_encoder_inst == NULL) {
  ------------------
  |  Branch (430:9): [True: 3.05k, False: 3.03k]
  ------------------
  431|       |        /* First iteration, where we prepare for what is to come */
  432|       |
  433|  3.05k|        data->count_output_structure =
  434|  3.05k|            data->ctx->output_structure == NULL ? -1 : 0;
  ------------------
  |  Branch (434:13): [True: 1.40k, False: 1.64k]
  ------------------
  435|  3.05k|        top = 1;
  436|  3.05k|    }
  437|       |
  438|  36.7k|    for (i = data->current_encoder_inst_index; i-- > 0;) {
  ------------------
  |  Branch (438:48): [True: 33.6k, False: 3.05k]
  ------------------
  439|  33.6k|        OSSL_ENCODER *next_encoder = NULL;
  440|  33.6k|        const char *current_output_type;
  441|  33.6k|        const char *current_output_structure;
  442|  33.6k|        struct encoder_process_data_st new_data;
  443|       |
  444|  33.6k|        if (!top)
  ------------------
  |  Branch (444:13): [True: 2.51k, False: 31.1k]
  ------------------
  445|  2.51k|            next_encoder =
  446|  2.51k|                OSSL_ENCODER_INSTANCE_get_encoder(data->next_encoder_inst);
  447|       |
  448|  33.6k|        current_encoder_inst =
  449|  33.6k|            sk_OSSL_ENCODER_INSTANCE_value(data->ctx->encoder_insts, i);
  450|  33.6k|        current_encoder =
  451|  33.6k|            OSSL_ENCODER_INSTANCE_get_encoder(current_encoder_inst);
  452|  33.6k|        current_encoder_ctx =
  453|  33.6k|            OSSL_ENCODER_INSTANCE_get_encoder_ctx(current_encoder_inst);
  454|  33.6k|        current_output_type =
  455|  33.6k|            OSSL_ENCODER_INSTANCE_get_output_type(current_encoder_inst);
  456|  33.6k|        current_output_structure =
  457|  33.6k|            OSSL_ENCODER_INSTANCE_get_output_structure(current_encoder_inst);
  458|  33.6k|        memset(&new_data, 0, sizeof(new_data));
  459|  33.6k|        new_data.ctx = data->ctx;
  460|  33.6k|        new_data.current_encoder_inst_index = i;
  461|  33.6k|        new_data.next_encoder_inst = current_encoder_inst;
  462|  33.6k|        new_data.count_output_structure = data->count_output_structure;
  463|  33.6k|        new_data.level = data->level + 1;
  464|       |
  465|  33.6k|        OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  220|  33.6k|    do {                                        \
  |  |  221|  33.6k|        BIO *trc_out = NULL;                    \
  |  |  222|  33.6k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  466|      0|            BIO_printf(trc_out,
  467|      0|                       "[%d] (ctx %p) Considering encoder instance %p (encoder %p)\n",
  468|      0|                       data->level, (void *)data->ctx,
  469|      0|                       (void *)current_encoder_inst, (void *)current_encoder);
  470|  33.6k|        } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  225|  33.6k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  471|       |
  472|       |        /*
  473|       |         * If this is the top call, we check if the output type of the current
  474|       |         * encoder matches the desired output type.
  475|       |         * If this isn't the top call, i.e. this is deeper in the recursion,
  476|       |         * we instead check if the output type of the current encoder matches
  477|       |         * the name of the next encoder (the one found by the parent call).
  478|       |         */
  479|  33.6k|        if (top) {
  ------------------
  |  Branch (479:13): [True: 31.1k, False: 2.51k]
  ------------------
  480|  31.1k|            if (data->ctx->output_type != NULL
  ------------------
  |  Branch (480:17): [True: 31.1k, False: 0]
  ------------------
  481|  31.1k|                && OPENSSL_strcasecmp(current_output_type,
  ------------------
  |  Branch (481:20): [True: 22.6k, False: 8.52k]
  ------------------
  482|  31.1k|                                      data->ctx->output_type) != 0) {
  483|  22.6k|                OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  220|  22.6k|    do {                                        \
  |  |  221|  22.6k|        BIO *trc_out = NULL;                    \
  |  |  222|  22.6k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  484|      0|                    BIO_printf(trc_out,
  485|      0|                               "[%d]    Skipping because current encoder output type (%s) != desired output type (%s)\n",
  486|      0|                               data->level,
  487|      0|                               current_output_type, data->ctx->output_type);
  488|  22.6k|                } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  225|  22.6k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|  22.6k|                continue;
  490|  22.6k|            }
  491|  31.1k|        } else {
  492|  2.51k|            if (!OSSL_ENCODER_is_a(next_encoder, current_output_type)) {
  ------------------
  |  Branch (492:17): [True: 2.51k, False: 0]
  ------------------
  493|  2.51k|                OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  220|  2.51k|    do {                                        \
  |  |  221|  2.51k|        BIO *trc_out = NULL;                    \
  |  |  222|  2.51k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  494|      0|                    BIO_printf(trc_out,
  495|      0|                               "[%d]    Skipping because current encoder output type (%s) != name of encoder %p\n",
  496|      0|                               data->level,
  497|      0|                               current_output_type, (void *)next_encoder);
  498|  2.51k|                } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  225|  2.51k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  499|  2.51k|                continue;
  500|  2.51k|            }
  501|  2.51k|        }
  502|       |
  503|       |        /*
  504|       |         * If the caller and the current encoder specify an output structure,
  505|       |         * Check if they match.  If they do, count the match, otherwise skip
  506|       |         * the current encoder.
  507|       |         */
  508|  8.52k|        if (data->ctx->output_structure != NULL
  ------------------
  |  Branch (508:13): [True: 7.11k, False: 1.40k]
  ------------------
  509|  8.52k|            && current_output_structure != NULL) {
  ------------------
  |  Branch (509:16): [True: 7.11k, False: 0]
  ------------------
  510|  7.11k|            if (OPENSSL_strcasecmp(data->ctx->output_structure,
  ------------------
  |  Branch (510:17): [True: 5.49k, False: 1.62k]
  ------------------
  511|  7.11k|                                   current_output_structure) != 0) {
  512|  5.49k|                OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  220|  5.49k|    do {                                        \
  |  |  221|  5.49k|        BIO *trc_out = NULL;                    \
  |  |  222|  5.49k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  513|      0|                    BIO_printf(trc_out,
  514|      0|                               "[%d]    Skipping because current encoder output structure (%s) != ctx output structure (%s)\n",
  515|      0|                               data->level,
  516|      0|                               current_output_structure,
  517|      0|                               data->ctx->output_structure);
  518|  5.49k|                } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  225|  5.49k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  519|  5.49k|                continue;
  520|  5.49k|            }
  521|       |
  522|  1.62k|            data->count_output_structure++;
  523|  1.62k|        }
  524|       |
  525|       |        /*
  526|       |         * Recurse to process the encoder implementations before the current
  527|       |         * one.
  528|       |         */
  529|  3.03k|        ok = encoder_process(&new_data);
  530|       |
  531|  3.03k|        data->prev_encoder_inst = new_data.prev_encoder_inst;
  532|  3.03k|        data->running_output = new_data.running_output;
  533|  3.03k|        data->running_output_length = new_data.running_output_length;
  534|       |
  535|       |        /*
  536|       |         * ok == -1     means that the recursion call above gave no further
  537|       |         *              encoders, and that the one we're currently at should
  538|       |         *              be tried.
  539|       |         * ok == 0      means that something failed in the recursion call
  540|       |         *              above, making the result unsuitable for a chain.
  541|       |         *              In this case, we simply continue to try finding a
  542|       |         *              suitable encoder at this recursion level.
  543|       |         * ok == 1      means that the recursion call was successful, and we
  544|       |         *              try to use the result at this recursion level.
  545|       |         */
  546|  3.03k|        if (ok != 0)
  ------------------
  |  Branch (546:13): [True: 3.03k, False: 0]
  ------------------
  547|  3.03k|            break;
  548|       |
  549|      0|        OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  220|      0|    do {                                        \
  |  |  221|      0|        BIO *trc_out = NULL;                    \
  |  |  222|      0|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  550|      0|            BIO_printf(trc_out,
  551|      0|                       "[%d]    Skipping because recursion level %d failed\n",
  552|      0|                       data->level, new_data.level);
  553|      0|        } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  225|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  554|      0|    }
  555|       |
  556|       |    /*
  557|       |     * If |i < 0|, we didn't find any useful encoder in this recursion, so
  558|       |     * we do the rest of the process only if |i >= 0|.
  559|       |     */
  560|  6.08k|    if (i < 0) {
  ------------------
  |  Branch (560:9): [True: 3.05k, False: 3.03k]
  ------------------
  561|  3.05k|        ok = -1;
  562|       |
  563|  3.05k|        OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  220|  3.05k|    do {                                        \
  |  |  221|  3.05k|        BIO *trc_out = NULL;                    \
  |  |  222|  3.05k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  564|      0|            BIO_printf(trc_out,
  565|      0|                       "[%d] (ctx %p) No suitable encoder found\n",
  566|      0|                       data->level, (void *)data->ctx);
  567|  3.05k|        } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  225|  3.05k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  568|  3.05k|    } else {
  569|       |        /* Preparations */
  570|       |
  571|  3.03k|        switch (ok) {
  ------------------
  |  Branch (571:17): [True: 0, False: 3.03k]
  ------------------
  572|      0|        case 0:
  ------------------
  |  Branch (572:9): [True: 0, False: 3.03k]
  ------------------
  573|      0|            break;
  574|  3.03k|        case -1:
  ------------------
  |  Branch (574:9): [True: 3.03k, False: 0]
  ------------------
  575|       |            /*
  576|       |             * We have reached the beginning of the encoder instance sequence,
  577|       |             * so we prepare the object to be encoded.
  578|       |             */
  579|       |
  580|       |            /*
  581|       |             * |data->count_output_structure| is one of these values:
  582|       |             *
  583|       |             * -1       There is no desired output structure
  584|       |             *  0       There is a desired output structure, and it wasn't
  585|       |             *          matched by any of the encoder instances that were
  586|       |             *          considered
  587|       |             * >0       There is a desired output structure, and at least one
  588|       |             *          of the encoder instances matched it
  589|       |             */
  590|  3.03k|            if (data->count_output_structure == 0)
  ------------------
  |  Branch (590:17): [True: 0, False: 3.03k]
  ------------------
  591|      0|                return 0;
  592|       |
  593|  3.03k|            original_data =
  594|  3.03k|                data->ctx->construct(current_encoder_inst,
  595|  3.03k|                                     data->ctx->construct_data);
  596|       |
  597|       |            /* Also set the data type, using the encoder implementation name */
  598|  3.03k|            data->data_type = OSSL_ENCODER_get0_name(current_encoder);
  599|       |
  600|       |            /* Assume that the constructor recorded an error */
  601|  3.03k|            if (original_data != NULL)
  ------------------
  |  Branch (601:17): [True: 3.03k, False: 0]
  ------------------
  602|  3.03k|                ok = 1;
  603|      0|            else
  604|      0|                ok = 0;
  605|  3.03k|            break;
  606|      0|        case 1:
  ------------------
  |  Branch (606:9): [True: 0, False: 3.03k]
  ------------------
  607|      0|            if (!ossl_assert(data->running_output != NULL)) {
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (607:17): [True: 0, False: 0]
  ------------------
  608|      0|                ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  609|      0|                ok = 0;
  610|      0|                break;
  611|      0|            }
  612|       |
  613|      0|            {
  614|       |                /*
  615|       |                 * Create an object abstraction from the latest output, which
  616|       |                 * was stolen from the previous round.
  617|       |                 */
  618|       |
  619|      0|                OSSL_PARAM *abstract_p = abstract;
  620|      0|                const char *prev_output_structure =
  621|      0|                    OSSL_ENCODER_INSTANCE_get_output_structure(data->prev_encoder_inst);
  622|       |
  623|      0|                *abstract_p++ =
  624|      0|                    OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_TYPE,
  ------------------
  |  |  352|      0|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  625|      0|                                                     (char *)data->data_type, 0);
  626|      0|                if (prev_output_structure != NULL)
  ------------------
  |  Branch (626:21): [True: 0, False: 0]
  ------------------
  627|      0|                    *abstract_p++ =
  628|      0|                        OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_STRUCTURE,
  ------------------
  |  |  351|      0|# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure"
  ------------------
  629|      0|                                                         (char *)prev_output_structure,
  630|      0|                                                         0);
  631|      0|                *abstract_p++ =
  632|      0|                    OSSL_PARAM_construct_octet_string(OSSL_OBJECT_PARAM_DATA,
  ------------------
  |  |  350|      0|# define OSSL_OBJECT_PARAM_DATA "data"
  ------------------
  633|      0|                                                      data->running_output,
  634|      0|                                                      data->running_output_length);
  635|      0|                *abstract_p = OSSL_PARAM_construct_end();
  636|      0|                current_abstract = abstract;
  637|      0|            }
  638|      0|            break;
  639|  3.03k|        }
  640|       |
  641|       |        /* Calling the encoder implementation */
  642|       |
  643|  3.03k|        if (ok) {
  ------------------
  |  Branch (643:13): [True: 3.03k, False: 0]
  ------------------
  644|  3.03k|            OSSL_CORE_BIO *cbio = NULL;
  645|  3.03k|            BIO *current_out = NULL;
  646|       |
  647|       |            /*
  648|       |             * If we're at the last encoder instance to use, we're setting up
  649|       |             * final output.  Otherwise, set up an intermediary memory output.
  650|       |             */
  651|  3.03k|            if (top)
  ------------------
  |  Branch (651:17): [True: 3.03k, False: 0]
  ------------------
  652|  3.03k|                current_out = data->bio;
  653|      0|            else if ((current_out = allocated_out = BIO_new(BIO_s_mem()))
  ------------------
  |  Branch (653:22): [True: 0, False: 0]
  ------------------
  654|      0|                     == NULL)
  655|      0|                ok = 0;     /* Assume BIO_new() recorded an error */
  656|       |
  657|  3.03k|            if (ok)
  ------------------
  |  Branch (657:17): [True: 3.03k, False: 0]
  ------------------
  658|  3.03k|                ok = (cbio = ossl_core_bio_new_from_bio(current_out)) != NULL;
  659|  3.03k|            if (ok) {
  ------------------
  |  Branch (659:17): [True: 3.03k, False: 0]
  ------------------
  660|  3.03k|                ok = current_encoder->encode(current_encoder_ctx, cbio,
  661|  3.03k|                                             original_data, current_abstract,
  662|  3.03k|                                             data->ctx->selection,
  663|  3.03k|                                             ossl_pw_passphrase_callback_enc,
  664|  3.03k|                                             &data->ctx->pwdata);
  665|  3.03k|                OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  220|  3.03k|    do {                                        \
  |  |  221|  3.03k|        BIO *trc_out = NULL;                    \
  |  |  222|  3.03k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  666|      0|                    BIO_printf(trc_out,
  667|      0|                               "[%d] (ctx %p) Running encoder instance %p => %d\n",
  668|      0|                               data->level, (void *)data->ctx,
  669|      0|                               (void *)current_encoder_inst, ok);
  670|  3.03k|                } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  225|  3.03k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  671|  3.03k|            }
  672|       |
  673|  3.03k|            ossl_core_bio_free(cbio);
  674|  3.03k|            data->prev_encoder_inst = current_encoder_inst;
  675|  3.03k|        }
  676|  3.03k|    }
  677|       |
  678|       |    /* Cleanup and collecting the result */
  679|       |
  680|  6.08k|    OPENSSL_free(data->running_output);
  ------------------
  |  |  115|  6.08k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  6.08k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  6.08k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  681|  6.08k|    data->running_output = NULL;
  682|       |
  683|       |    /*
  684|       |     * Steal the output from the BIO_s_mem, if we did allocate one.
  685|       |     * That'll be the data for an object abstraction in the next round.
  686|       |     */
  687|  6.08k|    if (allocated_out != NULL) {
  ------------------
  |  Branch (687:9): [True: 0, False: 6.08k]
  ------------------
  688|      0|        BUF_MEM *buf;
  689|       |
  690|      0|        BIO_get_mem_ptr(allocated_out, &buf);
  ------------------
  |  |  614|      0|# define BIO_get_mem_ptr(b,pp)   BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0, \
  |  |  ------------------
  |  |  |  |  446|      0|# define BIO_C_GET_BUF_MEM_PTR                   115
  |  |  ------------------
  |  |  615|      0|                                          (char *)(pp))
  ------------------
  691|      0|        data->running_output = (unsigned char *)buf->data;
  692|      0|        data->running_output_length = buf->length;
  693|      0|        memset(buf, 0, sizeof(*buf));
  694|      0|    }
  695|       |
  696|  6.08k|    BIO_free(allocated_out);
  697|  6.08k|    if (original_data != NULL)
  ------------------
  |  Branch (697:9): [True: 3.03k, False: 3.05k]
  ------------------
  698|  3.03k|        data->ctx->cleanup(data->ctx->construct_data);
  699|  6.08k|    return ok;
  700|  6.08k|}

OSSL_ENCODER_up_ref:
   53|  33.9k|{
   54|  33.9k|    int ref = 0;
   55|       |
   56|  33.9k|    CRYPTO_UP_REF(&encoder->base.refcnt, &ref);
   57|  33.9k|    return 1;
   58|  33.9k|}
OSSL_ENCODER_free:
   61|  34.1k|{
   62|  34.1k|    int ref = 0;
   63|       |
   64|  34.1k|    if (encoder == NULL)
  ------------------
  |  Branch (64:9): [True: 0, False: 34.1k]
  ------------------
   65|      0|        return;
   66|       |
   67|  34.1k|    CRYPTO_DOWN_REF(&encoder->base.refcnt, &ref);
   68|  34.1k|    if (ref > 0)
  ------------------
  |  Branch (68:9): [True: 33.9k, False: 241]
  ------------------
   69|  33.9k|        return;
   70|    241|    OPENSSL_free(encoder->base.name);
  ------------------
  |  |  115|    241|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    241|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    241|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   71|    241|    ossl_property_free(encoder->base.parsed_propdef);
   72|    241|    ossl_provider_free(encoder->base.prov);
   73|    241|    CRYPTO_FREE_REF(&encoder->base.refcnt);
   74|    241|    OPENSSL_free(encoder);
  ------------------
  |  |  115|    241|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    241|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    241|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   75|    241|}
ossl_encoder_store_cache_flush:
  451|      2|{
  452|      2|    OSSL_METHOD_STORE *store = get_encoder_store(libctx);
  453|       |
  454|      2|    if (store != NULL)
  ------------------
  |  Branch (454:9): [True: 2, False: 0]
  ------------------
  455|      2|        return ossl_method_store_cache_flush_all(store);
  456|      0|    return 1;
  457|      2|}
OSSL_ENCODER_get0_provider:
  474|  1.54M|{
  475|  1.54M|    if (!ossl_assert(encoder != NULL)) {
  ------------------
  |  |   52|  1.54M|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  1.54M|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (475:9): [True: 0, False: 1.54M]
  ------------------
  476|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  477|      0|        return 0;
  478|      0|    }
  479|       |
  480|  1.54M|    return encoder->base.prov;
  481|  1.54M|}
ossl_encoder_parsed_properties:
  495|  33.6k|{
  496|  33.6k|    if (!ossl_assert(encoder != NULL)) {
  ------------------
  |  |   52|  33.6k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  33.6k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (496:9): [True: 0, False: 33.6k]
  ------------------
  497|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  498|      0|        return 0;
  499|      0|    }
  500|       |
  501|  33.6k|    return encoder->base.parsed_propdef;
  502|  33.6k|}
OSSL_ENCODER_get0_name:
  515|  3.03k|{
  516|  3.03k|    return encoder->base.name;
  517|  3.03k|}
OSSL_ENCODER_is_a:
  525|  2.51k|{
  526|  2.51k|    if (encoder->base.prov != NULL) {
  ------------------
  |  Branch (526:9): [True: 2.51k, False: 0]
  ------------------
  527|  2.51k|        OSSL_LIB_CTX *libctx = ossl_provider_libctx(encoder->base.prov);
  528|  2.51k|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  529|       |
  530|  2.51k|        return ossl_namemap_name2num(namemap, name) == encoder->base.id;
  531|  2.51k|    }
  532|      0|    return 0;
  533|  2.51k|}
OSSL_ENCODER_do_all_provided:
  551|  6.10k|{
  552|  6.10k|    struct encoder_data_st methdata;
  553|  6.10k|    struct do_one_data_st data;
  554|       |
  555|  6.10k|    methdata.libctx = libctx;
  556|  6.10k|    methdata.tmp_store = NULL;
  557|  6.10k|    (void)inner_ossl_encoder_fetch(&methdata, NULL, NULL /* properties */);
  558|       |
  559|  6.10k|    data.user_fn = user_fn;
  560|  6.10k|    data.user_arg = user_arg;
  561|  6.10k|    if (methdata.tmp_store != NULL)
  ------------------
  |  Branch (561:9): [True: 0, False: 6.10k]
  ------------------
  562|      0|        ossl_method_store_do_all(methdata.tmp_store, &do_one, &data);
  563|  6.10k|    ossl_method_store_do_all(get_encoder_store(libctx), &do_one, &data);
  564|  6.10k|    dealloc_tmp_encoder_store(methdata.tmp_store);
  565|  6.10k|}
OSSL_ENCODER_CTX_new:
  617|  3.43k|{
  618|  3.43k|    OSSL_ENCODER_CTX *ctx;
  619|       |
  620|  3.43k|    ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|  3.43k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.43k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.43k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  621|  3.43k|    return ctx;
  622|  3.43k|}
OSSL_ENCODER_CTX_set_params:
  626|  3.43k|{
  627|  3.43k|    int ok = 1;
  628|  3.43k|    size_t i;
  629|  3.43k|    size_t l;
  630|       |
  631|  3.43k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  3.43k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.43k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (631:9): [True: 0, False: 3.43k]
  ------------------
  632|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  633|      0|        return 0;
  634|      0|    }
  635|       |
  636|  3.43k|    if (ctx->encoder_insts == NULL)
  ------------------
  |  Branch (636:9): [True: 379, False: 3.05k]
  ------------------
  637|    379|        return 1;
  638|       |
  639|  3.05k|    l = OSSL_ENCODER_CTX_get_num_encoders(ctx);
  640|  36.7k|    for (i = 0; i < l; i++) {
  ------------------
  |  Branch (640:17): [True: 33.6k, False: 3.05k]
  ------------------
  641|  33.6k|        OSSL_ENCODER_INSTANCE *encoder_inst =
  642|  33.6k|            sk_OSSL_ENCODER_INSTANCE_value(ctx->encoder_insts, i);
  643|  33.6k|        OSSL_ENCODER *encoder = OSSL_ENCODER_INSTANCE_get_encoder(encoder_inst);
  644|  33.6k|        void *encoderctx = OSSL_ENCODER_INSTANCE_get_encoder_ctx(encoder_inst);
  645|       |
  646|  33.6k|        if (encoderctx == NULL || encoder->set_ctx_params == NULL)
  ------------------
  |  Branch (646:13): [True: 0, False: 33.6k]
  |  Branch (646:35): [True: 4.36k, False: 29.3k]
  ------------------
  647|  4.36k|            continue;
  648|  29.3k|        if (!encoder->set_ctx_params(encoderctx, params))
  ------------------
  |  Branch (648:13): [True: 0, False: 29.3k]
  ------------------
  649|      0|            ok = 0;
  650|  29.3k|    }
  651|  3.05k|    return ok;
  652|  3.43k|}
OSSL_ENCODER_CTX_free:
  655|  3.43k|{
  656|  3.43k|    if (ctx != NULL) {
  ------------------
  |  Branch (656:9): [True: 3.43k, False: 4]
  ------------------
  657|  3.43k|        sk_OSSL_ENCODER_INSTANCE_pop_free(ctx->encoder_insts,
  658|  3.43k|                                          ossl_encoder_instance_free);
  659|  3.43k|        OPENSSL_free(ctx->construct_data);
  ------------------
  |  |  115|  3.43k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.43k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.43k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  660|  3.43k|        ossl_pw_clear_passphrase_data(&ctx->pwdata);
  661|  3.43k|        OPENSSL_free(ctx);
  ------------------
  |  |  115|  3.43k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.43k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.43k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  662|  3.43k|    }
  663|  3.43k|}
encoder_meth.c:inner_ossl_encoder_fetch:
  363|  6.10k|{
  364|  6.10k|    OSSL_METHOD_STORE *store = get_encoder_store(methdata->libctx);
  365|  6.10k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  366|  6.10k|    const char *const propq = properties != NULL ? properties : "";
  ------------------
  |  Branch (366:31): [True: 0, False: 6.10k]
  ------------------
  367|  6.10k|    void *method = NULL;
  368|  6.10k|    int unsupported, id;
  369|       |
  370|  6.10k|    if (store == NULL || namemap == NULL) {
  ------------------
  |  Branch (370:9): [True: 0, False: 6.10k]
  |  Branch (370:26): [True: 0, False: 6.10k]
  ------------------
  371|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  372|      0|        return NULL;
  373|      0|    }
  374|       |
  375|  6.10k|    id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
  ------------------
  |  Branch (375:10): [True: 0, False: 6.10k]
  ------------------
  376|       |
  377|       |    /*
  378|       |     * If we haven't found the name yet, chances are that the algorithm to
  379|       |     * be fetched is unsupported.
  380|       |     */
  381|  6.10k|    unsupported = id == 0;
  382|       |
  383|  6.10k|    if (id == 0
  ------------------
  |  Branch (383:9): [True: 6.10k, False: 0]
  ------------------
  384|  6.10k|        || !ossl_method_store_cache_get(store, NULL, id, propq, &method)) {
  ------------------
  |  Branch (384:12): [True: 0, False: 0]
  ------------------
  385|  6.10k|        OSSL_METHOD_CONSTRUCT_METHOD mcm = {
  386|  6.10k|            get_tmp_encoder_store,
  387|  6.10k|            reserve_encoder_store,
  388|  6.10k|            unreserve_encoder_store,
  389|  6.10k|            get_encoder_from_store,
  390|  6.10k|            put_encoder_in_store,
  391|  6.10k|            construct_encoder,
  392|  6.10k|            destruct_encoder
  393|  6.10k|        };
  394|  6.10k|        OSSL_PROVIDER *prov = NULL;
  395|       |
  396|  6.10k|        methdata->id = id;
  397|  6.10k|        methdata->names = name;
  398|  6.10k|        methdata->propquery = propq;
  399|  6.10k|        methdata->flag_construct_error_occurred = 0;
  400|  6.10k|        if ((method = ossl_method_construct(methdata->libctx, OSSL_OP_ENCODER,
  ------------------
  |  |  322|  6.10k|# define OSSL_OP_ENCODER                            20
  ------------------
  |  Branch (400:13): [True: 0, False: 6.10k]
  ------------------
  401|  6.10k|                                            &prov, 0 /* !force_cache */,
  402|  6.10k|                                            &mcm, methdata)) != NULL) {
  403|       |            /*
  404|       |             * If construction did create a method for us, we know that
  405|       |             * there is a correct name_id and meth_id, since those have
  406|       |             * already been calculated in get_encoder_from_store() and
  407|       |             * put_encoder_in_store() above.
  408|       |             */
  409|      0|            if (id == 0)
  ------------------
  |  Branch (409:17): [True: 0, False: 0]
  ------------------
  410|      0|                id = ossl_namemap_name2num(namemap, name);
  411|      0|            ossl_method_store_cache_set(store, prov, id, propq, method,
  412|      0|                                        up_ref_encoder, free_encoder);
  413|      0|        }
  414|       |
  415|       |        /*
  416|       |         * If we never were in the constructor, the algorithm to be fetched
  417|       |         * is unsupported.
  418|       |         */
  419|  6.10k|        unsupported = !methdata->flag_construct_error_occurred;
  420|  6.10k|    }
  421|       |
  422|  6.10k|    if ((id != 0 || name != NULL) && method == NULL) {
  ------------------
  |  Branch (422:10): [True: 0, False: 6.10k]
  |  Branch (422:21): [True: 0, False: 6.10k]
  |  Branch (422:38): [True: 0, False: 0]
  ------------------
  423|      0|        int code = unsupported ? ERR_R_UNSUPPORTED : ERR_R_FETCH_FAILED;
  ------------------
  |  |  363|      0|# define ERR_R_UNSUPPORTED                       (268|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      int code = unsupported ? ERR_R_UNSUPPORTED : ERR_R_FETCH_FAILED;
  ------------------
  |  |  364|      0|# define ERR_R_FETCH_FAILED                      (269|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (423:20): [True: 0, False: 0]
  ------------------
  424|       |
  425|      0|        if (name == NULL)
  ------------------
  |  Branch (425:13): [True: 0, False: 0]
  ------------------
  426|      0|            name = ossl_namemap_num2name(namemap, id, 0);
  427|      0|        ERR_raise_data(ERR_LIB_OSSL_ENCODER, code,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_ENCODER, code,
  ------------------
  |  |  120|      0|# define ERR_LIB_OSSL_ENCODER    59
  ------------------
  428|      0|                       "%s, Name (%s : %d), Properties (%s)",
  429|      0|                       ossl_lib_ctx_get_descriptor(methdata->libctx),
  430|      0|                       name == NULL ? "<null>" : name, id,
  ------------------
  |  Branch (430:24): [True: 0, False: 0]
  ------------------
  431|      0|                       properties == NULL ? "<null>" : properties);
  ------------------
  |  Branch (431:24): [True: 0, False: 0]
  ------------------
  432|      0|    }
  433|       |
  434|  6.10k|    return method;
  435|  6.10k|}
encoder_meth.c:reserve_encoder_store:
  117|  12.2k|{
  118|  12.2k|    struct encoder_data_st *methdata = data;
  119|       |
  120|  12.2k|    if (store == NULL
  ------------------
  |  Branch (120:9): [True: 12.2k, False: 0]
  ------------------
  121|  12.2k|        && (store = get_encoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (121:12): [True: 0, False: 12.2k]
  ------------------
  122|      0|        return 0;
  123|       |
  124|  12.2k|    return ossl_method_lock_store(store);
  125|  12.2k|}
encoder_meth.c:unreserve_encoder_store:
  128|  12.2k|{
  129|  12.2k|    struct encoder_data_st *methdata = data;
  130|       |
  131|  12.2k|    if (store == NULL
  ------------------
  |  Branch (131:9): [True: 12.2k, False: 0]
  ------------------
  132|  12.2k|        && (store = get_encoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (132:12): [True: 0, False: 12.2k]
  ------------------
  133|      0|        return 0;
  134|       |
  135|  12.2k|    return ossl_method_unlock_store(store);
  136|  12.2k|}
encoder_meth.c:get_encoder_from_store:
  141|  6.10k|{
  142|  6.10k|    struct encoder_data_st *methdata = data;
  143|  6.10k|    void *method = NULL;
  144|  6.10k|    int id;
  145|       |
  146|       |    /*
  147|       |     * get_encoder_from_store() is only called to try and get the method
  148|       |     * that OSSL_ENCODER_fetch() is asking for, and the name or name id are
  149|       |     * passed via methdata.
  150|       |     */
  151|  6.10k|    if ((id = methdata->id) == 0 && methdata->names != NULL) {
  ------------------
  |  Branch (151:9): [True: 6.10k, False: 0]
  |  Branch (151:37): [True: 0, False: 6.10k]
  ------------------
  152|      0|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  153|      0|        const char *names = methdata->names;
  154|      0|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   25|      0|#define NAME_SEPARATOR ':'
  ------------------
  155|      0|        size_t l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (155:21): [True: 0, False: 0]
  ------------------
  156|       |
  157|      0|        if (namemap == 0)
  ------------------
  |  Branch (157:13): [True: 0, False: 0]
  ------------------
  158|      0|            return NULL;
  159|      0|        id = ossl_namemap_name2num_n(namemap, methdata->names, l);
  160|      0|    }
  161|       |
  162|  6.10k|    if (id == 0)
  ------------------
  |  Branch (162:9): [True: 6.10k, False: 0]
  ------------------
  163|  6.10k|        return NULL;
  164|       |
  165|      0|    if (store == NULL
  ------------------
  |  Branch (165:9): [True: 0, False: 0]
  ------------------
  166|      0|        && (store = get_encoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (166:12): [True: 0, False: 0]
  ------------------
  167|      0|        return NULL;
  168|       |
  169|      0|    if (!ossl_method_store_fetch(store, id, methdata->propquery, prov, &method))
  ------------------
  |  Branch (169:9): [True: 0, False: 0]
  ------------------
  170|      0|        return NULL;
  171|      0|    return method;
  172|      0|}
encoder_meth.c:put_encoder_in_store:
  178|    241|{
  179|    241|    struct encoder_data_st *methdata = data;
  180|    241|    OSSL_NAMEMAP *namemap;
  181|    241|    int id;
  182|    241|    size_t l = 0;
  183|       |
  184|       |    /*
  185|       |     * put_encoder_in_store() is only called with an OSSL_ENCODER method that
  186|       |     * was successfully created by construct_encoder() below, which means that
  187|       |     * all the names should already be stored in the namemap with the same
  188|       |     * numeric identity, so just use the first to get that identity.
  189|       |     */
  190|    241|    if (names != NULL) {
  ------------------
  |  Branch (190:9): [True: 241, False: 0]
  ------------------
  191|    241|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   25|    241|#define NAME_SEPARATOR ':'
  ------------------
  192|       |
  193|    241|        l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (193:14): [True: 241, False: 0]
  ------------------
  194|    241|    }
  195|       |
  196|    241|    if ((namemap = ossl_namemap_stored(methdata->libctx)) == NULL
  ------------------
  |  Branch (196:9): [True: 0, False: 241]
  ------------------
  197|    241|        || (id = ossl_namemap_name2num_n(namemap, names, l)) == 0)
  ------------------
  |  Branch (197:12): [True: 0, False: 241]
  ------------------
  198|      0|        return 0;
  199|       |
  200|    241|    if (store == NULL && (store = get_encoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (200:9): [True: 241, False: 0]
  |  Branch (200:26): [True: 0, False: 241]
  ------------------
  201|      0|        return 0;
  202|       |
  203|    241|    return ossl_method_store_add(store, prov, id, propdef, method,
  204|    241|                                 ossl_encoder_up_ref,
  205|    241|                                 ossl_encoder_free);
  206|    241|}
encoder_meth.c:ossl_encoder_up_ref:
   33|    241|{
   34|    241|    return OSSL_ENCODER_up_ref(data);
   35|    241|}
encoder_meth.c:ossl_encoder_free:
   28|    241|{
   29|    241|    OSSL_ENCODER_free(data);
   30|    241|}
encoder_meth.c:construct_encoder:
  315|    241|{
  316|       |    /*
  317|       |     * This function is only called if get_encoder_from_store() returned
  318|       |     * NULL, so it's safe to say that of all the spots to create a new
  319|       |     * namemap entry, this is it.  Should the name already exist there, we
  320|       |     * know that ossl_namemap_add() will return its corresponding number.
  321|       |     */
  322|    241|    struct encoder_data_st *methdata = data;
  323|    241|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  324|    241|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  325|    241|    const char *names = algodef->algorithm_names;
  326|    241|    int id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
  ------------------
  |  |   25|    241|#define NAME_SEPARATOR ':'
  ------------------
  327|    241|    void *method = NULL;
  328|       |
  329|    241|    if (id != 0)
  ------------------
  |  Branch (329:9): [True: 241, False: 0]
  ------------------
  330|    241|        method = encoder_from_algorithm(id, algodef, prov);
  331|       |
  332|       |    /*
  333|       |     * Flag to indicate that there was actual construction errors.  This
  334|       |     * helps inner_evp_generic_fetch() determine what error it should
  335|       |     * record on inaccessible algorithms.
  336|       |     */
  337|    241|    if (method == NULL)
  ------------------
  |  Branch (337:9): [True: 0, False: 241]
  ------------------
  338|      0|        methdata->flag_construct_error_occurred = 1;
  339|       |
  340|    241|    return method;
  341|    241|}
encoder_meth.c:encoder_from_algorithm:
  211|    241|{
  212|    241|    OSSL_ENCODER *encoder = NULL;
  213|    241|    const OSSL_DISPATCH *fns = algodef->implementation;
  214|    241|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  215|       |
  216|    241|    if ((encoder = ossl_encoder_new()) == NULL)
  ------------------
  |  Branch (216:9): [True: 0, False: 241]
  ------------------
  217|      0|        return NULL;
  218|    241|    encoder->base.id = id;
  219|    241|    if ((encoder->base.name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (219:9): [True: 0, False: 241]
  ------------------
  220|      0|        OSSL_ENCODER_free(encoder);
  221|      0|        return NULL;
  222|      0|    }
  223|    241|    encoder->base.algodef = algodef;
  224|    241|    if ((encoder->base.parsed_propdef
  ------------------
  |  Branch (224:9): [True: 0, False: 241]
  ------------------
  225|    241|         = ossl_parse_property(libctx, algodef->property_definition)) == NULL) {
  226|      0|        OSSL_ENCODER_free(encoder);
  227|      0|        return NULL;
  228|      0|    }
  229|       |
  230|  2.07k|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (230:12): [True: 1.83k, False: 241]
  ------------------
  231|  1.83k|        switch (fns->function_id) {
  ------------------
  |  Branch (231:17): [True: 0, False: 1.83k]
  ------------------
  232|    241|        case OSSL_FUNC_ENCODER_NEWCTX:
  ------------------
  |  | 1032|    241|# define OSSL_FUNC_ENCODER_NEWCTX                      1
  ------------------
  |  Branch (232:9): [True: 241, False: 1.59k]
  ------------------
  233|    241|            if (encoder->newctx == NULL)
  ------------------
  |  Branch (233:17): [True: 241, False: 0]
  ------------------
  234|    241|                encoder->newctx =
  235|    241|                    OSSL_FUNC_encoder_newctx(fns);
  236|    241|            break;
  237|    241|        case OSSL_FUNC_ENCODER_FREECTX:
  ------------------
  |  | 1033|    241|# define OSSL_FUNC_ENCODER_FREECTX                     2
  ------------------
  |  Branch (237:9): [True: 241, False: 1.59k]
  ------------------
  238|    241|            if (encoder->freectx == NULL)
  ------------------
  |  Branch (238:17): [True: 241, False: 0]
  ------------------
  239|    241|                encoder->freectx =
  240|    241|                    OSSL_FUNC_encoder_freectx(fns);
  241|    241|            break;
  242|      0|        case OSSL_FUNC_ENCODER_GET_PARAMS:
  ------------------
  |  | 1034|      0|# define OSSL_FUNC_ENCODER_GET_PARAMS                  3
  ------------------
  |  Branch (242:9): [True: 0, False: 1.83k]
  ------------------
  243|      0|            if (encoder->get_params == NULL)
  ------------------
  |  Branch (243:17): [True: 0, False: 0]
  ------------------
  244|      0|                encoder->get_params =
  245|      0|                    OSSL_FUNC_encoder_get_params(fns);
  246|      0|            break;
  247|      0|        case OSSL_FUNC_ENCODER_GETTABLE_PARAMS:
  ------------------
  |  | 1035|      0|# define OSSL_FUNC_ENCODER_GETTABLE_PARAMS             4
  ------------------
  |  Branch (247:9): [True: 0, False: 1.83k]
  ------------------
  248|      0|            if (encoder->gettable_params == NULL)
  ------------------
  |  Branch (248:17): [True: 0, False: 0]
  ------------------
  249|      0|                encoder->gettable_params =
  250|      0|                    OSSL_FUNC_encoder_gettable_params(fns);
  251|      0|            break;
  252|    208|        case OSSL_FUNC_ENCODER_SET_CTX_PARAMS:
  ------------------
  |  | 1036|    208|# define OSSL_FUNC_ENCODER_SET_CTX_PARAMS              5
  ------------------
  |  Branch (252:9): [True: 208, False: 1.62k]
  ------------------
  253|    208|            if (encoder->set_ctx_params == NULL)
  ------------------
  |  Branch (253:17): [True: 208, False: 0]
  ------------------
  254|    208|                encoder->set_ctx_params =
  255|    208|                    OSSL_FUNC_encoder_set_ctx_params(fns);
  256|    208|            break;
  257|    208|        case OSSL_FUNC_ENCODER_SETTABLE_CTX_PARAMS:
  ------------------
  |  | 1037|    208|# define OSSL_FUNC_ENCODER_SETTABLE_CTX_PARAMS         6
  ------------------
  |  Branch (257:9): [True: 208, False: 1.62k]
  ------------------
  258|    208|            if (encoder->settable_ctx_params == NULL)
  ------------------
  |  Branch (258:17): [True: 208, False: 0]
  ------------------
  259|    208|                encoder->settable_ctx_params =
  260|    208|                    OSSL_FUNC_encoder_settable_ctx_params(fns);
  261|    208|            break;
  262|    212|        case OSSL_FUNC_ENCODER_DOES_SELECTION:
  ------------------
  |  | 1038|    212|# define OSSL_FUNC_ENCODER_DOES_SELECTION             10
  ------------------
  |  Branch (262:9): [True: 212, False: 1.62k]
  ------------------
  263|    212|            if (encoder->does_selection == NULL)
  ------------------
  |  Branch (263:17): [True: 212, False: 0]
  ------------------
  264|    212|                encoder->does_selection =
  265|    212|                    OSSL_FUNC_encoder_does_selection(fns);
  266|    212|            break;
  267|    241|        case OSSL_FUNC_ENCODER_ENCODE:
  ------------------
  |  | 1039|    241|# define OSSL_FUNC_ENCODER_ENCODE                     11
  ------------------
  |  Branch (267:9): [True: 241, False: 1.59k]
  ------------------
  268|    241|            if (encoder->encode == NULL)
  ------------------
  |  Branch (268:17): [True: 241, False: 0]
  ------------------
  269|    241|                encoder->encode = OSSL_FUNC_encoder_encode(fns);
  270|    241|            break;
  271|    241|        case OSSL_FUNC_ENCODER_IMPORT_OBJECT:
  ------------------
  |  | 1040|    241|# define OSSL_FUNC_ENCODER_IMPORT_OBJECT              20
  ------------------
  |  Branch (271:9): [True: 241, False: 1.59k]
  ------------------
  272|    241|            if (encoder->import_object == NULL)
  ------------------
  |  Branch (272:17): [True: 241, False: 0]
  ------------------
  273|    241|                encoder->import_object =
  274|    241|                    OSSL_FUNC_encoder_import_object(fns);
  275|    241|            break;
  276|    241|        case OSSL_FUNC_ENCODER_FREE_OBJECT:
  ------------------
  |  | 1041|    241|# define OSSL_FUNC_ENCODER_FREE_OBJECT                21
  ------------------
  |  Branch (276:9): [True: 241, False: 1.59k]
  ------------------
  277|    241|            if (encoder->free_object == NULL)
  ------------------
  |  Branch (277:17): [True: 241, False: 0]
  ------------------
  278|    241|                encoder->free_object =
  279|    241|                    OSSL_FUNC_encoder_free_object(fns);
  280|    241|            break;
  281|  1.83k|        }
  282|  1.83k|    }
  283|       |    /*
  284|       |     * Try to check that the method is sensible.
  285|       |     * If you have a constructor, you must have a destructor and vice versa.
  286|       |     * You must have the encoding driver functions.
  287|       |     */
  288|    241|    if (!((encoder->newctx == NULL && encoder->freectx == NULL)
  ------------------
  |  Branch (288:12): [True: 0, False: 241]
  |  Branch (288:39): [True: 0, False: 0]
  ------------------
  289|    241|          || (encoder->newctx != NULL && encoder->freectx != NULL)
  ------------------
  |  Branch (289:15): [True: 241, False: 0]
  |  Branch (289:42): [True: 241, False: 0]
  ------------------
  290|    241|          || (encoder->import_object != NULL && encoder->free_object != NULL)
  ------------------
  |  Branch (290:15): [True: 0, False: 0]
  |  Branch (290:49): [True: 0, False: 0]
  ------------------
  291|    241|          || (encoder->import_object == NULL && encoder->free_object == NULL))
  ------------------
  |  Branch (291:15): [True: 0, False: 0]
  |  Branch (291:49): [True: 0, False: 0]
  ------------------
  292|    241|        || encoder->encode == NULL) {
  ------------------
  |  Branch (292:12): [True: 0, False: 241]
  ------------------
  293|      0|        OSSL_ENCODER_free(encoder);
  294|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  295|      0|        return NULL;
  296|      0|    }
  297|       |
  298|    241|    if (prov != NULL && !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (298:9): [True: 241, False: 0]
  |  Branch (298:25): [True: 0, False: 241]
  ------------------
  299|      0|        OSSL_ENCODER_free(encoder);
  300|      0|        return NULL;
  301|      0|    }
  302|       |
  303|    241|    encoder->base.prov = prov;
  304|    241|    return encoder;
  305|    241|}
encoder_meth.c:ossl_encoder_new:
   39|    241|{
   40|    241|    OSSL_ENCODER *encoder = NULL;
   41|       |
   42|    241|    if ((encoder = OPENSSL_zalloc(sizeof(*encoder))) == NULL)
  ------------------
  |  |  104|    241|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    241|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    241|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (42:9): [True: 0, False: 241]
  ------------------
   43|      0|        return NULL;
   44|    241|    if (!CRYPTO_NEW_REF(&encoder->base.refcnt, 1)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 241]
  ------------------
   45|      0|        OSSL_ENCODER_free(encoder);
   46|      0|        return NULL;
   47|      0|    }
   48|       |
   49|    241|    return encoder;
   50|    241|}
encoder_meth.c:destruct_encoder:
  345|    241|{
  346|    241|    OSSL_ENCODER_free(method);
  347|    241|}
encoder_meth.c:dealloc_tmp_encoder_store:
  105|  6.10k|{
  106|  6.10k|    if (store != NULL)
  ------------------
  |  Branch (106:9): [True: 0, False: 6.10k]
  ------------------
  107|      0|        ossl_method_store_free(store);
  108|  6.10k|}
encoder_meth.c:get_encoder_store:
  112|  36.8k|{
  113|  36.8k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_ENCODER_STORE_INDEX);
  ------------------
  |  |  110|  36.8k|# define OSSL_LIB_CTX_ENCODER_STORE_INDEX           10
  ------------------
  114|  36.8k|}
encoder_meth.c:do_one:
  541|  1.47M|{
  542|  1.47M|    struct do_one_data_st *data = arg;
  543|       |
  544|  1.47M|    data->user_fn(method, data->user_arg);
  545|  1.47M|}

OSSL_ENCODER_CTX_new_for_pkey:
  352|  3.43k|{
  353|  3.43k|    OSSL_ENCODER_CTX *ctx = NULL;
  354|  3.43k|    OSSL_LIB_CTX *libctx = NULL;
  355|       |
  356|  3.43k|    if (pkey == NULL) {
  ------------------
  |  Branch (356:9): [True: 0, False: 3.43k]
  ------------------
  357|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  358|      0|        return NULL;
  359|      0|    }
  360|       |
  361|  3.43k|    if (!evp_pkey_is_assigned(pkey)) {
  ------------------
  |  |  641|  3.43k|    ((pk)->pkey.ptr != NULL || (pk)->keydata != NULL)
  |  |  ------------------
  |  |  |  Branch (641:6): [True: 379, False: 3.05k]
  |  |  |  Branch (641:32): [True: 3.05k, False: 0]
  |  |  ------------------
  ------------------
  362|      0|        ERR_raise_data(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  120|      0|# define ERR_LIB_OSSL_ENCODER    59
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  357|      0|# define ERR_R_PASSED_INVALID_ARGUMENT           (262|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  363|      0|                       "The passed EVP_PKEY must be assigned a key");
  364|      0|        return NULL;
  365|      0|    }
  366|       |
  367|  3.43k|    if ((ctx = OSSL_ENCODER_CTX_new()) == NULL) {
  ------------------
  |  Branch (367:9): [True: 0, False: 3.43k]
  ------------------
  368|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_OSSL_ENCODER_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  369|      0|        return NULL;
  370|      0|    }
  371|       |
  372|  3.43k|    if (evp_pkey_is_provided(pkey)) {
  ------------------
  |  |  649|  3.43k|    ((pk)->keymgmt != NULL)
  |  |  ------------------
  |  |  |  Branch (649:5): [True: 3.05k, False: 379]
  |  |  ------------------
  ------------------
  373|  3.05k|        const OSSL_PROVIDER *prov = EVP_KEYMGMT_get0_provider(pkey->keymgmt);
  374|       |
  375|  3.05k|        libctx = ossl_provider_libctx(prov);
  376|  3.05k|    }
  377|       |
  378|  3.43k|    OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  220|  3.43k|    do {                                        \
  |  |  221|  3.43k|        BIO *trc_out = NULL;                    \
  |  |  222|  3.43k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  379|      0|        BIO_printf(trc_out,
  380|      0|                   "(ctx %p) Looking for %s encoders with selection %d\n",
  381|      0|                   (void *)ctx, EVP_PKEY_get0_type_name(pkey), selection);
  382|      0|        BIO_printf(trc_out, "    output type: %s, output structure: %s\n",
  383|      0|                   output_type, output_struct);
  384|  3.43k|    } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  225|  3.43k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  385|       |
  386|  3.43k|    if (OSSL_ENCODER_CTX_set_output_type(ctx, output_type)
  ------------------
  |  Branch (386:9): [True: 3.43k, False: 0]
  ------------------
  387|  3.43k|        && (output_struct == NULL
  ------------------
  |  Branch (387:13): [True: 1.78k, False: 1.64k]
  ------------------
  388|  3.43k|            || OSSL_ENCODER_CTX_set_output_structure(ctx, output_struct))
  ------------------
  |  Branch (388:16): [True: 1.64k, False: 0]
  ------------------
  389|  3.43k|        && OSSL_ENCODER_CTX_set_selection(ctx, selection)
  ------------------
  |  Branch (389:12): [True: 3.43k, False: 0]
  ------------------
  390|  3.43k|        && ossl_encoder_ctx_setup_for_pkey(ctx, pkey, selection, propquery)
  ------------------
  |  Branch (390:12): [True: 3.43k, False: 0]
  ------------------
  391|  3.43k|        && OSSL_ENCODER_CTX_add_extra(ctx, libctx, propquery)) {
  ------------------
  |  Branch (391:12): [True: 3.43k, False: 0]
  ------------------
  392|  3.43k|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  3.43k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  3.43k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  393|  3.43k|        int save_parameters = pkey->save_parameters;
  394|       |
  395|  3.43k|        params[0] = OSSL_PARAM_construct_int(OSSL_ENCODER_PARAM_SAVE_PARAMETERS,
  ------------------
  |  |  253|  3.43k|# define OSSL_ENCODER_PARAM_SAVE_PARAMETERS "save-parameters"
  ------------------
  396|  3.43k|                                             &save_parameters);
  397|       |        /* ignoring error as this is only auxiliary parameter */
  398|  3.43k|        (void)OSSL_ENCODER_CTX_set_params(ctx, params);
  399|       |
  400|  3.43k|        OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  220|  3.43k|    do {                                        \
  |  |  221|  3.43k|        BIO *trc_out = NULL;                    \
  |  |  222|  3.43k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  401|      0|            BIO_printf(trc_out, "(ctx %p) Got %d encoders\n",
  402|      0|                       (void *)ctx, OSSL_ENCODER_CTX_get_num_encoders(ctx));
  403|  3.43k|        } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  225|  3.43k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  404|  3.43k|        return ctx;
  405|  3.43k|    }
  406|       |
  407|      0|    OSSL_ENCODER_CTX_free(ctx);
  408|      0|    return NULL;
  409|  3.43k|}
encoder_pkey.c:ossl_encoder_ctx_setup_for_pkey:
  236|  3.43k|{
  237|  3.43k|    struct construct_data_st *data = NULL;
  238|  3.43k|    const OSSL_PROVIDER *prov = NULL;
  239|  3.43k|    OSSL_LIB_CTX *libctx = NULL;
  240|  3.43k|    int ok = 0, i, end;
  241|  3.43k|    OSSL_NAMEMAP *namemap;
  242|       |
  243|  3.43k|    if (!ossl_assert(ctx != NULL) || !ossl_assert(pkey != NULL)) {
  ------------------
  |  |   52|  6.86k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  6.86k|                                         __FILE__, __LINE__)
  ------------------
                  if (!ossl_assert(ctx != NULL) || !ossl_assert(pkey != NULL)) {
  ------------------
  |  |   52|  3.43k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.43k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (243:9): [True: 0, False: 3.43k]
  |  Branch (243:38): [True: 0, False: 3.43k]
  ------------------
  244|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  245|      0|        return 0;
  246|      0|    }
  247|       |
  248|  3.43k|    if (evp_pkey_is_provided(pkey)) {
  ------------------
  |  |  649|  3.43k|    ((pk)->keymgmt != NULL)
  |  |  ------------------
  |  |  |  Branch (649:5): [True: 3.05k, False: 379]
  |  |  ------------------
  ------------------
  249|  3.05k|        prov = EVP_KEYMGMT_get0_provider(pkey->keymgmt);
  250|  3.05k|        libctx = ossl_provider_libctx(prov);
  251|  3.05k|    }
  252|       |
  253|  3.43k|    if (pkey->keymgmt != NULL) {
  ------------------
  |  Branch (253:9): [True: 3.05k, False: 379]
  ------------------
  254|  3.05k|        struct collected_encoder_st encoder_data;
  255|  3.05k|        struct collected_names_st keymgmt_data;
  256|       |
  257|  3.05k|        if ((data = OPENSSL_zalloc(sizeof(*data))) == NULL)
  ------------------
  |  |  104|  3.05k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.05k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.05k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (257:13): [True: 0, False: 3.05k]
  ------------------
  258|      0|            goto err;
  259|       |
  260|       |        /*
  261|       |         * Select the first encoder implementations in two steps.
  262|       |         * First, collect the keymgmt names, then the encoders that match.
  263|       |         */
  264|  3.05k|        keymgmt_data.names = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  258|  3.05k|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  265|  3.05k|        if (keymgmt_data.names == NULL) {
  ------------------
  |  Branch (265:13): [True: 0, False: 3.05k]
  ------------------
  266|      0|            ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  267|      0|            goto err;
  268|      0|        }
  269|       |
  270|  3.05k|        keymgmt_data.error_occurred = 0;
  271|  3.05k|        EVP_KEYMGMT_names_do_all(pkey->keymgmt, collect_name, &keymgmt_data);
  272|  3.05k|        if (keymgmt_data.error_occurred) {
  ------------------
  |  Branch (272:13): [True: 0, False: 3.05k]
  ------------------
  273|      0|            sk_OPENSSL_CSTRING_free(keymgmt_data.names);
  ------------------
  |  |  261|      0|#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
  ------------------
  274|      0|            goto err;
  275|      0|        }
  276|       |
  277|  3.05k|        encoder_data.names = keymgmt_data.names;
  278|  3.05k|        encoder_data.output_type = ctx->output_type;
  279|  3.05k|        encoder_data.output_structure = ctx->output_structure;
  280|  3.05k|        encoder_data.error_occurred = 0;
  281|  3.05k|        encoder_data.keymgmt_prov = prov;
  282|  3.05k|        encoder_data.ctx = ctx;
  283|  3.05k|        encoder_data.id_names = NULL;
  284|       |
  285|       |        /*
  286|       |         * collect_encoder() is called many times, and for every call it converts all encoder_data.names
  287|       |         * into namemap ids if it calls OSSL_ENCODER_is_a(). We cache the ids here instead,
  288|       |         * and can use them for encoders with the same provider as the keymgmt.
  289|       |         */
  290|  3.05k|        namemap = ossl_namemap_stored(libctx);
  291|  3.05k|        end = sk_OPENSSL_CSTRING_num(encoder_data.names);
  ------------------
  |  |  255|  3.05k|#define sk_OPENSSL_CSTRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_CSTRING_sk_type(sk))
  ------------------
  292|  3.05k|        if (end > 0) {
  ------------------
  |  Branch (292:13): [True: 3.05k, False: 0]
  ------------------
  293|  3.05k|            encoder_data.id_names = OPENSSL_malloc(end * sizeof(int));
  ------------------
  |  |  102|  3.05k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.05k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.05k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  294|  3.05k|            if (encoder_data.id_names == NULL) {
  ------------------
  |  Branch (294:17): [True: 0, False: 3.05k]
  ------------------
  295|      0|                sk_OPENSSL_CSTRING_free(keymgmt_data.names);
  ------------------
  |  |  261|      0|#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
  ------------------
  296|      0|                goto err;
  297|      0|            }
  298|  15.6k|            for (i = 0; i < end; ++i) {
  ------------------
  |  Branch (298:25): [True: 12.5k, False: 3.05k]
  ------------------
  299|  12.5k|                const char *name = sk_OPENSSL_CSTRING_value(keymgmt_data.names, i);
  ------------------
  |  |  256|  12.5k|#define sk_OPENSSL_CSTRING_value(sk, idx) ((const char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_CSTRING_sk_type(sk), (idx)))
  ------------------
  300|       |
  301|  12.5k|                encoder_data.id_names[i] = ossl_namemap_name2num(namemap, name);
  302|  12.5k|            }
  303|  3.05k|        }
  304|       |        /*
  305|       |         * Place the encoders with the a different provider as the keymgmt
  306|       |         * last (the chain is processed in reverse order)
  307|       |         */
  308|  3.05k|        encoder_data.flag_find_same_provider = 0;
  309|  3.05k|        OSSL_ENCODER_do_all_provided(libctx, collect_encoder, &encoder_data);
  310|       |
  311|       |        /*
  312|       |         * Place the encoders with the same provider as the keymgmt first
  313|       |         * (the chain is processed in reverse order)
  314|       |         */
  315|  3.05k|        encoder_data.flag_find_same_provider = 1;
  316|  3.05k|        OSSL_ENCODER_do_all_provided(libctx, collect_encoder, &encoder_data);
  317|       |
  318|  3.05k|        OPENSSL_free(encoder_data.id_names);
  ------------------
  |  |  115|  3.05k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.05k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.05k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  319|  3.05k|        sk_OPENSSL_CSTRING_free(keymgmt_data.names);
  ------------------
  |  |  261|  3.05k|#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
  ------------------
  320|  3.05k|        if (encoder_data.error_occurred) {
  ------------------
  |  Branch (320:13): [True: 0, False: 3.05k]
  ------------------
  321|      0|            ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  322|      0|            goto err;
  323|      0|        }
  324|  3.05k|    }
  325|       |
  326|  3.43k|    if (data != NULL && OSSL_ENCODER_CTX_get_num_encoders(ctx) != 0) {
  ------------------
  |  Branch (326:9): [True: 3.05k, False: 379]
  |  Branch (326:25): [True: 3.05k, False: 0]
  ------------------
  327|  3.05k|        if (!OSSL_ENCODER_CTX_set_construct(ctx, encoder_construct_pkey)
  ------------------
  |  Branch (327:13): [True: 0, False: 3.05k]
  ------------------
  328|  3.05k|            || !OSSL_ENCODER_CTX_set_construct_data(ctx, data)
  ------------------
  |  Branch (328:16): [True: 0, False: 3.05k]
  ------------------
  329|  3.05k|            || !OSSL_ENCODER_CTX_set_cleanup(ctx, encoder_destruct_pkey))
  ------------------
  |  Branch (329:16): [True: 0, False: 3.05k]
  ------------------
  330|      0|            goto err;
  331|       |
  332|  3.05k|        data->pk = pkey;
  333|  3.05k|        data->selection = selection;
  334|       |
  335|  3.05k|        data = NULL;             /* Avoid it being freed */
  336|  3.05k|    }
  337|       |
  338|  3.43k|    ok = 1;
  339|  3.43k| err:
  340|  3.43k|    if (data != NULL) {
  ------------------
  |  Branch (340:9): [True: 0, False: 3.43k]
  ------------------
  341|      0|        OSSL_ENCODER_CTX_set_construct_data(ctx, NULL);
  342|      0|        OPENSSL_free(data);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  343|      0|    }
  344|  3.43k|    return ok;
  345|  3.43k|}
encoder_pkey.c:collect_name:
  137|  12.5k|{
  138|  12.5k|    struct collected_names_st *data = arg;
  139|       |
  140|  12.5k|    if (data->error_occurred)
  ------------------
  |  Branch (140:9): [True: 0, False: 12.5k]
  ------------------
  141|      0|        return;
  142|       |
  143|  12.5k|    data->error_occurred = 1;         /* Assume the worst */
  144|       |
  145|  12.5k|    if (sk_OPENSSL_CSTRING_push(data->names, name) <= 0)
  ------------------
  |  |  265|  12.5k|#define sk_OPENSSL_CSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
  ------------------
  |  Branch (145:9): [True: 0, False: 12.5k]
  ------------------
  146|      0|        return;
  147|       |
  148|  12.5k|    data->error_occurred = 0;         /* All is good now */
  149|  12.5k|}
encoder_pkey.c:collect_encoder:
   88|  1.47M|{
   89|  1.47M|    struct collected_encoder_st *data = arg;
   90|  1.47M|    const OSSL_PROVIDER *prov;
   91|       |
   92|  1.47M|    if (data->error_occurred)
  ------------------
  |  Branch (92:9): [True: 0, False: 1.47M]
  ------------------
   93|      0|        return;
   94|       |
   95|  1.47M|    data->error_occurred = 1;     /* Assume the worst */
   96|       |
   97|  1.47M|    prov = OSSL_ENCODER_get0_provider(encoder);
   98|       |    /*
   99|       |     * collect_encoder() is called in two passes, one where the encoders
  100|       |     * from the same provider as the keymgmt are looked up, and one where
  101|       |     * the other encoders are looked up.  |data->flag_find_same_provider|
  102|       |     * tells us which pass we're in.
  103|       |     */
  104|  1.47M|    if ((data->keymgmt_prov == prov) == data->flag_find_same_provider) {
  ------------------
  |  Branch (104:9): [True: 735k, False: 735k]
  ------------------
  105|   735k|        void *provctx = OSSL_PROVIDER_get0_provider_ctx(prov);
  106|   735k|        int i, end_i = sk_OPENSSL_CSTRING_num(data->names);
  ------------------
  |  |  255|   735k|#define sk_OPENSSL_CSTRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_CSTRING_sk_type(sk))
  ------------------
  107|   735k|        int match;
  108|       |
  109|  3.62M|        for (i = 0; i < end_i; i++) {
  ------------------
  |  Branch (109:21): [True: 2.92M, False: 702k]
  ------------------
  110|  2.92M|            if (data->flag_find_same_provider)
  ------------------
  |  Branch (110:17): [True: 2.92M, False: 0]
  ------------------
  111|  2.92M|                match = (data->id_names[i] == encoder->base.id);
  112|      0|            else
  113|      0|                match = OSSL_ENCODER_is_a(encoder,
  114|      0|                                          sk_OPENSSL_CSTRING_value(data->names, i));
  ------------------
  |  |  256|      0|#define sk_OPENSSL_CSTRING_value(sk, idx) ((const char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_CSTRING_sk_type(sk), (idx)))
  ------------------
  115|  2.92M|            if (!match
  ------------------
  |  Branch (115:17): [True: 2.86M, False: 65.1k]
  ------------------
  116|  2.92M|                || (encoder->does_selection != NULL
  ------------------
  |  Branch (116:21): [True: 62.1k, False: 3.05k]
  ------------------
  117|  65.1k|                    && !encoder->does_selection(provctx, data->ctx->selection))
  ------------------
  |  Branch (117:24): [True: 31.4k, False: 30.6k]
  ------------------
  118|  2.92M|                || (data->keymgmt_prov != prov
  ------------------
  |  Branch (118:21): [True: 0, False: 33.6k]
  ------------------
  119|  33.6k|                    && encoder->import_object == NULL))
  ------------------
  |  Branch (119:24): [True: 0, False: 0]
  ------------------
  120|  2.89M|                continue;
  121|       |
  122|       |            /* Only add each encoder implementation once */
  123|  33.6k|            if (OSSL_ENCODER_CTX_add_encoder(data->ctx, encoder))
  ------------------
  |  Branch (123:17): [True: 33.6k, False: 0]
  ------------------
  124|  33.6k|                break;
  125|  33.6k|        }
  126|   735k|    }
  127|       |
  128|  1.47M|    data->error_occurred = 0;         /* All is good now */
  129|  1.47M|}
encoder_pkey.c:encoder_construct_pkey:
  181|  3.03k|{
  182|  3.03k|    struct construct_data_st *data = arg;
  183|       |
  184|  3.03k|    if (data->obj == NULL) {
  ------------------
  |  Branch (184:9): [True: 3.03k, False: 0]
  ------------------
  185|  3.03k|        OSSL_ENCODER *encoder =
  186|  3.03k|            OSSL_ENCODER_INSTANCE_get_encoder(encoder_inst);
  187|  3.03k|        const EVP_PKEY *pk = data->pk;
  188|  3.03k|        const OSSL_PROVIDER *k_prov = EVP_KEYMGMT_get0_provider(pk->keymgmt);
  189|  3.03k|        const OSSL_PROVIDER *e_prov = OSSL_ENCODER_get0_provider(encoder);
  190|       |
  191|  3.03k|        if (k_prov != e_prov) {
  ------------------
  |  Branch (191:13): [True: 0, False: 3.03k]
  ------------------
  192|      0|            int selection = data->selection;
  193|       |
  194|      0|            if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  640|      0|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (194:17): [True: 0, False: 0]
  ------------------
  195|      0|                selection |= OSSL_KEYMGMT_SELECT_PUBLIC_KEY;
  ------------------
  |  |  641|      0|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  196|      0|            data->encoder_inst = encoder_inst;
  197|       |
  198|      0|            if (!evp_keymgmt_export(pk->keymgmt, pk->keydata, selection,
  ------------------
  |  Branch (198:17): [True: 0, False: 0]
  ------------------
  199|      0|                                    &encoder_import_cb, data))
  200|      0|                return NULL;
  201|      0|            data->obj = data->constructed_obj;
  202|  3.03k|        } else {
  203|  3.03k|            data->obj = pk->keydata;
  204|  3.03k|        }
  205|  3.03k|    }
  206|       |
  207|  3.03k|    return data->obj;
  208|  3.03k|}
encoder_pkey.c:encoder_destruct_pkey:
  211|  3.03k|{
  212|  3.03k|    struct construct_data_st *data = arg;
  213|  3.03k|    int match = (data->obj == data->constructed_obj);
  214|       |
  215|  3.03k|    if (data->encoder_inst != NULL) {
  ------------------
  |  Branch (215:9): [True: 0, False: 3.03k]
  ------------------
  216|      0|        OSSL_ENCODER *encoder =
  217|      0|            OSSL_ENCODER_INSTANCE_get_encoder(data->encoder_inst);
  218|       |
  219|      0|        encoder->free_object(data->constructed_obj);
  220|      0|    }
  221|  3.03k|    data->constructed_obj = NULL;
  222|  3.03k|    if (match)
  ------------------
  |  Branch (222:9): [True: 0, False: 3.03k]
  ------------------
  223|      0|        data->obj = NULL;
  224|  3.03k|}

ossl_err_load_ENGINE_strings:
   85|      2|{
   86|      2|# ifndef OPENSSL_NO_ERR
   87|      2|    if (ERR_reason_error_string(ENGINE_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (87:9): [True: 2, False: 0]
  ------------------
   88|      2|        ERR_load_strings_const(ENGINE_str_reasons);
   89|      2|# endif
   90|      2|    return 1;
   91|      2|}

ENGINE_finish:
  107|   435k|{
  108|   435k|    int to_return = 1;
  109|       |
  110|   435k|    if (e == NULL)
  ------------------
  |  Branch (110:9): [True: 435k, False: 0]
  ------------------
  111|   435k|        return 1;
  112|      0|    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (112:9): [True: 0, False: 0]
  ------------------
  113|      0|        return 0;
  114|      0|    to_return = engine_unlocked_finish(e, 1);
  115|      0|    CRYPTO_THREAD_unlock(global_engine_lock);
  116|      0|    if (!to_return) {
  ------------------
  |  Branch (116:9): [True: 0, False: 0]
  ------------------
  117|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  118|      0|        return 0;
  119|      0|    }
  120|      0|    return to_return;
  121|      0|}

engine_cleanup_int:
  176|      2|{
  177|      2|    if (int_cleanup_check(0)) {
  ------------------
  |  Branch (177:9): [True: 0, False: 2]
  ------------------
  178|      0|        sk_ENGINE_CLEANUP_ITEM_pop_free(cleanup_stack,
  179|      0|                                        engine_cleanup_cb_free);
  180|      0|        cleanup_stack = NULL;
  181|      0|    }
  182|      2|    CRYPTO_THREAD_lock_free(global_engine_lock);
  183|      2|    global_engine_lock = NULL;
  184|      2|}
eng_lib.c:do_engine_lock_init:
   22|      1|{
   23|      1|    global_engine_lock = CRYPTO_THREAD_lock_new();
   24|      1|    return global_engine_lock != NULL;
   25|      1|}
eng_lib.c:int_cleanup_check:
  119|      2|{
  120|      2|    if (cleanup_stack)
  ------------------
  |  Branch (120:9): [True: 0, False: 2]
  ------------------
  121|      0|        return 1;
  122|      2|    if (!create)
  ------------------
  |  Branch (122:9): [True: 2, False: 0]
  ------------------
  123|      2|        return 0;
  124|      0|    cleanup_stack = sk_ENGINE_CLEANUP_ITEM_new_null();
  125|      0|    return (cleanup_stack ? 1 : 0);
  ------------------
  |  Branch (125:13): [True: 0, False: 0]
  ------------------
  126|      2|}

ossl_engine_table_select:
  202|   254k|{
  203|   254k|    ENGINE *ret = NULL;
  204|   254k|    ENGINE_PILE tmplate, *fnd = NULL;
  205|   254k|    int initres, loop = 0;
  206|       |
  207|   254k|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
  208|       |    /* Load the config before trying to check if engines are available */
  209|   254k|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  472|   254k|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  210|   254k|#endif
  211|       |
  212|   254k|    if (!(*table)) {
  ------------------
  |  Branch (212:9): [True: 254k, False: 0]
  ------------------
  213|   254k|        OSSL_TRACE3(ENGINE_TABLE,
  ------------------
  |  |  295|   254k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  ------------------
  |  |  |  |  283|   254k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  214|   254k|                   "%s:%d, nid=%d, nothing registered!\n",
  215|   254k|                   f, l, nid);
  216|   254k|        return NULL;
  217|   254k|    }
  218|       |
  219|      0|    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (219:9): [True: 0, False: 0]
  ------------------
  220|      0|        return NULL;
  221|       |
  222|      0|    ERR_set_mark();
  223|       |    /*
  224|       |     * Check again inside the lock otherwise we could race against cleanup
  225|       |     * operations. But don't worry about a debug printout
  226|       |     */
  227|      0|    if (!int_table_check(table, 0))
  ------------------
  |  Branch (227:9): [True: 0, False: 0]
  ------------------
  228|      0|        goto end;
  229|      0|    tmplate.nid = nid;
  230|      0|    fnd = lh_ENGINE_PILE_retrieve(&(*table)->piles, &tmplate);
  231|      0|    if (!fnd)
  ------------------
  |  Branch (231:9): [True: 0, False: 0]
  ------------------
  232|      0|        goto end;
  233|      0|    if (fnd->funct && engine_unlocked_init(fnd->funct)) {
  ------------------
  |  Branch (233:9): [True: 0, False: 0]
  |  Branch (233:23): [True: 0, False: 0]
  ------------------
  234|      0|        OSSL_TRACE4(ENGINE_TABLE,
  ------------------
  |  |  297|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  235|      0|                   "%s:%d, nid=%d, using ENGINE '%s' cached\n",
  236|      0|                   f, l, nid, fnd->funct->id);
  237|      0|        ret = fnd->funct;
  238|      0|        goto end;
  239|      0|    }
  240|      0|    if (fnd->uptodate) {
  ------------------
  |  Branch (240:9): [True: 0, False: 0]
  ------------------
  241|      0|        ret = fnd->funct;
  242|      0|        goto end;
  243|      0|    }
  244|      0| trynext:
  245|      0|    ret = sk_ENGINE_value(fnd->sk, loop++);
  246|      0|    if (!ret) {
  ------------------
  |  Branch (246:9): [True: 0, False: 0]
  ------------------
  247|      0|        OSSL_TRACE3(ENGINE_TABLE,
  ------------------
  |  |  295|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  248|      0|                    "%s:%d, nid=%d, "
  249|      0|                    "no registered implementations would initialise\n",
  250|      0|                    f, l, nid);
  251|      0|        goto end;
  252|      0|    }
  253|       |    /* Try to initialise the ENGINE? */
  254|      0|    if ((ret->funct_ref > 0) || !(table_flags & ENGINE_TABLE_FLAG_NOINIT))
  ------------------
  |  |   64|      0|#  define ENGINE_TABLE_FLAG_NOINIT        (unsigned int)0x0001
  ------------------
  |  Branch (254:9): [True: 0, False: 0]
  |  Branch (254:33): [True: 0, False: 0]
  ------------------
  255|      0|        initres = engine_unlocked_init(ret);
  256|      0|    else
  257|      0|        initres = 0;
  258|      0|    if (initres) {
  ------------------
  |  Branch (258:9): [True: 0, False: 0]
  ------------------
  259|       |        /* Update 'funct' */
  260|      0|        if ((fnd->funct != ret) && engine_unlocked_init(ret)) {
  ------------------
  |  Branch (260:13): [True: 0, False: 0]
  |  Branch (260:36): [True: 0, False: 0]
  ------------------
  261|       |            /* If there was a previous default we release it. */
  262|      0|            if (fnd->funct)
  ------------------
  |  Branch (262:17): [True: 0, False: 0]
  ------------------
  263|      0|                engine_unlocked_finish(fnd->funct, 0);
  264|      0|            fnd->funct = ret;
  265|      0|            OSSL_TRACE4(ENGINE_TABLE,
  ------------------
  |  |  297|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  266|      0|                        "%s:%d, nid=%d, setting default to '%s'\n",
  267|      0|                        f, l, nid, ret->id);
  268|      0|        }
  269|      0|        OSSL_TRACE4(ENGINE_TABLE,
  ------------------
  |  |  297|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  270|      0|                    "%s:%d, nid=%d, using newly initialised '%s'\n",
  271|      0|                    f, l, nid, ret->id);
  272|      0|        goto end;
  273|      0|    }
  274|      0|    goto trynext;
  275|      0| end:
  276|       |    /*
  277|       |     * If it failed, it is unlikely to succeed again until some future
  278|       |     * registrations have taken place. In all cases, we cache.
  279|       |     */
  280|      0|    if (fnd)
  ------------------
  |  Branch (280:9): [True: 0, False: 0]
  ------------------
  281|      0|        fnd->uptodate = 1;
  282|      0|    if (ret)
  ------------------
  |  Branch (282:9): [True: 0, False: 0]
  ------------------
  283|      0|        OSSL_TRACE4(ENGINE_TABLE,
  ------------------
  |  |  297|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  284|      0|                   "%s:%d, nid=%d, caching ENGINE '%s'\n",
  285|      0|                   f, l, nid, ret->id);
  286|      0|    else
  287|      0|        OSSL_TRACE3(ENGINE_TABLE,
  ------------------
  |  |  295|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  288|      0|                    "%s:%d, nid=%d, caching 'no matching ENGINE'\n",
  289|      0|                    f, l, nid);
  290|      0|    CRYPTO_THREAD_unlock(global_engine_lock);
  291|       |    /*
  292|       |     * Whatever happened, any failed init()s are not failures in this
  293|       |     * context, so clear our error state.
  294|       |     */
  295|      0|    ERR_pop_to_mark();
  296|      0|    return ret;
  297|      0|}
engine_table_doall:
  310|  34.9k|{
  311|  34.9k|    ENGINE_PILE_DOALL dall;
  312|  34.9k|    dall.cb = cb;
  313|  34.9k|    dall.arg = arg;
  314|  34.9k|    if (table)
  ------------------
  |  Branch (314:9): [True: 0, False: 34.9k]
  ------------------
  315|      0|        lh_ENGINE_PILE_doall_ENGINE_PILE_DOALL(&table->piles, int_dall, &dall);
  316|  34.9k|}

ENGINE_get_pkey_asn1_meth_engine:
   78|  49.0k|{
   79|  49.0k|    return ossl_engine_table_select(&pkey_asn1_meth_table, nid,
   80|  49.0k|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|  49.0k|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|  49.0k|#   define OPENSSL_LINE __LINE__
  ------------------
   81|  49.0k|}
ENGINE_pkey_asn1_find_str:
  191|  34.9k|{
  192|  34.9k|    ENGINE_FIND_STR fstr;
  193|  34.9k|    fstr.e = NULL;
  194|  34.9k|    fstr.ameth = NULL;
  195|  34.9k|    fstr.str = str;
  196|  34.9k|    fstr.len = len;
  197|       |
  198|  34.9k|    if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
  ------------------
  |  |  130|  34.9k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 34.9k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (198:9): [True: 0, False: 34.9k]
  ------------------
  199|       |        /* Maybe this should be raised in do_engine_lock_init() */
  200|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  201|      0|        return NULL;
  202|      0|    }
  203|       |
  204|  34.9k|    if (!CRYPTO_THREAD_read_lock(global_engine_lock))
  ------------------
  |  Branch (204:9): [True: 0, False: 34.9k]
  ------------------
  205|      0|        return NULL;
  206|  34.9k|    engine_table_doall(pkey_asn1_meth_table, look_str_cb, &fstr);
  207|       |    /* If found obtain a structural reference to engine */
  208|  34.9k|    if (fstr.e != NULL) {
  ------------------
  |  Branch (208:9): [True: 0, False: 34.9k]
  ------------------
  209|      0|        int ref;
  210|       |
  211|      0|        if (!CRYPTO_UP_REF(&fstr.e->struct_ref, &ref)) {
  ------------------
  |  Branch (211:13): [True: 0, False: 0]
  ------------------
  212|      0|            CRYPTO_THREAD_unlock(global_engine_lock);
  213|      0|            ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  214|      0|            return NULL;
  215|      0|        }
  216|      0|        ENGINE_REF_PRINT(fstr.e, 0, 1);
  ------------------
  |  |   29|      0|    OSSL_TRACE6(ENGINE_REF_COUNT,                                       \
  |  |  ------------------
  |  |  |  |  301|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6))
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      0|               "engine: %p %s from %d to %d (%s:%d)\n",                 \
  |  |   31|      0|               (void *)(e), (isfunct ? "funct" : "struct"),             \
  |  |   32|      0|               ((isfunct)                                               \
  |  |   33|      0|                ? ((e)->funct_ref - (diff))                             \
  |  |   34|      0|                : (eng_struct_ref(e) - (diff))),                        \
  |  |   35|      0|               ((isfunct) ? (e)->funct_ref : eng_struct_ref(e)),        \
  |  |   36|      0|               (OPENSSL_FILE), (OPENSSL_LINE))
  ------------------
  217|      0|    }
  218|  34.9k|    *pe = fstr.e;
  219|  34.9k|    CRYPTO_THREAD_unlock(global_engine_lock);
  220|  34.9k|    return fstr.ameth;
  221|  34.9k|}

ENGINE_get_default_DH:
   60|  33.0k|{
   61|  33.0k|    return ossl_engine_table_select(&dh_table, dummy_nid,
   62|  33.0k|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|  33.0k|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|  33.0k|#   define OPENSSL_LINE __LINE__
  ------------------
   63|  33.0k|}

ENGINE_get_digest_engine:
   67|  13.1k|{
   68|  13.1k|    return ossl_engine_table_select(&digest_table, nid,
   69|  13.1k|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|  13.1k|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|  13.1k|#   define OPENSSL_LINE __LINE__
  ------------------
   70|  13.1k|}

ENGINE_get_default_DSA:
   60|  43.8k|{
   61|  43.8k|    return ossl_engine_table_select(&dsa_table, dummy_nid,
   62|  43.8k|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|  43.8k|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|  43.8k|#   define OPENSSL_LINE __LINE__
  ------------------
   63|  43.8k|}

ENGINE_get_default_EC:
   60|  39.4k|{
   61|  39.4k|    return ossl_engine_table_select(&dh_table, dummy_nid,
   62|  39.4k|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|  39.4k|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|  39.4k|#   define OPENSSL_LINE __LINE__
  ------------------
   63|  39.4k|}

ENGINE_get_pkey_meth_engine:
   68|  27.6k|{
   69|  27.6k|    return ossl_engine_table_select(&pkey_meth_table, nid,
   70|  27.6k|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|  27.6k|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|  27.6k|#   define OPENSSL_LINE __LINE__
  ------------------
   71|  27.6k|}

ENGINE_get_default_RAND:
   60|      1|{
   61|      1|    return ossl_engine_table_select(&rand_table, dummy_nid,
   62|      1|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  ------------------
   63|      1|}

ENGINE_get_default_RSA:
   60|  48.6k|{
   61|  48.6k|    return ossl_engine_table_select(&rsa_table, dummy_nid,
   62|  48.6k|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|  48.6k|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|  48.6k|#   define OPENSSL_LINE __LINE__
  ------------------
   63|  48.6k|}

OSSL_ERR_STATE_free:
  202|      2|{
  203|      2|    int i;
  204|       |
  205|      2|    if (state == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 2]
  ------------------
  206|      0|        return;
  207|     34|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|     34|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (207:17): [True: 32, False: 2]
  ------------------
  208|     32|        err_clear(state, i, 1);
  209|     32|    }
  210|      2|    CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  ------------------
                  CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  ------------------
  211|      2|}
err_cleanup:
  233|      2|{
  234|      2|    if (set_err_thread_local != 0)
  ------------------
  |  Branch (234:9): [True: 2, False: 0]
  ------------------
  235|      2|        CRYPTO_THREAD_cleanup_local(&err_thread_local);
  236|      2|    CRYPTO_THREAD_lock_free(err_string_lock);
  237|      2|    err_string_lock = NULL;
  238|      2|#ifndef OPENSSL_NO_ERR
  239|      2|    lh_ERR_STRING_DATA_free(int_error_hash);
  ------------------
  |  |  376|      2|#define lh_ERR_STRING_DATA_free(lh) OPENSSL_LH_free(ossl_check_ERR_STRING_DATA_lh_type(lh))
  ------------------
  240|      2|    int_error_hash = NULL;
  241|      2|#endif
  242|      2|}
ossl_err_load_ERR_strings:
  272|     72|{
  273|     72|#ifndef OPENSSL_NO_ERR
  274|     72|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|     72|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 72, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (274:9): [True: 0, False: 72]
  ------------------
  275|      0|        return 0;
  276|       |
  277|     72|    err_load_strings(ERR_str_libraries);
  278|     72|    err_load_strings(ERR_str_reasons);
  279|     72|#endif
  280|     72|    return 1;
  281|     72|}
ERR_load_strings_const:
  297|     70|{
  298|     70|#ifndef OPENSSL_NO_ERR
  299|     70|    if (ossl_err_load_ERR_strings() == 0)
  ------------------
  |  Branch (299:9): [True: 0, False: 70]
  ------------------
  300|      0|        return 0;
  301|     70|    err_load_strings(str);
  302|     70|#endif
  303|       |
  304|     70|    return 1;
  305|     70|}
ERR_clear_error:
  335|  12.7k|{
  336|  12.7k|    int i;
  337|  12.7k|    ERR_STATE *es;
  338|       |
  339|  12.7k|    es = ossl_err_get_state_int();
  340|  12.7k|    if (es == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 12.7k]
  ------------------
  341|      0|        return;
  342|       |
  343|   216k|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|   216k|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (343:17): [True: 204k, False: 12.7k]
  ------------------
  344|   204k|        err_clear(es, i, 0);
  345|   204k|    }
  346|  12.7k|    es->top = es->bottom = 0;
  347|  12.7k|}
ERR_peek_error:
  375|  4.13k|{
  376|  4.13k|    return get_error_values(EV_PEEK, NULL, NULL, NULL, NULL, NULL);
  377|  4.13k|}
ERR_peek_last_error:
  410|  11.0M|{
  411|  11.0M|    return get_error_values(EV_PEEK_LAST, NULL, NULL, NULL, NULL, NULL);
  412|  11.0M|}
ERR_reason_error_string:
  613|     70|{
  614|     70|#ifndef OPENSSL_NO_ERR
  615|     70|    ERR_STRING_DATA d, *p = NULL;
  616|     70|    unsigned long l, r;
  617|       |
  618|     70|    if (!RUN_ONCE(&err_string_init, do_err_strings_init)) {
  ------------------
  |  |  130|     70|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 70, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (618:9): [True: 0, False: 70]
  ------------------
  619|      0|        return NULL;
  620|      0|    }
  621|       |
  622|       |    /*
  623|       |     * ERR_reason_error_string() can't safely return system error strings,
  624|       |     * since openssl_strerror_r() needs a buffer for thread safety, and we
  625|       |     * haven't got one that would serve any sensible purpose.
  626|       |     */
  627|     70|    if (ERR_SYSTEM_ERROR(e))
  ------------------
  |  |  239|     70|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|     70|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 70]
  |  |  ------------------
  ------------------
  628|      0|        return NULL;
  629|       |
  630|     70|    l = ERR_GET_LIB(e);
  631|     70|    r = ERR_GET_REASON(e);
  632|     70|    d.error = ERR_PACK(l, 0, r);
  ------------------
  |  |  279|     70|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     70|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     70|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     70|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     70|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  633|     70|    p = int_err_get_item(&d);
  634|     70|    if (p == NULL) {
  ------------------
  |  Branch (634:9): [True: 70, False: 0]
  ------------------
  635|     70|        d.error = ERR_PACK(0, 0, r);
  ------------------
  |  |  279|     70|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     70|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     70|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     70|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     70|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  636|     70|        p = int_err_get_item(&d);
  637|     70|    }
  638|     70|    return ((p == NULL) ? NULL : p->string);
  ------------------
  |  Branch (638:13): [True: 70, False: 0]
  ------------------
  639|       |#else
  640|       |    return NULL;
  641|       |#endif
  642|     70|}
ossl_err_get_state_int:
  673|  81.6M|{
  674|  81.6M|    ERR_STATE *state;
  675|  81.6M|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|  81.6M|# define get_last_sys_error()    errno
  ------------------
  676|       |
  677|  81.6M|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|  81.6M|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (677:9): [True: 0, False: 81.6M]
  ------------------
  678|      0|        return NULL;
  679|       |
  680|  81.6M|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|  81.6M|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 81.6M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (680:9): [True: 0, False: 81.6M]
  ------------------
  681|      0|        return NULL;
  682|       |
  683|  81.6M|    state = CRYPTO_THREAD_get_local(&err_thread_local);
  684|  81.6M|    if (state == (ERR_STATE*)-1)
  ------------------
  |  Branch (684:9): [True: 0, False: 81.6M]
  ------------------
  685|      0|        return NULL;
  686|       |
  687|  81.6M|    if (state == NULL) {
  ------------------
  |  Branch (687:9): [True: 2, False: 81.6M]
  ------------------
  688|      2|        if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1))
  ------------------
  |  Branch (688:13): [True: 0, False: 2]
  ------------------
  689|      0|            return NULL;
  690|       |
  691|      2|        state = OSSL_ERR_STATE_new();
  692|      2|        if (state == NULL) {
  ------------------
  |  Branch (692:13): [True: 0, False: 2]
  ------------------
  693|      0|            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  694|      0|            return NULL;
  695|      0|        }
  696|       |
  697|      2|        if (!ossl_init_thread_start(NULL, NULL, err_delete_thread_state)
  ------------------
  |  Branch (697:13): [True: 0, False: 2]
  ------------------
  698|      2|                || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
  ------------------
  |  Branch (698:20): [True: 0, False: 2]
  ------------------
  699|      0|            OSSL_ERR_STATE_free(state);
  700|      0|            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  701|      0|            return NULL;
  702|      0|        }
  703|       |
  704|       |        /* Ignore failures from these */
  705|      2|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  467|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  706|      2|    }
  707|       |
  708|  81.6M|    set_sys_error(saveerrno);
  ------------------
  |  |   32|  81.6M|# define set_sys_error(e)        errno=(e)
  ------------------
  709|  81.6M|    return state;
  710|  81.6M|}
err_shelve_state:
  725|      2|{
  726|      2|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|      2|# define get_last_sys_error()    errno
  ------------------
  727|       |
  728|       |    /*
  729|       |     * Note, at present our only caller is OPENSSL_init_crypto(), indirectly
  730|       |     * via ossl_init_load_crypto_nodelete(), by which point the requested
  731|       |     * "base" initialization has already been performed, so the below call is a
  732|       |     * NOOP, that re-enters OPENSSL_init_crypto() only to quickly return.
  733|       |     *
  734|       |     * If are no other valid callers of this function, the call below can be
  735|       |     * removed, avoiding the re-entry into OPENSSL_init_crypto().  If there are
  736|       |     * potential uses that are not from inside OPENSSL_init_crypto(), then this
  737|       |     * call is needed, but some care is required to make sure that the re-entry
  738|       |     * remains a NOOP.
  739|       |     */
  740|      2|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (740:9): [True: 0, False: 2]
  ------------------
  741|      0|        return 0;
  742|       |
  743|      2|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (743:9): [True: 0, False: 2]
  ------------------
  744|      0|        return 0;
  745|       |
  746|      2|    *state = CRYPTO_THREAD_get_local(&err_thread_local);
  747|      2|    if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1))
  ------------------
  |  Branch (747:9): [True: 0, False: 2]
  ------------------
  748|      0|        return 0;
  749|       |
  750|      2|    set_sys_error(saveerrno);
  ------------------
  |  |   32|      2|# define set_sys_error(e)        errno=(e)
  ------------------
  751|      2|    return 1;
  752|      2|}
err_unshelve_state:
  759|      2|{
  760|      2|    if (state != (void*)-1)
  ------------------
  |  Branch (760:9): [True: 2, False: 0]
  ------------------
  761|      2|        CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)state);
  762|      2|}
ERR_get_next_error_library:
  765|      3|{
  766|      3|    int ret;
  767|       |
  768|      3|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|      3|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 3, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (768:9): [True: 0, False: 3]
  ------------------
  769|      0|        return 0;
  770|       |
  771|      3|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (771:9): [True: 0, False: 3]
  ------------------
  772|      0|        return 0;
  773|      3|    ret = int_err_library_number++;
  774|      3|    CRYPTO_THREAD_unlock(err_string_lock);
  775|      3|    return ret;
  776|      3|}
ERR_add_error_data:
  813|  2.41M|{
  814|  2.41M|    va_list args;
  815|  2.41M|    va_start(args, num);
  816|  2.41M|    ERR_add_error_vdata(num, args);
  817|  2.41M|    va_end(args);
  818|  2.41M|}
ERR_add_error_vdata:
  821|  2.41M|{
  822|  2.41M|    int i, len, size;
  823|  2.41M|    int flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   48|  2.41M|# define ERR_TXT_MALLOCED        0x01
  ------------------
                  int flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   49|  2.41M|# define ERR_TXT_STRING          0x02
  ------------------
  824|  2.41M|    char *str, *arg;
  825|  2.41M|    ERR_STATE *es;
  826|       |
  827|       |    /* Get the current error data; if an allocated string get it. */
  828|  2.41M|    es = ossl_err_get_state_int();
  829|  2.41M|    if (es == NULL)
  ------------------
  |  Branch (829:9): [True: 0, False: 2.41M]
  ------------------
  830|      0|        return;
  831|  2.41M|    i = es->top;
  832|       |
  833|       |    /*
  834|       |     * If err_data is allocated already, reuse the space.
  835|       |     * Otherwise, allocate a small new buffer.
  836|       |     */
  837|  2.41M|    if ((es->err_data_flags[i] & flags) == flags
  ------------------
  |  Branch (837:9): [True: 0, False: 2.41M]
  ------------------
  838|  2.41M|            && ossl_assert(es->err_data[i] != NULL)) {
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:26): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  839|      0|        str = es->err_data[i];
  840|      0|        size = es->err_data_size[i];
  841|       |
  842|       |        /*
  843|       |         * To protect the string we just grabbed from tampering by other
  844|       |         * functions we may call, or to protect them from freeing a pointer
  845|       |         * that may no longer be valid at that point, we clear away the
  846|       |         * data pointer and the flags.  We will set them again at the end
  847|       |         * of this function.
  848|       |         */
  849|      0|        es->err_data[i] = NULL;
  850|      0|        es->err_data_flags[i] = 0;
  851|  2.41M|    } else if ((str = OPENSSL_malloc(size = 81)) == NULL) {
  ------------------
  |  |  102|  2.41M|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.41M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.41M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (851:16): [True: 0, False: 2.41M]
  ------------------
  852|      0|        return;
  853|  2.41M|    } else {
  854|  2.41M|        str[0] = '\0';
  855|  2.41M|    }
  856|  2.41M|    len = strlen(str);
  857|       |
  858|  10.3M|    while (--num >= 0) {
  ------------------
  |  Branch (858:12): [True: 7.88M, False: 2.41M]
  ------------------
  859|  7.88M|        arg = va_arg(args, char *);
  860|  7.88M|        if (arg == NULL)
  ------------------
  |  Branch (860:13): [True: 0, False: 7.88M]
  ------------------
  861|      0|            arg = "<NULL>";
  862|  7.88M|        len += strlen(arg);
  863|  7.88M|        if (len >= size) {
  ------------------
  |  Branch (863:13): [True: 0, False: 7.88M]
  ------------------
  864|      0|            char *p;
  865|       |
  866|      0|            size = len + 20;
  867|      0|            p = OPENSSL_realloc(str, size);
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  868|      0|            if (p == NULL) {
  ------------------
  |  Branch (868:17): [True: 0, False: 0]
  ------------------
  869|      0|                OPENSSL_free(str);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  870|      0|                return;
  871|      0|            }
  872|      0|            str = p;
  873|      0|        }
  874|  7.88M|        OPENSSL_strlcat(str, arg, (size_t)size);
  875|  7.88M|    }
  876|  2.41M|    if (!err_set_error_data_int(str, size, flags, 0))
  ------------------
  |  Branch (876:9): [True: 0, False: 2.41M]
  ------------------
  877|      0|        OPENSSL_free(str);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  878|  2.41M|}
err.c:do_err_strings_init:
  214|      2|{
  215|      2|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (215:9): [True: 0, False: 2]
  ------------------
  216|      0|        return 0;
  217|      2|    err_string_lock = CRYPTO_THREAD_lock_new();
  218|      2|    if (err_string_lock == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 2]
  ------------------
  219|      0|        return 0;
  220|      2|#ifndef OPENSSL_NO_ERR
  221|      2|    int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash,
  ------------------
  |  |  375|      2|#define lh_ERR_STRING_DATA_new(hfn, cmp) ((LHASH_OF(ERR_STRING_DATA) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_ERR_STRING_DATA_lh_hashfunc_type(hfn), ossl_check_ERR_STRING_DATA_lh_compfunc_type(cmp)), lh_ERR_STRING_DATA_hash_thunk, lh_ERR_STRING_DATA_comp_thunk, lh_ERR_STRING_DATA_doall_thunk, lh_ERR_STRING_DATA_doall_arg_thunk))
  ------------------
  222|      2|                                            err_string_data_cmp);
  223|      2|    if (int_error_hash == NULL) {
  ------------------
  |  Branch (223:9): [True: 0, False: 2]
  ------------------
  224|      0|        CRYPTO_THREAD_lock_free(err_string_lock);
  225|      0|        err_string_lock = NULL;
  226|      0|        return 0;
  227|      0|    }
  228|      2|#endif
  229|      2|    return 1;
  230|      2|}
err.c:err_string_data_hash:
  172|  9.64k|{
  173|  9.64k|    unsigned long ret, l;
  174|       |
  175|  9.64k|    l = a->error;
  176|  9.64k|    ret = l ^ ERR_GET_LIB(l);
  177|  9.64k|    return (ret ^ ret % 19 * 13);
  178|  9.64k|}
err.c:err_string_data_cmp:
  182|  6.16k|{
  183|  6.16k|    if (a->error == b->error)
  ------------------
  |  Branch (183:9): [True: 5.74k, False: 420]
  ------------------
  184|  5.74k|        return 0;
  185|    420|    return a->error > b->error ? 1 : -1;
  ------------------
  |  Branch (185:12): [True: 226, False: 194]
  ------------------
  186|  6.16k|}
err.c:err_load_strings:
  260|    214|{
  261|    214|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (261:9): [True: 0, False: 214]
  ------------------
  262|      0|        return 0;
  263|  9.71k|    for (; str->error; str++)
  ------------------
  |  Branch (263:12): [True: 9.50k, False: 214]
  ------------------
  264|  9.50k|        (void)lh_ERR_STRING_DATA_insert(int_error_hash,
  ------------------
  |  |  378|  9.71k|#define lh_ERR_STRING_DATA_insert(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_insert(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_ERR_STRING_DATA_lh_plain_type(ptr)))
  ------------------
  265|    214|                                       (ERR_STRING_DATA *)str);
  266|    214|    CRYPTO_THREAD_unlock(err_string_lock);
  267|    214|    return 1;
  268|    214|}
err.c:get_error_values:
  448|  11.0M|{
  449|  11.0M|    int i = 0;
  450|  11.0M|    ERR_STATE *es;
  451|  11.0M|    unsigned long ret;
  452|       |
  453|  11.0M|    es = ossl_err_get_state_int();
  454|  11.0M|    if (es == NULL)
  ------------------
  |  Branch (454:9): [True: 0, False: 11.0M]
  ------------------
  455|      0|        return 0;
  456|       |
  457|       |    /*
  458|       |     * Clear anything that should have been cleared earlier. We do this
  459|       |     * here because this doesn't have constant-time issues.
  460|       |     */
  461|  11.0M|    while (es->bottom != es->top) {
  ------------------
  |  Branch (461:12): [True: 11.0M, False: 48.8k]
  ------------------
  462|  11.0M|        if (es->err_flags[es->top] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|  11.0M|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (462:13): [True: 0, False: 11.0M]
  ------------------
  463|      0|            err_clear(es, es->top, 0);
  464|      0|            es->top = es->top > 0 ? es->top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|      0|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (464:23): [True: 0, False: 0]
  ------------------
  465|      0|            continue;
  466|      0|        }
  467|  11.0M|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|  11.0M|#  define ERR_NUM_ERRORS  16
  ------------------
  468|  11.0M|        if (es->err_flags[i] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|  11.0M|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (468:13): [True: 0, False: 11.0M]
  ------------------
  469|      0|            es->bottom = i;
  470|      0|            err_clear(es, es->bottom, 0);
  471|      0|            continue;
  472|      0|        }
  473|  11.0M|        break;
  474|  11.0M|    }
  475|       |
  476|       |    /* If everything has been cleared, the stack is empty. */
  477|  11.0M|    if (es->bottom == es->top)
  ------------------
  |  Branch (477:9): [True: 48.8k, False: 11.0M]
  ------------------
  478|  48.8k|        return 0;
  479|       |
  480|       |    /* Which error, the top of stack (latest one) or the first one? */
  481|  11.0M|    if (g == EV_PEEK_LAST)
  ------------------
  |  Branch (481:9): [True: 11.0M, False: 19]
  ------------------
  482|  11.0M|        i = es->top;
  483|     19|    else
  484|     19|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|     19|#  define ERR_NUM_ERRORS  16
  ------------------
  485|       |
  486|  11.0M|    ret = es->err_buffer[i];
  487|  11.0M|    if (g == EV_POP) {
  ------------------
  |  Branch (487:9): [True: 0, False: 11.0M]
  ------------------
  488|      0|        es->bottom = i;
  489|      0|        es->err_buffer[i] = 0;
  490|      0|    }
  491|       |
  492|  11.0M|    if (file != NULL) {
  ------------------
  |  Branch (492:9): [True: 0, False: 11.0M]
  ------------------
  493|      0|        *file = es->err_file[i];
  494|      0|        if (*file == NULL)
  ------------------
  |  Branch (494:13): [True: 0, False: 0]
  ------------------
  495|      0|            *file = "";
  496|      0|    }
  497|  11.0M|    if (line != NULL)
  ------------------
  |  Branch (497:9): [True: 0, False: 11.0M]
  ------------------
  498|      0|        *line = es->err_line[i];
  499|  11.0M|    if (func != NULL) {
  ------------------
  |  Branch (499:9): [True: 0, False: 11.0M]
  ------------------
  500|      0|        *func = es->err_func[i];
  501|      0|        if (*func == NULL)
  ------------------
  |  Branch (501:13): [True: 0, False: 0]
  ------------------
  502|      0|            *func = "";
  503|      0|    }
  504|  11.0M|    if (flags != NULL)
  ------------------
  |  Branch (504:9): [True: 0, False: 11.0M]
  ------------------
  505|      0|        *flags = es->err_data_flags[i];
  506|  11.0M|    if (data == NULL) {
  ------------------
  |  Branch (506:9): [True: 11.0M, False: 0]
  ------------------
  507|  11.0M|        if (g == EV_POP) {
  ------------------
  |  Branch (507:13): [True: 0, False: 11.0M]
  ------------------
  508|      0|            err_clear_data(es, i, 0);
  509|      0|        }
  510|  11.0M|    } else {
  511|      0|        *data = es->err_data[i];
  512|      0|        if (*data == NULL) {
  ------------------
  |  Branch (512:13): [True: 0, False: 0]
  ------------------
  513|      0|            *data = "";
  514|      0|            if (flags != NULL)
  ------------------
  |  Branch (514:17): [True: 0, False: 0]
  ------------------
  515|      0|                *flags = 0;
  516|      0|        }
  517|      0|    }
  518|  11.0M|    return ret;
  519|  11.0M|}
err.c:int_err_get_item:
  189|    140|{
  190|    140|    ERR_STRING_DATA *p = NULL;
  191|       |
  192|    140|    if (!CRYPTO_THREAD_read_lock(err_string_lock))
  ------------------
  |  Branch (192:9): [True: 0, False: 140]
  ------------------
  193|      0|        return NULL;
  194|    140|    p = lh_ERR_STRING_DATA_retrieve(int_error_hash, d);
  ------------------
  |  |  380|    140|#define lh_ERR_STRING_DATA_retrieve(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_retrieve(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_const_ERR_STRING_DATA_lh_plain_type(ptr)))
  ------------------
  195|    140|    CRYPTO_THREAD_unlock(err_string_lock);
  196|       |
  197|    140|    return p;
  198|    140|}
err.c:err_do_init:
  667|      2|{
  668|      2|    set_err_thread_local = 1;
  669|      2|    return CRYPTO_THREAD_init_local(&err_thread_local, NULL);
  670|      2|}
err.c:err_delete_thread_state:
  645|      2|{
  646|      2|    ERR_STATE *state = CRYPTO_THREAD_get_local(&err_thread_local);
  647|      2|    if (state == NULL)
  ------------------
  |  Branch (647:9): [True: 0, False: 2]
  ------------------
  648|      0|        return;
  649|       |
  650|      2|    CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  651|      2|    OSSL_ERR_STATE_free(state);
  652|      2|}
err.c:err_set_error_data_int:
  780|  2.41M|{
  781|  2.41M|    ERR_STATE *es;
  782|       |
  783|  2.41M|    es = ossl_err_get_state_int();
  784|  2.41M|    if (es == NULL)
  ------------------
  |  Branch (784:9): [True: 0, False: 2.41M]
  ------------------
  785|      0|        return 0;
  786|       |
  787|  2.41M|    err_clear_data(es, es->top, deallocate);
  788|  2.41M|    err_set_data(es, es->top, data, size, flags);
  789|       |
  790|  2.41M|    return 1;
  791|  2.41M|}

ossl_err_load_crypto_strings:
   49|      2|{
   50|      2|    if (0
  ------------------
  |  Branch (50:9): [Folded - Ignored]
  ------------------
   51|      2|#ifndef OPENSSL_NO_ERR
   52|      2|        || ossl_err_load_ERR_strings() == 0 /* include error strings for SYSerr */
  ------------------
  |  Branch (52:12): [True: 0, False: 2]
  ------------------
   53|      2|        || ossl_err_load_BN_strings() == 0
  ------------------
  |  Branch (53:12): [True: 0, False: 2]
  ------------------
   54|      2|        || ossl_err_load_RSA_strings() == 0
  ------------------
  |  Branch (54:12): [True: 0, False: 2]
  ------------------
   55|      2|# ifndef OPENSSL_NO_DH
   56|      2|        || ossl_err_load_DH_strings() == 0
  ------------------
  |  Branch (56:12): [True: 0, False: 2]
  ------------------
   57|      2|# endif
   58|      2|        || ossl_err_load_EVP_strings() == 0
  ------------------
  |  Branch (58:12): [True: 0, False: 2]
  ------------------
   59|      2|        || ossl_err_load_BUF_strings() == 0
  ------------------
  |  Branch (59:12): [True: 0, False: 2]
  ------------------
   60|      2|        || ossl_err_load_OBJ_strings() == 0
  ------------------
  |  Branch (60:12): [True: 0, False: 2]
  ------------------
   61|      2|        || ossl_err_load_PEM_strings() == 0
  ------------------
  |  Branch (61:12): [True: 0, False: 2]
  ------------------
   62|      2|# ifndef OPENSSL_NO_DSA
   63|      2|        || ossl_err_load_DSA_strings() == 0
  ------------------
  |  Branch (63:12): [True: 0, False: 2]
  ------------------
   64|      2|# endif
   65|      2|        || ossl_err_load_X509_strings() == 0
  ------------------
  |  Branch (65:12): [True: 0, False: 2]
  ------------------
   66|      2|        || ossl_err_load_ASN1_strings() == 0
  ------------------
  |  Branch (66:12): [True: 0, False: 2]
  ------------------
   67|      2|        || ossl_err_load_CONF_strings() == 0
  ------------------
  |  Branch (67:12): [True: 0, False: 2]
  ------------------
   68|      2|        || ossl_err_load_CRYPTO_strings() == 0
  ------------------
  |  Branch (68:12): [True: 0, False: 2]
  ------------------
   69|      2|# ifndef OPENSSL_NO_COMP
   70|      2|        || ossl_err_load_COMP_strings() == 0
  ------------------
  |  Branch (70:12): [True: 0, False: 2]
  ------------------
   71|      2|# endif
   72|      2|# ifndef OPENSSL_NO_EC
   73|      2|        || ossl_err_load_EC_strings() == 0
  ------------------
  |  Branch (73:12): [True: 0, False: 2]
  ------------------
   74|      2|# endif
   75|       |        /* skip ossl_err_load_SSL_strings() because it is not in this library */
   76|      2|        || ossl_err_load_BIO_strings() == 0
  ------------------
  |  Branch (76:12): [True: 0, False: 2]
  ------------------
   77|      2|        || ossl_err_load_PKCS7_strings() == 0
  ------------------
  |  Branch (77:12): [True: 0, False: 2]
  ------------------
   78|      2|        || ossl_err_load_X509V3_strings() == 0
  ------------------
  |  Branch (78:12): [True: 0, False: 2]
  ------------------
   79|      2|        || ossl_err_load_PKCS12_strings() == 0
  ------------------
  |  Branch (79:12): [True: 0, False: 2]
  ------------------
   80|      2|        || ossl_err_load_RAND_strings() == 0
  ------------------
  |  Branch (80:12): [True: 0, False: 2]
  ------------------
   81|      2|        || ossl_err_load_DSO_strings() == 0
  ------------------
  |  Branch (81:12): [True: 0, False: 2]
  ------------------
   82|      2|# ifndef OPENSSL_NO_TS
   83|      2|        || ossl_err_load_TS_strings() == 0
  ------------------
  |  Branch (83:12): [True: 0, False: 2]
  ------------------
   84|      2|# endif
   85|      2|# ifndef OPENSSL_NO_ENGINE
   86|      2|        || ossl_err_load_ENGINE_strings() == 0
  ------------------
  |  Branch (86:12): [True: 0, False: 2]
  ------------------
   87|      2|# endif
   88|      2|# ifndef OPENSSL_NO_HTTP
   89|      2|        || ossl_err_load_HTTP_strings() == 0
  ------------------
  |  Branch (89:12): [True: 0, False: 2]
  ------------------
   90|      2|# endif
   91|      2|# ifndef OPENSSL_NO_OCSP
   92|      2|        || ossl_err_load_OCSP_strings() == 0
  ------------------
  |  Branch (92:12): [True: 0, False: 2]
  ------------------
   93|      2|# endif
   94|      2|        || ossl_err_load_UI_strings() == 0
  ------------------
  |  Branch (94:12): [True: 0, False: 2]
  ------------------
   95|      2|# ifndef OPENSSL_NO_CMS
   96|      2|        || ossl_err_load_CMS_strings() == 0
  ------------------
  |  Branch (96:12): [True: 0, False: 2]
  ------------------
   97|      2|# endif
   98|      2|# ifndef OPENSSL_NO_CRMF
   99|      2|        || ossl_err_load_CRMF_strings() == 0
  ------------------
  |  Branch (99:12): [True: 0, False: 2]
  ------------------
  100|      2|        || ossl_err_load_CMP_strings() == 0
  ------------------
  |  Branch (100:12): [True: 0, False: 2]
  ------------------
  101|      2|# endif
  102|      2|# ifndef OPENSSL_NO_CT
  103|      2|        || ossl_err_load_CT_strings() == 0
  ------------------
  |  Branch (103:12): [True: 0, False: 2]
  ------------------
  104|      2|# endif
  105|      2|        || ossl_err_load_ESS_strings() == 0
  ------------------
  |  Branch (105:12): [True: 0, False: 2]
  ------------------
  106|      2|        || ossl_err_load_ASYNC_strings() == 0
  ------------------
  |  Branch (106:12): [True: 0, False: 2]
  ------------------
  107|      2|        || ossl_err_load_OSSL_STORE_strings() == 0
  ------------------
  |  Branch (107:12): [True: 0, False: 2]
  ------------------
  108|      2|        || ossl_err_load_PROP_strings() == 0
  ------------------
  |  Branch (108:12): [True: 0, False: 2]
  ------------------
  109|      2|        || ossl_err_load_PROV_strings() == 0
  ------------------
  |  Branch (109:12): [True: 0, False: 2]
  ------------------
  110|      2|#endif
  111|      2|        )
  112|      0|        return 0;
  113|       |
  114|      2|    return 1;
  115|      2|}

ERR_new:
   17|  17.4M|{
   18|  17.4M|    ERR_STATE *es;
   19|       |
   20|  17.4M|    es = ossl_err_get_state_int();
   21|  17.4M|    if (es == NULL)
  ------------------
  |  Branch (21:9): [True: 0, False: 17.4M]
  ------------------
   22|      0|        return;
   23|       |
   24|       |    /* Allocate a slot */
   25|  17.4M|    err_get_slot(es);
   26|  17.4M|    err_clear(es, es->top, 0);
   27|  17.4M|}
ERR_set_debug:
   30|  17.4M|{
   31|  17.4M|    ERR_STATE *es;
   32|       |
   33|  17.4M|    es = ossl_err_get_state_int();
   34|  17.4M|    if (es == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 17.4M]
  ------------------
   35|      0|        return;
   36|       |
   37|  17.4M|    err_set_debug(es, es->top, file, line, func);
   38|  17.4M|}
ERR_set_error:
   41|  17.4M|{
   42|  17.4M|    va_list args;
   43|       |
   44|  17.4M|    va_start(args, fmt);
   45|  17.4M|    ERR_vset_error(lib, reason, fmt, args);
   46|  17.4M|    va_end(args);
   47|  17.4M|}
ERR_vset_error:
   50|  17.4M|{
   51|  17.4M|    ERR_STATE *es;
   52|  17.4M|    char *buf = NULL;
   53|  17.4M|    size_t buf_size = 0;
   54|  17.4M|    unsigned long flags = 0;
   55|  17.4M|    size_t i;
   56|       |
   57|  17.4M|    es = ossl_err_get_state_int();
   58|  17.4M|    if (es == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 17.4M]
  ------------------
   59|      0|        return;
   60|  17.4M|    i = es->top;
   61|       |
   62|  17.4M|    if (fmt != NULL) {
  ------------------
  |  Branch (62:9): [True: 33.3k, False: 17.3M]
  ------------------
   63|  33.3k|        int printed_len = 0;
   64|  33.3k|        char *rbuf = NULL;
   65|       |
   66|  33.3k|        buf = es->err_data[i];
   67|  33.3k|        buf_size = es->err_data_size[i];
   68|       |
   69|       |        /*
   70|       |         * To protect the string we just grabbed from tampering by other
   71|       |         * functions we may call, or to protect them from freeing a pointer
   72|       |         * that may no longer be valid at that point, we clear away the
   73|       |         * data pointer and the flags.  We will set them again at the end
   74|       |         * of this function.
   75|       |         */
   76|  33.3k|        es->err_data[i] = NULL;
   77|  33.3k|        es->err_data_flags[i] = 0;
   78|       |
   79|       |        /*
   80|       |         * Try to maximize the space available.  If that fails, we use what
   81|       |         * we have.
   82|       |         */
   83|  33.3k|        if (buf_size < ERR_MAX_DATA_SIZE
  ------------------
  |  |  392|  66.6k|#define ERR_MAX_DATA_SIZE       1024
  ------------------
  |  Branch (83:13): [True: 33.3k, False: 0]
  ------------------
   84|  33.3k|            && (rbuf = OPENSSL_realloc(buf, ERR_MAX_DATA_SIZE)) != NULL) {
  ------------------
  |  |  109|  33.3k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  33.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  33.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (84:16): [True: 33.3k, False: 0]
  ------------------
   85|  33.3k|            buf = rbuf;
   86|  33.3k|            buf_size = ERR_MAX_DATA_SIZE;
  ------------------
  |  |  392|  33.3k|#define ERR_MAX_DATA_SIZE       1024
  ------------------
   87|  33.3k|        }
   88|       |
   89|  33.3k|        if (buf != NULL) {
  ------------------
  |  Branch (89:13): [True: 33.3k, False: 0]
  ------------------
   90|  33.3k|            printed_len = BIO_vsnprintf(buf, buf_size, fmt, args);
   91|  33.3k|        }
   92|  33.3k|        if (printed_len < 0)
  ------------------
  |  Branch (92:13): [True: 0, False: 33.3k]
  ------------------
   93|      0|            printed_len = 0;
   94|  33.3k|        if (buf != NULL)
  ------------------
  |  Branch (94:13): [True: 33.3k, False: 0]
  ------------------
   95|  33.3k|            buf[printed_len] = '\0';
   96|       |
   97|       |        /*
   98|       |         * Try to reduce the size, but only if we maximized above.  If that
   99|       |         * fails, we keep what we have.
  100|       |         * (According to documentation, realloc leaves the old buffer untouched
  101|       |         * if it fails)
  102|       |         */
  103|  33.3k|        if ((rbuf = OPENSSL_realloc(buf, printed_len + 1)) != NULL) {
  ------------------
  |  |  109|  33.3k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  33.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  33.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (103:13): [True: 33.3k, False: 0]
  ------------------
  104|  33.3k|            buf = rbuf;
  105|  33.3k|            buf_size = printed_len + 1;
  106|  33.3k|            buf[printed_len] = '\0';
  107|  33.3k|        }
  108|       |
  109|  33.3k|        if (buf != NULL)
  ------------------
  |  Branch (109:13): [True: 33.3k, False: 0]
  ------------------
  110|  33.3k|            flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   48|  33.3k|# define ERR_TXT_MALLOCED        0x01
  ------------------
                          flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   49|  33.3k|# define ERR_TXT_STRING          0x02
  ------------------
  111|  33.3k|    }
  112|       |
  113|  17.4M|    err_clear_data(es, es->top, 0);
  114|  17.4M|    err_set_error(es, es->top, lib, reason);
  115|  17.4M|    if (fmt != NULL)
  ------------------
  |  Branch (115:9): [True: 33.3k, False: 17.3M]
  ------------------
  116|  33.3k|        err_set_data(es, es->top, buf, buf_size, flags);
  117|  17.4M|}

err.c:err_clear:
   85|   204k|{
   86|   204k|    err_clear_data(es, i, (deall));
   87|   204k|    es->err_marks[i] = 0;
   88|   204k|    es->err_flags[i] = 0;
   89|   204k|    es->err_buffer[i] = 0;
   90|   204k|    es->err_line[i] = -1;
   91|   204k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  115|   204k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   204k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   204k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|   204k|    es->err_file[i] = NULL;
   93|   204k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  115|   204k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   204k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   204k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|   204k|    es->err_func[i] = NULL;
   95|   204k|}
err.c:err_clear_data:
   22|  2.61M|{
   23|  2.61M|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   48|  2.61M|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (23:9): [True: 2.61M, False: 60]
  ------------------
   24|  2.61M|        if (deall) {
  ------------------
  |  Branch (24:13): [True: 17, False: 2.61M]
  ------------------
   25|     17|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  115|     17|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     17|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     17|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|     17|            es->err_data[i] = NULL;
   27|     17|            es->err_data_size[i] = 0;
   28|     17|            es->err_data_flags[i] = 0;
   29|  2.61M|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (29:20): [True: 2.61M, False: 0]
  ------------------
   30|  2.61M|            es->err_data[i][0] = '\0';
   31|  2.61M|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   48|  2.61M|# define ERR_TXT_MALLOCED        0x01
  ------------------
   32|  2.61M|        }
   33|  2.61M|    } else {
   34|     60|        es->err_data[i] = NULL;
   35|     60|        es->err_data_size[i] = 0;
   36|     60|        es->err_data_flags[i] = 0;
   37|     60|    }
   38|  2.61M|}
err.c:err_set_data:
   76|  2.41M|{
   77|  2.41M|    if ((es->err_data_flags[i] & ERR_TXT_MALLOCED) != 0)
  ------------------
  |  |   48|  2.41M|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (77:9): [True: 2.41M, False: 15]
  ------------------
   78|  2.41M|        OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  115|  2.41M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.41M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.41M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|  2.41M|    es->err_data[i] = data;
   80|  2.41M|    es->err_data_size[i] = datasz;
   81|  2.41M|    es->err_data_flags[i] = flags;
   82|  2.41M|}
err_blocks.c:err_get_slot:
   15|  17.4M|{
   16|  17.4M|    es->top = (es->top + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|  17.4M|#  define ERR_NUM_ERRORS  16
  ------------------
   17|  17.4M|    if (es->top == es->bottom)
  ------------------
  |  Branch (17:9): [True: 5.15M, False: 12.2M]
  ------------------
   18|  5.15M|        es->bottom = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|  5.15M|#  define ERR_NUM_ERRORS  16
  ------------------
   19|  17.4M|}
err_blocks.c:err_clear:
   85|  17.4M|{
   86|  17.4M|    err_clear_data(es, i, (deall));
   87|  17.4M|    es->err_marks[i] = 0;
   88|  17.4M|    es->err_flags[i] = 0;
   89|  17.4M|    es->err_buffer[i] = 0;
   90|  17.4M|    es->err_line[i] = -1;
   91|  17.4M|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  115|  17.4M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  17.4M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  17.4M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|  17.4M|    es->err_file[i] = NULL;
   93|  17.4M|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  115|  17.4M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  17.4M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  17.4M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|  17.4M|    es->err_func[i] = NULL;
   95|  17.4M|}
err_blocks.c:err_set_debug:
   52|  17.4M|{
   53|       |    /*
   54|       |     * We dup the file and fn strings because they may be provider owned. If the
   55|       |     * provider gets unloaded, they may not be valid anymore.
   56|       |     */
   57|  17.4M|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  115|  17.4M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  17.4M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  17.4M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   58|  17.4M|    if (file == NULL || file[0] == '\0')
  ------------------
  |  Branch (58:9): [True: 0, False: 17.4M]
  |  Branch (58:25): [True: 0, False: 17.4M]
  ------------------
   59|      0|        es->err_file[i] = NULL;
   60|  17.4M|    else if ((es->err_file[i] = CRYPTO_malloc(strlen(file) + 1,
  ------------------
  |  Branch (60:14): [True: 17.4M, False: 0]
  ------------------
   61|  17.4M|                                              NULL, 0)) != NULL)
   62|       |        /* We cannot use OPENSSL_strdup due to possible recursion */
   63|  17.4M|        strcpy(es->err_file[i], file);
   64|       |
   65|  17.4M|    es->err_line[i] = line;
   66|  17.4M|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  115|  17.4M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  17.4M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  17.4M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|  17.4M|    if (fn == NULL || fn[0] == '\0')
  ------------------
  |  Branch (67:9): [True: 0, False: 17.4M]
  |  Branch (67:23): [True: 0, False: 17.4M]
  ------------------
   68|      0|        es->err_func[i] = NULL;
   69|  17.4M|    else if ((es->err_func[i] = CRYPTO_malloc(strlen(fn) + 1,
  ------------------
  |  Branch (69:14): [True: 17.4M, False: 0]
  ------------------
   70|  17.4M|                                              NULL, 0)) != NULL)
   71|  17.4M|        strcpy(es->err_func[i], fn);
   72|  17.4M|}
err_blocks.c:err_clear_data:
   22|  34.8M|{
   23|  34.8M|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   48|  34.8M|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (23:9): [True: 34.8M, False: 33.5k]
  ------------------
   24|  34.8M|        if (deall) {
  ------------------
  |  Branch (24:13): [True: 0, False: 34.8M]
  ------------------
   25|      0|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|      0|            es->err_data[i] = NULL;
   27|      0|            es->err_data_size[i] = 0;
   28|      0|            es->err_data_flags[i] = 0;
   29|  34.8M|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (29:20): [True: 34.8M, False: 0]
  ------------------
   30|  34.8M|            es->err_data[i][0] = '\0';
   31|  34.8M|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   48|  34.8M|# define ERR_TXT_MALLOCED        0x01
  ------------------
   32|  34.8M|        }
   33|  34.8M|    } else {
   34|  33.5k|        es->err_data[i] = NULL;
   35|  33.5k|        es->err_data_size[i] = 0;
   36|  33.5k|        es->err_data_flags[i] = 0;
   37|  33.5k|    }
   38|  34.8M|}
err_blocks.c:err_set_error:
   42|  17.4M|{
   43|  17.4M|    es->err_buffer[i] =
   44|  17.4M|        lib == ERR_LIB_SYS
  ------------------
  |  |   72|  17.4M|# define ERR_LIB_SYS             2
  ------------------
  |  Branch (44:9): [True: 2, False: 17.4M]
  ------------------
   45|  17.4M|        ? (unsigned int)(ERR_SYSTEM_FLAG |  reason)
  ------------------
  |  |  218|      2|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  ------------------
   46|  17.4M|        : ERR_PACK(lib, 0, reason);
  ------------------
  |  |  279|  34.8M|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|  17.4M|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|  17.4M|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|  34.8M|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|  17.4M|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
   47|  17.4M|}
err_blocks.c:err_set_data:
   76|  33.3k|{
   77|  33.3k|    if ((es->err_data_flags[i] & ERR_TXT_MALLOCED) != 0)
  ------------------
  |  |   48|  33.3k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (77:9): [True: 0, False: 33.3k]
  ------------------
   78|      0|        OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|  33.3k|    es->err_data[i] = data;
   80|  33.3k|    es->err_data_size[i] = datasz;
   81|  33.3k|    es->err_data_flags[i] = flags;
   82|  33.3k|}
err_mark.c:err_clear:
   85|  12.1M|{
   86|  12.1M|    err_clear_data(es, i, (deall));
   87|  12.1M|    es->err_marks[i] = 0;
   88|  12.1M|    es->err_flags[i] = 0;
   89|  12.1M|    es->err_buffer[i] = 0;
   90|  12.1M|    es->err_line[i] = -1;
   91|  12.1M|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  115|  12.1M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  12.1M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  12.1M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|  12.1M|    es->err_file[i] = NULL;
   93|  12.1M|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  115|  12.1M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  12.1M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  12.1M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|  12.1M|    es->err_func[i] = NULL;
   95|  12.1M|}
err_mark.c:err_clear_data:
   22|  12.1M|{
   23|  12.1M|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   48|  12.1M|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (23:9): [True: 12.1M, False: 4]
  ------------------
   24|  12.1M|        if (deall) {
  ------------------
  |  Branch (24:13): [True: 0, False: 12.1M]
  ------------------
   25|      0|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|      0|            es->err_data[i] = NULL;
   27|      0|            es->err_data_size[i] = 0;
   28|      0|            es->err_data_flags[i] = 0;
   29|  12.1M|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (29:20): [True: 12.1M, False: 0]
  ------------------
   30|  12.1M|            es->err_data[i][0] = '\0';
   31|  12.1M|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   48|  12.1M|# define ERR_TXT_MALLOCED        0x01
  ------------------
   32|  12.1M|        }
   33|  12.1M|    } else {
   34|      4|        es->err_data[i] = NULL;
   35|      4|        es->err_data_size[i] = 0;
   36|      4|        es->err_data_flags[i] = 0;
   37|      4|    }
   38|  12.1M|}

ERR_set_mark:
   16|  1.38M|{
   17|  1.38M|    ERR_STATE *es;
   18|       |
   19|  1.38M|    es = ossl_err_get_state_int();
   20|  1.38M|    if (es == NULL)
  ------------------
  |  Branch (20:9): [True: 0, False: 1.38M]
  ------------------
   21|      0|        return 0;
   22|       |
   23|  1.38M|    if (es->bottom == es->top)
  ------------------
  |  Branch (23:9): [True: 562k, False: 818k]
  ------------------
   24|   562k|        return 0;
   25|   818k|    es->err_marks[es->top]++;
   26|   818k|    return 1;
   27|  1.38M|}
ERR_pop_to_mark:
   43|  11.5M|{
   44|  11.5M|    ERR_STATE *es;
   45|       |
   46|  11.5M|    es = ossl_err_get_state_int();
   47|  11.5M|    if (es == NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 11.5M]
  ------------------
   48|      0|        return 0;
   49|       |
   50|  23.6M|    while (es->bottom != es->top
  ------------------
  |  Branch (50:12): [True: 12.5M, False: 11.1M]
  ------------------
   51|  23.6M|           && es->err_marks[es->top] == 0) {
  ------------------
  |  Branch (51:15): [True: 12.1M, False: 437k]
  ------------------
   52|  12.1M|        err_clear(es, es->top, 0);
   53|  12.1M|        es->top = es->top > 0 ? es->top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|   760k|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (53:19): [True: 11.3M, False: 760k]
  ------------------
   54|  12.1M|    }
   55|       |
   56|  11.5M|    if (es->bottom == es->top)
  ------------------
  |  Branch (56:9): [True: 11.1M, False: 437k]
  ------------------
   57|  11.1M|        return 0;
   58|   437k|    es->err_marks[es->top]--;
   59|   437k|    return 1;
   60|  11.5M|}
ERR_clear_last_mark:
   82|   451k|{
   83|   451k|    ERR_STATE *es;
   84|   451k|    int top;
   85|       |
   86|   451k|    es = ossl_err_get_state_int();
   87|   451k|    if (es == NULL)
  ------------------
  |  Branch (87:9): [True: 0, False: 451k]
  ------------------
   88|      0|        return 0;
   89|       |
   90|   451k|    top = es->top;
   91|  1.42M|    while (es->bottom != top
  ------------------
  |  Branch (91:12): [True: 1.24M, False: 174k]
  ------------------
   92|  1.42M|           && es->err_marks[top] == 0) {
  ------------------
  |  Branch (92:15): [True: 970k, False: 277k]
  ------------------
   93|   970k|        top = top > 0 ? top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|  42.9k|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (93:15): [True: 927k, False: 42.9k]
  ------------------
   94|   970k|    }
   95|       |
   96|   451k|    if (es->bottom == top)
  ------------------
  |  Branch (96:9): [True: 174k, False: 277k]
  ------------------
   97|   174k|        return 0;
   98|   277k|    es->err_marks[top]--;
   99|   277k|    return 1;
  100|   451k|}

OSSL_ERR_STATE_new:
   22|      2|{
   23|      2|    return CRYPTO_zalloc(sizeof(ERR_STATE), NULL, 0);
   24|      2|}

ossl_err_load_ESS_strings:
   42|      2|{
   43|      2|#ifndef OPENSSL_NO_ERR
   44|      2|    if (ERR_reason_error_string(ESS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (44:9): [True: 2, False: 0]
  ------------------
   45|      2|        ERR_load_strings_const(ESS_str_reasons);
   46|      2|#endif
   47|      2|    return 1;
   48|      2|}

openssl_add_all_ciphers_int:
   18|      2|{
   19|       |
   20|      2|#ifndef OPENSSL_NO_DES
   21|      2|    EVP_add_cipher(EVP_des_cfb());
  ------------------
  |  | 1003|      2|#  define EVP_des_cfb EVP_des_cfb64
  ------------------
   22|      2|    EVP_add_cipher(EVP_des_cfb1());
   23|      2|    EVP_add_cipher(EVP_des_cfb8());
   24|      2|    EVP_add_cipher(EVP_des_ede_cfb());
  ------------------
  |  | 1007|      2|#  define EVP_des_ede_cfb EVP_des_ede_cfb64
  ------------------
   25|      2|    EVP_add_cipher(EVP_des_ede3_cfb());
  ------------------
  |  | 1009|      2|#  define EVP_des_ede3_cfb EVP_des_ede3_cfb64
  ------------------
   26|      2|    EVP_add_cipher(EVP_des_ede3_cfb1());
   27|      2|    EVP_add_cipher(EVP_des_ede3_cfb8());
   28|       |
   29|      2|    EVP_add_cipher(EVP_des_ofb());
   30|      2|    EVP_add_cipher(EVP_des_ede_ofb());
   31|      2|    EVP_add_cipher(EVP_des_ede3_ofb());
   32|       |
   33|      2|    EVP_add_cipher(EVP_desx_cbc());
   34|      2|    EVP_add_cipher_alias(SN_desx_cbc, "DESX");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   35|      2|    EVP_add_cipher_alias(SN_desx_cbc, "desx");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   36|       |
   37|      2|    EVP_add_cipher(EVP_des_cbc());
   38|      2|    EVP_add_cipher_alias(SN_des_cbc, "DES");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   39|      2|    EVP_add_cipher_alias(SN_des_cbc, "des");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   40|      2|    EVP_add_cipher(EVP_des_ede_cbc());
   41|      2|    EVP_add_cipher(EVP_des_ede3_cbc());
   42|      2|    EVP_add_cipher_alias(SN_des_ede3_cbc, "DES3");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   43|      2|    EVP_add_cipher_alias(SN_des_ede3_cbc, "des3");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   44|       |
   45|      2|    EVP_add_cipher(EVP_des_ecb());
   46|      2|    EVP_add_cipher(EVP_des_ede());
   47|      2|    EVP_add_cipher_alias(SN_des_ede_ecb, "DES-EDE-ECB");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   48|      2|    EVP_add_cipher_alias(SN_des_ede_ecb, "des-ede-ecb");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   49|      2|    EVP_add_cipher(EVP_des_ede3());
   50|      2|    EVP_add_cipher_alias(SN_des_ede3_ecb, "DES-EDE3-ECB");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   51|      2|    EVP_add_cipher_alias(SN_des_ede3_ecb, "des-ede3-ecb");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   52|      2|    EVP_add_cipher(EVP_des_ede3_wrap());
   53|      2|    EVP_add_cipher_alias(SN_id_smime_alg_CMS3DESwrap, "des3-wrap");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   54|      2|#endif
   55|       |
   56|      2|#ifndef OPENSSL_NO_RC4
   57|      2|    EVP_add_cipher(EVP_rc4());
   58|      2|    EVP_add_cipher(EVP_rc4_40());
   59|      2|# ifndef OPENSSL_NO_MD5
   60|      2|    EVP_add_cipher(EVP_rc4_hmac_md5());
   61|      2|# endif
   62|      2|#endif
   63|       |
   64|      2|#ifndef OPENSSL_NO_IDEA
   65|      2|    EVP_add_cipher(EVP_idea_ecb());
   66|      2|    EVP_add_cipher(EVP_idea_cfb());
  ------------------
  |  | 1036|      2|#  define EVP_idea_cfb EVP_idea_cfb64
  ------------------
   67|      2|    EVP_add_cipher(EVP_idea_ofb());
   68|      2|    EVP_add_cipher(EVP_idea_cbc());
   69|      2|    EVP_add_cipher_alias(SN_idea_cbc, "IDEA");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   70|      2|    EVP_add_cipher_alias(SN_idea_cbc, "idea");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   71|      2|#endif
   72|       |
   73|      2|#ifndef OPENSSL_NO_SEED
   74|      2|    EVP_add_cipher(EVP_seed_ecb());
   75|      2|    EVP_add_cipher(EVP_seed_cfb());
  ------------------
  |  | 1190|      2|#  define EVP_seed_cfb EVP_seed_cfb128
  ------------------
   76|      2|    EVP_add_cipher(EVP_seed_ofb());
   77|      2|    EVP_add_cipher(EVP_seed_cbc());
   78|      2|    EVP_add_cipher_alias(SN_seed_cbc, "SEED");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   79|      2|    EVP_add_cipher_alias(SN_seed_cbc, "seed");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   80|      2|#endif
   81|       |
   82|      2|#ifndef OPENSSL_NO_SM4
   83|      2|    EVP_add_cipher(EVP_sm4_ecb());
   84|      2|    EVP_add_cipher(EVP_sm4_cbc());
   85|      2|    EVP_add_cipher(EVP_sm4_cfb());
  ------------------
  |  | 1198|      2|#  define EVP_sm4_cfb EVP_sm4_cfb128
  ------------------
   86|      2|    EVP_add_cipher(EVP_sm4_ofb());
   87|      2|    EVP_add_cipher(EVP_sm4_ctr());
   88|      2|    EVP_add_cipher_alias(SN_sm4_cbc, "SM4");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   89|      2|    EVP_add_cipher_alias(SN_sm4_cbc, "sm4");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   90|      2|#endif
   91|       |
   92|      2|#ifndef OPENSSL_NO_RC2
   93|      2|    EVP_add_cipher(EVP_rc2_ecb());
   94|      2|    EVP_add_cipher(EVP_rc2_cfb());
  ------------------
  |  | 1046|      2|#  define EVP_rc2_cfb EVP_rc2_cfb64
  ------------------
   95|      2|    EVP_add_cipher(EVP_rc2_ofb());
   96|      2|    EVP_add_cipher(EVP_rc2_cbc());
   97|      2|    EVP_add_cipher(EVP_rc2_40_cbc());
   98|      2|    EVP_add_cipher(EVP_rc2_64_cbc());
   99|      2|    EVP_add_cipher_alias(SN_rc2_cbc, "RC2");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  100|      2|    EVP_add_cipher_alias(SN_rc2_cbc, "rc2");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  101|      2|    EVP_add_cipher_alias(SN_rc2_cbc, "rc2-128");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  102|      2|    EVP_add_cipher_alias(SN_rc2_64_cbc, "rc2-64");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  103|      2|    EVP_add_cipher_alias(SN_rc2_40_cbc, "rc2-40");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  104|      2|#endif
  105|       |
  106|      2|#ifndef OPENSSL_NO_BF
  107|      2|    EVP_add_cipher(EVP_bf_ecb());
  108|      2|    EVP_add_cipher(EVP_bf_cfb());
  ------------------
  |  | 1053|      2|#  define EVP_bf_cfb EVP_bf_cfb64
  ------------------
  109|      2|    EVP_add_cipher(EVP_bf_ofb());
  110|      2|    EVP_add_cipher(EVP_bf_cbc());
  111|      2|    EVP_add_cipher_alias(SN_bf_cbc, "BF");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  112|      2|    EVP_add_cipher_alias(SN_bf_cbc, "bf");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  113|      2|    EVP_add_cipher_alias(SN_bf_cbc, "blowfish");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  114|      2|#endif
  115|       |
  116|      2|#ifndef OPENSSL_NO_CAST
  117|      2|    EVP_add_cipher(EVP_cast5_ecb());
  118|      2|    EVP_add_cipher(EVP_cast5_cfb());
  ------------------
  |  | 1060|      2|#  define EVP_cast5_cfb EVP_cast5_cfb64
  ------------------
  119|      2|    EVP_add_cipher(EVP_cast5_ofb());
  120|      2|    EVP_add_cipher(EVP_cast5_cbc());
  121|      2|    EVP_add_cipher_alias(SN_cast5_cbc, "CAST");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  122|      2|    EVP_add_cipher_alias(SN_cast5_cbc, "cast");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  123|      2|    EVP_add_cipher_alias(SN_cast5_cbc, "CAST-cbc");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  124|      2|    EVP_add_cipher_alias(SN_cast5_cbc, "cast-cbc");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  125|      2|#endif
  126|       |
  127|      2|#ifndef OPENSSL_NO_RC5
  128|      2|    EVP_add_cipher(EVP_rc5_32_12_16_ecb());
  129|      2|    EVP_add_cipher(EVP_rc5_32_12_16_cfb());
  ------------------
  |  | 1067|      2|#  define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64
  ------------------
  130|      2|    EVP_add_cipher(EVP_rc5_32_12_16_ofb());
  131|      2|    EVP_add_cipher(EVP_rc5_32_12_16_cbc());
  132|      2|    EVP_add_cipher_alias(SN_rc5_cbc, "rc5");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  133|      2|    EVP_add_cipher_alias(SN_rc5_cbc, "RC5");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  134|      2|#endif
  135|       |
  136|      2|    EVP_add_cipher(EVP_aes_128_ecb());
  137|      2|    EVP_add_cipher(EVP_aes_128_cbc());
  138|      2|    EVP_add_cipher(EVP_aes_128_cfb());
  ------------------
  |  | 1075|      2|# define EVP_aes_128_cfb EVP_aes_128_cfb128
  ------------------
  139|      2|    EVP_add_cipher(EVP_aes_128_cfb1());
  140|      2|    EVP_add_cipher(EVP_aes_128_cfb8());
  141|      2|    EVP_add_cipher(EVP_aes_128_ofb());
  142|      2|    EVP_add_cipher(EVP_aes_128_ctr());
  143|      2|    EVP_add_cipher(EVP_aes_128_gcm());
  144|      2|#ifndef OPENSSL_NO_OCB
  145|      2|    EVP_add_cipher(EVP_aes_128_ocb());
  146|      2|#endif
  147|      2|    EVP_add_cipher(EVP_aes_128_xts());
  148|      2|    EVP_add_cipher(EVP_aes_128_ccm());
  149|      2|    EVP_add_cipher(EVP_aes_128_wrap());
  150|      2|    EVP_add_cipher_alias(SN_id_aes128_wrap, "aes128-wrap");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  151|      2|    EVP_add_cipher(EVP_aes_128_wrap_pad());
  152|      2|    EVP_add_cipher_alias(SN_id_aes128_wrap_pad, "aes128-wrap-pad");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  153|      2|    EVP_add_cipher_alias(SN_aes_128_cbc, "AES128");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  154|      2|    EVP_add_cipher_alias(SN_aes_128_cbc, "aes128");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  155|      2|    EVP_add_cipher(EVP_aes_192_ecb());
  156|      2|    EVP_add_cipher(EVP_aes_192_cbc());
  157|      2|    EVP_add_cipher(EVP_aes_192_cfb());
  ------------------
  |  | 1091|      2|# define EVP_aes_192_cfb EVP_aes_192_cfb128
  ------------------
  158|      2|    EVP_add_cipher(EVP_aes_192_cfb1());
  159|      2|    EVP_add_cipher(EVP_aes_192_cfb8());
  160|      2|    EVP_add_cipher(EVP_aes_192_ofb());
  161|      2|    EVP_add_cipher(EVP_aes_192_ctr());
  162|      2|    EVP_add_cipher(EVP_aes_192_gcm());
  163|      2|#ifndef OPENSSL_NO_OCB
  164|      2|    EVP_add_cipher(EVP_aes_192_ocb());
  165|      2|#endif
  166|      2|    EVP_add_cipher(EVP_aes_192_ccm());
  167|      2|    EVP_add_cipher(EVP_aes_192_wrap());
  168|      2|    EVP_add_cipher_alias(SN_id_aes192_wrap, "aes192-wrap");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  169|      2|    EVP_add_cipher(EVP_aes_192_wrap_pad());
  170|      2|    EVP_add_cipher_alias(SN_id_aes192_wrap_pad, "aes192-wrap-pad");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  171|      2|    EVP_add_cipher_alias(SN_aes_192_cbc, "AES192");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  172|      2|    EVP_add_cipher_alias(SN_aes_192_cbc, "aes192");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  173|      2|    EVP_add_cipher(EVP_aes_256_ecb());
  174|      2|    EVP_add_cipher(EVP_aes_256_cbc());
  175|      2|    EVP_add_cipher(EVP_aes_256_cfb());
  ------------------
  |  | 1106|      2|# define EVP_aes_256_cfb EVP_aes_256_cfb128
  ------------------
  176|      2|    EVP_add_cipher(EVP_aes_256_cfb1());
  177|      2|    EVP_add_cipher(EVP_aes_256_cfb8());
  178|      2|    EVP_add_cipher(EVP_aes_256_ofb());
  179|      2|    EVP_add_cipher(EVP_aes_256_ctr());
  180|      2|    EVP_add_cipher(EVP_aes_256_gcm());
  181|      2|#ifndef OPENSSL_NO_OCB
  182|      2|    EVP_add_cipher(EVP_aes_256_ocb());
  183|      2|#endif
  184|      2|    EVP_add_cipher(EVP_aes_256_xts());
  185|      2|    EVP_add_cipher(EVP_aes_256_ccm());
  186|      2|    EVP_add_cipher(EVP_aes_256_wrap());
  187|      2|    EVP_add_cipher_alias(SN_id_aes256_wrap, "aes256-wrap");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  188|      2|    EVP_add_cipher(EVP_aes_256_wrap_pad());
  189|      2|    EVP_add_cipher_alias(SN_id_aes256_wrap_pad, "aes256-wrap-pad");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  190|      2|    EVP_add_cipher_alias(SN_aes_256_cbc, "AES256");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  191|      2|    EVP_add_cipher_alias(SN_aes_256_cbc, "aes256");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  192|      2|    EVP_add_cipher(EVP_aes_128_cbc_hmac_sha1());
  193|      2|    EVP_add_cipher(EVP_aes_256_cbc_hmac_sha1());
  194|      2|    EVP_add_cipher(EVP_aes_128_cbc_hmac_sha256());
  195|      2|    EVP_add_cipher(EVP_aes_256_cbc_hmac_sha256());
  196|      2|#ifndef OPENSSL_NO_ARIA
  197|      2|    EVP_add_cipher(EVP_aria_128_ecb());
  198|      2|    EVP_add_cipher(EVP_aria_128_cbc());
  199|      2|    EVP_add_cipher(EVP_aria_128_cfb());
  ------------------
  |  | 1127|      2|#  define EVP_aria_128_cfb EVP_aria_128_cfb128
  ------------------
  200|      2|    EVP_add_cipher(EVP_aria_128_cfb1());
  201|      2|    EVP_add_cipher(EVP_aria_128_cfb8());
  202|      2|    EVP_add_cipher(EVP_aria_128_ctr());
  203|      2|    EVP_add_cipher(EVP_aria_128_ofb());
  204|      2|    EVP_add_cipher(EVP_aria_128_gcm());
  205|      2|    EVP_add_cipher(EVP_aria_128_ccm());
  206|      2|    EVP_add_cipher_alias(SN_aria_128_cbc, "ARIA128");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  207|      2|    EVP_add_cipher_alias(SN_aria_128_cbc, "aria128");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  208|      2|    EVP_add_cipher(EVP_aria_192_ecb());
  209|      2|    EVP_add_cipher(EVP_aria_192_cbc());
  210|      2|    EVP_add_cipher(EVP_aria_192_cfb());
  ------------------
  |  | 1137|      2|#  define EVP_aria_192_cfb EVP_aria_192_cfb128
  ------------------
  211|      2|    EVP_add_cipher(EVP_aria_192_cfb1());
  212|      2|    EVP_add_cipher(EVP_aria_192_cfb8());
  213|      2|    EVP_add_cipher(EVP_aria_192_ctr());
  214|      2|    EVP_add_cipher(EVP_aria_192_ofb());
  215|      2|    EVP_add_cipher(EVP_aria_192_gcm());
  216|      2|    EVP_add_cipher(EVP_aria_192_ccm());
  217|      2|    EVP_add_cipher_alias(SN_aria_192_cbc, "ARIA192");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  218|      2|    EVP_add_cipher_alias(SN_aria_192_cbc, "aria192");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  219|      2|    EVP_add_cipher(EVP_aria_256_ecb());
  220|      2|    EVP_add_cipher(EVP_aria_256_cbc());
  221|      2|    EVP_add_cipher(EVP_aria_256_cfb());
  ------------------
  |  | 1147|      2|#  define EVP_aria_256_cfb EVP_aria_256_cfb128
  ------------------
  222|      2|    EVP_add_cipher(EVP_aria_256_cfb1());
  223|      2|    EVP_add_cipher(EVP_aria_256_cfb8());
  224|      2|    EVP_add_cipher(EVP_aria_256_ctr());
  225|      2|    EVP_add_cipher(EVP_aria_256_ofb());
  226|      2|    EVP_add_cipher(EVP_aria_256_gcm());
  227|      2|    EVP_add_cipher(EVP_aria_256_ccm());
  228|      2|    EVP_add_cipher_alias(SN_aria_256_cbc, "ARIA256");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  229|      2|    EVP_add_cipher_alias(SN_aria_256_cbc, "aria256");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  230|      2|#endif
  231|       |
  232|      2|#ifndef OPENSSL_NO_CAMELLIA
  233|      2|    EVP_add_cipher(EVP_camellia_128_ecb());
  234|      2|    EVP_add_cipher(EVP_camellia_128_cbc());
  235|      2|    EVP_add_cipher(EVP_camellia_128_cfb());
  ------------------
  |  | 1159|      2|#  define EVP_camellia_128_cfb EVP_camellia_128_cfb128
  ------------------
  236|      2|    EVP_add_cipher(EVP_camellia_128_cfb1());
  237|      2|    EVP_add_cipher(EVP_camellia_128_cfb8());
  238|      2|    EVP_add_cipher(EVP_camellia_128_ofb());
  239|      2|    EVP_add_cipher_alias(SN_camellia_128_cbc, "CAMELLIA128");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  240|      2|    EVP_add_cipher_alias(SN_camellia_128_cbc, "camellia128");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  241|      2|    EVP_add_cipher(EVP_camellia_192_ecb());
  242|      2|    EVP_add_cipher(EVP_camellia_192_cbc());
  243|      2|    EVP_add_cipher(EVP_camellia_192_cfb());
  ------------------
  |  | 1167|      2|#  define EVP_camellia_192_cfb EVP_camellia_192_cfb128
  ------------------
  244|      2|    EVP_add_cipher(EVP_camellia_192_cfb1());
  245|      2|    EVP_add_cipher(EVP_camellia_192_cfb8());
  246|      2|    EVP_add_cipher(EVP_camellia_192_ofb());
  247|      2|    EVP_add_cipher_alias(SN_camellia_192_cbc, "CAMELLIA192");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  248|      2|    EVP_add_cipher_alias(SN_camellia_192_cbc, "camellia192");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  249|      2|    EVP_add_cipher(EVP_camellia_256_ecb());
  250|      2|    EVP_add_cipher(EVP_camellia_256_cbc());
  251|      2|    EVP_add_cipher(EVP_camellia_256_cfb());
  ------------------
  |  | 1175|      2|#  define EVP_camellia_256_cfb EVP_camellia_256_cfb128
  ------------------
  252|      2|    EVP_add_cipher(EVP_camellia_256_cfb1());
  253|      2|    EVP_add_cipher(EVP_camellia_256_cfb8());
  254|      2|    EVP_add_cipher(EVP_camellia_256_ofb());
  255|      2|    EVP_add_cipher_alias(SN_camellia_256_cbc, "CAMELLIA256");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  256|      2|    EVP_add_cipher_alias(SN_camellia_256_cbc, "camellia256");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  257|      2|    EVP_add_cipher(EVP_camellia_128_ctr());
  258|      2|    EVP_add_cipher(EVP_camellia_192_ctr());
  259|      2|    EVP_add_cipher(EVP_camellia_256_ctr());
  260|      2|#endif
  261|       |
  262|      2|#ifndef OPENSSL_NO_CHACHA
  263|      2|    EVP_add_cipher(EVP_chacha20());
  264|      2|# ifndef OPENSSL_NO_POLY1305
  265|      2|    EVP_add_cipher(EVP_chacha20_poly1305());
  266|      2|# endif
  267|      2|#endif
  268|      2|}

openssl_add_all_digests_int:
   18|      2|{
   19|      2|#ifndef OPENSSL_NO_MD4
   20|      2|    EVP_add_digest(EVP_md4());
   21|      2|#endif
   22|      2|#ifndef OPENSSL_NO_MD5
   23|      2|    EVP_add_digest(EVP_md5());
   24|      2|    EVP_add_digest_alias(SN_md5, "ssl3-md5");
  ------------------
  |  |  712|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   25|      2|    EVP_add_digest(EVP_md5_sha1());
   26|      2|#endif
   27|      2|    EVP_add_digest(EVP_sha1());
   28|      2|    EVP_add_digest_alias(SN_sha1, "ssl3-sha1");
  ------------------
  |  |  712|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   29|      2|    EVP_add_digest_alias(SN_sha1WithRSAEncryption, SN_sha1WithRSA);
  ------------------
  |  |  712|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   30|      2|#if !defined(OPENSSL_NO_MDC2) && !defined(OPENSSL_NO_DES)
   31|      2|    EVP_add_digest(EVP_mdc2());
   32|      2|#endif
   33|      2|#ifndef OPENSSL_NO_RMD160
   34|      2|    EVP_add_digest(EVP_ripemd160());
   35|      2|    EVP_add_digest_alias(SN_ripemd160, "ripemd");
  ------------------
  |  |  712|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   36|      2|    EVP_add_digest_alias(SN_ripemd160, "rmd160");
  ------------------
  |  |  712|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   37|      2|#endif
   38|      2|    EVP_add_digest(EVP_sha224());
   39|      2|    EVP_add_digest(EVP_sha256());
   40|      2|    EVP_add_digest(EVP_sha384());
   41|      2|    EVP_add_digest(EVP_sha512());
   42|      2|    EVP_add_digest(EVP_sha512_224());
   43|      2|    EVP_add_digest(EVP_sha512_256());
   44|      2|#ifndef OPENSSL_NO_WHIRLPOOL
   45|      2|    EVP_add_digest(EVP_whirlpool());
   46|      2|#endif
   47|      2|#ifndef OPENSSL_NO_SM3
   48|      2|    EVP_add_digest(EVP_sm3());
   49|      2|#endif
   50|      2|#ifndef OPENSSL_NO_BLAKE2
   51|      2|    EVP_add_digest(EVP_blake2b512());
   52|      2|    EVP_add_digest(EVP_blake2s256());
   53|      2|#endif
   54|      2|    EVP_add_digest(EVP_sha3_224());
   55|      2|    EVP_add_digest(EVP_sha3_256());
   56|      2|    EVP_add_digest(EVP_sha3_384());
   57|      2|    EVP_add_digest(EVP_sha3_512());
   58|      2|    EVP_add_digest(EVP_shake128());
   59|      2|    EVP_add_digest(EVP_shake256());
   60|      2|}

evp_md_ctx_clear_digest:
   45|  6.59k|{
   46|  6.59k|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (46:9): [True: 6.59k, False: 0]
  ------------------
   47|  6.59k|        if (ctx->digest != NULL && ctx->digest->freectx != NULL)
  ------------------
  |  Branch (47:13): [True: 6.59k, False: 0]
  |  Branch (47:36): [True: 6.59k, False: 0]
  ------------------
   48|  6.59k|            ctx->digest->freectx(ctx->algctx);
   49|  6.59k|        ctx->algctx = NULL;
   50|  6.59k|        EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
  ------------------
  |  |  222|  6.59k|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
   51|  6.59k|    }
   52|       |
   53|       |    /* Code below to be removed when legacy support is dropped. */
   54|       |
   55|       |    /*
   56|       |     * Don't assume ctx->md_data was cleaned in EVP_Digest_Final, because
   57|       |     * sometimes only copies of the context are ever finalised.
   58|       |     */
   59|  6.59k|    cleanup_old_md_data(ctx, force);
   60|  6.59k|    if (force)
  ------------------
  |  Branch (60:9): [True: 0, False: 6.59k]
  ------------------
   61|      0|        ctx->digest = NULL;
   62|       |
   63|  6.59k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
   64|  6.59k|    ENGINE_finish(ctx->engine);
   65|  6.59k|    ctx->engine = NULL;
   66|  6.59k|#endif
   67|       |
   68|       |    /* Non legacy code, this has to be later than the ctx->digest cleaning */
   69|  6.59k|    if (!keep_fetched) {
  ------------------
  |  Branch (69:9): [True: 6.59k, False: 0]
  ------------------
   70|  6.59k|        EVP_MD_free(ctx->fetched_digest);
   71|  6.59k|        ctx->fetched_digest = NULL;
   72|  6.59k|        ctx->reqdigest = NULL;
   73|  6.59k|    }
   74|  6.59k|}
EVP_MD_CTX_reset:
   99|  6.59k|{
  100|  6.59k|    return evp_md_ctx_reset_ex(ctx, 0);
  101|  6.59k|}
EVP_MD_CTX_new:
  130|  6.59k|{
  131|  6.59k|    return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  ------------------
  |  |  104|  6.59k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  6.59k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  6.59k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  132|  6.59k|}
EVP_MD_CTX_free:
  135|  8.56k|{
  136|  8.56k|    if (ctx == NULL)
  ------------------
  |  Branch (136:9): [True: 1.96k, False: 6.59k]
  ------------------
  137|  1.96k|        return;
  138|       |
  139|  6.59k|    EVP_MD_CTX_reset(ctx);
  140|  6.59k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  6.59k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  6.59k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  6.59k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  141|  6.59k|}
evp_md_ctx_free_algctx:
  144|  6.59k|{
  145|  6.59k|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (145:9): [True: 0, False: 6.59k]
  ------------------
  146|      0|        if (!ossl_assert(ctx->digest != NULL)) {
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (146:13): [True: 0, False: 0]
  ------------------
  147|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  148|      0|            return 0;
  149|      0|        }
  150|      0|        if (ctx->digest->freectx != NULL)
  ------------------
  |  Branch (150:13): [True: 0, False: 0]
  ------------------
  151|      0|            ctx->digest->freectx(ctx->algctx);
  152|      0|        ctx->algctx = NULL;
  153|      0|    }
  154|  6.59k|    return 1;
  155|  6.59k|}
EVP_DigestInit_ex:
  381|  6.59k|{
  382|  6.59k|    return evp_md_init_internal(ctx, type, NULL, impl);
  383|  6.59k|}
EVP_DigestUpdate:
  386|  6.59k|{
  387|  6.59k|    if (count == 0)
  ------------------
  |  Branch (387:9): [True: 0, False: 6.59k]
  ------------------
  388|      0|        return 1;
  389|       |
  390|  6.59k|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|  6.59k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (390:9): [True: 0, False: 6.59k]
  ------------------
  391|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  392|      0|        return 0;
  393|      0|    }
  394|       |
  395|  6.59k|    if (ctx->pctx != NULL
  ------------------
  |  Branch (395:9): [True: 0, False: 6.59k]
  ------------------
  396|  6.59k|            && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  741|  6.59k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1764|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1748|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1758|      0|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1765|      0|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1759|      0|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1766|      0|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1750|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1767|      0|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (741:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  397|  6.59k|            && ctx->pctx->op.sig.algctx != NULL) {
  ------------------
  |  Branch (397:16): [True: 0, False: 0]
  ------------------
  398|      0|#ifndef FIPS_MODULE
  399|       |        /*
  400|       |         * Prior to OpenSSL 3.0 EVP_DigestSignUpdate() and
  401|       |         * EVP_DigestVerifyUpdate() were just macros for EVP_DigestUpdate().
  402|       |         * Some code calls EVP_DigestUpdate() directly even when initialised
  403|       |         * with EVP_DigestSignInit_ex() or
  404|       |         * EVP_DigestVerifyInit_ex(), so we detect that and redirect to
  405|       |         * the correct EVP_Digest*Update() function
  406|       |         */
  407|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  ------------------
  |  Branch (407:13): [True: 0, False: 0]
  ------------------
  408|      0|            return EVP_DigestSignUpdate(ctx, data, count);
  409|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_VERIFYCTX)
  ------------------
  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  ------------------
  |  Branch (409:13): [True: 0, False: 0]
  ------------------
  410|      0|            return EVP_DigestVerifyUpdate(ctx, data, count);
  411|      0|#endif
  412|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  413|      0|        return 0;
  414|      0|    }
  415|       |
  416|  6.59k|    if (ctx->digest == NULL
  ------------------
  |  Branch (416:9): [True: 0, False: 6.59k]
  ------------------
  417|  6.59k|            || ctx->digest->prov == NULL
  ------------------
  |  Branch (417:16): [True: 0, False: 6.59k]
  ------------------
  418|  6.59k|            || (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0)
  ------------------
  |  |  244|  6.59k|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (418:16): [True: 0, False: 6.59k]
  ------------------
  419|      0|        goto legacy;
  420|       |
  421|  6.59k|    if (ctx->digest->dupdate == NULL) {
  ------------------
  |  Branch (421:9): [True: 0, False: 6.59k]
  ------------------
  422|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  423|      0|        return 0;
  424|      0|    }
  425|  6.59k|    return ctx->digest->dupdate(ctx->algctx, data, count);
  426|       |
  427|       |    /* Code below to be removed when legacy support is dropped. */
  428|      0| legacy:
  429|      0|    return ctx->update != NULL ? ctx->update(ctx, data, count) : 0;
  ------------------
  |  Branch (429:12): [True: 0, False: 0]
  ------------------
  430|  6.59k|}
EVP_DigestFinal_ex:
  443|  6.59k|{
  444|  6.59k|    int ret, sz;
  445|  6.59k|    size_t size = 0;
  446|  6.59k|    size_t mdsize = 0;
  447|       |
  448|  6.59k|    if (ctx->digest == NULL)
  ------------------
  |  Branch (448:9): [True: 0, False: 6.59k]
  ------------------
  449|      0|        return 0;
  450|       |
  451|  6.59k|    sz = EVP_MD_CTX_get_size(ctx);
  ------------------
  |  |  594|  6.59k|# define EVP_MD_CTX_get_size(e)        EVP_MD_CTX_get_size_ex(e)
  ------------------
  452|  6.59k|    if (sz < 0)
  ------------------
  |  Branch (452:9): [True: 0, False: 6.59k]
  ------------------
  453|      0|        return 0;
  454|  6.59k|    mdsize = sz;
  455|  6.59k|    if (ctx->digest->prov == NULL)
  ------------------
  |  Branch (455:9): [True: 0, False: 6.59k]
  ------------------
  456|      0|        goto legacy;
  457|       |
  458|  6.59k|    if (ctx->digest->dfinal == NULL) {
  ------------------
  |  Branch (458:9): [True: 0, False: 6.59k]
  ------------------
  459|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  460|      0|        return 0;
  461|      0|    }
  462|       |
  463|  6.59k|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|  6.59k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (463:9): [True: 0, False: 6.59k]
  ------------------
  464|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  465|      0|        return 0;
  466|      0|    }
  467|       |
  468|  6.59k|    ret = ctx->digest->dfinal(ctx->algctx, md, &size, mdsize);
  469|       |
  470|  6.59k|    ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
  ------------------
  |  |   33|  6.59k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  471|       |
  472|  6.59k|    if (isize != NULL) {
  ------------------
  |  Branch (472:9): [True: 0, False: 6.59k]
  ------------------
  473|      0|        if (size <= UINT_MAX) {
  ------------------
  |  Branch (473:13): [True: 0, False: 0]
  ------------------
  474|      0|            *isize = (unsigned int)size;
  475|      0|        } else {
  476|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  477|      0|            ret = 0;
  478|      0|        }
  479|      0|    }
  480|       |
  481|  6.59k|    return ret;
  482|       |
  483|       |    /* Code below to be removed when legacy support is dropped. */
  484|      0| legacy:
  485|      0|    OPENSSL_assert(mdsize <= EVP_MAX_MD_SIZE);
  ------------------
  |  |  438|      0|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  486|      0|    ret = ctx->digest->final(ctx, md);
  487|      0|    if (isize != NULL)
  ------------------
  |  Branch (487:9): [True: 0, False: 0]
  ------------------
  488|      0|        *isize = mdsize;
  489|      0|    if (ctx->digest->cleanup) {
  ------------------
  |  Branch (489:9): [True: 0, False: 0]
  ------------------
  490|      0|        ctx->digest->cleanup(ctx);
  491|      0|        EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
  ------------------
  |  |  222|      0|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
  492|      0|    }
  493|      0|    OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);
  494|      0|    return ret;
  495|  6.59k|}
EVP_Digest:
  729|  6.59k|{
  730|  6.59k|    EVP_MD_CTX *ctx = EVP_MD_CTX_new();
  731|  6.59k|    int ret;
  732|       |
  733|  6.59k|    if (ctx == NULL)
  ------------------
  |  Branch (733:9): [True: 0, False: 6.59k]
  ------------------
  734|      0|        return 0;
  735|  6.59k|    EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT);
  ------------------
  |  |  220|  6.59k|# define EVP_MD_CTX_FLAG_ONESHOT         0x0001/* digest update will be
  ------------------
  736|  6.59k|    ret = EVP_DigestInit_ex(ctx, type, impl)
  ------------------
  |  Branch (736:11): [True: 6.59k, False: 0]
  ------------------
  737|  6.59k|        && EVP_DigestUpdate(ctx, data, count)
  ------------------
  |  Branch (737:12): [True: 6.59k, False: 0]
  ------------------
  738|  6.59k|        && EVP_DigestFinal_ex(ctx, md, size);
  ------------------
  |  Branch (738:12): [True: 6.59k, False: 0]
  ------------------
  739|  6.59k|    EVP_MD_CTX_free(ctx);
  740|       |
  741|  6.59k|    return ret;
  742|  6.59k|}
EVP_MD_CTX_gettable_params:
  863|  6.59k|{
  864|  6.59k|    EVP_PKEY_CTX *pctx;
  865|  6.59k|    void *provctx;
  866|       |
  867|  6.59k|    if (ctx == NULL)
  ------------------
  |  Branch (867:9): [True: 0, False: 6.59k]
  ------------------
  868|      0|        return NULL;
  869|       |
  870|       |    /* If we have a pctx then we should try that first */
  871|  6.59k|    pctx = ctx->pctx;
  872|  6.59k|    if (pctx != NULL
  ------------------
  |  Branch (872:9): [True: 0, False: 6.59k]
  ------------------
  873|  6.59k|            && (pctx->operation == EVP_PKEY_OP_VERIFYCTX
  ------------------
  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  ------------------
  |  Branch (873:17): [True: 0, False: 0]
  ------------------
  874|      0|                || pctx->operation == EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  ------------------
  |  Branch (874:20): [True: 0, False: 0]
  ------------------
  875|  6.59k|            && pctx->op.sig.algctx != NULL
  ------------------
  |  Branch (875:16): [True: 0, False: 0]
  ------------------
  876|  6.59k|            && pctx->op.sig.signature->gettable_ctx_md_params != NULL)
  ------------------
  |  Branch (876:16): [True: 0, False: 0]
  ------------------
  877|      0|        return pctx->op.sig.signature->gettable_ctx_md_params(
  878|      0|                    pctx->op.sig.algctx);
  879|       |
  880|  6.59k|    if (ctx->digest != NULL && ctx->digest->gettable_ctx_params != NULL) {
  ------------------
  |  Branch (880:9): [True: 6.59k, False: 0]
  |  Branch (880:32): [True: 0, False: 6.59k]
  ------------------
  881|      0|        provctx = ossl_provider_ctx(EVP_MD_get0_provider(ctx->digest));
  882|      0|        return ctx->digest->gettable_ctx_params(ctx->algctx, provctx);
  883|      0|    }
  884|  6.59k|    return NULL;
  885|  6.59k|}
evp_md_new:
  942|     27|{
  943|     27|    EVP_MD *md = OPENSSL_zalloc(sizeof(*md));
  ------------------
  |  |  104|     27|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  944|       |
  945|     27|    if (md != NULL && !CRYPTO_NEW_REF(&md->refcnt, 1)) {
  ------------------
  |  Branch (945:9): [True: 27, False: 0]
  |  Branch (945:23): [True: 0, False: 27]
  ------------------
  946|      0|        OPENSSL_free(md);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  947|      0|        return NULL;
  948|      0|    }
  949|     27|    return md;
  950|     27|}
EVP_MD_fetch:
 1164|  6.63k|{
 1165|  6.63k|    EVP_MD *md =
 1166|  6.63k|        evp_generic_fetch(ctx, OSSL_OP_DIGEST, algorithm, properties,
  ------------------
  |  |  310|  6.63k|# define OSSL_OP_DIGEST                              1
  ------------------
 1167|  6.63k|                          evp_md_from_algorithm, evp_md_up_ref, evp_md_free);
 1168|       |
 1169|  6.63k|    return md;
 1170|  6.63k|}
EVP_MD_up_ref:
 1173|  13.2k|{
 1174|  13.2k|    int ref = 0;
 1175|       |
 1176|  13.2k|    if (md->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|  13.2k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1176:9): [True: 13.2k, False: 0]
  ------------------
 1177|  13.2k|        CRYPTO_UP_REF(&md->refcnt, &ref);
 1178|  13.2k|    return 1;
 1179|  13.2k|}
EVP_MD_free:
 1182|  19.9k|{
 1183|  19.9k|    int i;
 1184|       |
 1185|  19.9k|    if (md == NULL || md->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|  13.2k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1185:9): [True: 6.61k, False: 13.2k]
  |  Branch (1185:23): [True: 0, False: 13.2k]
  ------------------
 1186|  6.61k|        return;
 1187|       |
 1188|  13.2k|    CRYPTO_DOWN_REF(&md->refcnt, &i);
 1189|  13.2k|    if (i > 0)
  ------------------
  |  Branch (1189:9): [True: 13.2k, False: 27]
  ------------------
 1190|  13.2k|        return;
 1191|     27|    evp_md_free_int(md);
 1192|     27|}
digest.c:cleanup_old_md_data:
   30|  13.1k|{
   31|  13.1k|    if (ctx->digest != NULL) {
  ------------------
  |  Branch (31:9): [True: 6.59k, False: 6.59k]
  ------------------
   32|  6.59k|        if (ctx->digest->cleanup != NULL
  ------------------
  |  Branch (32:13): [True: 0, False: 6.59k]
  ------------------
   33|  6.59k|                && !EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_CLEANED))
  ------------------
  |  |  222|      0|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
  |  Branch (33:20): [True: 0, False: 0]
  ------------------
   34|      0|            ctx->digest->cleanup(ctx);
   35|  6.59k|        if (ctx->md_data != NULL && ctx->digest->ctx_size > 0
  ------------------
  |  Branch (35:13): [True: 0, False: 6.59k]
  |  Branch (35:37): [True: 0, False: 0]
  ------------------
   36|  6.59k|                && (!EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_REUSE)
  ------------------
  |  |  224|      0|# define EVP_MD_CTX_FLAG_REUSE           0x0004/* Don't free up ctx->md_data
  ------------------
  |  Branch (36:21): [True: 0, False: 0]
  ------------------
   37|      0|                    || force)) {
  ------------------
  |  Branch (37:24): [True: 0, False: 0]
  ------------------
   38|      0|            OPENSSL_clear_free(ctx->md_data, ctx->digest->ctx_size);
  ------------------
  |  |  113|      0|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|      0|            ctx->md_data = NULL;
   40|      0|        }
   41|  6.59k|    }
   42|  13.1k|}
digest.c:evp_md_ctx_reset_ex:
   77|  6.59k|{
   78|  6.59k|    if (ctx == NULL)
  ------------------
  |  Branch (78:9): [True: 0, False: 6.59k]
  ------------------
   79|      0|        return 1;
   80|       |
   81|       |    /*
   82|       |     * pctx should be freed by the user of EVP_MD_CTX
   83|       |     * if EVP_MD_CTX_FLAG_KEEP_PKEY_CTX is set
   84|       |     */
   85|  6.59k|    if (!EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_KEEP_PKEY_CTX)) {
  ------------------
  |  |   32|  6.59k|#define EVP_MD_CTX_FLAG_KEEP_PKEY_CTX   0x0400
  ------------------
  |  Branch (85:9): [True: 6.59k, False: 0]
  ------------------
   86|  6.59k|        EVP_PKEY_CTX_free(ctx->pctx);
   87|  6.59k|        ctx->pctx = NULL;
   88|  6.59k|    }
   89|       |
   90|  6.59k|    evp_md_ctx_clear_digest(ctx, 0, keep_fetched);
   91|  6.59k|    if (!keep_fetched)
  ------------------
  |  Branch (91:9): [True: 6.59k, False: 0]
  ------------------
   92|  6.59k|        OPENSSL_cleanse(ctx, sizeof(*ctx));
   93|       |
   94|  6.59k|    return 1;
   95|  6.59k|}
digest.c:evp_md_init_internal:
  159|  6.59k|{
  160|  6.59k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  161|  6.59k|    ENGINE *tmpimpl = NULL;
  162|  6.59k|#endif
  163|       |
  164|  6.59k|#if !defined(FIPS_MODULE)
  165|  6.59k|    if (ctx->pctx != NULL
  ------------------
  |  Branch (165:9): [True: 0, False: 6.59k]
  ------------------
  166|  6.59k|            && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  741|  6.59k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1764|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1748|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1758|      0|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1765|      0|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1759|      0|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1766|      0|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1750|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1767|      0|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (741:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  167|  6.59k|            && ctx->pctx->op.sig.algctx != NULL) {
  ------------------
  |  Branch (167:16): [True: 0, False: 0]
  ------------------
  168|       |        /*
  169|       |         * Prior to OpenSSL 3.0 calling EVP_DigestInit_ex() on an mdctx
  170|       |         * previously initialised with EVP_DigestSignInit() would retain
  171|       |         * information about the key, and re-initialise for another sign
  172|       |         * operation. So in that case we redirect to EVP_DigestSignInit()
  173|       |         */
  174|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  ------------------
  |  Branch (174:13): [True: 0, False: 0]
  ------------------
  175|      0|            return EVP_DigestSignInit(ctx, NULL, type, impl, NULL);
  176|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_VERIFYCTX)
  ------------------
  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  ------------------
  |  Branch (176:13): [True: 0, False: 0]
  ------------------
  177|      0|            return EVP_DigestVerifyInit(ctx, NULL, type, impl, NULL);
  178|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  179|      0|        return 0;
  180|      0|    }
  181|  6.59k|#endif
  182|       |
  183|  6.59k|    EVP_MD_CTX_clear_flags(ctx, EVP_MD_CTX_FLAG_CLEANED
  ------------------
  |  |  222|  6.59k|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
  184|  6.59k|                                | EVP_MD_CTX_FLAG_FINALISED);
  ------------------
  |  |   33|  6.59k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  185|       |
  186|  6.59k|    if (type != NULL) {
  ------------------
  |  Branch (186:9): [True: 6.59k, False: 0]
  ------------------
  187|  6.59k|        ctx->reqdigest = type;
  188|  6.59k|    } else {
  189|      0|        if (ctx->digest == NULL) {
  ------------------
  |  Branch (189:13): [True: 0, False: 0]
  ------------------
  190|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_NO_DIGEST_SET);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  191|      0|            return 0;
  192|      0|        }
  193|      0|        type = ctx->digest;
  194|      0|    }
  195|       |
  196|       |    /* Code below to be removed when legacy support is dropped. */
  197|  6.59k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  198|       |    /*
  199|       |     * Whether it's nice or not, "Inits" can be used on "Final"'d contexts so
  200|       |     * this context may already have an ENGINE! Try to avoid releasing the
  201|       |     * previous handle, re-querying for an ENGINE, and having a
  202|       |     * reinitialisation, when it may all be unnecessary.
  203|       |     */
  204|  6.59k|    if (ctx->engine != NULL
  ------------------
  |  Branch (204:9): [True: 0, False: 6.59k]
  ------------------
  205|  6.59k|            && ctx->digest != NULL
  ------------------
  |  Branch (205:16): [True: 0, False: 0]
  ------------------
  206|  6.59k|            && type->type == ctx->digest->type)
  ------------------
  |  Branch (206:16): [True: 0, False: 0]
  ------------------
  207|      0|        goto skip_to_init;
  208|       |
  209|       |    /*
  210|       |     * Ensure an ENGINE left lying around from last time is cleared (the
  211|       |     * previous check attempted to avoid this if the same ENGINE and
  212|       |     * EVP_MD could be used).
  213|       |     */
  214|  6.59k|    ENGINE_finish(ctx->engine);
  215|  6.59k|    ctx->engine = NULL;
  216|       |
  217|  6.59k|    if (impl == NULL)
  ------------------
  |  Branch (217:9): [True: 6.59k, False: 0]
  ------------------
  218|  6.59k|        tmpimpl = ENGINE_get_digest_engine(type->type);
  219|  6.59k|#endif
  220|       |
  221|       |    /*
  222|       |     * If there are engines involved or EVP_MD_CTX_FLAG_NO_INIT is set then we
  223|       |     * should use legacy handling for now.
  224|       |     */
  225|  6.59k|    if (impl != NULL
  ------------------
  |  Branch (225:9): [True: 0, False: 6.59k]
  ------------------
  226|  6.59k|#if !defined(OPENSSL_NO_ENGINE)
  227|  6.59k|            || ctx->engine != NULL
  ------------------
  |  Branch (227:16): [True: 0, False: 6.59k]
  ------------------
  228|  6.59k|# if !defined(FIPS_MODULE)
  229|  6.59k|            || tmpimpl != NULL
  ------------------
  |  Branch (229:16): [True: 0, False: 6.59k]
  ------------------
  230|  6.59k|# endif
  231|  6.59k|#endif
  232|  6.59k|            || (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0
  ------------------
  |  |  244|  6.59k|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (232:16): [True: 0, False: 6.59k]
  ------------------
  233|  6.59k|            || (type != NULL && type->origin == EVP_ORIG_METH)
  ------------------
  |  |  254|  6.59k|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (233:17): [True: 6.59k, False: 0]
  |  Branch (233:33): [True: 0, False: 6.59k]
  ------------------
  234|  6.59k|            || (type == NULL && ctx->digest != NULL
  ------------------
  |  Branch (234:17): [True: 0, False: 6.59k]
  |  Branch (234:33): [True: 0, False: 0]
  ------------------
  235|  6.59k|                             && ctx->digest->origin == EVP_ORIG_METH)) {
  ------------------
  |  |  254|      0|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (235:33): [True: 0, False: 0]
  ------------------
  236|       |        /* If we were using provided hash before, cleanup algctx */
  237|      0|        if (!evp_md_ctx_free_algctx(ctx))
  ------------------
  |  Branch (237:13): [True: 0, False: 0]
  ------------------
  238|      0|            return 0;
  239|      0|        if (ctx->digest == ctx->fetched_digest)
  ------------------
  |  Branch (239:13): [True: 0, False: 0]
  ------------------
  240|      0|            ctx->digest = NULL;
  241|      0|        EVP_MD_free(ctx->fetched_digest);
  242|      0|        ctx->fetched_digest = NULL;
  243|      0|        goto legacy;
  244|      0|    }
  245|       |
  246|  6.59k|    cleanup_old_md_data(ctx, 1);
  247|       |
  248|       |    /* Start of non-legacy code below */
  249|  6.59k|    if (ctx->digest == type) {
  ------------------
  |  Branch (249:9): [True: 0, False: 6.59k]
  ------------------
  250|      0|        if (!ossl_assert(type->prov != NULL)) {
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (250:13): [True: 0, False: 0]
  ------------------
  251|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  252|      0|            return 0;
  253|      0|        }
  254|  6.59k|    } else {
  255|  6.59k|        if (!evp_md_ctx_free_algctx(ctx))
  ------------------
  |  Branch (255:13): [True: 0, False: 6.59k]
  ------------------
  256|      0|            return 0;
  257|  6.59k|    }
  258|       |
  259|  6.59k|    if (type->prov == NULL) {
  ------------------
  |  Branch (259:9): [True: 0, False: 6.59k]
  ------------------
  260|       |#ifdef FIPS_MODULE
  261|       |        /* We only do explicit fetches inside the FIPS module */
  262|       |        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  263|       |        return 0;
  264|       |#else
  265|       |        /* The NULL digest is a special case */
  266|      0|        EVP_MD *provmd = EVP_MD_fetch(NULL,
  267|      0|                                      type->type != NID_undef ? OBJ_nid2sn(type->type)
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (267:39): [True: 0, False: 0]
  ------------------
  268|      0|                                                              : "NULL", "");
  269|       |
  270|      0|        if (provmd == NULL) {
  ------------------
  |  Branch (270:13): [True: 0, False: 0]
  ------------------
  271|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|            return 0;
  273|      0|        }
  274|      0|        type = provmd;
  275|      0|        EVP_MD_free(ctx->fetched_digest);
  276|      0|        ctx->fetched_digest = provmd;
  277|      0|#endif
  278|      0|    }
  279|       |
  280|  6.59k|    if (type->prov != NULL && ctx->fetched_digest != type) {
  ------------------
  |  Branch (280:9): [True: 6.59k, False: 0]
  |  Branch (280:31): [True: 6.59k, False: 0]
  ------------------
  281|  6.59k|        if (!EVP_MD_up_ref((EVP_MD *)type)) {
  ------------------
  |  Branch (281:13): [True: 0, False: 6.59k]
  ------------------
  282|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  283|      0|            return 0;
  284|      0|        }
  285|  6.59k|        EVP_MD_free(ctx->fetched_digest);
  286|  6.59k|        ctx->fetched_digest = (EVP_MD *)type;
  287|  6.59k|    }
  288|  6.59k|    ctx->digest = type;
  289|  6.59k|    if (ctx->algctx == NULL) {
  ------------------
  |  Branch (289:9): [True: 6.59k, False: 0]
  ------------------
  290|  6.59k|        ctx->algctx = ctx->digest->newctx(ossl_provider_ctx(type->prov));
  291|  6.59k|        if (ctx->algctx == NULL) {
  ------------------
  |  Branch (291:13): [True: 0, False: 6.59k]
  ------------------
  292|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  293|      0|            return 0;
  294|      0|        }
  295|  6.59k|    }
  296|       |
  297|  6.59k|    if (ctx->digest->dinit == NULL) {
  ------------------
  |  Branch (297:9): [True: 0, False: 6.59k]
  ------------------
  298|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  299|      0|        return 0;
  300|      0|    }
  301|       |
  302|  6.59k|    return ctx->digest->dinit(ctx->algctx, params);
  303|       |
  304|       |    /* Code below to be removed when legacy support is dropped. */
  305|      0| legacy:
  306|       |
  307|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  308|      0|    if (type) {
  ------------------
  |  Branch (308:9): [True: 0, False: 0]
  ------------------
  309|      0|        if (impl != NULL) {
  ------------------
  |  Branch (309:13): [True: 0, False: 0]
  ------------------
  310|      0|            if (!ENGINE_init(impl)) {
  ------------------
  |  Branch (310:17): [True: 0, False: 0]
  ------------------
  311|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  312|      0|                return 0;
  313|      0|            }
  314|      0|        } else {
  315|       |            /* Ask if an ENGINE is reserved for this job */
  316|      0|            impl = tmpimpl;
  317|      0|        }
  318|      0|        if (impl != NULL) {
  ------------------
  |  Branch (318:13): [True: 0, False: 0]
  ------------------
  319|       |            /* There's an ENGINE for this job ... (apparently) */
  320|      0|            const EVP_MD *d = ENGINE_get_digest(impl, type->type);
  321|       |
  322|      0|            if (d == NULL) {
  ------------------
  |  Branch (322:17): [True: 0, False: 0]
  ------------------
  323|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  324|      0|                ENGINE_finish(impl);
  325|      0|                return 0;
  326|      0|            }
  327|       |            /* We'll use the ENGINE's private digest definition */
  328|      0|            type = d;
  329|       |            /*
  330|       |             * Store the ENGINE functional reference so we know 'type' came
  331|       |             * from an ENGINE and we need to release it when done.
  332|       |             */
  333|      0|            ctx->engine = impl;
  334|      0|        } else
  335|      0|            ctx->engine = NULL;
  336|      0|    }
  337|      0|#endif
  338|      0|    if (ctx->digest != type) {
  ------------------
  |  Branch (338:9): [True: 0, False: 0]
  ------------------
  339|      0|        cleanup_old_md_data(ctx, 1);
  340|       |
  341|      0|        ctx->digest = type;
  342|      0|        if (!(ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) && type->ctx_size) {
  ------------------
  |  |  244|      0|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (342:13): [True: 0, False: 0]
  |  Branch (342:56): [True: 0, False: 0]
  ------------------
  343|      0|            ctx->update = type->update;
  344|      0|            ctx->md_data = OPENSSL_zalloc(type->ctx_size);
  ------------------
  |  |  104|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  345|      0|            if (ctx->md_data == NULL)
  ------------------
  |  Branch (345:17): [True: 0, False: 0]
  ------------------
  346|      0|                return 0;
  347|      0|        }
  348|      0|    }
  349|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  350|      0| skip_to_init:
  351|      0|#endif
  352|      0|#ifndef FIPS_MODULE
  353|      0|    if (ctx->pctx != NULL
  ------------------
  |  Branch (353:9): [True: 0, False: 0]
  ------------------
  354|      0|            && (!EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  741|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1764|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1748|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1758|      0|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1765|      0|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1759|      0|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1766|      0|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1750|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1767|      0|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (354:17): [True: 0, False: 0]
  ------------------
  355|      0|                 || ctx->pctx->op.sig.signature == NULL)) {
  ------------------
  |  Branch (355:21): [True: 0, False: 0]
  ------------------
  356|      0|        int r;
  357|      0|        r = EVP_PKEY_CTX_ctrl(ctx->pctx, -1, EVP_PKEY_OP_TYPE_SIG,
  ------------------
  |  | 1764|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  ------------------
  |  |  |  | 1748|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  ------------------
  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  ------------------
  |  |  |  | 1758|      0|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  ------------------
  |  | 1765|      0|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  ------------------
  |  |  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  ------------------
  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  ------------------
  |  |  |  | 1759|      0|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  ------------------
  |  | 1766|      0|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  ------------------
  |  |  |  | 1750|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  ------------------
  |  | 1767|      0|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  ------------------
  |  |  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  ------------------
  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  ------------------
  |  |  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  ------------------
  ------------------
  358|      0|                              EVP_PKEY_CTRL_DIGESTINIT, 0, ctx);
  ------------------
  |  | 1793|      0|# define EVP_PKEY_CTRL_DIGESTINIT        7
  ------------------
  359|      0|        if (r <= 0 && (r != -2))
  ------------------
  |  Branch (359:13): [True: 0, False: 0]
  |  Branch (359:23): [True: 0, False: 0]
  ------------------
  360|      0|            return 0;
  361|      0|    }
  362|      0|#endif
  363|      0|    if (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT)
  ------------------
  |  |  244|      0|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (363:9): [True: 0, False: 0]
  ------------------
  364|      0|        return 1;
  365|      0|    return ctx->digest->init(ctx);
  366|      0|}
digest.c:evp_md_from_algorithm:
 1018|     27|{
 1019|     27|    const OSSL_DISPATCH *fns = algodef->implementation;
 1020|     27|    EVP_MD *md = NULL;
 1021|     27|    int fncnt = 0;
 1022|       |
 1023|       |    /* EVP_MD_fetch() will set the legacy NID if available */
 1024|     27|    if ((md = evp_md_new()) == NULL) {
  ------------------
  |  Branch (1024:9): [True: 0, False: 27]
  ------------------
 1025|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1026|      0|        return NULL;
 1027|      0|    }
 1028|       |
 1029|     27|#ifndef FIPS_MODULE
 1030|     27|    md->type = NID_undef;
  ------------------
  |  |   18|     27|#define NID_undef                       0
  ------------------
 1031|     27|    if (!evp_names_do_all(prov, name_id, set_legacy_nid, &md->type)
  ------------------
  |  Branch (1031:9): [True: 0, False: 27]
  ------------------
 1032|     27|            || md->type == -1) {
  ------------------
  |  Branch (1032:16): [True: 0, False: 27]
  ------------------
 1033|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1034|      0|        goto err;
 1035|      0|    }
 1036|     27|#endif
 1037|       |
 1038|     27|    md->name_id = name_id;
 1039|     27|    if ((md->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (1039:9): [True: 0, False: 27]
  ------------------
 1040|      0|        goto err;
 1041|       |
 1042|     27|    md->description = algodef->algorithm_description;
 1043|       |
 1044|    302|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (1044:12): [True: 275, False: 27]
  ------------------
 1045|    275|        switch (fns->function_id) {
  ------------------
  |  Branch (1045:17): [True: 0, False: 275]
  ------------------
 1046|     27|        case OSSL_FUNC_DIGEST_NEWCTX:
  ------------------
  |  |  330|     27|# define OSSL_FUNC_DIGEST_NEWCTX                     1
  ------------------
  |  Branch (1046:9): [True: 27, False: 248]
  ------------------
 1047|     27|            if (md->newctx == NULL) {
  ------------------
  |  Branch (1047:17): [True: 27, False: 0]
  ------------------
 1048|     27|                md->newctx = OSSL_FUNC_digest_newctx(fns);
 1049|     27|                fncnt++;
 1050|     27|            }
 1051|     27|            break;
 1052|     27|        case OSSL_FUNC_DIGEST_INIT:
  ------------------
  |  |  331|     27|# define OSSL_FUNC_DIGEST_INIT                       2
  ------------------
  |  Branch (1052:9): [True: 27, False: 248]
  ------------------
 1053|     27|            if (md->dinit == NULL) {
  ------------------
  |  Branch (1053:17): [True: 27, False: 0]
  ------------------
 1054|     27|                md->dinit = OSSL_FUNC_digest_init(fns);
 1055|     27|                fncnt++;
 1056|     27|            }
 1057|     27|            break;
 1058|     27|        case OSSL_FUNC_DIGEST_UPDATE:
  ------------------
  |  |  332|     27|# define OSSL_FUNC_DIGEST_UPDATE                     3
  ------------------
  |  Branch (1058:9): [True: 27, False: 248]
  ------------------
 1059|     27|            if (md->dupdate == NULL) {
  ------------------
  |  Branch (1059:17): [True: 27, False: 0]
  ------------------
 1060|     27|                md->dupdate = OSSL_FUNC_digest_update(fns);
 1061|     27|                fncnt++;
 1062|     27|            }
 1063|     27|            break;
 1064|     27|        case OSSL_FUNC_DIGEST_FINAL:
  ------------------
  |  |  333|     27|# define OSSL_FUNC_DIGEST_FINAL                      4
  ------------------
  |  Branch (1064:9): [True: 27, False: 248]
  ------------------
 1065|     27|            if (md->dfinal == NULL) {
  ------------------
  |  Branch (1065:17): [True: 27, False: 0]
  ------------------
 1066|     27|                md->dfinal = OSSL_FUNC_digest_final(fns);
 1067|     27|                fncnt++;
 1068|     27|            }
 1069|     27|            break;
 1070|      4|        case OSSL_FUNC_DIGEST_SQUEEZE:
  ------------------
  |  |  343|      4|# define OSSL_FUNC_DIGEST_SQUEEZE                   14
  ------------------
  |  Branch (1070:9): [True: 4, False: 271]
  ------------------
 1071|      4|            if (md->dsqueeze == NULL) {
  ------------------
  |  Branch (1071:17): [True: 4, False: 0]
  ------------------
 1072|      4|                md->dsqueeze = OSSL_FUNC_digest_squeeze(fns);
 1073|      4|                fncnt++;
 1074|      4|            }
 1075|      4|            break;
 1076|      0|        case OSSL_FUNC_DIGEST_DIGEST:
  ------------------
  |  |  334|      0|# define OSSL_FUNC_DIGEST_DIGEST                     5
  ------------------
  |  Branch (1076:9): [True: 0, False: 275]
  ------------------
 1077|      0|            if (md->digest == NULL)
  ------------------
  |  Branch (1077:17): [True: 0, False: 0]
  ------------------
 1078|      0|                md->digest = OSSL_FUNC_digest_digest(fns);
 1079|       |            /* We don't increment fnct for this as it is stand alone */
 1080|      0|            break;
 1081|     27|        case OSSL_FUNC_DIGEST_FREECTX:
  ------------------
  |  |  335|     27|# define OSSL_FUNC_DIGEST_FREECTX                    6
  ------------------
  |  Branch (1081:9): [True: 27, False: 248]
  ------------------
 1082|     27|            if (md->freectx == NULL) {
  ------------------
  |  Branch (1082:17): [True: 27, False: 0]
  ------------------
 1083|     27|                md->freectx = OSSL_FUNC_digest_freectx(fns);
 1084|     27|                fncnt++;
 1085|     27|            }
 1086|     27|            break;
 1087|     27|        case OSSL_FUNC_DIGEST_DUPCTX:
  ------------------
  |  |  336|     27|# define OSSL_FUNC_DIGEST_DUPCTX                     7
  ------------------
  |  Branch (1087:9): [True: 27, False: 248]
  ------------------
 1088|     27|            if (md->dupctx == NULL)
  ------------------
  |  Branch (1088:17): [True: 27, False: 0]
  ------------------
 1089|     27|                md->dupctx = OSSL_FUNC_digest_dupctx(fns);
 1090|     27|            break;
 1091|     27|        case OSSL_FUNC_DIGEST_GET_PARAMS:
  ------------------
  |  |  337|     27|# define OSSL_FUNC_DIGEST_GET_PARAMS                 8
  ------------------
  |  Branch (1091:9): [True: 27, False: 248]
  ------------------
 1092|     27|            if (md->get_params == NULL)
  ------------------
  |  Branch (1092:17): [True: 27, False: 0]
  ------------------
 1093|     27|                md->get_params = OSSL_FUNC_digest_get_params(fns);
 1094|     27|            break;
 1095|      8|        case OSSL_FUNC_DIGEST_SET_CTX_PARAMS:
  ------------------
  |  |  338|      8|# define OSSL_FUNC_DIGEST_SET_CTX_PARAMS             9
  ------------------
  |  Branch (1095:9): [True: 8, False: 267]
  ------------------
 1096|      8|            if (md->set_ctx_params == NULL)
  ------------------
  |  Branch (1096:17): [True: 8, False: 0]
  ------------------
 1097|      8|                md->set_ctx_params = OSSL_FUNC_digest_set_ctx_params(fns);
 1098|      8|            break;
 1099|      6|        case OSSL_FUNC_DIGEST_GET_CTX_PARAMS:
  ------------------
  |  |  339|      6|# define OSSL_FUNC_DIGEST_GET_CTX_PARAMS            10
  ------------------
  |  Branch (1099:9): [True: 6, False: 269]
  ------------------
 1100|      6|            if (md->get_ctx_params == NULL)
  ------------------
  |  Branch (1100:17): [True: 6, False: 0]
  ------------------
 1101|      6|                md->get_ctx_params = OSSL_FUNC_digest_get_ctx_params(fns);
 1102|      6|            break;
 1103|     27|        case OSSL_FUNC_DIGEST_GETTABLE_PARAMS:
  ------------------
  |  |  340|     27|# define OSSL_FUNC_DIGEST_GETTABLE_PARAMS           11
  ------------------
  |  Branch (1103:9): [True: 27, False: 248]
  ------------------
 1104|     27|            if (md->gettable_params == NULL)
  ------------------
  |  Branch (1104:17): [True: 27, False: 0]
  ------------------
 1105|     27|                md->gettable_params = OSSL_FUNC_digest_gettable_params(fns);
 1106|     27|            break;
 1107|      8|        case OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  341|      8|# define OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS       12
  ------------------
  |  Branch (1107:9): [True: 8, False: 267]
  ------------------
 1108|      8|            if (md->settable_ctx_params == NULL)
  ------------------
  |  Branch (1108:17): [True: 8, False: 0]
  ------------------
 1109|      8|                md->settable_ctx_params =
 1110|      8|                    OSSL_FUNC_digest_settable_ctx_params(fns);
 1111|      8|            break;
 1112|      6|        case OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  342|      6|# define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS       13
  ------------------
  |  Branch (1112:9): [True: 6, False: 269]
  ------------------
 1113|      6|            if (md->gettable_ctx_params == NULL)
  ------------------
  |  Branch (1113:17): [True: 6, False: 0]
  ------------------
 1114|      6|                md->gettable_ctx_params =
 1115|      6|                    OSSL_FUNC_digest_gettable_ctx_params(fns);
 1116|      6|            break;
 1117|     27|        case OSSL_FUNC_DIGEST_COPYCTX:
  ------------------
  |  |  344|     27|# define OSSL_FUNC_DIGEST_COPYCTX                   15
  ------------------
  |  Branch (1117:9): [True: 27, False: 248]
  ------------------
 1118|     27|            if (md->copyctx == NULL)
  ------------------
  |  Branch (1118:17): [True: 27, False: 0]
  ------------------
 1119|     27|                md->copyctx =
 1120|     27|                    OSSL_FUNC_digest_copyctx(fns);
 1121|     27|            break;
 1122|    275|        }
 1123|    275|    }
 1124|     27|    if ((fncnt != 0 && fncnt != 5 && fncnt != 6)
  ------------------
  |  Branch (1124:10): [True: 27, False: 0]
  |  Branch (1124:24): [True: 4, False: 23]
  |  Branch (1124:38): [True: 0, False: 4]
  ------------------
 1125|     27|        || (fncnt == 0 && md->digest == NULL)) {
  ------------------
  |  Branch (1125:13): [True: 0, False: 27]
  |  Branch (1125:27): [True: 0, False: 0]
  ------------------
 1126|       |        /*
 1127|       |         * In order to be a consistent set of functions we either need the
 1128|       |         * whole set of init/update/final etc functions or none of them.
 1129|       |         * The "digest" function can standalone. We at least need one way to
 1130|       |         * generate digests.
 1131|       |         */
 1132|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1133|      0|        goto err;
 1134|      0|    }
 1135|     27|    if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (1135:9): [True: 27, False: 0]
  |  Branch (1135:25): [True: 0, False: 27]
  ------------------
 1136|      0|        goto err;
 1137|       |
 1138|     27|    md->prov = prov;
 1139|       |
 1140|     27|    if (!evp_md_cache_constants(md)) {
  ------------------
  |  Branch (1140:9): [True: 0, False: 27]
  ------------------
 1141|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_CACHE_CONSTANTS_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1142|      0|        goto err;
 1143|      0|    }
 1144|       |
 1145|     27|    return md;
 1146|       |
 1147|      0|err:
 1148|      0|    EVP_MD_free(md);
 1149|      0|    return NULL;
 1150|     27|}
digest.c:set_legacy_nid:
  959|     71|{
  960|     71|    int nid;
  961|     71|    int *legacy_nid = vlegacy_nid;
  962|       |    /*
  963|       |     * We use lowest level function to get the associated method, because
  964|       |     * higher level functions such as EVP_get_digestbyname() have changed
  965|       |     * to look at providers too.
  966|       |     */
  967|     71|    const void *legacy_method = OBJ_NAME_get(name, OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|     71|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  968|       |
  969|     71|    if (*legacy_nid == -1)       /* We found a clash already */
  ------------------
  |  Branch (969:9): [True: 0, False: 71]
  ------------------
  970|      0|        return;
  971|       |
  972|     71|    if (legacy_method == NULL)
  ------------------
  |  Branch (972:9): [True: 48, False: 23]
  ------------------
  973|     48|        return;
  974|     23|    nid = EVP_MD_nid(legacy_method);
  ------------------
  |  |  559|     23|# define EVP_MD_nid EVP_MD_get_type
  ------------------
  975|     23|    if (*legacy_nid != NID_undef && *legacy_nid != nid) {
  ------------------
  |  |   18|     46|#define NID_undef                       0
  ------------------
  |  Branch (975:9): [True: 4, False: 19]
  |  Branch (975:37): [True: 0, False: 4]
  ------------------
  976|      0|        *legacy_nid = -1;
  977|      0|        return;
  978|      0|    }
  979|     23|    *legacy_nid = nid;
  980|     23|}
digest.c:evp_md_cache_constants:
  984|     27|{
  985|     27|    int ok, xof = 0, algid_absent = 0;
  986|     27|    size_t blksz = 0;
  987|     27|    size_t mdsize = 0;
  988|     27|    OSSL_PARAM params[5];
  989|       |
  990|       |    /*
  991|       |     * Note that these parameters are 'constants' that are only set up
  992|       |     * during the EVP_MD_fetch(). For this reason the XOF functions set the
  993|       |     * md_size to 0, since the output size is unknown.
  994|       |     */
  995|     27|    params[0] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_BLOCK_SIZE, &blksz);
  ------------------
  |  |  220|     27|# define OSSL_DIGEST_PARAM_BLOCK_SIZE "blocksize"
  ------------------
  996|     27|    params[1] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_SIZE, &mdsize);
  ------------------
  |  |  223|     27|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
  997|     27|    params[2] = OSSL_PARAM_construct_int(OSSL_DIGEST_PARAM_XOF, &xof);
  ------------------
  |  |  225|     27|# define OSSL_DIGEST_PARAM_XOF "xof"
  ------------------
  998|     27|    params[3] = OSSL_PARAM_construct_int(OSSL_DIGEST_PARAM_ALGID_ABSENT,
  ------------------
  |  |  219|     27|# define OSSL_DIGEST_PARAM_ALGID_ABSENT "algid-absent"
  ------------------
  999|     27|                                         &algid_absent);
 1000|     27|    params[4] = OSSL_PARAM_construct_end();
 1001|     27|    ok = evp_do_md_getparams(md, params) > 0;
 1002|     27|    if (mdsize > INT_MAX || blksz > INT_MAX)
  ------------------
  |  Branch (1002:9): [True: 0, False: 27]
  |  Branch (1002:29): [True: 0, False: 27]
  ------------------
 1003|      0|        ok = 0;
 1004|     27|    if (ok) {
  ------------------
  |  Branch (1004:9): [True: 27, False: 0]
  ------------------
 1005|     27|        md->block_size = (int)blksz;
 1006|     27|        md->md_size = (int)mdsize;
 1007|     27|        if (xof)
  ------------------
  |  Branch (1007:13): [True: 4, False: 23]
  ------------------
 1008|      4|            md->flags |= EVP_MD_FLAG_XOF;
  ------------------
  |  |  184|      4|#  define EVP_MD_FLAG_XOF         0x0002
  ------------------
 1009|     27|        if (algid_absent)
  ------------------
  |  Branch (1009:13): [True: 18, False: 9]
  ------------------
 1010|     18|            md->flags |= EVP_MD_FLAG_DIGALGID_ABSENT;
  ------------------
  |  |  196|     18|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
 1011|     27|    }
 1012|     27|    return ok;
 1013|     27|}
digest.c:evp_md_up_ref:
 1153|  6.66k|{
 1154|  6.66k|    return EVP_MD_up_ref(md);
 1155|  6.66k|}
digest.c:evp_md_free:
 1158|     58|{
 1159|     58|    EVP_MD_free(md);
 1160|     58|}

EVP_aes_128_cbc:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_ecb:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_ofb:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_cfb128:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_cfb1:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_cfb8:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_ctr:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_cbc:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_ecb:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_ofb:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_cfb128:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_cfb1:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_cfb8:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_ctr:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_cbc:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_ecb:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_ofb:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_cfb128:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_cfb1:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_cfb8:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_ctr:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_gcm:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_gcm:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_gcm:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_xts:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_xts:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_ccm:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_ccm:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_ccm:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_wrap:
 3772|      2|{
 3773|      2|    return &aes_128_wrap;
 3774|      2|}
EVP_aes_192_wrap:
 3786|      2|{
 3787|      2|    return &aes_192_wrap;
 3788|      2|}
EVP_aes_256_wrap:
 3800|      2|{
 3801|      2|    return &aes_256_wrap;
 3802|      2|}
EVP_aes_128_wrap_pad:
 3814|      2|{
 3815|      2|    return &aes_128_wrap_pad;
 3816|      2|}
EVP_aes_192_wrap_pad:
 3828|      2|{
 3829|      2|    return &aes_192_wrap_pad;
 3830|      2|}
EVP_aes_256_wrap_pad:
 3842|      2|{
 3843|      2|    return &aes_256_wrap_pad;
 3844|      2|}
EVP_aes_128_ocb:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_ocb:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_ocb:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------

EVP_aes_128_cbc_hmac_sha1:
  956|      2|{
  957|      2|    return (OPENSSL_ia32cap_P[1] & AESNI_CAPABLE ?
  ------------------
  |  |   47|      2|# define AESNI_CAPABLE   (1<<(57-32))
  ------------------
  |  Branch (957:13): [True: 2, False: 0]
  ------------------
  958|      2|            &aesni_128_cbc_hmac_sha1_cipher : NULL);
  959|      2|}
EVP_aes_256_cbc_hmac_sha1:
  962|      2|{
  963|      2|    return (OPENSSL_ia32cap_P[1] & AESNI_CAPABLE ?
  ------------------
  |  |   47|      2|# define AESNI_CAPABLE   (1<<(57-32))
  ------------------
  |  Branch (963:13): [True: 2, False: 0]
  ------------------
  964|      2|            &aesni_256_cbc_hmac_sha1_cipher : NULL);
  965|      2|}

EVP_aes_128_cbc_hmac_sha256:
  933|      2|{
  934|      2|    return ((OPENSSL_ia32cap_P[1] & AESNI_CAPABLE) &&
  ------------------
  |  |   47|      2|# define AESNI_CAPABLE   (1<<(57-32))
  ------------------
  |  Branch (934:13): [True: 2, False: 0]
  ------------------
  935|      2|            aesni_cbc_sha256_enc(NULL, NULL, 0, NULL, NULL, NULL, NULL) ?
  ------------------
  |  Branch (935:13): [True: 2, False: 0]
  ------------------
  936|      2|            &aesni_128_cbc_hmac_sha256_cipher : NULL);
  937|      2|}
EVP_aes_256_cbc_hmac_sha256:
  940|      2|{
  941|      2|    return ((OPENSSL_ia32cap_P[1] & AESNI_CAPABLE) &&
  ------------------
  |  |   47|      2|# define AESNI_CAPABLE   (1<<(57-32))
  ------------------
  |  Branch (941:13): [True: 2, False: 0]
  ------------------
  942|      2|            aesni_cbc_sha256_enc(NULL, NULL, 0, NULL, NULL, NULL, NULL) ?
  ------------------
  |  Branch (942:13): [True: 2, False: 0]
  ------------------
  943|      2|            &aesni_256_cbc_hmac_sha256_cipher : NULL);
  944|      2|}

EVP_aria_128_ctr:
  172|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  173|      2|{ return &aria_##keylen##_##mode; }
EVP_aria_192_ctr:
  172|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  173|      2|{ return &aria_##keylen##_##mode; }
EVP_aria_256_ctr:
  172|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  173|      2|{ return &aria_##keylen##_##mode; }
EVP_aria_128_gcm:
  775|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  776|      2|{ return (EVP_CIPHER*)&aria_##keylen##_##mode; }
EVP_aria_192_gcm:
  775|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  776|      2|{ return (EVP_CIPHER*)&aria_##keylen##_##mode; }
EVP_aria_256_gcm:
  775|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  776|      2|{ return (EVP_CIPHER*)&aria_##keylen##_##mode; }
EVP_aria_128_ccm:
  775|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  776|      2|{ return (EVP_CIPHER*)&aria_##keylen##_##mode; }
EVP_aria_192_ccm:
  775|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  776|      2|{ return (EVP_CIPHER*)&aria_##keylen##_##mode; }
EVP_aria_256_ccm:
  775|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  776|      2|{ return (EVP_CIPHER*)&aria_##keylen##_##mode; }

EVP_camellia_128_cbc:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_128_ecb:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_128_ofb:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_128_cfb128:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_128_cfb1:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_128_cfb8:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_128_ctr:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_192_cbc:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_192_ecb:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_192_ofb:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_192_cfb128:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_192_cfb1:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_192_cfb8:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_192_ctr:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_256_cbc:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_256_ecb:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_256_ofb:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_256_cfb128:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_256_cfb1:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_256_cfb8:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_256_ctr:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }

EVP_chacha20:
  146|      2|{
  147|      2|    return &chacha20;
  148|      2|}
EVP_chacha20_poly1305:
  631|      2|{
  632|      2|    return(&chacha20_poly1305);
  633|      2|}

EVP_des_ede:
  303|      2|{
  304|      2|    return &des_ede_ecb;
  305|      2|}
EVP_des_ede3:
  308|      2|{
  309|      2|    return &des_ede3_ecb;
  310|      2|}
EVP_des_ede3_wrap:
  423|      2|{
  424|      2|    return &des3_wrap;
  425|      2|}

EVP_rc2_64_cbc:
   83|      2|{
   84|      2|    return &r2_64_cbc_cipher;
   85|      2|}
EVP_rc2_40_cbc:
   88|      2|{
   89|      2|    return &r2_40_cbc_cipher;
   90|      2|}

EVP_rc4:
   68|      2|{
   69|      2|    return &r4_cipher;
   70|      2|}
EVP_rc4_40:
   73|      2|{
   74|      2|    return &r4_40_cipher;
   75|      2|}

EVP_rc4_hmac_md5:
  270|      2|{
  271|      2|    return &r4_hmac_md5_cipher;
  272|      2|}

EVP_sm4_cbc:
   46|      2|const EVP_CIPHER *EVP_sm4_##mode(void) \
   47|      2|{ return &sm4_##mode; }
EVP_sm4_ecb:
   46|      2|const EVP_CIPHER *EVP_sm4_##mode(void) \
   47|      2|{ return &sm4_##mode; }
EVP_sm4_ofb:
   46|      2|const EVP_CIPHER *EVP_sm4_##mode(void) \
   47|      2|{ return &sm4_##mode; }
EVP_sm4_cfb128:
   46|      2|const EVP_CIPHER *EVP_sm4_##mode(void) \
   47|      2|{ return &sm4_##mode; }
EVP_sm4_ctr:
   46|      2|const EVP_CIPHER *EVP_sm4_##mode(void) \
   47|      2|{ return &sm4_##mode; }

EVP_desx_cbc:
   56|      2|{
   57|      2|    return &d_xcbc_cipher;
   58|      2|}

OSSL_EC_curve_nid2name:
  119|  7.38k|{
  120|  7.38k|    size_t i;
  121|       |
  122|  7.38k|    if (nid <= 0)
  ------------------
  |  Branch (122:9): [True: 0, False: 7.38k]
  ------------------
  123|      0|        return NULL;
  124|       |
  125|   179k|    for (i = 0; i < OSSL_NELEM(curve_list); i++) {
  ------------------
  |  |   14|   179k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (125:17): [True: 179k, False: 0]
  ------------------
  126|   179k|        if (curve_list[i].nid == nid)
  ------------------
  |  Branch (126:13): [True: 7.38k, False: 172k]
  ------------------
  127|  7.38k|            return curve_list[i].name;
  128|   179k|    }
  129|      0|    return NULL;
  130|  7.38k|}
ossl_ec_curve_nid2nist_int:
  171|  1.08k|{
  172|  1.08k|    size_t i;
  173|  14.7k|    for (i = 0; i < OSSL_NELEM(nist_curves); i++) {
  ------------------
  |  |   14|  14.7k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (173:17): [True: 14.1k, False: 621]
  ------------------
  174|  14.1k|        if (nist_curves[i].nid == nid)
  ------------------
  |  Branch (174:13): [True: 461, False: 13.7k]
  ------------------
  175|    461|            return nist_curves[i].name;
  176|  14.1k|    }
  177|    621|    return NULL;
  178|  1.08k|}

EVP_CIPHER_CTX_reset:
   34|    762|{
   35|    762|    if (ctx == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 762]
  ------------------
   36|      0|        return 1;
   37|       |
   38|    762|    if (ctx->cipher == NULL || ctx->cipher->prov == NULL)
  ------------------
  |  Branch (38:9): [True: 762, False: 0]
  |  Branch (38:32): [True: 0, False: 0]
  ------------------
   39|    762|        goto legacy;
   40|       |
   41|      0|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (41:9): [True: 0, False: 0]
  ------------------
   42|      0|        if (ctx->cipher->freectx != NULL)
  ------------------
  |  Branch (42:13): [True: 0, False: 0]
  ------------------
   43|      0|            ctx->cipher->freectx(ctx->algctx);
   44|      0|        ctx->algctx = NULL;
   45|      0|    }
   46|      0|    if (ctx->fetched_cipher != NULL)
  ------------------
  |  Branch (46:9): [True: 0, False: 0]
  ------------------
   47|      0|        EVP_CIPHER_free(ctx->fetched_cipher);
   48|      0|    memset(ctx, 0, sizeof(*ctx));
   49|      0|    ctx->iv_len = -1;
   50|       |
   51|      0|    return 1;
   52|       |
   53|       |    /* Remove legacy code below when legacy support is removed. */
   54|    762| legacy:
   55|       |
   56|    762|    if (ctx->cipher != NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 762]
  ------------------
   57|      0|        if (ctx->cipher->cleanup && !ctx->cipher->cleanup(ctx))
  ------------------
  |  Branch (57:13): [True: 0, False: 0]
  |  Branch (57:37): [True: 0, False: 0]
  ------------------
   58|      0|            return 0;
   59|       |        /* Cleanse cipher context data */
   60|      0|        if (ctx->cipher_data && ctx->cipher->ctx_size)
  ------------------
  |  Branch (60:13): [True: 0, False: 0]
  |  Branch (60:33): [True: 0, False: 0]
  ------------------
   61|      0|            OPENSSL_cleanse(ctx->cipher_data, ctx->cipher->ctx_size);
   62|      0|    }
   63|    762|    OPENSSL_free(ctx->cipher_data);
  ------------------
  |  |  115|    762|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    762|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    762|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|    762|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   65|    762|    ENGINE_finish(ctx->engine);
   66|    762|#endif
   67|    762|    memset(ctx, 0, sizeof(*ctx));
   68|    762|    ctx->iv_len = -1;
   69|    762|    return 1;
   70|    762|}
EVP_CIPHER_CTX_new:
   73|    762|{
   74|    762|    EVP_CIPHER_CTX *ctx;
   75|       |
   76|    762|    ctx = OPENSSL_zalloc(sizeof(EVP_CIPHER_CTX));
  ------------------
  |  |  104|    762|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    762|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    762|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|    762|    if (ctx == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 762]
  ------------------
   78|      0|        return NULL;
   79|       |
   80|    762|    ctx->iv_len = -1;
   81|    762|    return ctx;
   82|    762|}
EVP_CIPHER_CTX_free:
   85|    762|{
   86|    762|    if (ctx == NULL)
  ------------------
  |  Branch (86:9): [True: 0, False: 762]
  ------------------
   87|      0|        return;
   88|    762|    EVP_CIPHER_CTX_reset(ctx);
   89|    762|    OPENSSL_free(ctx);
  ------------------
  |  |  115|    762|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    762|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    762|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   90|    762|}
EVP_CIPHER_free:
 2120|  28.0k|{
 2121|  28.0k|    int i;
 2122|       |
 2123|  28.0k|    if (cipher == NULL || cipher->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|      0|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (2123:9): [True: 28.0k, False: 0]
  |  Branch (2123:27): [True: 0, False: 0]
  ------------------
 2124|  28.0k|        return;
 2125|       |
 2126|      0|    CRYPTO_DOWN_REF(&cipher->refcnt, &i);
 2127|      0|    if (i > 0)
  ------------------
  |  Branch (2127:9): [True: 0, False: 0]
  ------------------
 2128|      0|        return;
 2129|      0|    evp_cipher_free_int(cipher);
 2130|      0|}

ossl_err_load_EVP_strings:
  227|      2|{
  228|      2|#ifndef OPENSSL_NO_ERR
  229|      2|    if (ERR_reason_error_string(EVP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (229:9): [True: 2, False: 0]
  ------------------
  230|      2|        ERR_load_strings_const(EVP_str_reasons);
  231|      2|#endif
  232|      2|    return 1;
  233|      2|}

evp_generic_fetch:
  397|  6.65k|{
  398|  6.65k|    struct evp_method_data_st methdata;
  399|  6.65k|    void *method;
  400|       |
  401|  6.65k|    methdata.libctx = libctx;
  402|  6.65k|    methdata.tmp_store = NULL;
  403|  6.65k|    method = inner_evp_generic_fetch(&methdata, NULL, operation_id,
  404|  6.65k|                                     name, properties,
  405|  6.65k|                                     new_method, up_ref_method, free_method);
  406|  6.65k|    dealloc_tmp_evp_method_store(methdata.tmp_store);
  407|  6.65k|    return method;
  408|  6.65k|}
evp_method_store_cache_flush:
  437|      2|{
  438|      2|    OSSL_METHOD_STORE *store = get_evp_method_store(libctx);
  439|       |
  440|      2|    if (store != NULL)
  ------------------
  |  Branch (440:9): [True: 2, False: 0]
  ------------------
  441|      2|        return ossl_method_store_cache_flush_all(store);
  442|      0|    return 1;
  443|      2|}
evp_generic_do_all:
  636|    223|{
  637|    223|    struct evp_method_data_st methdata;
  638|    223|    struct filter_data_st data;
  639|       |
  640|    223|    methdata.libctx = libctx;
  641|    223|    methdata.tmp_store = NULL;
  642|    223|    (void)inner_evp_generic_fetch(&methdata, NULL, operation_id, NULL, NULL,
  643|    223|                                  new_method, up_ref_method, free_method);
  644|       |
  645|    223|    data.operation_id = operation_id;
  646|    223|    data.user_fn = user_fn;
  647|    223|    data.user_arg = user_arg;
  648|    223|    if (methdata.tmp_store != NULL)
  ------------------
  |  Branch (648:9): [True: 0, False: 223]
  ------------------
  649|      0|        ossl_method_store_do_all(methdata.tmp_store, &filter_on_operation_id,
  650|      0|                                 &data);
  651|    223|    ossl_method_store_do_all(get_evp_method_store(libctx),
  652|    223|                             &filter_on_operation_id, &data);
  653|    223|    dealloc_tmp_evp_method_store(methdata.tmp_store);
  654|    223|}
evp_is_a:
  658|  17.1k|{
  659|       |    /*
  660|       |     * For a |prov| that is NULL, the library context will be NULL
  661|       |     */
  662|  17.1k|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  663|  17.1k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  664|       |
  665|  17.1k|    if (prov == NULL)
  ------------------
  |  Branch (665:9): [True: 6.59k, False: 10.5k]
  ------------------
  666|  6.59k|        number = ossl_namemap_name2num(namemap, legacy_name);
  667|  17.1k|    return ossl_namemap_name2num(namemap, name) == number;
  668|  17.1k|}
evp_names_do_all:
  673|  11.4k|{
  674|  11.4k|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  675|  11.4k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  676|       |
  677|  11.4k|    return ossl_namemap_doall_names(namemap, number, fn, data);
  678|  11.4k|}
evp_fetch.c:inner_evp_generic_fetch:
  259|  6.88k|{
  260|  6.88k|    OSSL_METHOD_STORE *store = get_evp_method_store(methdata->libctx);
  261|  6.88k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  262|       |#ifdef FIPS_MODULE
  263|       |    /*
  264|       |     * The FIPS provider has its own internal library context where only it
  265|       |     * is loaded.  Consequently, property queries aren't relevant because
  266|       |     * there is only one fetchable algorithm and it is assumed that the
  267|       |     * FIPS-ness is handled by the using algorithm.
  268|       |     */
  269|       |    const char *const propq = "";
  270|       |#else
  271|  6.88k|    const char *const propq = properties != NULL ? properties : "";
  ------------------
  |  Branch (271:31): [True: 58, False: 6.82k]
  ------------------
  272|  6.88k|#endif  /* FIPS_MODULE */
  273|  6.88k|    uint32_t meth_id = 0;
  274|  6.88k|    void *method = NULL;
  275|  6.88k|    int unsupported, name_id;
  276|       |
  277|  6.88k|    if (store == NULL || namemap == NULL) {
  ------------------
  |  Branch (277:9): [True: 0, False: 6.88k]
  |  Branch (277:26): [True: 0, False: 6.88k]
  ------------------
  278|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  279|      0|        return NULL;
  280|      0|    }
  281|       |
  282|       |    /*
  283|       |     * If there's ever an operation_id == 0 passed, we have an internal
  284|       |     * programming error.
  285|       |     */
  286|  6.88k|    if (!ossl_assert(operation_id > 0)) {
  ------------------
  |  |   52|  6.88k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  6.88k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (286:9): [True: 0, False: 6.88k]
  ------------------
  287|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  288|      0|        return NULL;
  289|      0|    }
  290|       |
  291|       |    /* If we haven't received a name id yet, try to get one for the name */
  292|  6.88k|    name_id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
  ------------------
  |  Branch (292:15): [True: 6.65k, False: 223]
  ------------------
  293|       |
  294|       |    /*
  295|       |     * If we have a name id, calculate a method id with evp_method_id().
  296|       |     *
  297|       |     * evp_method_id returns 0 if we have too many operations (more than
  298|       |     * about 2^8) or too many names (more than about 2^24).  In that case,
  299|       |     * we can't create any new method.
  300|       |     * For all intents and purposes, this is an internal error.
  301|       |     */
  302|  6.88k|    if (name_id != 0 && (meth_id = evp_method_id(name_id, operation_id)) == 0) {
  ------------------
  |  Branch (302:9): [True: 6.65k, False: 225]
  |  Branch (302:25): [True: 0, False: 6.65k]
  ------------------
  303|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  304|      0|        return NULL;
  305|      0|    }
  306|       |
  307|       |    /*
  308|       |     * If we haven't found the name yet, chances are that the algorithm to
  309|       |     * be fetched is unsupported.
  310|       |     */
  311|  6.88k|    unsupported = name_id == 0;
  312|       |
  313|  6.88k|    if (meth_id == 0
  ------------------
  |  Branch (313:9): [True: 225, False: 6.65k]
  ------------------
  314|  6.88k|        || !ossl_method_store_cache_get(store, prov, meth_id, propq, &method)) {
  ------------------
  |  Branch (314:12): [True: 5, False: 6.65k]
  ------------------
  315|    230|        OSSL_METHOD_CONSTRUCT_METHOD mcm = {
  316|    230|            get_tmp_evp_method_store,
  317|    230|            reserve_evp_method_store,
  318|    230|            unreserve_evp_method_store,
  319|    230|            get_evp_method_from_store,
  320|    230|            put_evp_method_in_store,
  321|    230|            construct_evp_method,
  322|    230|            destruct_evp_method
  323|    230|        };
  324|       |
  325|    230|        methdata->operation_id = operation_id;
  326|    230|        methdata->name_id = name_id;
  327|    230|        methdata->names = name;
  328|    230|        methdata->propquery = propq;
  329|    230|        methdata->method_from_algorithm = new_method;
  330|    230|        methdata->refcnt_up_method = up_ref_method;
  331|    230|        methdata->destruct_method = free_method;
  332|    230|        methdata->flag_construct_error_occurred = 0;
  333|    230|        if ((method = ossl_method_construct(methdata->libctx, operation_id,
  ------------------
  |  Branch (333:13): [True: 7, False: 223]
  ------------------
  334|    230|                                            &prov, 0 /* !force_cache */,
  335|    230|                                            &mcm, methdata)) != NULL) {
  336|       |            /*
  337|       |             * If construction did create a method for us, we know that
  338|       |             * there is a correct name_id and meth_id, since those have
  339|       |             * already been calculated in get_evp_method_from_store() and
  340|       |             * put_evp_method_in_store() above.
  341|       |             * Note that there is a corner case here, in which, if a user
  342|       |             * passes a name of the form name1:name2:..., then the construction
  343|       |             * will create a method against all names, but the lookup will fail
  344|       |             * as ossl_namemap_name2num treats the name string as a single name
  345|       |             * rather than introducing new features where in the EVP_<obj>_fetch
  346|       |             * parses the string and queries for each, return an error.
  347|       |             */
  348|      7|            if (name_id == 0)
  ------------------
  |  Branch (348:17): [True: 2, False: 5]
  ------------------
  349|      2|                name_id = ossl_namemap_name2num(namemap, name);
  350|      7|            if (name_id == 0) {
  ------------------
  |  Branch (350:17): [True: 0, False: 7]
  ------------------
  351|      0|                ERR_raise_data(ERR_LIB_EVP, ERR_R_FETCH_FAILED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_EVP, ERR_R_FETCH_FAILED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                              ERR_raise_data(ERR_LIB_EVP, ERR_R_FETCH_FAILED,
  ------------------
  |  |  364|      0|# define ERR_R_FETCH_FAILED                      (269|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  352|      0|                               "Algorithm %s cannot be found", name);
  353|      0|                free_method(method);
  354|      0|                method = NULL;
  355|      7|            } else {
  356|      7|                meth_id = evp_method_id(name_id, operation_id);
  357|      7|                if (meth_id != 0)
  ------------------
  |  Branch (357:21): [True: 7, False: 0]
  ------------------
  358|      7|                    ossl_method_store_cache_set(store, prov, meth_id, propq,
  359|      7|                                                method, up_ref_method, free_method);
  360|      7|            }
  361|      7|        }
  362|       |
  363|       |        /*
  364|       |         * If we never were in the constructor, the algorithm to be fetched
  365|       |         * is unsupported.
  366|       |         */
  367|    230|        unsupported = !methdata->flag_construct_error_occurred;
  368|    230|    }
  369|       |
  370|  6.88k|    if ((name_id != 0 || name != NULL) && method == NULL) {
  ------------------
  |  Branch (370:10): [True: 6.65k, False: 223]
  |  Branch (370:26): [True: 0, False: 223]
  |  Branch (370:43): [True: 0, False: 6.65k]
  ------------------
  371|      0|        int code = unsupported ? ERR_R_UNSUPPORTED : ERR_R_FETCH_FAILED;
  ------------------
  |  |  363|      0|# define ERR_R_UNSUPPORTED                       (268|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      int code = unsupported ? ERR_R_UNSUPPORTED : ERR_R_FETCH_FAILED;
  ------------------
  |  |  364|      0|# define ERR_R_FETCH_FAILED                      (269|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (371:20): [True: 0, False: 0]
  ------------------
  372|       |
  373|      0|        if (name == NULL)
  ------------------
  |  Branch (373:13): [True: 0, False: 0]
  ------------------
  374|      0|            name = ossl_namemap_num2name(namemap, name_id, 0);
  375|      0|        ERR_raise_data(ERR_LIB_EVP, code,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, code,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
  376|      0|                       "%s, Algorithm (%s : %d), Properties (%s)",
  377|      0|                       ossl_lib_ctx_get_descriptor(methdata->libctx),
  378|      0|                       name == NULL ? "<null>" : name, name_id,
  ------------------
  |  Branch (378:24): [True: 0, False: 0]
  ------------------
  379|      0|                       properties == NULL ? "<null>" : properties);
  ------------------
  |  Branch (379:24): [True: 0, False: 0]
  ------------------
  380|  6.88k|    } else {
  381|  6.88k|        OSSL_TRACE4(QUERY, "%s, Algorithm (%s : %d), Properties (%s)\n",
  ------------------
  |  |  297|  6.88k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  283|  6.88k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  382|  6.88k|                    ossl_lib_ctx_get_descriptor(methdata->libctx),
  383|  6.88k|                    name == NULL ? "<null>" : name, name_id,
  384|  6.88k|                    properties == NULL ? "<null>" : properties);
  385|  6.88k|    }
  386|       |
  387|  6.88k|    return method;
  388|  6.88k|}
evp_fetch.c:evp_method_id:
  117|  6.75k|{
  118|  6.75k|    if (!ossl_assert(name_id > 0 && name_id <= METHOD_ID_NAME_MAX)
  ------------------
  |  |   52|  13.5k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 6.75k, False: 0]
  |  |  |  Branch (52:43): [True: 6.75k, False: 0]
  |  |  ------------------
  |  |   53|  13.5k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (118:9): [True: 0, False: 6.75k]
  ------------------
  119|  6.75k|        || !ossl_assert(operation_id > 0
  ------------------
  |  |   52|  13.5k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 6.75k, False: 0]
  |  |  |  Branch (52:43): [True: 6.75k, False: 0]
  |  |  ------------------
  |  |   53|  6.75k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (119:12): [True: 0, False: 6.75k]
  ------------------
  120|  6.75k|                        && operation_id <= METHOD_ID_OPERATION_MAX))
  121|      0|        return 0;
  122|  6.75k|    return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  114|  6.75k|#define METHOD_ID_NAME_OFFSET           8
  ------------------
                  return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  113|  6.75k|#define METHOD_ID_NAME_MASK             0x7FFFFF00
  ------------------
  123|  6.75k|            | (operation_id & METHOD_ID_OPERATION_MASK));
  ------------------
  |  |  111|  6.75k|#define METHOD_ID_OPERATION_MASK        0x000000FF
  ------------------
  124|  6.75k|}
evp_fetch.c:reserve_evp_method_store:
   73|    460|{
   74|    460|    struct evp_method_data_st *methdata = data;
   75|       |
   76|    460|    if (store == NULL
  ------------------
  |  Branch (76:9): [True: 460, False: 0]
  ------------------
   77|    460|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (77:12): [True: 0, False: 460]
  ------------------
   78|      0|        return 0;
   79|       |
   80|    460|    return ossl_method_lock_store(store);
   81|    460|}
evp_fetch.c:unreserve_evp_method_store:
   84|    460|{
   85|    460|    struct evp_method_data_st *methdata = data;
   86|       |
   87|    460|    if (store == NULL
  ------------------
  |  Branch (87:9): [True: 460, False: 0]
  ------------------
   88|    460|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (88:12): [True: 0, False: 460]
  ------------------
   89|      0|        return 0;
   90|       |
   91|    460|    return ossl_method_unlock_store(store);
   92|    460|}
evp_fetch.c:get_evp_method_from_store:
  128|    230|{
  129|    230|    struct evp_method_data_st *methdata = data;
  130|    230|    void *method = NULL;
  131|    230|    int name_id;
  132|    230|    uint32_t meth_id;
  133|       |
  134|       |    /*
  135|       |     * get_evp_method_from_store() is only called to try and get the method
  136|       |     * that evp_generic_fetch() is asking for, and the operation id as well
  137|       |     * as the name or name id are passed via methdata.
  138|       |     */
  139|    230|    if ((name_id = methdata->name_id) == 0 && methdata->names != NULL) {
  ------------------
  |  Branch (139:9): [True: 225, False: 5]
  |  Branch (139:47): [True: 2, False: 223]
  ------------------
  140|      2|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  141|      2|        const char *names = methdata->names;
  142|      2|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   24|      2|#define NAME_SEPARATOR ':'
  ------------------
  143|      2|        size_t l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (143:21): [True: 2, False: 0]
  ------------------
  144|       |
  145|      2|        if (namemap == 0)
  ------------------
  |  Branch (145:13): [True: 0, False: 2]
  ------------------
  146|      0|            return NULL;
  147|      2|        name_id = ossl_namemap_name2num_n(namemap, names, l);
  148|      2|    }
  149|       |
  150|    230|    if (name_id == 0
  ------------------
  |  Branch (150:9): [True: 223, False: 7]
  ------------------
  151|    230|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (151:12): [True: 0, False: 7]
  ------------------
  152|    223|        return NULL;
  153|       |
  154|      7|    if (store == NULL
  ------------------
  |  Branch (154:9): [True: 7, False: 0]
  ------------------
  155|      7|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (155:12): [True: 0, False: 7]
  ------------------
  156|      0|        return NULL;
  157|       |
  158|      7|    if (!ossl_method_store_fetch(store, meth_id, methdata->propquery, prov,
  ------------------
  |  Branch (158:9): [True: 0, False: 7]
  ------------------
  159|      7|                                 &method))
  160|      0|        return NULL;
  161|      7|    return method;
  162|      7|}
evp_fetch.c:put_evp_method_in_store:
  168|     82|{
  169|     82|    struct evp_method_data_st *methdata = data;
  170|     82|    OSSL_NAMEMAP *namemap;
  171|     82|    int name_id;
  172|     82|    uint32_t meth_id;
  173|     82|    size_t l = 0;
  174|       |
  175|       |    /*
  176|       |     * put_evp_method_in_store() is only called with an EVP method that was
  177|       |     * successfully created by construct_method() below, which means that
  178|       |     * all the names should already be stored in the namemap with the same
  179|       |     * numeric identity, so just use the first to get that identity.
  180|       |     */
  181|     82|    if (names != NULL) {
  ------------------
  |  Branch (181:9): [True: 82, False: 0]
  ------------------
  182|     82|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   24|     82|#define NAME_SEPARATOR ':'
  ------------------
  183|       |
  184|     82|        l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (184:14): [True: 26, False: 56]
  ------------------
  185|     82|    }
  186|       |
  187|     82|    if ((namemap = ossl_namemap_stored(methdata->libctx)) == NULL
  ------------------
  |  Branch (187:9): [True: 0, False: 82]
  ------------------
  188|     82|        || (name_id = ossl_namemap_name2num_n(namemap, names, l)) == 0
  ------------------
  |  Branch (188:12): [True: 0, False: 82]
  ------------------
  189|     82|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (189:12): [True: 0, False: 82]
  ------------------
  190|      0|        return 0;
  191|       |
  192|     82|    OSSL_TRACE1(QUERY, "put_evp_method_in_store: original store: %p\n", store);
  ------------------
  |  |  291|     82|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  283|     82|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  193|     82|    if (store == NULL
  ------------------
  |  Branch (193:9): [True: 82, False: 0]
  ------------------
  194|     82|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (194:12): [True: 0, False: 82]
  ------------------
  195|      0|        return 0;
  196|       |
  197|     82|    OSSL_TRACE5(QUERY,
  ------------------
  |  |  299|     82|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5))
  |  |  ------------------
  |  |  |  |  283|     82|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  198|     82|                "put_evp_method_in_store: "
  199|     82|                "store: %p, names: %s, operation_id %d, method_id: %d, properties: %s\n",
  200|     82|                store, names, methdata->operation_id, meth_id, propdef ? propdef : "<null>");
  201|     82|    return ossl_method_store_add(store, prov, meth_id, propdef, method,
  202|     82|                                 methdata->refcnt_up_method,
  203|     82|                                 methdata->destruct_method);
  204|     82|}
evp_fetch.c:construct_evp_method:
  212|     82|{
  213|       |    /*
  214|       |     * This function is only called if get_evp_method_from_store() returned
  215|       |     * NULL, so it's safe to say that of all the spots to create a new
  216|       |     * namemap entry, this is it.  Should the name already exist there, we
  217|       |     * know that ossl_namemap_add_name() will return its corresponding
  218|       |     * number.
  219|       |     */
  220|     82|    struct evp_method_data_st *methdata = data;
  221|     82|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  222|     82|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  223|     82|    const char *names = algodef->algorithm_names;
  224|     82|    int name_id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
  ------------------
  |  |   24|     82|#define NAME_SEPARATOR ':'
  ------------------
  225|     82|    void *method;
  226|       |
  227|     82|    if (name_id == 0)
  ------------------
  |  Branch (227:9): [True: 0, False: 82]
  ------------------
  228|      0|        return NULL;
  229|       |
  230|     82|    method = methdata->method_from_algorithm(name_id, algodef, prov);
  231|       |
  232|       |    /*
  233|       |     * Flag to indicate that there was actual construction errors.  This
  234|       |     * helps inner_evp_generic_fetch() determine what error it should
  235|       |     * record on inaccessible algorithms.
  236|       |     */
  237|     82|    if (method == NULL)
  ------------------
  |  Branch (237:9): [True: 0, False: 82]
  ------------------
  238|      0|        methdata->flag_construct_error_occurred = 1;
  239|       |
  240|     82|    return method;
  241|     82|}
evp_fetch.c:destruct_evp_method:
  244|     82|{
  245|     82|    struct evp_method_data_st *methdata = data;
  246|       |
  247|     82|    methdata->destruct_method(method);
  248|     82|}
evp_fetch.c:dealloc_tmp_evp_method_store:
   61|  6.88k|{
   62|  6.88k|    OSSL_TRACE1(QUERY, "Deallocating the tmp_store %p\n", store);
  ------------------
  |  |  291|  6.88k|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  283|  6.88k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   63|  6.88k|    if (store != NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 6.88k]
  ------------------
   64|      0|        ossl_method_store_free(store);
   65|  6.88k|}
evp_fetch.c:get_evp_method_store:
   68|  8.11k|{
   69|  8.11k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX);
  ------------------
  |  |   98|  8.11k|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
   70|  8.11k|}
evp_fetch.c:filter_on_operation_id:
  621|  16.5k|{
  622|  16.5k|    struct filter_data_st *data = arg;
  623|       |
  624|  16.5k|    if ((id & METHOD_ID_OPERATION_MASK) == data->operation_id)
  ------------------
  |  |  111|  16.5k|#define METHOD_ID_OPERATION_MASK        0x000000FF
  ------------------
  |  Branch (624:9): [True: 8.92k, False: 7.61k]
  ------------------
  625|  8.92k|        data->user_fn(method, data->user_arg);
  626|  16.5k|}

EVP_CIPHER_get_type:
  256|    183|{
  257|    183|    int nid;
  258|    183|    nid = EVP_CIPHER_get_nid(cipher);
  259|       |
  260|    183|    switch (nid) {
  261|       |
  262|      3|    case NID_rc2_cbc:
  ------------------
  |  | 1280|      3|#define NID_rc2_cbc             37
  ------------------
  |  Branch (262:5): [True: 3, False: 180]
  ------------------
  263|      5|    case NID_rc2_64_cbc:
  ------------------
  |  | 1301|      5|#define NID_rc2_64_cbc          166
  ------------------
  |  Branch (263:5): [True: 2, False: 181]
  ------------------
  264|      7|    case NID_rc2_40_cbc:
  ------------------
  |  | 1297|      7|#define NID_rc2_40_cbc          98
  ------------------
  |  Branch (264:5): [True: 2, False: 181]
  ------------------
  265|       |
  266|      7|        return NID_rc2_cbc;
  ------------------
  |  | 1280|      7|#define NID_rc2_cbc             37
  ------------------
  267|       |
  268|      1|    case NID_rc4:
  ------------------
  |  | 1305|      1|#define NID_rc4         5
  ------------------
  |  Branch (268:5): [True: 1, False: 182]
  ------------------
  269|      2|    case NID_rc4_40:
  ------------------
  |  | 1310|      2|#define NID_rc4_40              97
  ------------------
  |  Branch (269:5): [True: 1, False: 182]
  ------------------
  270|       |
  271|      2|        return NID_rc4;
  ------------------
  |  | 1305|      2|#define NID_rc4         5
  ------------------
  272|       |
  273|      1|    case NID_aes_128_cfb128:
  ------------------
  |  | 3089|      1|#define NID_aes_128_cfb128              421
  ------------------
  |  Branch (273:5): [True: 1, False: 182]
  ------------------
  274|      2|    case NID_aes_128_cfb8:
  ------------------
  |  | 3210|      2|#define NID_aes_128_cfb8                653
  ------------------
  |  Branch (274:5): [True: 1, False: 182]
  ------------------
  275|      3|    case NID_aes_128_cfb1:
  ------------------
  |  | 3198|      3|#define NID_aes_128_cfb1                650
  ------------------
  |  Branch (275:5): [True: 1, False: 182]
  ------------------
  276|       |
  277|      3|        return NID_aes_128_cfb128;
  ------------------
  |  | 3089|      3|#define NID_aes_128_cfb128              421
  ------------------
  278|       |
  279|      1|    case NID_aes_192_cfb128:
  ------------------
  |  | 3127|      1|#define NID_aes_192_cfb128              425
  ------------------
  |  Branch (279:5): [True: 1, False: 182]
  ------------------
  280|      2|    case NID_aes_192_cfb8:
  ------------------
  |  | 3214|      2|#define NID_aes_192_cfb8                654
  ------------------
  |  Branch (280:5): [True: 1, False: 182]
  ------------------
  281|      3|    case NID_aes_192_cfb1:
  ------------------
  |  | 3202|      3|#define NID_aes_192_cfb1                651
  ------------------
  |  Branch (281:5): [True: 1, False: 182]
  ------------------
  282|       |
  283|      3|        return NID_aes_192_cfb128;
  ------------------
  |  | 3127|      3|#define NID_aes_192_cfb128              425
  ------------------
  284|       |
  285|      1|    case NID_aes_256_cfb128:
  ------------------
  |  | 3165|      1|#define NID_aes_256_cfb128              429
  ------------------
  |  Branch (285:5): [True: 1, False: 182]
  ------------------
  286|      2|    case NID_aes_256_cfb8:
  ------------------
  |  | 3218|      2|#define NID_aes_256_cfb8                655
  ------------------
  |  Branch (286:5): [True: 1, False: 182]
  ------------------
  287|      3|    case NID_aes_256_cfb1:
  ------------------
  |  | 3206|      3|#define NID_aes_256_cfb1                652
  ------------------
  |  Branch (287:5): [True: 1, False: 182]
  ------------------
  288|       |
  289|      3|        return NID_aes_256_cfb128;
  ------------------
  |  | 3165|      3|#define NID_aes_256_cfb128              429
  ------------------
  290|       |
  291|      1|    case NID_des_cfb64:
  ------------------
  |  | 2259|      1|#define NID_des_cfb64           30
  ------------------
  |  Branch (291:5): [True: 1, False: 182]
  ------------------
  292|      2|    case NID_des_cfb8:
  ------------------
  |  | 3250|      2|#define NID_des_cfb8            657
  ------------------
  |  Branch (292:5): [True: 1, False: 182]
  ------------------
  293|      3|    case NID_des_cfb1:
  ------------------
  |  | 3246|      3|#define NID_des_cfb1            656
  ------------------
  |  Branch (293:5): [True: 1, False: 182]
  ------------------
  294|       |
  295|      3|        return NID_des_cfb64;
  ------------------
  |  | 2259|      3|#define NID_des_cfb64           30
  ------------------
  296|       |
  297|      1|    case NID_des_ede3_cfb64:
  ------------------
  |  | 2300|      1|#define NID_des_ede3_cfb64              61
  ------------------
  |  Branch (297:5): [True: 1, False: 182]
  ------------------
  298|      2|    case NID_des_ede3_cfb8:
  ------------------
  |  | 3258|      2|#define NID_des_ede3_cfb8               659
  ------------------
  |  Branch (298:5): [True: 1, False: 182]
  ------------------
  299|      3|    case NID_des_ede3_cfb1:
  ------------------
  |  | 3254|      3|#define NID_des_ede3_cfb1               658
  ------------------
  |  Branch (299:5): [True: 1, False: 182]
  ------------------
  300|       |
  301|      3|        return NID_des_cfb64;
  ------------------
  |  | 2259|      3|#define NID_des_cfb64           30
  ------------------
  302|       |
  303|    159|    default:
  ------------------
  |  Branch (303:5): [True: 159, False: 24]
  ------------------
  304|       |#ifdef FIPS_MODULE
  305|       |        return NID_undef;
  306|       |#else
  307|    159|        {
  308|       |            /* Check it has an OID and it is valid */
  309|    159|            ASN1_OBJECT *otmp = OBJ_nid2obj(nid);
  310|       |
  311|    159|            if (OBJ_get0_data(otmp) == NULL)
  ------------------
  |  Branch (311:17): [True: 48, False: 111]
  ------------------
  312|     48|                nid = NID_undef;
  ------------------
  |  |   18|     48|#define NID_undef                       0
  ------------------
  313|    159|            ASN1_OBJECT_free(otmp);
  314|    159|            return nid;
  315|      2|        }
  316|    183|#endif
  317|    183|    }
  318|    183|}
EVP_CIPHER_get_nid:
  676|    183|{
  677|    183|    return (cipher == NULL) ? NID_undef : cipher->nid;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (677:12): [True: 0, False: 183]
  ------------------
  678|    183|}
EVP_MD_is_a:
  742|  6.59k|{
  743|  6.59k|    if (md == NULL)
  ------------------
  |  Branch (743:9): [True: 0, False: 6.59k]
  ------------------
  744|      0|        return 0;
  745|  6.59k|    if (md->prov != NULL)
  ------------------
  |  Branch (745:9): [True: 0, False: 6.59k]
  ------------------
  746|      0|        return evp_is_a(md->prov, md->name_id, NULL, name);
  747|  6.59k|    return evp_is_a(NULL, 0, EVP_MD_get0_name(md), name);
  748|  6.59k|}
EVP_MD_get0_name:
  767|  13.1k|{
  768|  13.1k|    if (md == NULL)
  ------------------
  |  Branch (768:9): [True: 0, False: 13.1k]
  ------------------
  769|      0|        return NULL;
  770|  13.1k|    if (md->type_name != NULL)
  ------------------
  |  Branch (770:9): [True: 0, False: 13.1k]
  ------------------
  771|      0|        return md->type_name;
  772|  13.1k|#ifndef FIPS_MODULE
  773|  13.1k|    return OBJ_nid2sn(EVP_MD_nid(md));
  ------------------
  |  |  559|  13.1k|# define EVP_MD_nid EVP_MD_get_type
  ------------------
  774|       |#else
  775|       |    return NULL;
  776|       |#endif
  777|  13.1k|}
EVP_MD_get0_provider:
  790|  6.59k|{
  791|  6.59k|    return md->prov;
  792|  6.59k|}
EVP_MD_get_type:
  795|  19.8k|{
  796|  19.8k|    return md->type;
  797|  19.8k|}
EVP_MD_get_size:
  814|  6.59k|{
  815|  6.59k|    if (md == NULL) {
  ------------------
  |  Branch (815:9): [True: 0, False: 6.59k]
  ------------------
  816|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  817|      0|        return -1;
  818|      0|    }
  819|  6.59k|    return md->md_size;
  820|  6.59k|}
evp_md_free_int:
  866|     27|{
  867|     27|    OPENSSL_free(md->type_name);
  ------------------
  |  |  115|     27|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  868|     27|    ossl_provider_free(md->prov);
  869|     27|    CRYPTO_FREE_REF(&md->refcnt);
  870|     27|    OPENSSL_free(md);
  ------------------
  |  |  115|     27|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  871|     27|}
EVP_MD_CTX_get0_md:
 1023|  6.59k|{
 1024|  6.59k|    if (ctx == NULL)
  ------------------
  |  Branch (1024:9): [True: 0, False: 6.59k]
  ------------------
 1025|      0|        return NULL;
 1026|  6.59k|    return ctx->reqdigest;
 1027|  6.59k|}
EVP_MD_CTX_get_size_ex:
 1042|  6.59k|{
 1043|  6.59k|    EVP_MD_CTX *c = (EVP_MD_CTX *)ctx;
 1044|  6.59k|    const OSSL_PARAM *gettables;
 1045|       |
 1046|  6.59k|    gettables = EVP_MD_CTX_gettable_params(c);
 1047|  6.59k|    if (gettables != NULL
  ------------------
  |  Branch (1047:9): [True: 0, False: 6.59k]
  ------------------
 1048|  6.59k|            && OSSL_PARAM_locate_const(gettables,
  ------------------
  |  Branch (1048:16): [True: 0, False: 0]
  ------------------
 1049|      0|                                       OSSL_DIGEST_PARAM_SIZE) != NULL) {
  ------------------
  |  |  223|      0|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
 1050|      0|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
 1051|      0|        size_t sz = 0;
 1052|       |
 1053|       |        /*
 1054|       |         * For XOF's EVP_MD_get_size() returns 0
 1055|       |         * So try to get the xoflen instead. This will return -1 if the
 1056|       |         * xof length has not been set.
 1057|       |         */
 1058|      0|        params[0] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_SIZE, &sz);
  ------------------
  |  |  223|      0|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
 1059|      0|        if (EVP_MD_CTX_get_params(c, params) != 1
  ------------------
  |  Branch (1059:13): [True: 0, False: 0]
  ------------------
 1060|      0|                || sz == SIZE_MAX
  ------------------
  |  Branch (1060:20): [True: 0, False: 0]
  ------------------
 1061|      0|                || sz == 0)
  ------------------
  |  Branch (1061:20): [True: 0, False: 0]
  ------------------
 1062|      0|            return -1;
 1063|      0|        return sz;
 1064|      0|    }
 1065|       |    /* Normal digests have a constant fixed size output */
 1066|  6.59k|    return EVP_MD_get_size(EVP_MD_CTX_get0_md(ctx));
 1067|  6.59k|}
EVP_MD_CTX_set_flags:
 1114|  13.1k|{
 1115|  13.1k|    ctx->flags |= flags;
 1116|  13.1k|}
EVP_MD_CTX_clear_flags:
 1119|  6.59k|{
 1120|  6.59k|    ctx->flags &= ~flags;
 1121|  6.59k|}
EVP_MD_CTX_test_flags:
 1124|  6.59k|{
 1125|  6.59k|    return (ctx->flags & flags);
 1126|  6.59k|}
EVP_CIPHER_CTX_set_flags:
 1138|    762|{
 1139|    762|    int oldflags = ctx->flags;
 1140|       |
 1141|    762|    ctx->flags |= flags;
 1142|    762|    if (((oldflags ^ ctx->flags) & EVP_CIPH_FLAG_LENGTH_BITS) != 0)
  ------------------
  |  |  357|    762|# define         EVP_CIPH_FLAG_LENGTH_BITS       0x2000
  ------------------
  |  Branch (1142:9): [True: 0, False: 762]
  ------------------
 1143|      0|        evp_cipher_ctx_enable_use_bits(ctx, 1);
 1144|    762|}

EVP_PBE_cleanup:
  296|      2|{
  297|      2|    sk_EVP_PBE_CTL_pop_free(pbe_algs, free_evp_pbe_ctl);
  298|      2|    pbe_algs = NULL;
  299|      2|}

evp_pkcs82pkey_legacy:
   27|    127|{
   28|    127|    EVP_PKEY *pkey = NULL;
   29|    127|    const ASN1_OBJECT *algoid;
   30|    127|    char obj_tmp[80];
   31|       |
   32|    127|    if (!PKCS8_pkey_get0(&algoid, NULL, NULL, NULL, p8))
  ------------------
  |  Branch (32:9): [True: 0, False: 127]
  ------------------
   33|      0|        return NULL;
   34|       |
   35|    127|    if ((pkey = EVP_PKEY_new()) == NULL) {
  ------------------
  |  Branch (35:9): [True: 0, False: 127]
  ------------------
   36|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   37|      0|        return NULL;
   38|      0|    }
   39|       |
   40|    127|    if (!EVP_PKEY_set_type(pkey, OBJ_obj2nid(algoid))) {
  ------------------
  |  Branch (40:9): [True: 45, False: 82]
  ------------------
   41|     45|        i2t_ASN1_OBJECT(obj_tmp, 80, algoid);
   42|     45|        ERR_raise_data(ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM,
  ------------------
  |  |  403|     45|    (ERR_new(),                                                 \
  |  |  404|     45|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|     45|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|     45|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|     45|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|     45|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM,
  ------------------
  |  |   76|     45|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM,
  ------------------
  |  |  140|     45|# define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM          118
  ------------------
   43|     45|                       "TYPE=%s", obj_tmp);
   44|     45|        goto error;
   45|     45|    }
   46|       |
   47|     82|    if (pkey->ameth->priv_decode_ex != NULL) {
  ------------------
  |  Branch (47:9): [True: 48, False: 34]
  ------------------
   48|     48|        if (!pkey->ameth->priv_decode_ex(pkey, p8, libctx, propq))
  ------------------
  |  Branch (48:13): [True: 43, False: 5]
  ------------------
   49|     43|            goto error;
   50|     48|    } else if (pkey->ameth->priv_decode != NULL) {
  ------------------
  |  Branch (50:16): [True: 34, False: 0]
  ------------------
   51|     34|        if (!pkey->ameth->priv_decode(pkey, p8)) {
  ------------------
  |  Branch (51:13): [True: 29, False: 5]
  ------------------
   52|     29|            ERR_raise(ERR_LIB_EVP, EVP_R_PRIVATE_KEY_DECODE_ERROR);
  ------------------
  |  |  401|     29|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     29|    (ERR_new(),                                                 \
  |  |  |  |  404|     29|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     29|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     29|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     29|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     29|     ERR_set_error)
  |  |  ------------------
  ------------------
   53|     29|            goto error;
   54|     29|        }
   55|     34|    } else {
   56|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   57|      0|        goto error;
   58|      0|    }
   59|       |
   60|     10|    return pkey;
   61|       |
   62|    117| error:
   63|    117|    EVP_PKEY_free(pkey);
   64|    117|    return NULL;
   65|     82|}
EVP_PKEY2PKCS8:
  125|      4|{
  126|      4|    PKCS8_PRIV_KEY_INFO *p8 = NULL;
  127|      4|    OSSL_ENCODER_CTX *ctx = NULL;
  128|       |
  129|       |    /*
  130|       |     * The implementation for provider-native keys is to encode the
  131|       |     * key to a DER encoded PKCS#8 structure, then convert it to a
  132|       |     * PKCS8_PRIV_KEY_INFO with good old d2i functions.
  133|       |     */
  134|      4|    if (evp_pkey_is_provided(pkey)) {
  ------------------
  |  |  649|      4|    ((pk)->keymgmt != NULL)
  |  |  ------------------
  |  |  |  Branch (649:5): [True: 0, False: 4]
  |  |  ------------------
  ------------------
  135|      0|        int selection = OSSL_KEYMGMT_SELECT_ALL;
  ------------------
  |  |  652|      0|    ( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  ------------------
  |  |  |  |  650|      0|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  640|      0|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  |  |  ------------------
  |  |  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|      0|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  ------------------
  |  |  |  |  647|      0|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  642|      0|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  ------------------
  |  |  |  |  648|      0|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  643|      0|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  136|      0|        unsigned char *der = NULL;
  137|      0|        size_t derlen = 0;
  138|      0|        const unsigned char *pp;
  139|       |
  140|      0|        if ((ctx = OSSL_ENCODER_CTX_new_for_pkey(pkey, selection,
  ------------------
  |  Branch (140:13): [True: 0, False: 0]
  ------------------
  141|      0|                                                 "DER", "PrivateKeyInfo",
  142|      0|                                                 NULL)) == NULL
  143|      0|            || !OSSL_ENCODER_to_data(ctx, &der, &derlen))
  ------------------
  |  Branch (143:16): [True: 0, False: 0]
  ------------------
  144|      0|            goto error;
  145|       |
  146|      0|        pp = der;
  147|      0|        p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &pp, (long)derlen);
  148|      0|        OPENSSL_free(der);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  149|      0|        if (p8 == NULL)
  ------------------
  |  Branch (149:13): [True: 0, False: 0]
  ------------------
  150|      0|            goto error;
  151|      4|    } else {
  152|      4|        p8 = PKCS8_PRIV_KEY_INFO_new();
  153|      4|        if (p8  == NULL) {
  ------------------
  |  Branch (153:13): [True: 0, False: 4]
  ------------------
  154|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  155|      0|            return NULL;
  156|      0|        }
  157|       |
  158|      4|        if (pkey->ameth != NULL) {
  ------------------
  |  Branch (158:13): [True: 4, False: 0]
  ------------------
  159|      4|            if (pkey->ameth->priv_encode != NULL) {
  ------------------
  |  Branch (159:17): [True: 4, False: 0]
  ------------------
  160|      4|                if (!pkey->ameth->priv_encode(p8, pkey)) {
  ------------------
  |  Branch (160:21): [True: 0, False: 4]
  ------------------
  161|      0|                    ERR_raise(ERR_LIB_EVP, EVP_R_PRIVATE_KEY_ENCODE_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  162|      0|                    goto error;
  163|      0|                }
  164|      4|            } else {
  165|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  166|      0|                goto error;
  167|      0|            }
  168|      4|        } else {
  169|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  170|      0|            goto error;
  171|      0|        }
  172|      4|    }
  173|      4|    goto end;
  174|      4| error:
  175|      0|    PKCS8_PRIV_KEY_INFO_free(p8);
  176|      0|    p8 = NULL;
  177|      4| end:
  178|      4|    OSSL_ENCODER_CTX_free(ctx);
  179|      4|    return p8;
  180|       |
  181|      0|}

EVP_RAND_enable_locking:
   95|      1|{
   96|      1|    if (rand->meth->enable_locking != NULL)
  ------------------
  |  Branch (96:9): [True: 1, False: 0]
  ------------------
   97|      1|        return rand->meth->enable_locking(rand->algctx);
   98|      1|    ERR_raise(ERR_LIB_EVP, EVP_R_LOCKING_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   99|      0|    return 0;
  100|      1|}
EVP_RAND_fetch:
  287|      3|{
  288|      3|    return evp_generic_fetch(libctx, OSSL_OP_RAND, algorithm, properties,
  ------------------
  |  |  314|      3|# define OSSL_OP_RAND                                5
  ------------------
  289|      3|                             evp_rand_from_algorithm, evp_rand_up_ref,
  290|      3|                             evp_rand_free);
  291|      3|}
EVP_RAND_up_ref:
  294|      3|{
  295|      3|    return evp_rand_up_ref(rand);
  296|      3|}
EVP_RAND_free:
  299|      6|{
  300|      6|    evp_rand_free(rand);
  301|      6|}
EVP_RAND_get0_provider:
  324|      2|{
  325|      2|    return rand->prov;
  326|      2|}
EVP_RAND_CTX_up_ref:
  336|      2|{
  337|      2|    int ref = 0;
  338|       |
  339|      2|    return CRYPTO_UP_REF(&ctx->refcnt, &ref);
  340|      2|}
EVP_RAND_CTX_new:
  343|      3|{
  344|      3|    EVP_RAND_CTX *ctx;
  345|      3|    void *parent_ctx = NULL;
  346|      3|    const OSSL_DISPATCH *parent_dispatch = NULL;
  347|       |
  348|      3|    if (rand == NULL) {
  ------------------
  |  Branch (348:9): [True: 0, False: 3]
  ------------------
  349|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_NULL_ALGORITHM);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  350|      0|        return NULL;
  351|      0|    }
  352|       |
  353|      3|    ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|      3|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  354|      3|    if (ctx == NULL)
  ------------------
  |  Branch (354:9): [True: 0, False: 3]
  ------------------
  355|      0|        return NULL;
  356|      3|    if (!CRYPTO_NEW_REF(&ctx->refcnt, 1)) {
  ------------------
  |  Branch (356:9): [True: 0, False: 3]
  ------------------
  357|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  358|      0|        return NULL;
  359|      0|    }
  360|      3|    if (parent != NULL) {
  ------------------
  |  Branch (360:9): [True: 2, False: 1]
  ------------------
  361|      2|        if (!EVP_RAND_CTX_up_ref(parent)) {
  ------------------
  |  Branch (361:13): [True: 0, False: 2]
  ------------------
  362|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  363|      0|            CRYPTO_FREE_REF(&ctx->refcnt);
  364|      0|            OPENSSL_free(ctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  365|      0|            return NULL;
  366|      0|        }
  367|      2|        parent_ctx = parent->algctx;
  368|      2|        parent_dispatch = parent->meth->dispatch;
  369|      2|    }
  370|      3|    if ((ctx->algctx = rand->newctx(ossl_provider_ctx(rand->prov), parent_ctx,
  ------------------
  |  Branch (370:9): [True: 0, False: 3]
  ------------------
  371|      3|                                    parent_dispatch)) == NULL
  372|      3|            || !EVP_RAND_up_ref(rand)) {
  ------------------
  |  Branch (372:16): [True: 0, False: 3]
  ------------------
  373|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  374|      0|        rand->freectx(ctx->algctx);
  375|      0|        CRYPTO_FREE_REF(&ctx->refcnt);
  376|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  377|      0|        EVP_RAND_CTX_free(parent);
  378|      0|        return NULL;
  379|      0|    }
  380|      3|    ctx->meth = rand;
  381|      3|    ctx->parent = parent;
  382|      3|    return ctx;
  383|      3|}
EVP_RAND_CTX_free:
  386|      9|{
  387|      9|    int ref = 0;
  388|      9|    EVP_RAND_CTX *parent;
  389|       |
  390|      9|    if (ctx == NULL)
  ------------------
  |  Branch (390:9): [True: 4, False: 5]
  ------------------
  391|      4|        return;
  392|       |
  393|      5|    CRYPTO_DOWN_REF(&ctx->refcnt, &ref);
  394|      5|    if (ref > 0)
  ------------------
  |  Branch (394:9): [True: 2, False: 3]
  ------------------
  395|      2|        return;
  396|      3|    parent = ctx->parent;
  397|      3|    ctx->meth->freectx(ctx->algctx);
  398|      3|    ctx->algctx = NULL;
  399|      3|    EVP_RAND_free(ctx->meth);
  400|      3|    CRYPTO_FREE_REF(&ctx->refcnt);
  401|      3|    OPENSSL_free(ctx);
  ------------------
  |  |  115|      3|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  402|      3|    EVP_RAND_CTX_free(parent);
  403|      3|}
EVP_RAND_CTX_settable_params:
  484|      2|{
  485|      2|    void *provctx;
  486|       |
  487|      2|    if (ctx->meth->settable_ctx_params == NULL)
  ------------------
  |  Branch (487:9): [True: 2, False: 0]
  ------------------
  488|      2|        return NULL;
  489|      0|    provctx = ossl_provider_ctx(EVP_RAND_get0_provider(ctx->meth));
  490|      0|    return ctx->meth->settable_ctx_params(ctx->algctx, provctx);
  491|      2|}
EVP_RAND_instantiate:
  525|      3|{
  526|      3|    int res;
  527|       |
  528|      3|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (528:9): [True: 0, False: 3]
  ------------------
  529|      0|        return 0;
  530|      3|    res = evp_rand_instantiate_locked(ctx, strength, prediction_resistance,
  531|      3|                                      pstr, pstr_len, params);
  532|      3|    evp_rand_unlock(ctx);
  533|      3|    return res;
  534|      3|}
EVP_RAND_generate:
  587|  58.7k|{
  588|  58.7k|    int res;
  589|       |
  590|  58.7k|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (590:9): [True: 0, False: 58.7k]
  ------------------
  591|      0|        return 0;
  592|  58.7k|    res = evp_rand_generate_locked(ctx, out, outlen, strength,
  593|  58.7k|                                   prediction_resistance, addin, addin_len);
  594|  58.7k|    evp_rand_unlock(ctx);
  595|  58.7k|    return res;
  596|  58.7k|}
evp_rand.c:evp_rand_from_algorithm:
  120|      6|{
  121|      6|    const OSSL_DISPATCH *fns = algodef->implementation;
  122|      6|    EVP_RAND *rand = NULL;
  123|      6|    int fnrandcnt = 0, fnctxcnt = 0, fnlockcnt = 0, fnenablelockcnt = 0;
  124|       |#ifdef FIPS_MODULE
  125|       |    int fnzeroizecnt = 0;
  126|       |#endif
  127|       |
  128|      6|    if ((rand = evp_rand_new()) == NULL) {
  ------------------
  |  Branch (128:9): [True: 0, False: 6]
  ------------------
  129|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  130|      0|        return NULL;
  131|      0|    }
  132|      6|    rand->name_id = name_id;
  133|      6|    if ((rand->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 6]
  ------------------
  134|      0|        evp_rand_free(rand);
  135|      0|        return NULL;
  136|      0|    }
  137|      6|    rand->description = algodef->algorithm_description;
  138|      6|    rand->dispatch = fns;
  139|     92|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (139:12): [True: 86, False: 6]
  ------------------
  140|     86|        switch (fns->function_id) {
  ------------------
  |  Branch (140:17): [True: 0, False: 86]
  ------------------
  141|      6|        case OSSL_FUNC_RAND_NEWCTX:
  ------------------
  |  |  535|      6|# define OSSL_FUNC_RAND_NEWCTX                        1
  ------------------
  |  Branch (141:9): [True: 6, False: 80]
  ------------------
  142|      6|            if (rand->newctx != NULL)
  ------------------
  |  Branch (142:17): [True: 0, False: 6]
  ------------------
  143|      0|                break;
  144|      6|            rand->newctx = OSSL_FUNC_rand_newctx(fns);
  145|      6|            fnctxcnt++;
  146|      6|            break;
  147|      6|        case OSSL_FUNC_RAND_FREECTX:
  ------------------
  |  |  536|      6|# define OSSL_FUNC_RAND_FREECTX                       2
  ------------------
  |  Branch (147:9): [True: 6, False: 80]
  ------------------
  148|      6|            if (rand->freectx != NULL)
  ------------------
  |  Branch (148:17): [True: 0, False: 6]
  ------------------
  149|      0|                break;
  150|      6|            rand->freectx = OSSL_FUNC_rand_freectx(fns);
  151|      6|            fnctxcnt++;
  152|      6|            break;
  153|      6|        case OSSL_FUNC_RAND_INSTANTIATE:
  ------------------
  |  |  537|      6|# define OSSL_FUNC_RAND_INSTANTIATE                   3
  ------------------
  |  Branch (153:9): [True: 6, False: 80]
  ------------------
  154|      6|            if (rand->instantiate != NULL)
  ------------------
  |  Branch (154:17): [True: 0, False: 6]
  ------------------
  155|      0|                break;
  156|      6|            rand->instantiate = OSSL_FUNC_rand_instantiate(fns);
  157|      6|            fnrandcnt++;
  158|      6|            break;
  159|      6|        case OSSL_FUNC_RAND_UNINSTANTIATE:
  ------------------
  |  |  538|      6|# define OSSL_FUNC_RAND_UNINSTANTIATE                 4
  ------------------
  |  Branch (159:9): [True: 6, False: 80]
  ------------------
  160|      6|             if (rand->uninstantiate != NULL)
  ------------------
  |  Branch (160:18): [True: 0, False: 6]
  ------------------
  161|      0|                break;
  162|      6|            rand->uninstantiate = OSSL_FUNC_rand_uninstantiate(fns);
  163|      6|            fnrandcnt++;
  164|      6|            break;
  165|      6|        case OSSL_FUNC_RAND_GENERATE:
  ------------------
  |  |  539|      6|# define OSSL_FUNC_RAND_GENERATE                      5
  ------------------
  |  Branch (165:9): [True: 6, False: 80]
  ------------------
  166|      6|            if (rand->generate != NULL)
  ------------------
  |  Branch (166:17): [True: 0, False: 6]
  ------------------
  167|      0|                break;
  168|      6|            rand->generate = OSSL_FUNC_rand_generate(fns);
  169|      6|            fnrandcnt++;
  170|      6|            break;
  171|      5|        case OSSL_FUNC_RAND_RESEED:
  ------------------
  |  |  540|      5|# define OSSL_FUNC_RAND_RESEED                        6
  ------------------
  |  Branch (171:9): [True: 5, False: 81]
  ------------------
  172|      5|            if (rand->reseed != NULL)
  ------------------
  |  Branch (172:17): [True: 0, False: 5]
  ------------------
  173|      0|                break;
  174|      5|            rand->reseed = OSSL_FUNC_rand_reseed(fns);
  175|      5|            break;
  176|      1|        case OSSL_FUNC_RAND_NONCE:
  ------------------
  |  |  541|      1|# define OSSL_FUNC_RAND_NONCE                         7
  ------------------
  |  Branch (176:9): [True: 1, False: 85]
  ------------------
  177|      1|            if (rand->nonce != NULL)
  ------------------
  |  Branch (177:17): [True: 0, False: 1]
  ------------------
  178|      0|                break;
  179|      1|            rand->nonce = OSSL_FUNC_rand_nonce(fns);
  180|      1|            break;
  181|      6|        case OSSL_FUNC_RAND_ENABLE_LOCKING:
  ------------------
  |  |  542|      6|# define OSSL_FUNC_RAND_ENABLE_LOCKING                8
  ------------------
  |  Branch (181:9): [True: 6, False: 80]
  ------------------
  182|      6|            if (rand->enable_locking != NULL)
  ------------------
  |  Branch (182:17): [True: 0, False: 6]
  ------------------
  183|      0|                break;
  184|      6|            rand->enable_locking = OSSL_FUNC_rand_enable_locking(fns);
  185|      6|            fnenablelockcnt++;
  186|      6|            break;
  187|      5|        case OSSL_FUNC_RAND_LOCK:
  ------------------
  |  |  543|      5|# define OSSL_FUNC_RAND_LOCK                          9
  ------------------
  |  Branch (187:9): [True: 5, False: 81]
  ------------------
  188|      5|            if (rand->lock != NULL)
  ------------------
  |  Branch (188:17): [True: 0, False: 5]
  ------------------
  189|      0|                break;
  190|      5|            rand->lock = OSSL_FUNC_rand_lock(fns);
  191|      5|            fnlockcnt++;
  192|      5|            break;
  193|      5|        case OSSL_FUNC_RAND_UNLOCK:
  ------------------
  |  |  544|      5|# define OSSL_FUNC_RAND_UNLOCK                       10
  ------------------
  |  Branch (193:9): [True: 5, False: 81]
  ------------------
  194|      5|            if (rand->unlock != NULL)
  ------------------
  |  Branch (194:17): [True: 0, False: 5]
  ------------------
  195|      0|                break;
  196|      5|            rand->unlock = OSSL_FUNC_rand_unlock(fns);
  197|      5|            fnlockcnt++;
  198|      5|            break;
  199|      0|        case OSSL_FUNC_RAND_GETTABLE_PARAMS:
  ------------------
  |  |  545|      0|# define OSSL_FUNC_RAND_GETTABLE_PARAMS              11
  ------------------
  |  Branch (199:9): [True: 0, False: 86]
  ------------------
  200|      0|            if (rand->gettable_params != NULL)
  ------------------
  |  Branch (200:17): [True: 0, False: 0]
  ------------------
  201|      0|                break;
  202|      0|            rand->gettable_params =
  203|      0|                OSSL_FUNC_rand_gettable_params(fns);
  204|      0|            break;
  205|      6|        case OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  546|      6|# define OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS          12
  ------------------
  |  Branch (205:9): [True: 6, False: 80]
  ------------------
  206|      6|            if (rand->gettable_ctx_params != NULL)
  ------------------
  |  Branch (206:17): [True: 0, False: 6]
  ------------------
  207|      0|                break;
  208|      6|            rand->gettable_ctx_params =
  209|      6|                OSSL_FUNC_rand_gettable_ctx_params(fns);
  210|      6|            break;
  211|      4|        case OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  547|      4|# define OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS          13
  ------------------
  |  Branch (211:9): [True: 4, False: 82]
  ------------------
  212|      4|            if (rand->settable_ctx_params != NULL)
  ------------------
  |  Branch (212:17): [True: 0, False: 4]
  ------------------
  213|      0|                break;
  214|      4|            rand->settable_ctx_params =
  215|      4|                OSSL_FUNC_rand_settable_ctx_params(fns);
  216|      4|            break;
  217|      0|        case OSSL_FUNC_RAND_GET_PARAMS:
  ------------------
  |  |  548|      0|# define OSSL_FUNC_RAND_GET_PARAMS                   14
  ------------------
  |  Branch (217:9): [True: 0, False: 86]
  ------------------
  218|      0|            if (rand->get_params != NULL)
  ------------------
  |  Branch (218:17): [True: 0, False: 0]
  ------------------
  219|      0|                break;
  220|      0|            rand->get_params = OSSL_FUNC_rand_get_params(fns);
  221|      0|            break;
  222|      6|        case OSSL_FUNC_RAND_GET_CTX_PARAMS:
  ------------------
  |  |  549|      6|# define OSSL_FUNC_RAND_GET_CTX_PARAMS               15
  ------------------
  |  Branch (222:9): [True: 6, False: 80]
  ------------------
  223|      6|            if (rand->get_ctx_params != NULL)
  ------------------
  |  Branch (223:17): [True: 0, False: 6]
  ------------------
  224|      0|                break;
  225|      6|            rand->get_ctx_params = OSSL_FUNC_rand_get_ctx_params(fns);
  226|      6|            fnctxcnt++;
  227|      6|            break;
  228|      4|        case OSSL_FUNC_RAND_SET_CTX_PARAMS:
  ------------------
  |  |  550|      4|# define OSSL_FUNC_RAND_SET_CTX_PARAMS               16
  ------------------
  |  Branch (228:9): [True: 4, False: 82]
  ------------------
  229|      4|            if (rand->set_ctx_params != NULL)
  ------------------
  |  Branch (229:17): [True: 0, False: 4]
  ------------------
  230|      0|                break;
  231|      4|            rand->set_ctx_params = OSSL_FUNC_rand_set_ctx_params(fns);
  232|      4|            break;
  233|      5|        case OSSL_FUNC_RAND_VERIFY_ZEROIZATION:
  ------------------
  |  |  551|      5|# define OSSL_FUNC_RAND_VERIFY_ZEROIZATION           17
  ------------------
  |  Branch (233:9): [True: 5, False: 81]
  ------------------
  234|      5|            if (rand->verify_zeroization != NULL)
  ------------------
  |  Branch (234:17): [True: 0, False: 5]
  ------------------
  235|      0|                break;
  236|      5|            rand->verify_zeroization = OSSL_FUNC_rand_verify_zeroization(fns);
  237|       |#ifdef FIPS_MODULE
  238|       |            fnzeroizecnt++;
  239|       |#endif
  240|      5|            break;
  241|      5|        case OSSL_FUNC_RAND_GET_SEED:
  ------------------
  |  |  552|      5|# define OSSL_FUNC_RAND_GET_SEED                     18
  ------------------
  |  Branch (241:9): [True: 5, False: 81]
  ------------------
  242|      5|            if (rand->get_seed != NULL)
  ------------------
  |  Branch (242:17): [True: 0, False: 5]
  ------------------
  243|      0|                break;
  244|      5|            rand->get_seed = OSSL_FUNC_rand_get_seed(fns);
  245|      5|            break;
  246|      4|        case OSSL_FUNC_RAND_CLEAR_SEED:
  ------------------
  |  |  553|      4|# define OSSL_FUNC_RAND_CLEAR_SEED                   19
  ------------------
  |  Branch (246:9): [True: 4, False: 82]
  ------------------
  247|      4|            if (rand->clear_seed != NULL)
  ------------------
  |  Branch (247:17): [True: 0, False: 4]
  ------------------
  248|      0|                break;
  249|      4|            rand->clear_seed = OSSL_FUNC_rand_clear_seed(fns);
  250|      4|            break;
  251|     86|        }
  252|     86|    }
  253|       |    /*
  254|       |     * In order to be a consistent set of functions we must have at least
  255|       |     * a complete set of "rand" functions and a complete set of context
  256|       |     * management functions.  In FIPS mode, we also require the zeroization
  257|       |     * verification function.
  258|       |     *
  259|       |     * In addition, if locking can be enabled, we need a complete set of
  260|       |     * locking functions.
  261|       |     */
  262|      6|    if (fnrandcnt != 3
  ------------------
  |  Branch (262:9): [True: 0, False: 6]
  ------------------
  263|      6|            || fnctxcnt != 3
  ------------------
  |  Branch (263:16): [True: 0, False: 6]
  ------------------
  264|      6|            || (fnenablelockcnt != 0 && fnenablelockcnt != 1)
  ------------------
  |  Branch (264:17): [True: 6, False: 0]
  |  Branch (264:41): [True: 0, False: 6]
  ------------------
  265|      6|            || (fnlockcnt != 0 && fnlockcnt != 2)
  ------------------
  |  Branch (265:17): [True: 5, False: 1]
  |  Branch (265:35): [True: 0, False: 5]
  ------------------
  266|       |#ifdef FIPS_MODULE
  267|       |            || fnzeroizecnt != 1
  268|       |#endif
  269|      6|       ) {
  270|      0|        evp_rand_free(rand);
  271|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        return NULL;
  273|      0|    }
  274|       |
  275|      6|    if (prov != NULL && !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (275:9): [True: 6, False: 0]
  |  Branch (275:25): [True: 0, False: 6]
  ------------------
  276|      0|        evp_rand_free(rand);
  277|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  278|      0|        return NULL;
  279|      0|    }
  280|      6|    rand->prov = prov;
  281|       |
  282|      6|    return rand;
  283|      6|}
evp_rand.c:evp_rand_new:
   80|      6|{
   81|      6|    EVP_RAND *rand = OPENSSL_zalloc(sizeof(*rand));
  ------------------
  |  |  104|      6|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   82|       |
   83|      6|    if (rand == NULL)
  ------------------
  |  Branch (83:9): [True: 0, False: 6]
  ------------------
   84|      0|        return NULL;
   85|       |
   86|      6|    if (!CRYPTO_NEW_REF(&rand->refcnt, 1)) {
  ------------------
  |  Branch (86:9): [True: 0, False: 6]
  ------------------
   87|      0|        OPENSSL_free(rand);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   88|      0|        return NULL;
   89|      0|    }
   90|      6|    return rand;
   91|      6|}
evp_rand.c:evp_rand_up_ref:
   54|     14|{
   55|     14|    EVP_RAND *rand = (EVP_RAND *)vrand;
   56|     14|    int ref = 0;
   57|       |
   58|     14|    if (rand != NULL)
  ------------------
  |  Branch (58:9): [True: 14, False: 0]
  ------------------
   59|     14|        return CRYPTO_UP_REF(&rand->refcnt, &ref);
   60|      0|    return 1;
   61|     14|}
evp_rand.c:evp_rand_free:
   64|     20|{
   65|     20|    EVP_RAND *rand = (EVP_RAND *)vrand;
   66|     20|    int ref = 0;
   67|       |
   68|     20|    if (rand == NULL)
  ------------------
  |  Branch (68:9): [True: 0, False: 20]
  ------------------
   69|      0|        return;
   70|     20|    CRYPTO_DOWN_REF(&rand->refcnt, &ref);
   71|     20|    if (ref > 0)
  ------------------
  |  Branch (71:9): [True: 14, False: 6]
  ------------------
   72|     14|        return;
   73|      6|    OPENSSL_free(rand->type_name);
  ------------------
  |  |  115|      6|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   74|      6|    ossl_provider_free(rand->prov);
   75|      6|    CRYPTO_FREE_REF(&rand->refcnt);
   76|      6|    OPENSSL_free(rand);
  ------------------
  |  |  115|      6|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|      6|}
evp_rand.c:evp_rand_lock:
  104|  58.7k|{
  105|  58.7k|    if (rand->meth->lock != NULL)
  ------------------
  |  Branch (105:9): [True: 1, False: 58.7k]
  ------------------
  106|      1|        return rand->meth->lock(rand->algctx);
  107|  58.7k|    return 1;
  108|  58.7k|}
evp_rand.c:evp_rand_get_ctx_params_locked:
  412|  58.7k|{
  413|  58.7k|    return ctx->meth->get_ctx_params(ctx->algctx, params);
  414|  58.7k|}
evp_rand.c:evp_rand_unlock:
  112|  58.7k|{
  113|  58.7k|    if (rand->meth->unlock != NULL)
  ------------------
  |  Branch (113:9): [True: 1, False: 58.7k]
  ------------------
  114|      1|        rand->meth->unlock(rand->algctx);
  115|  58.7k|}
evp_rand.c:evp_rand_instantiate_locked:
  516|      3|{
  517|      3|    return ctx->meth->instantiate(ctx->algctx, strength, prediction_resistance,
  518|      3|                                  pstr, pstr_len, params);
  519|      3|}
evp_rand.c:evp_rand_generate_locked:
  557|  58.7k|{
  558|  58.7k|    size_t chunk, max_request = 0;
  559|  58.7k|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  58.7k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  58.7k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  560|       |
  561|  58.7k|    params[0] = OSSL_PARAM_construct_size_t(OSSL_RAND_PARAM_MAX_REQUEST,
  ------------------
  |  |  532|  58.7k|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
  562|  58.7k|                                            &max_request);
  563|  58.7k|    if (!evp_rand_get_ctx_params_locked(ctx, params)
  ------------------
  |  Branch (563:9): [True: 0, False: 58.7k]
  ------------------
  564|  58.7k|            || max_request == 0) {
  ------------------
  |  Branch (564:16): [True: 0, False: 58.7k]
  ------------------
  565|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  566|      0|        return 0;
  567|      0|    }
  568|   117k|    for (; outlen > 0; outlen -= chunk, out += chunk) {
  ------------------
  |  Branch (568:12): [True: 58.7k, False: 58.7k]
  ------------------
  569|  58.7k|        chunk = outlen > max_request ? max_request : outlen;
  ------------------
  |  Branch (569:17): [True: 0, False: 58.7k]
  ------------------
  570|  58.7k|        if (!ctx->meth->generate(ctx->algctx, out, chunk, strength,
  ------------------
  |  Branch (570:13): [True: 0, False: 58.7k]
  ------------------
  571|  58.7k|                                 prediction_resistance, addin, addin_len)) {
  572|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_GENERATE_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  573|      0|            return 0;
  574|      0|        }
  575|       |        /*
  576|       |         * Prediction resistance is only relevant the first time around,
  577|       |         * subsequently, the DRBG has already been properly reseeded.
  578|       |         */
  579|  58.7k|        prediction_resistance = 0;
  580|  58.7k|    }
  581|  58.7k|    return 1;
  582|  58.7k|}

evp_do_md_getparams:
   38|     27|int name (const type *obj, OSSL_PARAM params[])                                \
   39|     27|{                                                                              \
   40|     54|    PARAM_CHECK(obj, func, err)                                                \
  ------------------
  |  |   28|     27|    if (obj == NULL)                                                           \
  |  |  ------------------
  |  |  |  Branch (28:9): [True: 0, False: 27]
  |  |  ------------------
  |  |   29|     27|        return 0;                                                              \
  |  |   30|     27|    if (obj->prov == NULL)                                                     \
  |  |  ------------------
  |  |  |  Branch (30:9): [True: 0, False: 27]
  |  |  ------------------
  |  |   31|     27|        return EVP_CTRL_RET_UNSUPPORTED;                                       \
  |  |  ------------------
  |  |  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  |  |  ------------------
  |  |   32|     27|    if (obj->func == NULL) {                                                   \
  |  |  ------------------
  |  |  |  Branch (32:9): [True: 0, False: 27]
  |  |  ------------------
  |  |   33|      0|        errfunc();                                                             \
  |  |   34|      0|        return 0;                                                              \
  |  |   35|      0|    }
  ------------------
   41|     54|    return obj->func(params);                                                  \
   42|     54|}

evp_keymgmt_util_assign_pkey:
   62|  8.30k|{
   63|  8.30k|    if (pkey == NULL || keymgmt == NULL || keydata == NULL
  ------------------
  |  Branch (63:9): [True: 0, False: 8.30k]
  |  Branch (63:25): [True: 0, False: 8.30k]
  |  Branch (63:44): [True: 0, False: 8.30k]
  ------------------
   64|  8.30k|        || !EVP_PKEY_set_type_by_keymgmt(pkey, keymgmt)) {
  ------------------
  |  Branch (64:12): [True: 0, False: 8.30k]
  ------------------
   65|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   66|      0|        return 0;
   67|      0|    }
   68|  8.30k|    pkey->keydata = keydata;
   69|  8.30k|    evp_keymgmt_util_cache_keyinfo(pkey);
   70|  8.30k|    return 1;
   71|  8.30k|}
evp_keymgmt_util_make_pkey:
   74|  8.30k|{
   75|  8.30k|    EVP_PKEY *pkey = NULL;
   76|       |
   77|  8.30k|    if (keymgmt == NULL
  ------------------
  |  Branch (77:9): [True: 0, False: 8.30k]
  ------------------
   78|  8.30k|        || keydata == NULL
  ------------------
  |  Branch (78:12): [True: 0, False: 8.30k]
  ------------------
   79|  8.30k|        || (pkey = EVP_PKEY_new()) == NULL
  ------------------
  |  Branch (79:12): [True: 0, False: 8.30k]
  ------------------
   80|  8.30k|        || !evp_keymgmt_util_assign_pkey(pkey, keymgmt, keydata)) {
  ------------------
  |  Branch (80:12): [True: 0, False: 8.30k]
  ------------------
   81|      0|        EVP_PKEY_free(pkey);
   82|      0|        return NULL;
   83|      0|    }
   84|  8.30k|    return pkey;
   85|  8.30k|}
evp_keymgmt_util_clear_operation_cache:
  223|  43.1k|{
  224|  43.1k|    if (pk != NULL) {
  ------------------
  |  Branch (224:9): [True: 43.1k, False: 0]
  ------------------
  225|  43.1k|        sk_OP_CACHE_ELEM_pop_free(pk->operation_cache, op_cache_free);
  226|  43.1k|        pk->operation_cache = NULL;
  227|  43.1k|    }
  228|       |
  229|  43.1k|    return 1;
  230|  43.1k|}
evp_keymgmt_util_cache_keyinfo:
  290|  8.30k|{
  291|       |    /*
  292|       |     * Cache information about the provider "origin" key.
  293|       |     *
  294|       |     * This services functions like EVP_PKEY_get_size, EVP_PKEY_get_bits, etc
  295|       |     */
  296|  8.30k|    if (pk->keydata != NULL) {
  ------------------
  |  Branch (296:9): [True: 8.30k, False: 0]
  ------------------
  297|  8.30k|        int bits = 0;
  298|  8.30k|        int security_bits = 0;
  299|  8.30k|        int security_category = -1;
  300|  8.30k|        int size = 0;
  301|  8.30k|        OSSL_PARAM params[5];
  302|       |
  303|  8.30k|        params[0] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_BITS, &bits);
  ------------------
  |  |  360|  8.30k|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  304|  8.30k|        params[1] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_SECURITY_BITS,
  ------------------
  |  |  487|  8.30k|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  305|  8.30k|                                             &security_bits);
  306|  8.30k|        params[2] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_SECURITY_CATEGORY,
  ------------------
  |  |  488|  8.30k|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  127|  8.30k|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  307|  8.30k|                                             &security_category);
  308|  8.30k|        params[3] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_MAX_SIZE, &size);
  ------------------
  |  |  416|  8.30k|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  309|  8.30k|        params[4] = OSSL_PARAM_construct_end();
  310|  8.30k|        if (evp_keymgmt_get_params(pk->keymgmt, pk->keydata, params)) {
  ------------------
  |  Branch (310:13): [True: 8.30k, False: 0]
  ------------------
  311|  8.30k|            pk->cache.size = size;
  312|  8.30k|            pk->cache.bits = bits;
  313|  8.30k|            pk->cache.security_bits = security_bits;
  314|  8.30k|            pk->cache.security_category = security_category;
  315|  8.30k|        }
  316|  8.30k|    }
  317|  8.30k|}
evp_keymgmt_util_has:
  334|  1.40k|{
  335|       |    /* Check if key is even assigned */
  336|  1.40k|    if (pk->keymgmt == NULL)
  ------------------
  |  Branch (336:9): [True: 0, False: 1.40k]
  ------------------
  337|      0|        return 0;
  338|       |
  339|  1.40k|    return evp_keymgmt_has(pk->keymgmt, pk->keydata, selection);
  340|  1.40k|}

EVP_KEYMGMT_up_ref:
  295|   550k|{
  296|   550k|    int ref = 0;
  297|       |
  298|   550k|    CRYPTO_UP_REF(&keymgmt->refcnt, &ref);
  299|   550k|    return 1;
  300|   550k|}
EVP_KEYMGMT_free:
  303|   550k|{
  304|   550k|    int ref = 0;
  305|       |
  306|   550k|    if (keymgmt == NULL)
  ------------------
  |  Branch (306:9): [True: 0, False: 550k]
  ------------------
  307|      0|        return;
  308|       |
  309|   550k|    CRYPTO_DOWN_REF(&keymgmt->refcnt, &ref);
  310|   550k|    if (ref > 0)
  ------------------
  |  Branch (310:9): [True: 550k, False: 40]
  ------------------
  311|   550k|        return;
  312|     40|    OPENSSL_free(keymgmt->type_name);
  ------------------
  |  |  115|     40|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     40|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  313|     40|    ossl_provider_free(keymgmt->prov);
  314|     40|    CRYPTO_FREE_REF(&keymgmt->refcnt);
  315|     40|    OPENSSL_free(keymgmt);
  ------------------
  |  |  115|     40|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     40|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  316|     40|}
EVP_KEYMGMT_get0_provider:
  319|  19.6k|{
  320|  19.6k|    return keymgmt->prov;
  321|  19.6k|}
EVP_KEYMGMT_is_a:
  344|  10.5k|{
  345|  10.5k|    return keymgmt != NULL
  ------------------
  |  Branch (345:12): [True: 10.5k, False: 0]
  ------------------
  346|  10.5k|           && evp_is_a(keymgmt->prov, keymgmt->name_id, NULL, name);
  ------------------
  |  Branch (346:15): [True: 8.30k, False: 2.24k]
  ------------------
  347|  10.5k|}
EVP_KEYMGMT_do_all_provided:
  352|    223|{
  353|    223|    evp_generic_do_all(libctx, OSSL_OP_KEYMGMT,
  ------------------
  |  |  315|    223|# define OSSL_OP_KEYMGMT                            10
  ------------------
  354|    223|                       (void (*)(void *, void *))fn, arg,
  355|    223|                       keymgmt_from_algorithm,
  356|    223|                       evp_keymgmt_up_ref,
  357|    223|                       evp_keymgmt_free);
  358|    223|}
EVP_KEYMGMT_names_do_all:
  363|  11.3k|{
  364|  11.3k|    if (keymgmt->prov != NULL)
  ------------------
  |  Branch (364:9): [True: 11.3k, False: 0]
  ------------------
  365|  11.3k|        return evp_names_do_all(keymgmt->prov, keymgmt->name_id, fn, data);
  366|       |
  367|      0|    return 1;
  368|  11.3k|}
evp_keymgmt_freedata:
  388|  8.30k|{
  389|       |    /* This is mandatory, no need to check for its presence */
  390|  8.30k|    keymgmt->free(keydata);
  391|  8.30k|}
evp_keymgmt_has_load:
  477|  18.8k|{
  478|  18.8k|    return keymgmt != NULL && keymgmt->load != NULL;
  ------------------
  |  Branch (478:12): [True: 18.8k, False: 0]
  |  Branch (478:31): [True: 18.8k, False: 0]
  ------------------
  479|  18.8k|}
evp_keymgmt_load:
  483|  8.30k|{
  484|  8.30k|    if (evp_keymgmt_has_load(keymgmt))
  ------------------
  |  Branch (484:9): [True: 8.30k, False: 0]
  ------------------
  485|  8.30k|        return keymgmt->load(objref, objref_sz);
  486|      0|    return NULL;
  487|  8.30k|}
evp_keymgmt_get_params:
  491|  8.30k|{
  492|  8.30k|    if (keymgmt->get_params == NULL)
  ------------------
  |  Branch (492:9): [True: 0, False: 8.30k]
  ------------------
  493|      0|        return 1;
  494|  8.30k|    return keymgmt->get_params(keydata, params);
  495|  8.30k|}
evp_keymgmt_has:
  524|  1.40k|{
  525|       |    /* This is mandatory, no need to check for its presence */
  526|  1.40k|    return keymgmt->has(keydata, selection);
  527|  1.40k|}
keymgmt_meth.c:keymgmt_from_algorithm:
   66|     40|{
   67|     40|    const OSSL_DISPATCH *fns = algodef->implementation;
   68|     40|    EVP_KEYMGMT *keymgmt = NULL;
   69|     40|    int setparamfncnt = 0, getparamfncnt = 0;
   70|     40|    int setgenparamfncnt = 0;
   71|     40|    int importfncnt = 0, exportfncnt = 0;
   72|     40|    int importtypesfncnt = 0, exporttypesfncnt = 0;
   73|     40|    int getgenparamfncnt = 0;
   74|       |
   75|     40|    if ((keymgmt = keymgmt_new()) == NULL)
  ------------------
  |  Branch (75:9): [True: 0, False: 40]
  ------------------
   76|      0|        return NULL;
   77|       |
   78|     40|    keymgmt->name_id = name_id;
   79|     40|    if ((keymgmt->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (79:9): [True: 0, False: 40]
  ------------------
   80|      0|        EVP_KEYMGMT_free(keymgmt);
   81|      0|        return NULL;
   82|      0|    }
   83|     40|    keymgmt->description = algodef->algorithm_description;
   84|       |
   85|    746|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (85:12): [True: 706, False: 40]
  ------------------
   86|    706|        switch (fns->function_id) {
  ------------------
  |  Branch (86:17): [True: 0, False: 706]
  ------------------
   87|     40|        case OSSL_FUNC_KEYMGMT_NEW:
  ------------------
  |  |  658|     40|# define OSSL_FUNC_KEYMGMT_NEW                         1
  ------------------
  |  Branch (87:9): [True: 40, False: 666]
  ------------------
   88|     40|            if (keymgmt->new == NULL)
  ------------------
  |  Branch (88:17): [True: 40, False: 0]
  ------------------
   89|     40|                keymgmt->new = OSSL_FUNC_keymgmt_new(fns);
   90|     40|            break;
   91|     37|        case OSSL_FUNC_KEYMGMT_GEN_INIT:
  ------------------
  |  |  662|     37|# define OSSL_FUNC_KEYMGMT_GEN_INIT                    2
  ------------------
  |  Branch (91:9): [True: 37, False: 669]
  ------------------
   92|     37|            if (keymgmt->gen_init == NULL)
  ------------------
  |  Branch (92:17): [True: 37, False: 0]
  ------------------
   93|     37|                keymgmt->gen_init = OSSL_FUNC_keymgmt_gen_init(fns);
   94|     37|            break;
   95|      5|        case OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE:
  ------------------
  |  |  663|      5|# define OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE            3
  ------------------
  |  Branch (95:9): [True: 5, False: 701]
  ------------------
   96|      5|            if (keymgmt->gen_set_template == NULL)
  ------------------
  |  Branch (96:17): [True: 5, False: 0]
  ------------------
   97|      5|                keymgmt->gen_set_template =
   98|      5|                    OSSL_FUNC_keymgmt_gen_set_template(fns);
   99|      5|            break;
  100|     37|        case OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS:
  ------------------
  |  |  664|     37|# define OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS              4
  ------------------
  |  Branch (100:9): [True: 37, False: 669]
  ------------------
  101|     37|            if (keymgmt->gen_set_params == NULL) {
  ------------------
  |  Branch (101:17): [True: 37, False: 0]
  ------------------
  102|     37|                setgenparamfncnt++;
  103|     37|                keymgmt->gen_set_params =
  104|     37|                    OSSL_FUNC_keymgmt_gen_set_params(fns);
  105|     37|            }
  106|     37|            break;
  107|     37|        case OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS:
  ------------------
  |  |  665|     37|# define OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS         5
  ------------------
  |  Branch (107:9): [True: 37, False: 669]
  ------------------
  108|     37|            if (keymgmt->gen_settable_params == NULL) {
  ------------------
  |  Branch (108:17): [True: 37, False: 0]
  ------------------
  109|     37|                setgenparamfncnt++;
  110|     37|                keymgmt->gen_settable_params =
  111|     37|                    OSSL_FUNC_keymgmt_gen_settable_params(fns);
  112|     37|            }
  113|     37|            break;
  114|      2|        case OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS:
  ------------------
  |  |  668|      2|# define OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS              15
  ------------------
  |  Branch (114:9): [True: 2, False: 704]
  ------------------
  115|      2|            if (keymgmt->gen_get_params == NULL) {
  ------------------
  |  Branch (115:17): [True: 2, False: 0]
  ------------------
  116|      2|                getgenparamfncnt++;
  117|      2|                keymgmt->gen_get_params =
  118|      2|                    OSSL_FUNC_keymgmt_gen_get_params(fns);
  119|      2|            }
  120|      2|            break;
  121|      2|        case OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS:
  ------------------
  |  |  669|      2|# define OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS         16
  ------------------
  |  Branch (121:9): [True: 2, False: 704]
  ------------------
  122|      2|            if (keymgmt->gen_gettable_params == NULL) {
  ------------------
  |  Branch (122:17): [True: 2, False: 0]
  ------------------
  123|      2|                getgenparamfncnt++;
  124|      2|                keymgmt->gen_gettable_params =
  125|      2|                    OSSL_FUNC_keymgmt_gen_gettable_params(fns);
  126|      2|            }
  127|      2|            break;
  128|     37|        case OSSL_FUNC_KEYMGMT_GEN:
  ------------------
  |  |  666|     37|# define OSSL_FUNC_KEYMGMT_GEN                         6
  ------------------
  |  Branch (128:9): [True: 37, False: 669]
  ------------------
  129|     37|            if (keymgmt->gen == NULL)
  ------------------
  |  Branch (129:17): [True: 37, False: 0]
  ------------------
  130|     37|                keymgmt->gen = OSSL_FUNC_keymgmt_gen(fns);
  131|     37|            break;
  132|     37|        case OSSL_FUNC_KEYMGMT_GEN_CLEANUP:
  ------------------
  |  |  667|     37|# define OSSL_FUNC_KEYMGMT_GEN_CLEANUP                 7
  ------------------
  |  Branch (132:9): [True: 37, False: 669]
  ------------------
  133|     37|            if (keymgmt->gen_cleanup == NULL)
  ------------------
  |  Branch (133:17): [True: 37, False: 0]
  ------------------
  134|     37|                keymgmt->gen_cleanup = OSSL_FUNC_keymgmt_gen_cleanup(fns);
  135|     37|            break;
  136|     40|        case OSSL_FUNC_KEYMGMT_FREE:
  ------------------
  |  |  694|     40|# define OSSL_FUNC_KEYMGMT_FREE                       10
  ------------------
  |  Branch (136:9): [True: 40, False: 666]
  ------------------
  137|     40|            if (keymgmt->free == NULL)
  ------------------
  |  Branch (137:17): [True: 40, False: 0]
  ------------------
  138|     40|                keymgmt->free = OSSL_FUNC_keymgmt_free(fns);
  139|     40|            break;
  140|     29|        case OSSL_FUNC_KEYMGMT_LOAD:
  ------------------
  |  |  689|     29|# define OSSL_FUNC_KEYMGMT_LOAD                        8
  ------------------
  |  Branch (140:9): [True: 29, False: 677]
  ------------------
  141|     29|            if (keymgmt->load == NULL)
  ------------------
  |  Branch (141:17): [True: 29, False: 0]
  ------------------
  142|     29|                keymgmt->load = OSSL_FUNC_keymgmt_load(fns);
  143|     29|            break;
  144|     37|        case OSSL_FUNC_KEYMGMT_GET_PARAMS:
  ------------------
  |  |  698|     37|#define OSSL_FUNC_KEYMGMT_GET_PARAMS                  11
  ------------------
  |  Branch (144:9): [True: 37, False: 669]
  ------------------
  145|     37|            if (keymgmt->get_params == NULL) {
  ------------------
  |  Branch (145:17): [True: 37, False: 0]
  ------------------
  146|     37|                getparamfncnt++;
  147|     37|                keymgmt->get_params = OSSL_FUNC_keymgmt_get_params(fns);
  148|     37|            }
  149|     37|            break;
  150|     37|        case OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS:
  ------------------
  |  |  699|     37|#define OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS             12
  ------------------
  |  Branch (150:9): [True: 37, False: 669]
  ------------------
  151|     37|            if (keymgmt->gettable_params == NULL) {
  ------------------
  |  Branch (151:17): [True: 37, False: 0]
  ------------------
  152|     37|                getparamfncnt++;
  153|     37|                keymgmt->gettable_params =
  154|     37|                    OSSL_FUNC_keymgmt_gettable_params(fns);
  155|     37|            }
  156|     37|            break;
  157|     19|         case OSSL_FUNC_KEYMGMT_SET_PARAMS:
  ------------------
  |  |  705|     19|#define OSSL_FUNC_KEYMGMT_SET_PARAMS                  13
  ------------------
  |  Branch (157:10): [True: 19, False: 687]
  ------------------
  158|     19|            if (keymgmt->set_params == NULL) {
  ------------------
  |  Branch (158:17): [True: 19, False: 0]
  ------------------
  159|     19|                setparamfncnt++;
  160|     19|                keymgmt->set_params = OSSL_FUNC_keymgmt_set_params(fns);
  161|     19|            }
  162|     19|            break;
  163|     19|        case OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS:
  ------------------
  |  |  706|     19|#define OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS             14
  ------------------
  |  Branch (163:9): [True: 19, False: 687]
  ------------------
  164|     19|            if (keymgmt->settable_params == NULL) {
  ------------------
  |  Branch (164:17): [True: 19, False: 0]
  ------------------
  165|     19|                setparamfncnt++;
  166|     19|                keymgmt->settable_params =
  167|     19|                    OSSL_FUNC_keymgmt_settable_params(fns);
  168|     19|            }
  169|     19|            break;
  170|      4|        case OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME:
  ------------------
  |  |  713|      4|# define OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME       20
  ------------------
  |  Branch (170:9): [True: 4, False: 702]
  ------------------
  171|      4|            if (keymgmt->query_operation_name == NULL)
  ------------------
  |  Branch (171:17): [True: 4, False: 0]
  ------------------
  172|      4|                keymgmt->query_operation_name =
  173|      4|                    OSSL_FUNC_keymgmt_query_operation_name(fns);
  174|      4|            break;
  175|     40|        case OSSL_FUNC_KEYMGMT_HAS:
  ------------------
  |  |  718|     40|# define OSSL_FUNC_KEYMGMT_HAS                        21
  ------------------
  |  Branch (175:9): [True: 40, False: 666]
  ------------------
  176|     40|            if (keymgmt->has == NULL)
  ------------------
  |  Branch (176:17): [True: 40, False: 0]
  ------------------
  177|     40|                keymgmt->has = OSSL_FUNC_keymgmt_has(fns);
  178|     40|            break;
  179|     33|        case OSSL_FUNC_KEYMGMT_DUP:
  ------------------
  |  |  748|     33|# define OSSL_FUNC_KEYMGMT_DUP                        44
  ------------------
  |  Branch (179:9): [True: 33, False: 673]
  ------------------
  180|     33|            if (keymgmt->dup == NULL)
  ------------------
  |  Branch (180:17): [True: 33, False: 0]
  ------------------
  181|     33|                keymgmt->dup = OSSL_FUNC_keymgmt_dup(fns);
  182|     33|            break;
  183|     29|        case OSSL_FUNC_KEYMGMT_VALIDATE:
  ------------------
  |  |  722|     29|# define OSSL_FUNC_KEYMGMT_VALIDATE                   22
  ------------------
  |  Branch (183:9): [True: 29, False: 677]
  ------------------
  184|     29|            if (keymgmt->validate == NULL)
  ------------------
  |  Branch (184:17): [True: 29, False: 0]
  ------------------
  185|     29|                keymgmt->validate = OSSL_FUNC_keymgmt_validate(fns);
  186|     29|            break;
  187|     37|        case OSSL_FUNC_KEYMGMT_MATCH:
  ------------------
  |  |  727|     37|# define OSSL_FUNC_KEYMGMT_MATCH                      23
  ------------------
  |  Branch (187:9): [True: 37, False: 669]
  ------------------
  188|     37|            if (keymgmt->match == NULL)
  ------------------
  |  Branch (188:17): [True: 37, False: 0]
  ------------------
  189|     37|                keymgmt->match = OSSL_FUNC_keymgmt_match(fns);
  190|     37|            break;
  191|     37|        case OSSL_FUNC_KEYMGMT_IMPORT:
  ------------------
  |  |  733|     37|# define OSSL_FUNC_KEYMGMT_IMPORT                     40
  ------------------
  |  Branch (191:9): [True: 37, False: 669]
  ------------------
  192|     37|            if (keymgmt->import == NULL) {
  ------------------
  |  Branch (192:17): [True: 37, False: 0]
  ------------------
  193|     37|                importfncnt++;
  194|     37|                keymgmt->import = OSSL_FUNC_keymgmt_import(fns);
  195|     37|            }
  196|     37|            break;
  197|     37|        case OSSL_FUNC_KEYMGMT_IMPORT_TYPES:
  ------------------
  |  |  734|     37|# define OSSL_FUNC_KEYMGMT_IMPORT_TYPES               41
  ------------------
  |  Branch (197:9): [True: 37, False: 669]
  ------------------
  198|     37|            if (keymgmt->import_types == NULL) {
  ------------------
  |  Branch (198:17): [True: 37, False: 0]
  ------------------
  199|     37|                if (importtypesfncnt == 0)
  ------------------
  |  Branch (199:21): [True: 37, False: 0]
  ------------------
  200|     37|                    importfncnt++;
  201|     37|                importtypesfncnt++;
  202|     37|                keymgmt->import_types = OSSL_FUNC_keymgmt_import_types(fns);
  203|     37|            }
  204|     37|            break;
  205|      0|        case OSSL_FUNC_KEYMGMT_IMPORT_TYPES_EX:
  ------------------
  |  |  753|      0|# define OSSL_FUNC_KEYMGMT_IMPORT_TYPES_EX            45
  ------------------
  |  Branch (205:9): [True: 0, False: 706]
  ------------------
  206|      0|            if (keymgmt->import_types_ex == NULL) {
  ------------------
  |  Branch (206:17): [True: 0, False: 0]
  ------------------
  207|      0|                if (importtypesfncnt == 0)
  ------------------
  |  Branch (207:21): [True: 0, False: 0]
  ------------------
  208|      0|                    importfncnt++;
  209|      0|                importtypesfncnt++;
  210|      0|                keymgmt->import_types_ex = OSSL_FUNC_keymgmt_import_types_ex(fns);
  211|      0|            }
  212|      0|            break;
  213|     37|        case OSSL_FUNC_KEYMGMT_EXPORT:
  ------------------
  |  |  735|     37|# define OSSL_FUNC_KEYMGMT_EXPORT                     42
  ------------------
  |  Branch (213:9): [True: 37, False: 669]
  ------------------
  214|     37|            if (keymgmt->export == NULL) {
  ------------------
  |  Branch (214:17): [True: 37, False: 0]
  ------------------
  215|     37|                exportfncnt++;
  216|     37|                keymgmt->export = OSSL_FUNC_keymgmt_export(fns);
  217|     37|            }
  218|     37|            break;
  219|     37|        case OSSL_FUNC_KEYMGMT_EXPORT_TYPES:
  ------------------
  |  |  736|     37|# define OSSL_FUNC_KEYMGMT_EXPORT_TYPES               43
  ------------------
  |  Branch (219:9): [True: 37, False: 669]
  ------------------
  220|     37|            if (keymgmt->export_types == NULL) {
  ------------------
  |  Branch (220:17): [True: 37, False: 0]
  ------------------
  221|     37|                if (exporttypesfncnt == 0)
  ------------------
  |  Branch (221:21): [True: 37, False: 0]
  ------------------
  222|     37|                    exportfncnt++;
  223|     37|                exporttypesfncnt++;
  224|     37|                keymgmt->export_types = OSSL_FUNC_keymgmt_export_types(fns);
  225|     37|            }
  226|     37|            break;
  227|      0|        case OSSL_FUNC_KEYMGMT_EXPORT_TYPES_EX:
  ------------------
  |  |  754|      0|# define OSSL_FUNC_KEYMGMT_EXPORT_TYPES_EX            46
  ------------------
  |  Branch (227:9): [True: 0, False: 706]
  ------------------
  228|      0|            if (keymgmt->export_types_ex == NULL) {
  ------------------
  |  Branch (228:17): [True: 0, False: 0]
  ------------------
  229|      0|                if (exporttypesfncnt == 0)
  ------------------
  |  Branch (229:21): [True: 0, False: 0]
  ------------------
  230|      0|                    exportfncnt++;
  231|      0|                exporttypesfncnt++;
  232|      0|                keymgmt->export_types_ex = OSSL_FUNC_keymgmt_export_types_ex(fns);
  233|      0|            }
  234|      0|            break;
  235|    706|        }
  236|    706|    }
  237|       |    /*
  238|       |     * Try to check that the method is sensible.
  239|       |     * At least one constructor and the destructor are MANDATORY
  240|       |     * The functions 'has' is MANDATORY
  241|       |     * It makes no sense being able to free stuff if you can't create it.
  242|       |     * It makes no sense providing OSSL_PARAM descriptors for import and
  243|       |     * export if you can't import or export.
  244|       |     */
  245|     40|    if (keymgmt->free == NULL
  ------------------
  |  Branch (245:9): [True: 0, False: 40]
  ------------------
  246|     40|        || (keymgmt->new == NULL
  ------------------
  |  Branch (246:13): [True: 0, False: 40]
  ------------------
  247|     40|            && keymgmt->gen == NULL
  ------------------
  |  Branch (247:16): [True: 0, False: 0]
  ------------------
  248|     40|            && keymgmt->load == NULL)
  ------------------
  |  Branch (248:16): [True: 0, False: 0]
  ------------------
  249|     40|        || keymgmt->has == NULL
  ------------------
  |  Branch (249:12): [True: 0, False: 40]
  ------------------
  250|     40|        || (getparamfncnt != 0 && getparamfncnt != 2)
  ------------------
  |  Branch (250:13): [True: 37, False: 3]
  |  Branch (250:35): [True: 0, False: 37]
  ------------------
  251|     40|        || (setparamfncnt != 0 && setparamfncnt != 2)
  ------------------
  |  Branch (251:13): [True: 19, False: 21]
  |  Branch (251:35): [True: 0, False: 19]
  ------------------
  252|     40|        || (setgenparamfncnt != 0 && setgenparamfncnt != 2)
  ------------------
  |  Branch (252:13): [True: 37, False: 3]
  |  Branch (252:38): [True: 0, False: 37]
  ------------------
  253|     40|        || (getgenparamfncnt != 0 && getgenparamfncnt != 2)
  ------------------
  |  Branch (253:13): [True: 2, False: 38]
  |  Branch (253:38): [True: 0, False: 2]
  ------------------
  254|     40|        || (importfncnt != 0 && importfncnt != 2)
  ------------------
  |  Branch (254:13): [True: 37, False: 3]
  |  Branch (254:33): [True: 0, False: 37]
  ------------------
  255|     40|        || (exportfncnt != 0 && exportfncnt != 2)
  ------------------
  |  Branch (255:13): [True: 37, False: 3]
  |  Branch (255:33): [True: 0, False: 37]
  ------------------
  256|     40|        || (keymgmt->gen != NULL
  ------------------
  |  Branch (256:13): [True: 37, False: 3]
  ------------------
  257|     40|            && (keymgmt->gen_init == NULL
  ------------------
  |  Branch (257:17): [True: 0, False: 37]
  ------------------
  258|     37|                || keymgmt->gen_cleanup == NULL))) {
  ------------------
  |  Branch (258:20): [True: 0, False: 37]
  ------------------
  259|      0|        EVP_KEYMGMT_free(keymgmt);
  260|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  261|      0|        return NULL;
  262|      0|    }
  263|     40|    keymgmt->prov = prov;
  264|     40|    if (prov != NULL)
  ------------------
  |  Branch (264:9): [True: 40, False: 0]
  ------------------
  265|     40|        ossl_provider_up_ref(prov);
  266|       |
  267|     40|#ifndef FIPS_MODULE
  268|     40|    keymgmt->legacy_alg = get_legacy_alg_type_from_keymgmt(keymgmt);
  269|     40|#endif
  270|       |
  271|     40|    return keymgmt;
  272|     40|}
keymgmt_meth.c:keymgmt_new:
   31|     40|{
   32|     40|    EVP_KEYMGMT *keymgmt = NULL;
   33|       |
   34|     40|    if ((keymgmt = OPENSSL_zalloc(sizeof(*keymgmt))) == NULL)
  ------------------
  |  |  104|     40|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     40|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (34:9): [True: 0, False: 40]
  ------------------
   35|      0|        return NULL;
   36|     40|    if (!CRYPTO_NEW_REF(&keymgmt->refcnt, 1)) {
  ------------------
  |  Branch (36:9): [True: 0, False: 40]
  ------------------
   37|      0|        EVP_KEYMGMT_free(keymgmt);
   38|      0|        return NULL;
   39|      0|    }
   40|     40|    return keymgmt;
   41|     40|}
keymgmt_meth.c:get_legacy_alg_type_from_keymgmt:
   54|     40|{
   55|     40|    int type = NID_undef;
  ------------------
  |  |   18|     40|#define NID_undef                       0
  ------------------
   56|       |
   57|     40|    EVP_KEYMGMT_names_do_all(keymgmt, help_get_legacy_alg_type_from_keymgmt,
   58|     40|                             &type);
   59|     40|    return type;
   60|     40|}
keymgmt_meth.c:help_get_legacy_alg_type_from_keymgmt:
   46|    107|{
   47|    107|    int *type = arg;
   48|       |
   49|    107|    if (*type == NID_undef)
  ------------------
  |  |   18|    107|#define NID_undef                       0
  ------------------
  |  Branch (49:9): [True: 84, False: 23]
  ------------------
   50|     84|        *type = evp_pkey_name2type(keytype);
   51|    107|}
keymgmt_meth.c:evp_keymgmt_up_ref:
   26|     40|{
   27|     40|    return EVP_KEYMGMT_up_ref(data);
   28|     40|}
keymgmt_meth.c:evp_keymgmt_free:
   21|     80|{
   22|     80|    EVP_KEYMGMT_free(data);
   23|     80|}

EVP_blake2b512:
   51|      2|{
   52|      2|    return &blake2b_md;
   53|      2|}
EVP_blake2s256:
   66|      2|{
   67|      2|    return &blake2s_md;
   68|      2|}

EVP_md4:
   32|      2|{
   33|      2|    return &md4_md;
   34|      2|}

EVP_md5:
   32|      2|{
   33|      2|    return &md5_md;
   34|      2|}

EVP_md5_sha1:
   39|      2|{
   40|      2|    return &md5_sha1_md;
   41|      2|}

EVP_mdc2:
   33|      2|{
   34|      2|    return &mdc2_md;
   35|      2|}

EVP_ripemd160:
   33|      2|{
   34|      2|    return &ripemd160_md;
   35|      2|}

EVP_sha1:
  103|  6.61k|{
  104|  6.61k|    return &sha1_md;
  105|  6.61k|}
EVP_sha224:
  118|      2|{
  119|      2|    return &sha224_md;
  120|      2|}
EVP_sha256:
  133|      2|{
  134|      2|    return &sha256_md;
  135|      2|}
EVP_sha512_224:
  148|      2|{
  149|      2|    return &sha512_224_md;
  150|      2|}
EVP_sha512_256:
  163|      2|{
  164|      2|    return &sha512_256_md;
  165|      2|}
EVP_sha384:
  178|      2|{
  179|      2|    return &sha384_md;
  180|      2|}
EVP_sha512:
  193|      2|{
  194|      2|    return &sha512_md;
  195|      2|}
EVP_sha3_224:
  198|      2|const EVP_MD *EVP_sha3_##bitlen(void)                                          \
  199|      2|{                                                                              \
  200|      2|    static const EVP_MD sha3_##bitlen##_md = {                                 \
  201|      2|        NID_sha3_##bitlen,                                                     \
  202|      2|        NID_RSA_SHA3_##bitlen,                                                 \
  203|      2|        bitlen / 8,                                                            \
  204|      2|        EVP_MD_FLAG_DIGALGID_ABSENT,                                           \
  ------------------
  |  |  196|      2|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  205|      2|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  253|      2|#define EVP_ORIG_GLOBAL     1
  ------------------
  206|      2|        LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update,               \
  ------------------
  |  |   40|      2|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  207|      2|                                 sha3_int_final, NULL,                         \
  208|      2|                                 (KECCAK1600_WIDTH - bitlen * 2) / 8),         \
  209|      2|    };                                                                         \
  210|      2|    return &sha3_##bitlen##_md;                                                \
  211|      2|}
EVP_sha3_256:
  198|      2|const EVP_MD *EVP_sha3_##bitlen(void)                                          \
  199|      2|{                                                                              \
  200|      2|    static const EVP_MD sha3_##bitlen##_md = {                                 \
  201|      2|        NID_sha3_##bitlen,                                                     \
  202|      2|        NID_RSA_SHA3_##bitlen,                                                 \
  203|      2|        bitlen / 8,                                                            \
  204|      2|        EVP_MD_FLAG_DIGALGID_ABSENT,                                           \
  ------------------
  |  |  196|      2|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  205|      2|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  253|      2|#define EVP_ORIG_GLOBAL     1
  ------------------
  206|      2|        LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update,               \
  ------------------
  |  |   40|      2|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  207|      2|                                 sha3_int_final, NULL,                         \
  208|      2|                                 (KECCAK1600_WIDTH - bitlen * 2) / 8),         \
  209|      2|    };                                                                         \
  210|      2|    return &sha3_##bitlen##_md;                                                \
  211|      2|}
EVP_sha3_384:
  198|      2|const EVP_MD *EVP_sha3_##bitlen(void)                                          \
  199|      2|{                                                                              \
  200|      2|    static const EVP_MD sha3_##bitlen##_md = {                                 \
  201|      2|        NID_sha3_##bitlen,                                                     \
  202|      2|        NID_RSA_SHA3_##bitlen,                                                 \
  203|      2|        bitlen / 8,                                                            \
  204|      2|        EVP_MD_FLAG_DIGALGID_ABSENT,                                           \
  ------------------
  |  |  196|      2|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  205|      2|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  253|      2|#define EVP_ORIG_GLOBAL     1
  ------------------
  206|      2|        LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update,               \
  ------------------
  |  |   40|      2|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  207|      2|                                 sha3_int_final, NULL,                         \
  208|      2|                                 (KECCAK1600_WIDTH - bitlen * 2) / 8),         \
  209|      2|    };                                                                         \
  210|      2|    return &sha3_##bitlen##_md;                                                \
  211|      2|}
EVP_sha3_512:
  198|      2|const EVP_MD *EVP_sha3_##bitlen(void)                                          \
  199|      2|{                                                                              \
  200|      2|    static const EVP_MD sha3_##bitlen##_md = {                                 \
  201|      2|        NID_sha3_##bitlen,                                                     \
  202|      2|        NID_RSA_SHA3_##bitlen,                                                 \
  203|      2|        bitlen / 8,                                                            \
  204|      2|        EVP_MD_FLAG_DIGALGID_ABSENT,                                           \
  ------------------
  |  |  196|      2|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  205|      2|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  253|      2|#define EVP_ORIG_GLOBAL     1
  ------------------
  206|      2|        LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update,               \
  ------------------
  |  |   40|      2|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  207|      2|                                 sha3_int_final, NULL,                         \
  208|      2|                                 (KECCAK1600_WIDTH - bitlen * 2) / 8),         \
  209|      2|    };                                                                         \
  210|      2|    return &sha3_##bitlen##_md;                                                \
  211|      2|}
EVP_shake128:
  213|      2|const EVP_MD *EVP_shake##bitlen(void)                                          \
  214|      2|{                                                                              \
  215|      2|    static const EVP_MD shake##bitlen##_md = {                                 \
  216|      2|        NID_shake##bitlen,                                                     \
  217|      2|        0,                                                                     \
  218|      2|        bitlen / 8,                                                            \
  219|      2|        EVP_MD_FLAG_XOF | EVP_MD_FLAG_DIGALGID_ABSENT,                         \
  ------------------
  |  |  184|      2|#  define EVP_MD_FLAG_XOF         0x0002
  ------------------
                      EVP_MD_FLAG_XOF | EVP_MD_FLAG_DIGALGID_ABSENT,                         \
  ------------------
  |  |  196|      2|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  220|      2|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  253|      2|#define EVP_ORIG_GLOBAL     1
  ------------------
  221|      2|        LEGACY_EVP_MD_METH_TABLE(shake_init, sha3_int_update, sha3_int_final,  \
  ------------------
  |  |   40|      2|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  222|      2|                        shake_ctrl, (KECCAK1600_WIDTH - bitlen * 2) / 8),      \
  223|      2|    };                                                                         \
  224|      2|    return &shake##bitlen##_md;                                                \
  225|      2|}
EVP_shake256:
  213|      2|const EVP_MD *EVP_shake##bitlen(void)                                          \
  214|      2|{                                                                              \
  215|      2|    static const EVP_MD shake##bitlen##_md = {                                 \
  216|      2|        NID_shake##bitlen,                                                     \
  217|      2|        0,                                                                     \
  218|      2|        bitlen / 8,                                                            \
  219|      2|        EVP_MD_FLAG_XOF | EVP_MD_FLAG_DIGALGID_ABSENT,                         \
  ------------------
  |  |  184|      2|#  define EVP_MD_FLAG_XOF         0x0002
  ------------------
                      EVP_MD_FLAG_XOF | EVP_MD_FLAG_DIGALGID_ABSENT,                         \
  ------------------
  |  |  196|      2|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  220|      2|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  253|      2|#define EVP_ORIG_GLOBAL     1
  ------------------
  221|      2|        LEGACY_EVP_MD_METH_TABLE(shake_init, sha3_int_update, sha3_int_final,  \
  ------------------
  |  |   40|      2|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  222|      2|                        shake_ctrl, (KECCAK1600_WIDTH - bitlen * 2) / 8),      \
  223|      2|    };                                                                         \
  224|      2|    return &shake##bitlen##_md;                                                \
  225|      2|}

EVP_whirlpool:
   33|      2|{
   34|      2|    return &whirlpool_md;
   35|      2|}

EVP_MAC_fetch:
  180|     17|{
  181|     17|    return evp_generic_fetch(libctx, OSSL_OP_MAC, algorithm, properties,
  ------------------
  |  |  312|     17|# define OSSL_OP_MAC                                 3
  ------------------
  182|     17|                             evp_mac_from_algorithm, evp_mac_up_ref,
  183|     17|                             evp_mac_free);
  184|     17|}
EVP_MAC_free:
  192|     31|{
  193|     31|    evp_mac_free(mac);
  194|     31|}
mac_meth.c:evp_mac_from_algorithm:
   60|      9|{
   61|      9|    const OSSL_DISPATCH *fns = algodef->implementation;
   62|      9|    EVP_MAC *mac = NULL;
   63|      9|    int fnmaccnt = 0, fnctxcnt = 0, mac_init_found = 0;
   64|       |
   65|      9|    if ((mac = evp_mac_new()) == NULL) {
  ------------------
  |  Branch (65:9): [True: 0, False: 9]
  ------------------
   66|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   67|      0|        goto err;
   68|      0|    }
   69|      9|    mac->name_id = name_id;
   70|       |
   71|      9|    if ((mac->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (71:9): [True: 0, False: 9]
  ------------------
   72|      0|        goto err;
   73|       |
   74|      9|    mac->description = algodef->algorithm_description;
   75|       |
   76|     99|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (76:12): [True: 90, False: 9]
  ------------------
   77|     90|        switch (fns->function_id) {
  ------------------
  |  Branch (77:17): [True: 0, False: 90]
  ------------------
   78|      9|        case OSSL_FUNC_MAC_NEWCTX:
  ------------------
  |  |  466|      9|# define OSSL_FUNC_MAC_NEWCTX                        1
  ------------------
  |  Branch (78:9): [True: 9, False: 81]
  ------------------
   79|      9|            if (mac->newctx != NULL)
  ------------------
  |  Branch (79:17): [True: 0, False: 9]
  ------------------
   80|      0|                break;
   81|      9|            mac->newctx = OSSL_FUNC_mac_newctx(fns);
   82|      9|            fnctxcnt++;
   83|      9|            break;
   84|      9|        case OSSL_FUNC_MAC_DUPCTX:
  ------------------
  |  |  467|      9|# define OSSL_FUNC_MAC_DUPCTX                        2
  ------------------
  |  Branch (84:9): [True: 9, False: 81]
  ------------------
   85|      9|            if (mac->dupctx != NULL)
  ------------------
  |  Branch (85:17): [True: 0, False: 9]
  ------------------
   86|      0|                break;
   87|      9|            mac->dupctx = OSSL_FUNC_mac_dupctx(fns);
   88|      9|            break;
   89|      9|        case OSSL_FUNC_MAC_FREECTX:
  ------------------
  |  |  468|      9|# define OSSL_FUNC_MAC_FREECTX                       3
  ------------------
  |  Branch (89:9): [True: 9, False: 81]
  ------------------
   90|      9|            if (mac->freectx != NULL)
  ------------------
  |  Branch (90:17): [True: 0, False: 9]
  ------------------
   91|      0|                break;
   92|      9|            mac->freectx = OSSL_FUNC_mac_freectx(fns);
   93|      9|            fnctxcnt++;
   94|      9|            break;
   95|      9|        case OSSL_FUNC_MAC_INIT:
  ------------------
  |  |  469|      9|# define OSSL_FUNC_MAC_INIT                          4
  ------------------
  |  Branch (95:9): [True: 9, False: 81]
  ------------------
   96|      9|            if (mac->init != NULL)
  ------------------
  |  Branch (96:17): [True: 0, False: 9]
  ------------------
   97|      0|                break;
   98|      9|            mac->init = OSSL_FUNC_mac_init(fns);
   99|      9|            mac_init_found = 1;
  100|      9|            break;
  101|      9|        case OSSL_FUNC_MAC_UPDATE:
  ------------------
  |  |  470|      9|# define OSSL_FUNC_MAC_UPDATE                        5
  ------------------
  |  Branch (101:9): [True: 9, False: 81]
  ------------------
  102|      9|            if (mac->update != NULL)
  ------------------
  |  Branch (102:17): [True: 0, False: 9]
  ------------------
  103|      0|                break;
  104|      9|            mac->update = OSSL_FUNC_mac_update(fns);
  105|      9|            fnmaccnt++;
  106|      9|            break;
  107|      9|        case OSSL_FUNC_MAC_FINAL:
  ------------------
  |  |  471|      9|# define OSSL_FUNC_MAC_FINAL                         6
  ------------------
  |  Branch (107:9): [True: 9, False: 81]
  ------------------
  108|      9|            if (mac->final != NULL)
  ------------------
  |  Branch (108:17): [True: 0, False: 9]
  ------------------
  109|      0|                break;
  110|      9|            mac->final = OSSL_FUNC_mac_final(fns);
  111|      9|            fnmaccnt++;
  112|      9|            break;
  113|      2|        case OSSL_FUNC_MAC_GETTABLE_PARAMS:
  ------------------
  |  |  475|      2|# define OSSL_FUNC_MAC_GETTABLE_PARAMS              10
  ------------------
  |  Branch (113:9): [True: 2, False: 88]
  ------------------
  114|      2|            if (mac->gettable_params != NULL)
  ------------------
  |  Branch (114:17): [True: 0, False: 2]
  ------------------
  115|      0|                break;
  116|      2|            mac->gettable_params =
  117|      2|                OSSL_FUNC_mac_gettable_params(fns);
  118|      2|            break;
  119|      7|        case OSSL_FUNC_MAC_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  476|      7|# define OSSL_FUNC_MAC_GETTABLE_CTX_PARAMS          11
  ------------------
  |  Branch (119:9): [True: 7, False: 83]
  ------------------
  120|      7|            if (mac->gettable_ctx_params != NULL)
  ------------------
  |  Branch (120:17): [True: 0, False: 7]
  ------------------
  121|      0|                break;
  122|      7|            mac->gettable_ctx_params =
  123|      7|                OSSL_FUNC_mac_gettable_ctx_params(fns);
  124|      7|            break;
  125|      9|        case OSSL_FUNC_MAC_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  477|      9|# define OSSL_FUNC_MAC_SETTABLE_CTX_PARAMS          12
  ------------------
  |  Branch (125:9): [True: 9, False: 81]
  ------------------
  126|      9|            if (mac->settable_ctx_params != NULL)
  ------------------
  |  Branch (126:17): [True: 0, False: 9]
  ------------------
  127|      0|                break;
  128|      9|            mac->settable_ctx_params =
  129|      9|                OSSL_FUNC_mac_settable_ctx_params(fns);
  130|      9|            break;
  131|      2|        case OSSL_FUNC_MAC_GET_PARAMS:
  ------------------
  |  |  472|      2|# define OSSL_FUNC_MAC_GET_PARAMS                    7
  ------------------
  |  Branch (131:9): [True: 2, False: 88]
  ------------------
  132|      2|            if (mac->get_params != NULL)
  ------------------
  |  Branch (132:17): [True: 0, False: 2]
  ------------------
  133|      0|                break;
  134|      2|            mac->get_params = OSSL_FUNC_mac_get_params(fns);
  135|      2|            break;
  136|      7|        case OSSL_FUNC_MAC_GET_CTX_PARAMS:
  ------------------
  |  |  473|      7|# define OSSL_FUNC_MAC_GET_CTX_PARAMS                8
  ------------------
  |  Branch (136:9): [True: 7, False: 83]
  ------------------
  137|      7|            if (mac->get_ctx_params != NULL)
  ------------------
  |  Branch (137:17): [True: 0, False: 7]
  ------------------
  138|      0|                break;
  139|      7|            mac->get_ctx_params = OSSL_FUNC_mac_get_ctx_params(fns);
  140|      7|            break;
  141|      9|        case OSSL_FUNC_MAC_SET_CTX_PARAMS:
  ------------------
  |  |  474|      9|# define OSSL_FUNC_MAC_SET_CTX_PARAMS                9
  ------------------
  |  Branch (141:9): [True: 9, False: 81]
  ------------------
  142|      9|            if (mac->set_ctx_params != NULL)
  ------------------
  |  Branch (142:17): [True: 0, False: 9]
  ------------------
  143|      0|                break;
  144|      9|            mac->set_ctx_params = OSSL_FUNC_mac_set_ctx_params(fns);
  145|      9|            break;
  146|      0|        case OSSL_FUNC_MAC_INIT_SKEY:
  ------------------
  |  |  478|      0|# define OSSL_FUNC_MAC_INIT_SKEY                    13
  ------------------
  |  Branch (146:9): [True: 0, False: 90]
  ------------------
  147|      0|            if (mac->init_skey != NULL)
  ------------------
  |  Branch (147:17): [True: 0, False: 0]
  ------------------
  148|      0|                break;
  149|      0|            mac->init_skey = OSSL_FUNC_mac_init_skey(fns);
  150|      0|            mac_init_found = 1;
  151|      0|            break;
  152|     90|        }
  153|     90|    }
  154|      9|    fnmaccnt += mac_init_found;
  155|      9|    if (fnmaccnt != 3
  ------------------
  |  Branch (155:9): [True: 0, False: 9]
  ------------------
  156|      9|        || fnctxcnt != 2) {
  ------------------
  |  Branch (156:12): [True: 0, False: 9]
  ------------------
  157|       |        /*
  158|       |         * In order to be a consistent set of functions we must have at least
  159|       |         * a complete set of "mac" functions, and a complete set of context
  160|       |         * management functions, as well as the size function.
  161|       |         */
  162|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  163|      0|        goto err;
  164|      0|    }
  165|       |
  166|      9|    if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (166:9): [True: 9, False: 0]
  |  Branch (166:25): [True: 0, False: 9]
  ------------------
  167|      0|        goto err;
  168|       |
  169|      9|    mac->prov = prov;
  170|       |
  171|      9|    return mac;
  172|       |
  173|      0|err:
  174|      0|    evp_mac_free(mac);
  175|      0|    return NULL;
  176|      9|}
mac_meth.c:evp_mac_new:
   46|      9|{
   47|      9|    EVP_MAC *mac = NULL;
   48|       |
   49|      9|    if ((mac = OPENSSL_zalloc(sizeof(*mac))) == NULL
  ------------------
  |  |  104|      9|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      9|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      9|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (49:9): [True: 0, False: 9]
  ------------------
   50|      9|        || !CRYPTO_NEW_REF(&mac->refcnt, 1)) {
  ------------------
  |  Branch (50:12): [True: 0, False: 9]
  ------------------
   51|      0|        evp_mac_free(mac);
   52|      0|        return NULL;
   53|      0|    }
   54|      9|    return mac;
   55|      9|}
mac_meth.c:evp_mac_up_ref:
   20|     27|{
   21|     27|    EVP_MAC *mac = vmac;
   22|     27|    int ref = 0;
   23|       |
   24|     27|    CRYPTO_UP_REF(&mac->refcnt, &ref);
   25|     27|    return 1;
   26|     27|}
mac_meth.c:evp_mac_free:
   29|     50|{
   30|     50|    EVP_MAC *mac = vmac;
   31|     50|    int ref = 0;
   32|       |
   33|     50|    if (mac == NULL)
  ------------------
  |  Branch (33:9): [True: 14, False: 36]
  ------------------
   34|     14|        return;
   35|       |
   36|     36|    CRYPTO_DOWN_REF(&mac->refcnt, &ref);
   37|     36|    if (ref > 0)
  ------------------
  |  Branch (37:9): [True: 27, False: 9]
  ------------------
   38|     27|        return;
   39|      9|    OPENSSL_free(mac->type_name);
  ------------------
  |  |  115|      9|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      9|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      9|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      9|    ossl_provider_free(mac->prov);
   41|      9|    CRYPTO_FREE_REF(&mac->refcnt);
   42|      9|    OPENSSL_free(mac);
  ------------------
  |  |  115|      9|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      9|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      9|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   43|      9|}

EVP_add_cipher:
   20|    288|{
   21|    288|    int r;
   22|       |
   23|    288|    if (c == NULL)
  ------------------
  |  Branch (23:9): [True: 0, False: 288]
  ------------------
   24|      0|        return 0;
   25|       |
   26|    288|    r = OBJ_NAME_add(OBJ_nid2sn(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    288|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
   27|    288|                     (const char *)c);
   28|    288|    if (r == 0)
  ------------------
  |  Branch (28:9): [True: 0, False: 288]
  ------------------
   29|      0|        return 0;
   30|    288|    r = OBJ_NAME_add(OBJ_nid2ln(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    288|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
   31|    288|                     (const char *)c);
   32|    288|    return r;
   33|    288|}
EVP_add_digest:
   36|     44|{
   37|     44|    int r;
   38|     44|    const char *name;
   39|       |
   40|     44|    name = OBJ_nid2sn(md->type);
   41|     44|    r = OBJ_NAME_add(name, OBJ_NAME_TYPE_MD_METH, (const char *)md);
  ------------------
  |  |   25|     44|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
   42|     44|    if (r == 0)
  ------------------
  |  Branch (42:9): [True: 0, False: 44]
  ------------------
   43|      0|        return 0;
   44|     44|    r = OBJ_NAME_add(OBJ_nid2ln(md->type), OBJ_NAME_TYPE_MD_METH,
  ------------------
  |  |   25|     44|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
   45|     44|                     (const char *)md);
   46|     44|    if (r == 0)
  ------------------
  |  Branch (46:9): [True: 0, False: 44]
  ------------------
   47|      0|        return 0;
   48|       |
   49|     44|    if (md->pkey_type && md->type != md->pkey_type) {
  ------------------
  |  Branch (49:9): [True: 34, False: 10]
  |  Branch (49:26): [True: 32, False: 2]
  ------------------
   50|     32|        r = OBJ_NAME_add(OBJ_nid2sn(md->pkey_type),
   51|     32|                         OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     32|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
                                       OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     32|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
   52|     32|        if (r == 0)
  ------------------
  |  Branch (52:13): [True: 0, False: 32]
  ------------------
   53|      0|            return 0;
   54|     32|        r = OBJ_NAME_add(OBJ_nid2ln(md->pkey_type),
   55|     32|                         OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     32|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
                                       OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     32|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
   56|     32|    }
   57|     44|    return r;
   58|     44|}
evp_cleanup_int:
  180|      2|{
  181|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_KDF_METH);
  ------------------
  |  |   30|      2|# define OBJ_NAME_TYPE_KDF_METH          0x06
  ------------------
  182|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
  183|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  184|       |    /*
  185|       |     * The above calls will only clean out the contents of the name hash
  186|       |     * table, but not the hash table itself.  The following line does that
  187|       |     * part.  -- Richard Levitte
  188|       |     */
  189|      2|    OBJ_NAME_cleanup(-1);
  190|       |
  191|      2|    EVP_PBE_cleanup();
  192|      2|    OBJ_sigid_free();
  193|       |
  194|      2|    evp_app_cleanup_int();
  195|      2|}

evp_pkey_get0_RSA_int:
   41|     47|{
   42|     47|    if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA_PSS) {
  ------------------
  |  |   63|     47|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|     94|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
                  if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA_PSS) {
  ------------------
  |  |   65|      4|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      4|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (42:9): [True: 4, False: 43]
  |  Branch (42:39): [True: 0, False: 4]
  ------------------
   43|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_EXPECTING_AN_RSA_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   44|      0|        return NULL;
   45|      0|    }
   46|     47|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
   47|     47|}
EVP_PKEY_get1_RSA:
   55|     47|{
   56|     47|    RSA *ret = evp_pkey_get0_RSA_int(pkey);
   57|       |
   58|     47|    if (ret != NULL && !RSA_up_ref(ret))
  ------------------
  |  Branch (58:9): [True: 47, False: 0]
  |  Branch (58:24): [True: 0, False: 47]
  ------------------
   59|      0|        ret = NULL;
   60|       |
   61|     47|    return ret;
   62|     47|}
evp_pkey_get0_EC_KEY_int:
   77|  6.77k|{
   78|  6.77k|    if (EVP_PKEY_get_base_id(pkey) != EVP_PKEY_EC) {
  ------------------
  |  |   73|  6.77k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|  6.77k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (78:9): [True: 0, False: 6.77k]
  ------------------
   79|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_EXPECTING_A_EC_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   80|      0|        return NULL;
   81|      0|    }
   82|  6.77k|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
   83|  6.77k|}
EVP_PKEY_get1_EC_KEY:
   91|  6.77k|{
   92|  6.77k|    EC_KEY *ret = evp_pkey_get0_EC_KEY_int(pkey);
   93|       |
   94|  6.77k|    if (ret != NULL && !EC_KEY_up_ref(ret))
  ------------------
  |  Branch (94:9): [True: 6.77k, False: 0]
  |  Branch (94:24): [True: 0, False: 6.77k]
  ------------------
   95|      0|        ret = NULL;
   96|  6.77k|    return ret;
   97|  6.77k|}

EVP_PKEY_set_type:
  724|  42.1k|{
  725|  42.1k|    return pkey_set_type(pkey, NULL, type, NULL, -1, NULL);
  726|  42.1k|}
EVP_PKEY_assign:
  794|  7.27k|{
  795|  7.27k|#  ifndef OPENSSL_NO_EC
  796|  7.27k|    int pktype;
  797|       |
  798|  7.27k|    pktype = EVP_PKEY_type(type);
  799|  7.27k|    if ((key != NULL) && (pktype == EVP_PKEY_EC || pktype == EVP_PKEY_SM2)) {
  ------------------
  |  |   73|  7.27k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|  14.5k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
                  if ((key != NULL) && (pktype == EVP_PKEY_EC || pktype == EVP_PKEY_SM2)) {
  ------------------
  |  |   74|    492|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|    492|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (799:9): [True: 7.27k, False: 0]
  |  Branch (799:27): [True: 6.78k, False: 492]
  |  Branch (799:52): [True: 0, False: 492]
  ------------------
  800|  6.78k|        const EC_GROUP *group = EC_KEY_get0_group(key);
  801|       |
  802|  6.78k|        if (group != NULL) {
  ------------------
  |  Branch (802:13): [True: 6.78k, False: 0]
  ------------------
  803|  6.78k|            int curve = EC_GROUP_get_curve_name(group);
  804|       |
  805|       |            /*
  806|       |             * Regardless of what is requested the SM2 curve must be SM2 type,
  807|       |             * and non SM2 curves are EC type.
  808|       |             */
  809|  6.78k|            if (curve == NID_sm2 && pktype == EVP_PKEY_EC)
  ------------------
  |  | 1232|  13.5k|#define NID_sm2         1172
  ------------------
                          if (curve == NID_sm2 && pktype == EVP_PKEY_EC)
  ------------------
  |  |   73|      1|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|      1|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (809:17): [True: 1, False: 6.78k]
  |  Branch (809:37): [True: 1, False: 0]
  ------------------
  810|      1|                type = EVP_PKEY_SM2;
  ------------------
  |  |   74|      1|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|      1|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  811|  6.78k|            else if(curve != NID_sm2 && pktype == EVP_PKEY_SM2)
  ------------------
  |  | 1232|  13.5k|#define NID_sm2         1172
  ------------------
                          else if(curve != NID_sm2 && pktype == EVP_PKEY_SM2)
  ------------------
  |  |   74|  6.78k|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|  6.78k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (811:21): [True: 6.78k, False: 0]
  |  Branch (811:41): [True: 0, False: 6.78k]
  ------------------
  812|      0|                type = EVP_PKEY_EC;
  ------------------
  |  |   73|      0|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|      0|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  813|  6.78k|        }
  814|  6.78k|    }
  815|  7.27k|#  endif
  816|       |
  817|  7.27k|    if (pkey == NULL || !EVP_PKEY_set_type(pkey, type))
  ------------------
  |  Branch (817:9): [True: 0, False: 7.27k]
  |  Branch (817:25): [True: 0, False: 7.27k]
  ------------------
  818|      0|        return 0;
  819|       |
  820|  7.27k|    pkey->pkey.ptr = key;
  821|  7.27k|    detect_foreign_key(pkey);
  822|       |
  823|  7.27k|    return (key != NULL);
  824|  7.27k|}
EVP_PKEY_get1_DSA:
  918|      5|{
  919|      5|    DSA *ret = evp_pkey_get0_DSA_int(pkey);
  920|       |
  921|      5|    if (ret != NULL && !DSA_up_ref(ret))
  ------------------
  |  Branch (921:9): [True: 5, False: 0]
  |  Branch (921:24): [True: 0, False: 5]
  ------------------
  922|      0|        return NULL;
  923|       |
  924|      5|    return ret;
  925|      5|}
ossl_evp_pkey_get1_X25519:
  949|      1|    {                                                                   \
  950|      1|        return evp_pkey_get1_ECX_KEY(pkey, EVP_PKEY_##NAME);            \
  951|      1|    }
ossl_evp_pkey_get1_X448:
  949|      1|    {                                                                   \
  950|      1|        return evp_pkey_get1_ECX_KEY(pkey, EVP_PKEY_##NAME);            \
  951|      1|    }
ossl_evp_pkey_get1_ED25519:
  949|      1|    {                                                                   \
  950|      1|        return evp_pkey_get1_ECX_KEY(pkey, EVP_PKEY_##NAME);            \
  951|      1|    }
ossl_evp_pkey_get1_ED448:
  949|      1|    {                                                                   \
  950|      1|        return evp_pkey_get1_ECX_KEY(pkey, EVP_PKEY_##NAME);            \
  951|      1|    }
evp_pkey_get0_DH_int:
 1001|     65|{
 1002|     65|    if (pkey->type != EVP_PKEY_DH && pkey->type != EVP_PKEY_DHX) {
  ------------------
  |  |   71|     65|# define EVP_PKEY_DH     NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|    130|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
                  if (pkey->type != EVP_PKEY_DH && pkey->type != EVP_PKEY_DHX) {
  ------------------
  |  |   72|      1|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5499|      1|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
  |  Branch (1002:9): [True: 1, False: 64]
  |  Branch (1002:38): [True: 0, False: 1]
  ------------------
 1003|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_EXPECTING_A_DH_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1004|      0|        return NULL;
 1005|      0|    }
 1006|     65|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
 1007|     65|}
EVP_PKEY_get1_DH:
 1015|     65|{
 1016|     65|    DH *ret = evp_pkey_get0_DH_int(pkey);
 1017|       |
 1018|     65|    if (ret != NULL && !DH_up_ref(ret))
  ------------------
  |  Branch (1018:9): [True: 65, False: 0]
  |  Branch (1018:24): [True: 0, False: 65]
  ------------------
 1019|      0|        ret = NULL;
 1020|       |
 1021|     65|    return ret;
 1022|     65|}
EVP_PKEY_type:
 1026|  14.2k|{
 1027|  14.2k|    int ret;
 1028|  14.2k|    const EVP_PKEY_ASN1_METHOD *ameth;
 1029|  14.2k|    ENGINE *e;
 1030|  14.2k|    ameth = EVP_PKEY_asn1_find(&e, type);
 1031|  14.2k|    if (ameth)
  ------------------
  |  Branch (1031:9): [True: 14.0k, False: 146]
  ------------------
 1032|  14.0k|        ret = ameth->pkey_id;
 1033|    146|    else
 1034|    146|        ret = NID_undef;
  ------------------
  |  |   18|    146|#define NID_undef                       0
  ------------------
 1035|  14.2k|# ifndef OPENSSL_NO_ENGINE
 1036|  14.2k|    ENGINE_finish(e);
 1037|  14.2k|# endif
 1038|  14.2k|    return ret;
 1039|  14.2k|}
EVP_PKEY_get_id:
 1042|  6.84k|{
 1043|  6.84k|    return pkey->type;
 1044|  6.84k|}
EVP_PKEY_get_base_id:
 1047|  6.77k|{
 1048|  6.77k|    return EVP_PKEY_type(pkey->type);
 1049|  6.77k|}
evp_pkey_name2type:
 1079|     84|{
 1080|     84|    int type;
 1081|     84|    size_t i;
 1082|       |
 1083|  1.05k|    for (i = 0; i < OSSL_NELEM(standard_name2type); i++) {
  ------------------
  |  |   14|  1.05k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1083:17): [True: 978, False: 78]
  ------------------
 1084|    978|        if (OPENSSL_strcasecmp(name, standard_name2type[i].ptr) == 0)
  ------------------
  |  Branch (1084:13): [True: 6, False: 972]
  ------------------
 1085|      6|            return (int)standard_name2type[i].id;
 1086|    978|    }
 1087|       |
 1088|     78|    if ((type = EVP_PKEY_type(OBJ_sn2nid(name))) != NID_undef)
  ------------------
  |  |   18|     78|#define NID_undef                       0
  ------------------
  |  Branch (1088:9): [True: 5, False: 73]
  ------------------
 1089|      5|        return type;
 1090|     73|    return EVP_PKEY_type(OBJ_ln2nid(name));
 1091|     78|}
EVP_PKEY_print_private:
 1259|  1.78k|{
 1260|  1.78k|    return print_pkey(pkey, out, indent, EVP_PKEY_PRIVATE_KEY, NULL,
  ------------------
  |  |  109|  1.78k|    ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  107|  1.78k|    ( OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  |  |  ------------------
  |  |  |  |  |  |  647|  1.78k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  642|  1.78k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  648|  1.78k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  643|  1.78k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  640|  1.78k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  ------------------
 1261|  1.78k|                      (pkey->ameth != NULL ? pkey->ameth->priv_print : NULL),
  ------------------
  |  Branch (1261:24): [True: 379, False: 1.40k]
  ------------------
 1262|  1.78k|                      pctx);
 1263|  1.78k|}
EVP_PKEY_new:
 1509|  43.1k|{
 1510|  43.1k|    EVP_PKEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  43.1k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  43.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  43.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1511|       |
 1512|  43.1k|    if (ret == NULL)
  ------------------
  |  Branch (1512:9): [True: 0, False: 43.1k]
  ------------------
 1513|      0|        return NULL;
 1514|       |
 1515|  43.1k|    ret->type = EVP_PKEY_NONE;
  ------------------
  |  |   62|  43.1k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  43.1k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1516|  43.1k|    ret->save_type = EVP_PKEY_NONE;
  ------------------
  |  |   62|  43.1k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  43.1k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1517|       |
 1518|  43.1k|    if (!CRYPTO_NEW_REF(&ret->references, 1))
  ------------------
  |  Branch (1518:9): [True: 0, False: 43.1k]
  ------------------
 1519|      0|        goto err;
 1520|       |
 1521|  43.1k|    ret->lock = CRYPTO_THREAD_lock_new();
 1522|  43.1k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (1522:9): [True: 0, False: 43.1k]
  ------------------
 1523|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1524|      0|        goto err;
 1525|      0|    }
 1526|       |
 1527|  43.1k|#ifndef FIPS_MODULE
 1528|  43.1k|    ret->save_parameters = 1;
 1529|  43.1k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, ret, &ret->ex_data)) {
  ------------------
  |  |  247|  43.1k|# define CRYPTO_EX_INDEX_EVP_PKEY        17
  ------------------
  |  Branch (1529:9): [True: 0, False: 43.1k]
  ------------------
 1530|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1531|      0|        goto err;
 1532|      0|    }
 1533|  43.1k|#endif
 1534|  43.1k|    return ret;
 1535|       |
 1536|      0| err:
 1537|      0|    CRYPTO_FREE_REF(&ret->references);
 1538|      0|    CRYPTO_THREAD_lock_free(ret->lock);
 1539|      0|    OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1540|      0|    return NULL;
 1541|  43.1k|}
EVP_PKEY_set_type_by_keymgmt:
 1695|  8.30k|{
 1696|  8.30k|#ifndef FIPS_MODULE
 1697|  8.30k|# define EVP_PKEY_TYPE_STR str[0]
 1698|  8.30k|# define EVP_PKEY_TYPE_STRLEN (str[0] == NULL ? -1 : (int)strlen(str[0]))
 1699|       |    /*
 1700|       |     * Find at most two strings that have an associated EVP_PKEY_ASN1_METHOD
 1701|       |     * Ideally, only one should be found.  If two (or more) are found, the
 1702|       |     * match is ambiguous.  This should never happen, but...
 1703|       |     */
 1704|  8.30k|    const char *str[2] = { NULL, NULL };
 1705|       |
 1706|  8.30k|    if (!EVP_KEYMGMT_names_do_all(keymgmt, find_ameth, &str)
  ------------------
  |  Branch (1706:9): [True: 0, False: 8.30k]
  ------------------
 1707|  8.30k|            || str[1] != NULL) {
  ------------------
  |  Branch (1707:16): [True: 0, False: 8.30k]
  ------------------
 1708|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1709|      0|        return 0;
 1710|      0|    }
 1711|       |#else
 1712|       |# define EVP_PKEY_TYPE_STR NULL
 1713|       |# define EVP_PKEY_TYPE_STRLEN -1
 1714|       |#endif
 1715|  8.30k|    return pkey_set_type(pkey, NULL, EVP_PKEY_NONE,
  ------------------
  |  |   62|  8.30k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  8.30k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1716|  8.30k|                         EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
  ------------------
  |  | 1697|  8.30k|# define EVP_PKEY_TYPE_STR str[0]
  ------------------
                                       EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
  ------------------
  |  | 1698|  8.30k|# define EVP_PKEY_TYPE_STRLEN (str[0] == NULL ? -1 : (int)strlen(str[0]))
  |  |  ------------------
  |  |  |  Branch (1698:32): [True: 5, False: 8.29k]
  |  |  ------------------
  ------------------
 1717|  8.30k|                         keymgmt);
 1718|       |
 1719|  8.30k|#undef EVP_PKEY_TYPE_STR
 1720|  8.30k|#undef EVP_PKEY_TYPE_STRLEN
 1721|  8.30k|}
EVP_PKEY_up_ref:
 1724|  6.89k|{
 1725|  6.89k|    int i;
 1726|       |
 1727|  6.89k|    if (CRYPTO_UP_REF(&pkey->references, &i) <= 0)
  ------------------
  |  Branch (1727:9): [True: 0, False: 6.89k]
  ------------------
 1728|      0|        return 0;
 1729|       |
 1730|  6.89k|    REF_PRINT_COUNT("EVP_PKEY", i, pkey);
  ------------------
  |  |  301|  6.89k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  6.89k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  6.89k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  6.89k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1731|  6.89k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|  6.89k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 6.89k]
  |  |  ------------------
  ------------------
 1732|  6.89k|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (1732:13): [True: 6.89k, False: 0]
  ------------------
 1733|  6.89k|}
evp_pkey_free_legacy:
 1798|  43.1k|{
 1799|  43.1k|    const EVP_PKEY_ASN1_METHOD *ameth = x->ameth;
 1800|  43.1k|    ENGINE *tmpe = NULL;
 1801|       |
 1802|  43.1k|    if (ameth == NULL && x->legacy_cache_pkey.ptr != NULL)
  ------------------
  |  Branch (1802:9): [True: 8.34k, False: 34.7k]
  |  Branch (1802:26): [True: 0, False: 8.34k]
  ------------------
 1803|      0|        ameth = EVP_PKEY_asn1_find(&tmpe, x->type);
 1804|       |
 1805|  43.1k|    if (ameth != NULL) {
  ------------------
  |  Branch (1805:9): [True: 34.7k, False: 8.34k]
  ------------------
 1806|  34.7k|        if (x->legacy_cache_pkey.ptr != NULL) {
  ------------------
  |  Branch (1806:13): [True: 0, False: 34.7k]
  ------------------
 1807|       |            /*
 1808|       |             * We should never have both a legacy origin key, and a key in the
 1809|       |             * legacy cache.
 1810|       |             */
 1811|      0|            assert(x->pkey.ptr == NULL);
 1812|       |            /*
 1813|       |             * For the purposes of freeing we make the legacy cache look like
 1814|       |             * a legacy origin key.
 1815|       |             */
 1816|      0|            x->pkey = x->legacy_cache_pkey;
 1817|      0|            x->legacy_cache_pkey.ptr = NULL;
 1818|      0|        }
 1819|  34.7k|        if (ameth->pkey_free != NULL)
  ------------------
  |  Branch (1819:13): [True: 34.7k, False: 0]
  ------------------
 1820|  34.7k|            ameth->pkey_free(x);
 1821|  34.7k|        x->pkey.ptr = NULL;
 1822|  34.7k|    }
 1823|  43.1k|# ifndef OPENSSL_NO_ENGINE
 1824|  43.1k|    ENGINE_finish(tmpe);
 1825|  43.1k|    ENGINE_finish(x->engine);
 1826|  43.1k|    x->engine = NULL;
 1827|  43.1k|    ENGINE_finish(x->pmeth_engine);
 1828|  43.1k|    x->pmeth_engine = NULL;
 1829|  43.1k|# endif
 1830|  43.1k|}
EVP_PKEY_free:
 1851|   217k|{
 1852|   217k|    int i;
 1853|       |
 1854|   217k|    if (x == NULL)
  ------------------
  |  Branch (1854:9): [True: 167k, False: 50.0k]
  ------------------
 1855|   167k|        return;
 1856|       |
 1857|  50.0k|    CRYPTO_DOWN_REF(&x->references, &i);
 1858|  50.0k|    REF_PRINT_COUNT("EVP_PKEY", i, x);
  ------------------
  |  |  301|  50.0k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  50.0k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  50.0k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  50.0k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1859|  50.0k|    if (i > 0)
  ------------------
  |  Branch (1859:9): [True: 6.89k, False: 43.1k]
  ------------------
 1860|  6.89k|        return;
 1861|  43.1k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|  43.1k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 43.1k]
  |  |  ------------------
  ------------------
 1862|  43.1k|    evp_pkey_free_it(x);
 1863|  43.1k|#ifndef FIPS_MODULE
 1864|  43.1k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, x, &x->ex_data);
  ------------------
  |  |  247|  43.1k|# define CRYPTO_EX_INDEX_EVP_PKEY        17
  ------------------
 1865|  43.1k|#endif
 1866|  43.1k|    CRYPTO_THREAD_lock_free(x->lock);
 1867|  43.1k|    CRYPTO_FREE_REF(&x->references);
 1868|  43.1k|#ifndef FIPS_MODULE
 1869|  43.1k|    sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
  ------------------
  |  |  278|  43.1k|#define sk_X509_ATTRIBUTE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_freefunc_type(freefunc))
  ------------------
 1870|  43.1k|#endif
 1871|  43.1k|    OPENSSL_free(x);
  ------------------
  |  |  115|  43.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  43.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  43.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1872|  43.1k|}
evp_pkey_get_legacy:
 2177|  6.89k|{
 2178|  6.89k|    EVP_PKEY *tmp_copy = NULL;
 2179|  6.89k|    void *ret = NULL;
 2180|       |
 2181|  6.89k|    if (!ossl_assert(pk != NULL))
  ------------------
  |  |   52|  6.89k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  6.89k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (2181:9): [True: 0, False: 6.89k]
  ------------------
 2182|      0|        return NULL;
 2183|       |
 2184|       |    /*
 2185|       |     * If this isn't an assigned provider side key, we just use any existing
 2186|       |     * origin legacy key.
 2187|       |     */
 2188|  6.89k|    if (!evp_pkey_is_assigned(pk))
  ------------------
  |  |  641|  6.89k|    ((pk)->pkey.ptr != NULL || (pk)->keydata != NULL)
  |  |  ------------------
  |  |  |  Branch (641:6): [True: 6.89k, False: 0]
  |  |  |  Branch (641:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2189|      0|        return NULL;
 2190|  6.89k|    if (!evp_pkey_is_provided(pk))
  ------------------
  |  |  649|  6.89k|    ((pk)->keymgmt != NULL)
  ------------------
  |  Branch (2190:9): [True: 6.89k, False: 0]
  ------------------
 2191|  6.89k|        return pk->pkey.ptr;
 2192|       |
 2193|      0|    if (!CRYPTO_THREAD_read_lock(pk->lock))
  ------------------
  |  Branch (2193:9): [True: 0, False: 0]
  ------------------
 2194|      0|        return NULL;
 2195|       |
 2196|      0|    ret = pk->legacy_cache_pkey.ptr;
 2197|       |
 2198|      0|    if (!CRYPTO_THREAD_unlock(pk->lock))
  ------------------
  |  Branch (2198:9): [True: 0, False: 0]
  ------------------
 2199|      0|        return NULL;
 2200|       |
 2201|      0|    if (ret != NULL)
  ------------------
  |  Branch (2201:9): [True: 0, False: 0]
  ------------------
 2202|      0|        return ret;
 2203|       |
 2204|      0|    if (!evp_pkey_copy_downgraded(&tmp_copy, pk))
  ------------------
  |  Branch (2204:9): [True: 0, False: 0]
  ------------------
 2205|      0|        goto err;
 2206|       |
 2207|      0|    if (!CRYPTO_THREAD_write_lock(pk->lock))
  ------------------
  |  Branch (2207:9): [True: 0, False: 0]
  ------------------
 2208|      0|        goto err;
 2209|       |
 2210|       |    /* Check again in case some other thread has updated it in the meantime */
 2211|      0|    ret = pk->legacy_cache_pkey.ptr;
 2212|      0|    if (ret == NULL) {
  ------------------
  |  Branch (2212:9): [True: 0, False: 0]
  ------------------
 2213|       |        /* Steal the legacy key reference from the temporary copy */
 2214|      0|        ret = pk->legacy_cache_pkey.ptr = tmp_copy->pkey.ptr;
 2215|      0|        tmp_copy->pkey.ptr = NULL;
 2216|      0|    }
 2217|       |
 2218|      0|    if (!CRYPTO_THREAD_unlock(pk->lock)) {
  ------------------
  |  Branch (2218:9): [True: 0, False: 0]
  ------------------
 2219|      0|        ret = NULL;
 2220|      0|        goto err;
 2221|      0|    }
 2222|       |
 2223|      0| err:
 2224|      0|    EVP_PKEY_free(tmp_copy);
 2225|       |
 2226|      0|    return ret;
 2227|      0|}
p_lib.c:detect_foreign_key:
  760|  7.27k|{
  761|  7.27k|    switch (pkey->type) {
  762|    408|    case EVP_PKEY_RSA:
  ------------------
  |  |   63|    408|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|    408|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  |  Branch (762:5): [True: 408, False: 6.86k]
  ------------------
  763|    414|    case EVP_PKEY_RSA_PSS:
  ------------------
  |  |   65|    414|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|    414|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (763:5): [True: 6, False: 7.26k]
  ------------------
  764|    414|        pkey->foreign = pkey->pkey.rsa != NULL
  ------------------
  |  Branch (764:25): [True: 414, False: 0]
  ------------------
  765|    414|                        && ossl_rsa_is_foreign(pkey->pkey.rsa);
  ------------------
  |  Branch (765:28): [True: 0, False: 414]
  ------------------
  766|    414|        break;
  767|      0|#  ifndef OPENSSL_NO_EC
  768|      1|    case EVP_PKEY_SM2:
  ------------------
  |  |   74|      1|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|      1|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (768:5): [True: 1, False: 7.27k]
  ------------------
  769|      1|        break;
  770|  6.78k|    case EVP_PKEY_EC:
  ------------------
  |  |   73|  6.78k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|  6.78k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (770:5): [True: 6.78k, False: 493]
  ------------------
  771|  6.78k|        pkey->foreign = pkey->pkey.ec != NULL
  ------------------
  |  Branch (771:25): [True: 6.78k, False: 0]
  ------------------
  772|  6.78k|                        && ossl_ec_key_is_foreign(pkey->pkey.ec);
  ------------------
  |  Branch (772:28): [True: 0, False: 6.78k]
  ------------------
  773|  6.78k|        break;
  774|      0|#  endif
  775|      0|#  ifndef OPENSSL_NO_DSA
  776|      6|    case EVP_PKEY_DSA:
  ------------------
  |  |   66|      6|# define EVP_PKEY_DSA    NID_dsa
  |  |  ------------------
  |  |  |  |  136|      6|#define NID_dsa         116
  |  |  ------------------
  ------------------
  |  Branch (776:5): [True: 6, False: 7.26k]
  ------------------
  777|      6|        pkey->foreign = pkey->pkey.dsa != NULL
  ------------------
  |  Branch (777:25): [True: 6, False: 0]
  ------------------
  778|      6|                        && ossl_dsa_is_foreign(pkey->pkey.dsa);
  ------------------
  |  Branch (778:28): [True: 0, False: 6]
  ------------------
  779|      6|        break;
  780|      0|#endif
  781|      0|#  ifndef OPENSSL_NO_DH
  782|     64|    case EVP_PKEY_DH:
  ------------------
  |  |   71|     64|# define EVP_PKEY_DH     NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|     64|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
  |  Branch (782:5): [True: 64, False: 7.21k]
  ------------------
  783|     64|        pkey->foreign = pkey->pkey.dh != NULL
  ------------------
  |  Branch (783:25): [True: 64, False: 0]
  ------------------
  784|     64|                        && ossl_dh_is_foreign(pkey->pkey.dh);
  ------------------
  |  Branch (784:28): [True: 0, False: 64]
  ------------------
  785|     64|        break;
  786|      0|#endif
  787|      8|    default:
  ------------------
  |  Branch (787:5): [True: 8, False: 7.26k]
  ------------------
  788|      8|        pkey->foreign = 0;
  789|      8|        break;
  790|  7.27k|    }
  791|  7.27k|}
p_lib.c:evp_pkey_get0_DSA_int:
  890|      5|{
  891|      5|    if (pkey->type != EVP_PKEY_DSA) {
  ------------------
  |  |   66|      5|# define EVP_PKEY_DSA    NID_dsa
  |  |  ------------------
  |  |  |  |  136|      5|#define NID_dsa         116
  |  |  ------------------
  ------------------
  |  Branch (891:9): [True: 0, False: 5]
  ------------------
  892|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_EXPECTING_A_DSA_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  893|      0|        return NULL;
  894|      0|    }
  895|      5|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
  896|      5|}
p_lib.c:evp_pkey_get1_ECX_KEY:
  939|      4|{
  940|      4|    ECX_KEY *ret = (ECX_KEY *)evp_pkey_get0_ECX_KEY(pkey, type);
  941|       |
  942|      4|    if (ret != NULL && !ossl_ecx_key_up_ref(ret))
  ------------------
  |  Branch (942:9): [True: 4, False: 0]
  |  Branch (942:24): [True: 0, False: 4]
  ------------------
  943|      0|        ret = NULL;
  944|      4|    return ret;
  945|      4|}
p_lib.c:evp_pkey_get0_ECX_KEY:
  930|      4|{
  931|      4|    if (EVP_PKEY_get_base_id(pkey) != type) {
  ------------------
  |  Branch (931:9): [True: 0, False: 4]
  ------------------
  932|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_EXPECTING_A_ECX_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  933|      0|        return NULL;
  934|      0|    }
  935|      4|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
  936|      4|}
p_lib.c:print_pkey:
 1220|  1.78k|{
 1221|  1.78k|    int pop_f_prefix;
 1222|  1.78k|    long saved_indent;
 1223|  1.78k|    OSSL_ENCODER_CTX *ctx = NULL;
 1224|  1.78k|    int ret = -2;                /* default to unsupported */
 1225|       |
 1226|  1.78k|    if (!print_set_indent(&out, &pop_f_prefix, &saved_indent, indent))
  ------------------
  |  Branch (1226:9): [True: 0, False: 1.78k]
  ------------------
 1227|      0|        return 0;
 1228|       |
 1229|  1.78k|    ctx = OSSL_ENCODER_CTX_new_for_pkey(pkey, selection, "TEXT", NULL,
 1230|  1.78k|                                        propquery);
 1231|  1.78k|    if (OSSL_ENCODER_CTX_get_num_encoders(ctx) != 0)
  ------------------
  |  Branch (1231:9): [True: 1.40k, False: 379]
  ------------------
 1232|  1.40k|        ret = OSSL_ENCODER_to_bio(ctx, out);
 1233|  1.78k|    OSSL_ENCODER_CTX_free(ctx);
 1234|       |
 1235|  1.78k|    if (ret != -2)
  ------------------
  |  Branch (1235:9): [True: 1.40k, False: 379]
  ------------------
 1236|  1.40k|        goto end;
 1237|       |
 1238|       |    /* legacy fallback */
 1239|    379|    if (legacy_print != NULL)
  ------------------
  |  Branch (1239:9): [True: 379, False: 0]
  ------------------
 1240|    379|        ret = legacy_print(out, pkey, 0, legacy_pctx);
 1241|      0|    else
 1242|      0|        ret = unsup_alg(out, pkey, 0, "Public Key");
 1243|       |
 1244|  1.78k| end:
 1245|  1.78k|    print_reset_indent(&out, pop_f_prefix, saved_indent);
 1246|  1.78k|    return ret;
 1247|    379|}
p_lib.c:print_set_indent:
 1183|  1.78k|{
 1184|  1.78k|    *pop_f_prefix = 0;
 1185|  1.78k|    *saved_indent = 0;
 1186|  1.78k|    if (indent > 0) {
  ------------------
  |  Branch (1186:9): [True: 0, False: 1.78k]
  ------------------
 1187|      0|        long i = BIO_get_indent(*out);
  ------------------
  |  |  703|      0|# define BIO_get_indent(b) BIO_ctrl((b), BIO_CTRL_GET_INDENT, 0, NULL)
  |  |  ------------------
  |  |  |  |  177|      0|# define BIO_CTRL_GET_INDENT                    81
  |  |  ------------------
  ------------------
 1188|       |
 1189|      0|        *saved_indent =  (i < 0 ? 0 : i);
  ------------------
  |  Branch (1189:27): [True: 0, False: 0]
  ------------------
 1190|      0|        if (BIO_set_indent(*out, indent) <= 0) {
  ------------------
  |  |  702|      0|# define BIO_set_indent(b,i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL)
  |  |  ------------------
  |  |  |  |  176|      0|# define BIO_CTRL_SET_INDENT                    80
  |  |  ------------------
  ------------------
  |  Branch (1190:13): [True: 0, False: 0]
  ------------------
 1191|      0|            BIO *prefbio = BIO_new(BIO_f_prefix());
 1192|       |
 1193|      0|            if (prefbio == NULL)
  ------------------
  |  Branch (1193:17): [True: 0, False: 0]
  ------------------
 1194|      0|                return 0;
 1195|      0|            *out = BIO_push(prefbio, *out);
 1196|      0|            *pop_f_prefix = 1;
 1197|      0|        }
 1198|      0|        if (BIO_set_indent(*out, indent) <= 0) {
  ------------------
  |  |  702|      0|# define BIO_set_indent(b,i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL)
  |  |  ------------------
  |  |  |  |  176|      0|# define BIO_CTRL_SET_INDENT                    80
  |  |  ------------------
  ------------------
  |  Branch (1198:13): [True: 0, False: 0]
  ------------------
 1199|      0|            print_reset_indent(out, *pop_f_prefix, *saved_indent);
 1200|      0|            return 0;
 1201|      0|        }
 1202|      0|    }
 1203|  1.78k|    return 1;
 1204|  1.78k|}
p_lib.c:print_reset_indent:
 1170|  1.78k|{
 1171|  1.78k|    BIO_set_indent(*out, saved_indent);
  ------------------
  |  |  702|  1.78k|# define BIO_set_indent(b,i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL)
  |  |  ------------------
  |  |  |  |  176|  1.78k|# define BIO_CTRL_SET_INDENT                    80
  |  |  ------------------
  ------------------
 1172|  1.78k|    if (pop_f_prefix) {
  ------------------
  |  Branch (1172:9): [True: 0, False: 1.78k]
  ------------------
 1173|      0|        BIO *next = BIO_pop(*out);
 1174|       |
 1175|      0|        BIO_free(*out);
 1176|      0|        *out = next;
 1177|      0|    }
 1178|  1.78k|    return 1;
 1179|  1.78k|}
p_lib.c:pkey_set_type:
 1558|  77.0k|{
 1559|  77.0k|#ifndef FIPS_MODULE
 1560|  77.0k|    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
 1561|  77.0k|    ENGINE **eptr = (e == NULL) ? &e :  NULL;
  ------------------
  |  Branch (1561:21): [True: 77.0k, False: 0]
  ------------------
 1562|  77.0k|#endif
 1563|       |
 1564|       |    /*
 1565|       |     * The setups can't set both legacy and provider side methods.
 1566|       |     * It is forbidden
 1567|       |     */
 1568|  77.0k|    if (!ossl_assert(type == EVP_PKEY_NONE || keymgmt == NULL)
  ------------------
  |  |   52|   154k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 34.9k, False: 42.0k]
  |  |  |  Branch (52:43): [True: 42.0k, False: 0]
  |  |  ------------------
  |  |   53|   154k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1568:9): [True: 0, False: 77.0k]
  ------------------
 1569|  77.0k|        || !ossl_assert(e == NULL || keymgmt == NULL)) {
  ------------------
  |  |   52|  77.0k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 77.0k, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|  77.0k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1569:12): [True: 0, False: 77.0k]
  ------------------
 1570|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1571|      0|        return 0;
 1572|      0|    }
 1573|       |
 1574|  77.0k|    if (pkey != NULL) {
  ------------------
  |  Branch (1574:9): [True: 50.4k, False: 26.6k]
  ------------------
 1575|  50.4k|        int free_it = 0;
 1576|       |
 1577|  50.4k|#ifndef FIPS_MODULE
 1578|  50.4k|        free_it = free_it || pkey->pkey.ptr != NULL;
  ------------------
  |  Branch (1578:19): [True: 0, False: 50.4k]
  |  Branch (1578:30): [True: 0, False: 50.4k]
  ------------------
 1579|  50.4k|#endif
 1580|  50.4k|        free_it = free_it || pkey->keydata != NULL;
  ------------------
  |  Branch (1580:19): [True: 0, False: 50.4k]
  |  Branch (1580:30): [True: 0, False: 50.4k]
  ------------------
 1581|  50.4k|        if (free_it)
  ------------------
  |  Branch (1581:13): [True: 0, False: 50.4k]
  ------------------
 1582|      0|            evp_pkey_free_it(pkey);
 1583|  50.4k|#ifndef FIPS_MODULE
 1584|       |        /*
 1585|       |         * If key type matches and a method exists then this lookup has
 1586|       |         * succeeded once so just indicate success.
 1587|       |         */
 1588|  50.4k|        if (pkey->type != EVP_PKEY_NONE
  ------------------
  |  |   62|  50.4k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|   100k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1588:13): [True: 7.27k, False: 43.1k]
  ------------------
 1589|  50.4k|            && type == pkey->save_type
  ------------------
  |  Branch (1589:16): [True: 7.27k, False: 1]
  ------------------
 1590|  50.4k|            && pkey->ameth != NULL)
  ------------------
  |  Branch (1590:16): [True: 7.27k, False: 0]
  ------------------
 1591|  7.27k|            return 1;
 1592|  43.1k|# ifndef OPENSSL_NO_ENGINE
 1593|       |        /* If we have ENGINEs release them */
 1594|  43.1k|        ENGINE_finish(pkey->engine);
 1595|  43.1k|        pkey->engine = NULL;
 1596|  43.1k|        ENGINE_finish(pkey->pmeth_engine);
 1597|  43.1k|        pkey->pmeth_engine = NULL;
 1598|  43.1k|# endif
 1599|  43.1k|#endif
 1600|  43.1k|    }
 1601|  69.7k|#ifndef FIPS_MODULE
 1602|  69.7k|    if (str != NULL)
  ------------------
  |  Branch (1602:9): [True: 34.9k, False: 34.8k]
  ------------------
 1603|  34.9k|        ameth = EVP_PKEY_asn1_find_str(eptr, str, len);
 1604|  34.8k|    else if (type != EVP_PKEY_NONE)
  ------------------
  |  |   62|  34.8k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  34.8k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1604:14): [True: 34.8k, False: 28]
  ------------------
 1605|  34.8k|        ameth = EVP_PKEY_asn1_find(eptr, type);
 1606|  69.7k|# ifndef OPENSSL_NO_ENGINE
 1607|  69.7k|    if (pkey == NULL && eptr != NULL)
  ------------------
  |  Branch (1607:9): [True: 26.6k, False: 43.1k]
  |  Branch (1607:25): [True: 26.6k, False: 0]
  ------------------
 1608|  26.6k|        ENGINE_finish(e);
 1609|  69.7k|# endif
 1610|  69.7k|#endif
 1611|       |
 1612|       |
 1613|  69.7k|    {
 1614|  69.7k|        int check = 1;
 1615|       |
 1616|  69.7k|#ifndef FIPS_MODULE
 1617|  69.7k|        check = check && ameth == NULL;
  ------------------
  |  Branch (1617:17): [True: 69.7k, False: 0]
  |  Branch (1617:26): [True: 18.4k, False: 51.3k]
  ------------------
 1618|  69.7k|#endif
 1619|  69.7k|        check = check && keymgmt == NULL;
  ------------------
  |  Branch (1619:17): [True: 18.4k, False: 51.3k]
  |  Branch (1619:26): [True: 18.4k, False: 5]
  ------------------
 1620|  69.7k|        if (check) {
  ------------------
  |  Branch (1620:13): [True: 18.4k, False: 51.3k]
  ------------------
 1621|  18.4k|            ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  401|  18.4k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  18.4k|    (ERR_new(),                                                 \
  |  |  |  |  404|  18.4k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  18.4k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  18.4k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.4k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  18.4k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1622|  18.4k|            return 0;
 1623|  18.4k|        }
 1624|  69.7k|    }
 1625|  51.3k|    if (pkey != NULL) {
  ------------------
  |  Branch (1625:9): [True: 43.0k, False: 8.29k]
  ------------------
 1626|  43.0k|        if (keymgmt != NULL && !EVP_KEYMGMT_up_ref(keymgmt)) {
  ------------------
  |  Branch (1626:13): [True: 8.30k, False: 34.7k]
  |  Branch (1626:32): [True: 0, False: 8.30k]
  ------------------
 1627|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1628|      0|            return 0;
 1629|      0|        }
 1630|       |
 1631|  43.0k|        pkey->keymgmt = keymgmt;
 1632|       |
 1633|  43.0k|        pkey->save_type = type;
 1634|  43.0k|        pkey->type = type;
 1635|       |
 1636|  43.0k|#ifndef FIPS_MODULE
 1637|       |        /*
 1638|       |         * If the internal "origin" key is provider side, don't save |ameth|.
 1639|       |         * The main reason is that |ameth| is one factor to detect that the
 1640|       |         * internal "origin" key is a legacy one.
 1641|       |         */
 1642|  43.0k|        if (keymgmt == NULL)
  ------------------
  |  Branch (1642:13): [True: 34.7k, False: 8.30k]
  ------------------
 1643|  34.7k|            pkey->ameth = ameth;
 1644|       |
 1645|       |        /*
 1646|       |         * The EVP_PKEY_ASN1_METHOD |pkey_id| retains its legacy key purpose
 1647|       |         * for any key type that has a legacy implementation, regardless of
 1648|       |         * if the internal key is a legacy or a provider side one.  When
 1649|       |         * there is no legacy implementation for the key, the type becomes
 1650|       |         * EVP_PKEY_KEYMGMT, which indicates that one should be cautious
 1651|       |         * with functions that expect legacy internal keys.
 1652|       |         */
 1653|  43.0k|        if (ameth != NULL) {
  ------------------
  |  Branch (1653:13): [True: 43.0k, False: 5]
  ------------------
 1654|  43.0k|            if (type == EVP_PKEY_NONE)
  ------------------
  |  |   62|  43.0k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  43.0k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1654:17): [True: 8.29k, False: 34.7k]
  ------------------
 1655|  8.29k|                pkey->type = ameth->pkey_id;
 1656|  43.0k|        } else {
 1657|      5|            pkey->type = EVP_PKEY_KEYMGMT;
  ------------------
  |  |  103|      5|# define EVP_PKEY_KEYMGMT -1
  ------------------
 1658|      5|        }
 1659|  43.0k|# ifndef OPENSSL_NO_ENGINE
 1660|  43.0k|        if (eptr == NULL && e != NULL && !ENGINE_init(e)) {
  ------------------
  |  Branch (1660:13): [True: 0, False: 43.0k]
  |  Branch (1660:29): [True: 0, False: 0]
  |  Branch (1660:42): [True: 0, False: 0]
  ------------------
 1661|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1662|      0|            return 0;
 1663|      0|        }
 1664|  43.0k|# endif
 1665|  43.0k|        pkey->engine = e;
 1666|  43.0k|#endif
 1667|  43.0k|    }
 1668|  51.3k|    return 1;
 1669|  51.3k|}
p_lib.c:find_ameth:
 1673|  26.6k|{
 1674|  26.6k|    const char **str = data;
 1675|       |
 1676|       |    /*
 1677|       |     * The error messages from pkey_set_type() are uninteresting here,
 1678|       |     * and misleading.
 1679|       |     */
 1680|  26.6k|    ERR_set_mark();
 1681|       |
 1682|  26.6k|    if (pkey_set_type(NULL, NULL, EVP_PKEY_NONE, name, strlen(name),
  ------------------
  |  |   62|  26.6k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  26.6k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1682:9): [True: 8.29k, False: 18.3k]
  ------------------
 1683|  26.6k|                      NULL)) {
 1684|  8.29k|        if (str[0] == NULL)
  ------------------
  |  Branch (1684:13): [True: 8.29k, False: 0]
  ------------------
 1685|  8.29k|            str[0] = name;
 1686|      0|        else if (str[1] == NULL)
  ------------------
  |  Branch (1686:18): [True: 0, False: 0]
  ------------------
 1687|      0|            str[1] = name;
 1688|  8.29k|    }
 1689|       |
 1690|  26.6k|    ERR_pop_to_mark();
 1691|  26.6k|}
p_lib.c:evp_pkey_free_it:
 1834|  43.1k|{
 1835|       |    /* internal function; x is never NULL */
 1836|  43.1k|    evp_keymgmt_util_clear_operation_cache(x);
 1837|  43.1k|#ifndef FIPS_MODULE
 1838|  43.1k|    evp_pkey_free_legacy(x);
 1839|  43.1k|#endif
 1840|       |
 1841|  43.1k|    if (x->keymgmt != NULL) {
  ------------------
  |  Branch (1841:9): [True: 8.30k, False: 34.8k]
  ------------------
 1842|  8.30k|        evp_keymgmt_freedata(x->keymgmt, x->keydata);
 1843|  8.30k|        EVP_KEYMGMT_free(x->keymgmt);
 1844|  8.30k|        x->keymgmt = NULL;
 1845|  8.30k|        x->keydata = NULL;
 1846|  8.30k|    }
 1847|  43.1k|    x->type = EVP_PKEY_NONE;
  ------------------
  |  |   62|  43.1k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  43.1k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1848|  43.1k|}

EVP_PKEY_CTX_free:
  392|  9.64k|{
  393|  9.64k|    if (ctx == NULL)
  ------------------
  |  Branch (393:9): [True: 9.64k, False: 0]
  ------------------
  394|  9.64k|        return;
  395|      0|    if (ctx->pmeth && ctx->pmeth->cleanup)
  ------------------
  |  Branch (395:9): [True: 0, False: 0]
  |  Branch (395:23): [True: 0, False: 0]
  ------------------
  396|      0|        ctx->pmeth->cleanup(ctx);
  397|       |
  398|      0|    evp_pkey_ctx_free_old_ops(ctx);
  399|      0|#ifndef FIPS_MODULE
  400|      0|    evp_pkey_ctx_free_all_cached_data(ctx);
  401|      0|#endif
  402|      0|    EVP_KEYMGMT_free(ctx->keymgmt);
  403|       |
  404|      0|    OPENSSL_free(ctx->propquery);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  405|      0|    EVP_PKEY_free(ctx->pkey);
  406|      0|    EVP_PKEY_free(ctx->peerkey);
  407|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  408|      0|    ENGINE_finish(ctx->engine);
  409|      0|#endif
  410|      0|    BN_free(ctx->rsa_pubexp);
  411|      0|    OPENSSL_free(ctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  412|      0|}
evp_app_cleanup_int:
  633|      2|{
  634|      2|    if (app_pkey_methods != NULL)
  ------------------
  |  Branch (634:9): [True: 0, False: 2]
  ------------------
  635|      0|        sk_EVP_PKEY_METHOD_pop_free(app_pkey_methods, EVP_PKEY_meth_free);
  636|      2|}

ossl_do_ex_data_init:
   15|      4|{
   16|      4|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   17|       |
   18|      4|    if (global == NULL)
  ------------------
  |  Branch (18:9): [True: 0, False: 4]
  ------------------
   19|      0|        return 0;
   20|       |
   21|      4|    global->ex_data_lock = CRYPTO_THREAD_lock_new();
   22|      4|    return global->ex_data_lock != NULL;
   23|      4|}
ossl_crypto_cleanup_all_ex_data_int:
   73|      2|{
   74|      2|    int i;
   75|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   76|       |
   77|      2|    if (global == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 2]
  ------------------
   78|      0|        return;
   79|       |
   80|     38|    for (i = 0; i < CRYPTO_EX_INDEX__COUNT; ++i) {
  ------------------
  |  |  248|     38|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (80:17): [True: 36, False: 2]
  ------------------
   81|     36|        EX_CALLBACKS *ip = &global->ex_data[i];
   82|       |
   83|     36|        sk_EX_CALLBACK_pop_free(ip->meth, cleanup_cb);
   84|     36|        ip->meth = NULL;
   85|     36|    }
   86|       |
   87|      2|    CRYPTO_THREAD_lock_free(global->ex_data_lock);
   88|      2|    global->ex_data_lock = NULL;
   89|      2|}
ossl_crypto_free_ex_index_ex:
  114|      2|{
  115|      2|    EX_CALLBACKS *ip;
  116|      2|    EX_CALLBACK *a;
  117|      2|    int toret = 0;
  118|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  119|       |
  120|      2|    if (global == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 2]
  ------------------
  121|      0|        return 0;
  122|       |
  123|      2|    ip = get_and_lock(global, class_index, 0);
  124|      2|    if (ip == NULL)
  ------------------
  |  Branch (124:9): [True: 0, False: 2]
  ------------------
  125|      0|        return 0;
  126|       |
  127|      2|    if (idx < 0 || idx >= sk_EX_CALLBACK_num(ip->meth))
  ------------------
  |  Branch (127:9): [True: 2, False: 0]
  |  Branch (127:20): [True: 0, False: 0]
  ------------------
  128|      2|        goto err;
  129|      0|    a = sk_EX_CALLBACK_value(ip->meth, idx);
  130|      0|    if (a == NULL)
  ------------------
  |  Branch (130:9): [True: 0, False: 0]
  ------------------
  131|      0|        goto err;
  132|      0|    a->new_func = dummy_new;
  133|      0|    a->dup_func = dummy_dup;
  134|      0|    a->free_func = dummy_free;
  135|      0|    toret = 1;
  136|      2|err:
  137|      2|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  138|      2|    return toret;
  139|      0|}
CRYPTO_free_ex_index:
  142|      2|{
  143|      2|    return ossl_crypto_free_ex_index_ex(NULL, class_index, idx);
  144|      2|}
ossl_crypto_new_ex_data_ex:
  221|  2.58M|{
  222|  2.58M|    int mx, i;
  223|  2.58M|    void *ptr;
  224|  2.58M|    EX_CALLBACK **storage = NULL;
  225|  2.58M|    EX_CALLBACK *stack[10];
  226|  2.58M|    EX_CALLBACKS *ip;
  227|  2.58M|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  228|       |
  229|  2.58M|    if (global == NULL)
  ------------------
  |  Branch (229:9): [True: 0, False: 2.58M]
  ------------------
  230|      0|        return 0;
  231|       |
  232|  2.58M|    ip = get_and_lock(global, class_index, 1);
  233|  2.58M|    if (ip == NULL)
  ------------------
  |  Branch (233:9): [True: 0, False: 2.58M]
  ------------------
  234|      0|        return 0;
  235|       |
  236|  2.58M|    ad->ctx = ctx;
  237|  2.58M|    ad->sk = NULL;
  238|  2.58M|    mx = sk_EX_CALLBACK_num(ip->meth);
  239|  2.58M|    if (mx > 0) {
  ------------------
  |  Branch (239:9): [True: 0, False: 2.58M]
  ------------------
  240|      0|        if (mx < (int)OSSL_NELEM(stack))
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (240:13): [True: 0, False: 0]
  ------------------
  241|      0|            storage = stack;
  242|      0|        else
  243|      0|            storage = OPENSSL_malloc(sizeof(*storage) * mx);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  244|      0|        if (storage != NULL)
  ------------------
  |  Branch (244:13): [True: 0, False: 0]
  ------------------
  245|      0|            for (i = 0; i < mx; i++)
  ------------------
  |  Branch (245:25): [True: 0, False: 0]
  ------------------
  246|      0|                storage[i] = sk_EX_CALLBACK_value(ip->meth, i);
  247|      0|    }
  248|  2.58M|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  249|       |
  250|  2.58M|    if (mx > 0 && storage == NULL)
  ------------------
  |  Branch (250:9): [True: 0, False: 2.58M]
  |  Branch (250:19): [True: 0, False: 0]
  ------------------
  251|      0|        return 0;
  252|  2.58M|    for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (252:17): [True: 0, False: 2.58M]
  ------------------
  253|      0|        if (storage[i] != NULL && storage[i]->new_func != NULL) {
  ------------------
  |  Branch (253:13): [True: 0, False: 0]
  |  Branch (253:35): [True: 0, False: 0]
  ------------------
  254|      0|            ptr = CRYPTO_get_ex_data(ad, i);
  255|      0|            storage[i]->new_func(obj, ptr, ad, i,
  256|      0|                                 storage[i]->argl, storage[i]->argp);
  257|      0|        }
  258|      0|    }
  259|  2.58M|    if (storage != stack)
  ------------------
  |  Branch (259:9): [True: 2.58M, False: 0]
  ------------------
  260|  2.58M|        OPENSSL_free(storage);
  ------------------
  |  |  115|  2.58M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.58M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.58M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  261|  2.58M|    return 1;
  262|  2.58M|}
CRYPTO_new_ex_data:
  265|  2.53M|{
  266|  2.53M|    return ossl_crypto_new_ex_data_ex(NULL, class_index, obj, ad);
  267|  2.53M|}
CRYPTO_free_ex_data:
  368|  2.58M|{
  369|  2.58M|    int mx, i;
  370|  2.58M|    EX_CALLBACKS *ip;
  371|  2.58M|    void *ptr;
  372|  2.58M|    const EX_CALLBACK *f;
  373|  2.58M|    struct ex_callback_entry stack[10];
  374|  2.58M|    struct ex_callback_entry *storage = NULL;
  375|  2.58M|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ad->ctx);
  376|       |
  377|  2.58M|    if (global == NULL)
  ------------------
  |  Branch (377:9): [True: 0, False: 2.58M]
  ------------------
  378|      0|        goto err;
  379|       |
  380|  2.58M|    ip = get_and_lock(global, class_index, 1);
  381|  2.58M|    if (ip == NULL)
  ------------------
  |  Branch (381:9): [True: 0, False: 2.58M]
  ------------------
  382|      0|        goto err;
  383|       |
  384|  2.58M|    mx = sk_EX_CALLBACK_num(ip->meth);
  385|  2.58M|    if (mx > 0) {
  ------------------
  |  Branch (385:9): [True: 0, False: 2.58M]
  ------------------
  386|      0|        if (mx < (int)OSSL_NELEM(stack))
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (386:13): [True: 0, False: 0]
  ------------------
  387|      0|            storage = stack;
  388|      0|        else
  389|      0|            storage = OPENSSL_malloc(sizeof(*storage) * mx);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  390|      0|        if (storage != NULL)
  ------------------
  |  Branch (390:13): [True: 0, False: 0]
  ------------------
  391|      0|            for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (391:25): [True: 0, False: 0]
  ------------------
  392|      0|                storage[i].excb = sk_EX_CALLBACK_value(ip->meth, i);
  393|      0|                storage[i].index = i;
  394|      0|            }
  395|      0|    }
  396|  2.58M|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  397|       |
  398|  2.58M|    if (storage != NULL) {
  ------------------
  |  Branch (398:9): [True: 0, False: 2.58M]
  ------------------
  399|       |        /* Sort according to priority. High priority first */
  400|      0|        qsort(storage, mx, sizeof(*storage), ex_callback_compare);
  401|      0|        for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (401:21): [True: 0, False: 0]
  ------------------
  402|      0|            f = storage[i].excb;
  403|       |
  404|      0|            if (f != NULL && f->free_func != NULL) {
  ------------------
  |  Branch (404:17): [True: 0, False: 0]
  |  Branch (404:30): [True: 0, False: 0]
  ------------------
  405|      0|                ptr = CRYPTO_get_ex_data(ad, storage[i].index);
  406|      0|                f->free_func(obj, ptr, ad, storage[i].index, f->argl, f->argp);
  407|      0|            }
  408|      0|        }
  409|      0|    }
  410|       |
  411|  2.58M|    if (storage != stack)
  ------------------
  |  Branch (411:9): [True: 2.58M, False: 0]
  ------------------
  412|  2.58M|        OPENSSL_free(storage);
  ------------------
  |  |  115|  2.58M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.58M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.58M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  413|  2.58M| err:
  414|  2.58M|    sk_void_free(ad->sk);
  ------------------
  |  |  204|  2.58M|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
  415|  2.58M|    ad->sk = NULL;
  416|  2.58M|    ad->ctx = NULL;
  417|  2.58M|}
ex_data.c:get_and_lock:
   33|  5.16M|{
   34|  5.16M|    EX_CALLBACKS *ip;
   35|       |
   36|  5.16M|    if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
  ------------------
  |  |  248|  5.16M|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (36:9): [True: 0, False: 5.16M]
  |  Branch (36:28): [True: 0, False: 5.16M]
  ------------------
   37|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   38|      0|        return NULL;
   39|      0|    }
   40|       |
   41|  5.16M|    if (global->ex_data_lock == NULL) {
  ------------------
  |  Branch (41:9): [True: 0, False: 5.16M]
  ------------------
   42|       |        /*
   43|       |         * If we get here, someone (who?) cleaned up the lock, so just
   44|       |         * treat it as an error.
   45|       |         */
   46|      0|         return NULL;
   47|      0|    }
   48|       |
   49|  5.16M|    if (read) {
  ------------------
  |  Branch (49:9): [True: 5.16M, False: 2]
  ------------------
   50|  5.16M|        if (!CRYPTO_THREAD_read_lock(global->ex_data_lock))
  ------------------
  |  Branch (50:13): [True: 0, False: 5.16M]
  ------------------
   51|      0|            return NULL;
   52|  5.16M|    } else {
   53|      2|        if (!CRYPTO_THREAD_write_lock(global->ex_data_lock))
  ------------------
  |  Branch (53:13): [True: 0, False: 2]
  ------------------
   54|      0|            return NULL;
   55|      2|    }
   56|       |
   57|  5.16M|    ip = &global->ex_data[class_index];
   58|  5.16M|    return ip;
   59|  5.16M|}

ossl_ffc_numbers_to_dh_named_group:
  116|    296|{
  117|    296|    size_t i;
  118|       |
  119|  4.44k|    for (i = 0; i < OSSL_NELEM(dh_named_groups); ++i) {
  ------------------
  |  |   14|  4.44k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (119:17): [True: 4.14k, False: 296]
  ------------------
  120|       |        /* Keep searching until a matching p and g is found */
  121|  4.14k|        if (BN_cmp(p, dh_named_groups[i].p) == 0
  ------------------
  |  Branch (121:13): [True: 0, False: 4.14k]
  ------------------
  122|  4.14k|            && BN_cmp(g, dh_named_groups[i].g) == 0
  ------------------
  |  Branch (122:16): [True: 0, False: 0]
  ------------------
  123|       |            /* Verify q is correct if it exists */
  124|  4.14k|            && (q == NULL || BN_cmp(q, dh_named_groups[i].q) == 0))
  ------------------
  |  Branch (124:17): [True: 0, False: 0]
  |  Branch (124:30): [True: 0, False: 0]
  ------------------
  125|      0|            return &dh_named_groups[i];
  126|  4.14k|    }
  127|    296|    return NULL;
  128|    296|}

ossl_ffc_params_init:
   21|   153k|{
   22|   153k|    memset(params, 0, sizeof(*params));
   23|   153k|    params->pcounter = -1;
   24|   153k|    params->gindex = FFC_UNVERIFIABLE_GINDEX;
  ------------------
  |  |   23|   153k|# define FFC_UNVERIFIABLE_GINDEX -1
  ------------------
   25|   153k|    params->flags = FFC_PARAM_FLAG_VALIDATE_PQG;
  ------------------
  |  |   46|   153k|    (FFC_PARAM_FLAG_VALIDATE_PQ | FFC_PARAM_FLAG_VALIDATE_G)
  |  |  ------------------
  |  |  |  |   43|   153k|# define FFC_PARAM_FLAG_VALIDATE_PQ    0x01
  |  |  ------------------
  |  |                   (FFC_PARAM_FLAG_VALIDATE_PQ | FFC_PARAM_FLAG_VALIDATE_G)
  |  |  ------------------
  |  |  |  |   44|   153k|# define FFC_PARAM_FLAG_VALIDATE_G     0x02
  |  |  ------------------
  ------------------
   26|   153k|}
ossl_ffc_params_cleanup:
   29|  76.9k|{
   30|       |#ifdef OPENSSL_PEDANTIC_ZEROIZATION
   31|       |    BN_clear_free(params->p);
   32|       |    BN_clear_free(params->q);
   33|       |    BN_clear_free(params->g);
   34|       |    BN_clear_free(params->j);
   35|       |    OPENSSL_clear_free(params->seed, params->seedlen);
   36|       |#else
   37|  76.9k|    BN_free(params->p);
   38|  76.9k|    BN_free(params->q);
   39|  76.9k|    BN_free(params->g);
   40|  76.9k|    BN_free(params->j);
   41|  76.9k|    OPENSSL_free(params->seed);
  ------------------
  |  |  115|  76.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  76.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  76.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   42|  76.9k|#endif
   43|  76.9k|    ossl_ffc_params_init(params);
   44|  76.9k|}
ossl_ffc_params_set0_pqg:
   47|     89|{
   48|     89|    if (p != NULL && p != d->p) {
  ------------------
  |  Branch (48:9): [True: 89, False: 0]
  |  Branch (48:22): [True: 89, False: 0]
  ------------------
   49|     89|        BN_free(d->p);
   50|     89|        d->p = p;
   51|     89|    }
   52|     89|    if (q != NULL && q != d->q) {
  ------------------
  |  Branch (52:9): [True: 89, False: 0]
  |  Branch (52:22): [True: 89, False: 0]
  ------------------
   53|     89|        BN_free(d->q);
   54|     89|        d->q = q;
   55|     89|    }
   56|     89|    if (g != NULL && g != d->g) {
  ------------------
  |  Branch (56:9): [True: 89, False: 0]
  |  Branch (56:22): [True: 89, False: 0]
  ------------------
   57|     89|        BN_free(d->g);
   58|     89|        d->g = g;
   59|     89|    }
   60|     89|}
ossl_ffc_params_get0_pqg:
   64|     83|{
   65|     83|    if (p != NULL)
  ------------------
  |  Branch (65:9): [True: 83, False: 0]
  ------------------
   66|     83|        *p = d->p;
   67|     83|    if (q != NULL)
  ------------------
  |  Branch (67:9): [True: 83, False: 0]
  ------------------
   68|     83|        *q = d->q;
   69|     83|    if (g != NULL)
  ------------------
  |  Branch (69:9): [True: 83, False: 0]
  ------------------
   70|     83|        *g = d->g;
   71|     83|}
ossl_ffc_params_set0_j:
   76|     89|{
   77|     89|    BN_free(d->j);
   78|     89|    d->j = NULL;
   79|     89|    if (j != NULL)
  ------------------
  |  Branch (79:9): [True: 24, False: 65]
  ------------------
   80|     24|        d->j = j;
   81|     89|}
ossl_ffc_params_set_seed:
   85|     41|{
   86|     41|    if (params->seed != NULL) {
  ------------------
  |  Branch (86:9): [True: 0, False: 41]
  ------------------
   87|      0|        if (params->seed == seed)
  ------------------
  |  Branch (87:13): [True: 0, False: 0]
  ------------------
   88|      0|            return 1;
   89|      0|        OPENSSL_free(params->seed);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   90|      0|    }
   91|       |
   92|     41|    if (seed != NULL && seedlen > 0) {
  ------------------
  |  Branch (92:9): [True: 34, False: 7]
  |  Branch (92:25): [True: 34, False: 0]
  ------------------
   93|     34|        params->seed = OPENSSL_memdup(seed, seedlen);
  ------------------
  |  |  117|     34|        CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     34|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     34|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|     34|        if (params->seed == NULL)
  ------------------
  |  Branch (94:13): [True: 0, False: 34]
  ------------------
   95|      0|            return 0;
   96|     34|        params->seedlen = seedlen;
   97|     34|    } else {
   98|      7|        params->seed = NULL;
   99|      7|        params->seedlen = 0;
  100|      7|    }
  101|     41|    return 1;
  102|     41|}
ossl_ffc_params_set_validate_params:
  142|     41|{
  143|     41|    if (!ossl_ffc_params_set_seed(params, seed, seedlen))
  ------------------
  |  Branch (143:9): [True: 0, False: 41]
  ------------------
  144|      0|        return 0;
  145|     41|    params->pcounter = counter;
  146|     41|    return 1;
  147|     41|}
ossl_ffc_params_get_validate_params:
  152|     78|{
  153|     78|    if (seed != NULL)
  ------------------
  |  Branch (153:9): [True: 78, False: 0]
  ------------------
  154|     78|        *seed = params->seed;
  155|     78|    if (seedlen != NULL)
  ------------------
  |  Branch (155:9): [True: 78, False: 0]
  ------------------
  156|     78|        *seedlen = params->seedlen;
  157|     78|    if (pcounter != NULL)
  ------------------
  |  Branch (157:9): [True: 78, False: 0]
  ------------------
  158|     78|        *pcounter = params->pcounter;
  159|     78|}
ossl_ffc_params_todata:
  218|    602|{
  219|    602|    int test_flags;
  220|       |
  221|    602|    if (ffc->p != NULL
  ------------------
  |  Branch (221:9): [True: 602, False: 0]
  ------------------
  222|    602|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_P, ffc->p))
  ------------------
  |  |  398|    602|# define OSSL_PKEY_PARAM_FFC_P "p"
  ------------------
  |  Branch (222:12): [True: 0, False: 602]
  ------------------
  223|      0|        return 0;
  224|    602|    if (ffc->q != NULL
  ------------------
  |  Branch (224:9): [True: 538, False: 64]
  ------------------
  225|    602|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_Q, ffc->q))
  ------------------
  |  |  401|    538|# define OSSL_PKEY_PARAM_FFC_Q "q"
  ------------------
  |  Branch (225:12): [True: 0, False: 538]
  ------------------
  226|      0|        return 0;
  227|    602|    if (ffc->g != NULL
  ------------------
  |  Branch (227:9): [True: 602, False: 0]
  ------------------
  228|    602|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_G, ffc->g))
  ------------------
  |  |  395|    602|# define OSSL_PKEY_PARAM_FFC_G "g"
  ------------------
  |  Branch (228:12): [True: 0, False: 602]
  ------------------
  229|      0|        return 0;
  230|    602|    if (ffc->j != NULL
  ------------------
  |  Branch (230:9): [True: 16, False: 586]
  ------------------
  231|    602|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_COFACTOR,
  ------------------
  |  |  392|     16|# define OSSL_PKEY_PARAM_FFC_COFACTOR "j"
  ------------------
  |  Branch (231:12): [True: 0, False: 16]
  ------------------
  232|     16|                                    ffc->j))
  233|      0|        return 0;
  234|    602|    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_GINDEX,
  ------------------
  |  |  396|    602|# define OSSL_PKEY_PARAM_FFC_GINDEX "gindex"
  ------------------
  |  Branch (234:9): [True: 0, False: 602]
  ------------------
  235|    602|                                  ffc->gindex))
  236|      0|        return 0;
  237|    602|    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_PCOUNTER,
  ------------------
  |  |  400|    602|# define OSSL_PKEY_PARAM_FFC_PCOUNTER "pcounter"
  ------------------
  |  Branch (237:9): [True: 0, False: 602]
  ------------------
  238|    602|                                  ffc->pcounter))
  239|      0|        return 0;
  240|    602|    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_H, ffc->h))
  ------------------
  |  |  397|    602|# define OSSL_PKEY_PARAM_FFC_H "hindex"
  ------------------
  |  Branch (240:9): [True: 0, False: 602]
  ------------------
  241|      0|        return 0;
  242|    602|    if (ffc->seed != NULL
  ------------------
  |  Branch (242:9): [True: 0, False: 602]
  ------------------
  243|    602|        && !ossl_param_build_set_octet_string(bld, params,
  ------------------
  |  Branch (243:12): [True: 0, False: 0]
  ------------------
  244|      0|                                              OSSL_PKEY_PARAM_FFC_SEED,
  ------------------
  |  |  403|      0|# define OSSL_PKEY_PARAM_FFC_SEED "seed"
  ------------------
  245|      0|                                              ffc->seed, ffc->seedlen))
  246|      0|        return 0;
  247|    602|    if (ffc->nid != NID_undef) {
  ------------------
  |  |   18|    602|#define NID_undef                       0
  ------------------
  |  Branch (247:9): [True: 0, False: 602]
  ------------------
  248|      0|        const DH_NAMED_GROUP *group = ossl_ffc_uid_to_dh_named_group(ffc->nid);
  249|      0|        const char *name = ossl_ffc_named_group_get_name(group);
  250|       |
  251|      0|        if (name == NULL
  ------------------
  |  Branch (251:13): [True: 0, False: 0]
  ------------------
  252|      0|            || !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (252:16): [True: 0, False: 0]
  ------------------
  253|      0|                                                 OSSL_PKEY_PARAM_GROUP_NAME,
  ------------------
  |  |  412|      0|# define OSSL_PKEY_PARAM_GROUP_NAME "group"
  ------------------
  254|      0|                                                 name))
  255|      0|            return 0;
  256|      0|    }
  257|    602|    test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_PQ) != 0);
  ------------------
  |  |   43|    602|# define FFC_PARAM_FLAG_VALIDATE_PQ    0x01
  ------------------
  258|    602|    if (!ossl_param_build_set_int(bld, params,
  ------------------
  |  Branch (258:9): [True: 0, False: 602]
  ------------------
  259|    602|                                  OSSL_PKEY_PARAM_FFC_VALIDATE_PQ, test_flags))
  ------------------
  |  |  407|    602|# define OSSL_PKEY_PARAM_FFC_VALIDATE_PQ "validate-pq"
  ------------------
  260|      0|        return 0;
  261|    602|    test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_G) != 0);
  ------------------
  |  |   44|    602|# define FFC_PARAM_FLAG_VALIDATE_G     0x02
  ------------------
  262|    602|    if (!ossl_param_build_set_int(bld, params,
  ------------------
  |  Branch (262:9): [True: 0, False: 602]
  ------------------
  263|    602|                                  OSSL_PKEY_PARAM_FFC_VALIDATE_G, test_flags))
  ------------------
  |  |  405|    602|# define OSSL_PKEY_PARAM_FFC_VALIDATE_G "validate-g"
  ------------------
  264|      0|        return 0;
  265|    602|    test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_LEGACY) != 0);
  ------------------
  |  |   47|    602|#define FFC_PARAM_FLAG_VALIDATE_LEGACY 0x04
  ------------------
  266|    602|    if (!ossl_param_build_set_int(bld, params,
  ------------------
  |  Branch (266:9): [True: 0, False: 602]
  ------------------
  267|    602|                                  OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY,
  ------------------
  |  |  406|    602|# define OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY "validate-legacy"
  ------------------
  268|    602|                                  test_flags))
  269|      0|        return 0;
  270|       |
  271|    602|    if (ffc->mdname != NULL
  ------------------
  |  Branch (271:9): [True: 0, False: 602]
  ------------------
  272|    602|        && !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (272:12): [True: 0, False: 0]
  ------------------
  273|      0|                                             OSSL_PKEY_PARAM_FFC_DIGEST,
  ------------------
  |  |  393|      0|# define OSSL_PKEY_PARAM_FFC_DIGEST OSSL_PKEY_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  366|      0|# define OSSL_PKEY_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  274|      0|                                             ffc->mdname))
  275|      0|       return 0;
  276|    602|    if (ffc->mdprops != NULL
  ------------------
  |  Branch (276:9): [True: 0, False: 602]
  ------------------
  277|    602|        && !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (277:12): [True: 0, False: 0]
  ------------------
  278|      0|                                             OSSL_PKEY_PARAM_FFC_DIGEST_PROPS,
  ------------------
  |  |  394|      0|# define OSSL_PKEY_PARAM_FFC_DIGEST_PROPS OSSL_PKEY_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  432|      0|# define OSSL_PKEY_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  279|      0|                                             ffc->mdprops))
  280|      0|        return 0;
  281|    602|    return 1;
  282|    602|}
ossl_ffc_params_print:
  286|      1|{
  287|      1|    if (!ASN1_bn_print(bp, "prime P:", ffc->p, NULL, indent))
  ------------------
  |  Branch (287:9): [True: 0, False: 1]
  ------------------
  288|      0|        goto err;
  289|      1|    if (!ASN1_bn_print(bp, "generator G:", ffc->g, NULL, indent))
  ------------------
  |  Branch (289:9): [True: 0, False: 1]
  ------------------
  290|      0|        goto err;
  291|      1|    if (ffc->q != NULL
  ------------------
  |  Branch (291:9): [True: 1, False: 0]
  ------------------
  292|      1|        && !ASN1_bn_print(bp, "subgroup order Q:", ffc->q, NULL, indent))
  ------------------
  |  Branch (292:12): [True: 0, False: 1]
  ------------------
  293|      0|        goto err;
  294|      1|    if (ffc->j != NULL
  ------------------
  |  Branch (294:9): [True: 0, False: 1]
  ------------------
  295|      1|        && !ASN1_bn_print(bp, "subgroup factor:", ffc->j, NULL, indent))
  ------------------
  |  Branch (295:12): [True: 0, False: 0]
  ------------------
  296|      0|        goto err;
  297|      1|    if (ffc->seed != NULL) {
  ------------------
  |  Branch (297:9): [True: 0, False: 1]
  ------------------
  298|      0|        size_t i;
  299|       |
  300|      0|        if (!BIO_indent(bp, indent, 128)
  ------------------
  |  Branch (300:13): [True: 0, False: 0]
  ------------------
  301|      0|            || BIO_puts(bp, "seed:") <= 0)
  ------------------
  |  Branch (301:16): [True: 0, False: 0]
  ------------------
  302|      0|            goto err;
  303|      0|        for (i = 0; i < ffc->seedlen; i++) {
  ------------------
  |  Branch (303:21): [True: 0, False: 0]
  ------------------
  304|      0|            if ((i % 15) == 0) {
  ------------------
  |  Branch (304:17): [True: 0, False: 0]
  ------------------
  305|      0|                if (BIO_puts(bp, "\n") <= 0
  ------------------
  |  Branch (305:21): [True: 0, False: 0]
  ------------------
  306|      0|                    || !BIO_indent(bp, indent + 4, 128))
  ------------------
  |  Branch (306:24): [True: 0, False: 0]
  ------------------
  307|      0|                    goto err;
  308|      0|            }
  309|      0|            if (BIO_printf(bp, "%02x%s", ffc->seed[i],
  ------------------
  |  Branch (309:17): [True: 0, False: 0]
  ------------------
  310|      0|                           ((i + 1) == ffc->seedlen) ? "" : ":") <= 0)
  ------------------
  |  Branch (310:28): [True: 0, False: 0]
  ------------------
  311|      0|                goto err;
  312|      0|        }
  313|      0|        if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (313:13): [True: 0, False: 0]
  ------------------
  314|      0|            return 0;
  315|      0|    }
  316|      1|    if (ffc->pcounter != -1) {
  ------------------
  |  Branch (316:9): [True: 0, False: 1]
  ------------------
  317|      0|        if (!BIO_indent(bp, indent, 128)
  ------------------
  |  Branch (317:13): [True: 0, False: 0]
  ------------------
  318|      0|            || BIO_printf(bp, "counter: %d\n", ffc->pcounter) <= 0)
  ------------------
  |  Branch (318:16): [True: 0, False: 0]
  ------------------
  319|      0|            goto err;
  320|      0|    }
  321|      1|    return 1;
  322|      0|err:
  323|      0|    return 0;
  324|      1|}

ossl_safe_getenv:
   19|      2|{
   20|       |#if defined(_WIN32) && defined(CP_UTF8) && !defined(_WIN32_WCE)
   21|       |    if (GetEnvironmentVariableW(L"OPENSSL_WIN32_UTF8", NULL, 0) != 0) {
   22|       |        char *val = NULL;
   23|       |        int vallen = 0;
   24|       |        WCHAR *namew = NULL;
   25|       |        WCHAR *valw = NULL;
   26|       |        DWORD envlen = 0;
   27|       |        DWORD dwFlags = MB_ERR_INVALID_CHARS;
   28|       |        int rsize, fsize;
   29|       |        UINT curacp;
   30|       |
   31|       |        curacp = GetACP();
   32|       |
   33|       |        /*
   34|       |         * For the code pages listed below, dwFlags must be set to 0.
   35|       |         * Otherwise, the function fails with ERROR_INVALID_FLAGS.
   36|       |         */
   37|       |        if (curacp == 50220 || curacp == 50221 || curacp == 50222 ||
   38|       |            curacp == 50225 || curacp == 50227 || curacp == 50229 ||
   39|       |            (57002 <= curacp && curacp <=57011) || curacp == 65000 ||
   40|       |            curacp == 42)
   41|       |            dwFlags = 0;
   42|       |
   43|       |        /* query for buffer len */
   44|       |        rsize = MultiByteToWideChar(curacp, dwFlags, name, -1, NULL, 0);
   45|       |        /* if name is valid string and can be converted to wide string */
   46|       |        if (rsize > 0)
   47|       |            namew = _malloca(rsize * sizeof(WCHAR));
   48|       |
   49|       |        if (NULL != namew) {
   50|       |            /* convert name to wide string */
   51|       |            fsize = MultiByteToWideChar(curacp, dwFlags, name, -1, namew, rsize);
   52|       |            /* if conversion is ok, then determine value string size in wchars */
   53|       |            if (fsize > 0)
   54|       |                envlen = GetEnvironmentVariableW(namew, NULL, 0);
   55|       |        }
   56|       |
   57|       |        if (envlen > 0)
   58|       |            valw = _malloca(envlen * sizeof(WCHAR));
   59|       |
   60|       |        if (NULL != valw) {
   61|       |            /* if can get env value as wide string */
   62|       |            if (GetEnvironmentVariableW(namew, valw, envlen) < envlen) {
   63|       |                /* determine value string size in utf-8 */
   64|       |                vallen = WideCharToMultiByte(CP_UTF8, 0, valw, -1, NULL, 0,
   65|       |                                             NULL, NULL);
   66|       |            }
   67|       |        }
   68|       |
   69|       |        if (vallen > 0)
   70|       |            val = OPENSSL_malloc(vallen);
   71|       |
   72|       |        if (NULL != val) {
   73|       |            /* convert value string from wide to utf-8 */
   74|       |            if (WideCharToMultiByte(CP_UTF8, 0, valw, -1, val, vallen,
   75|       |                                    NULL, NULL) == 0) {
   76|       |                OPENSSL_free(val);
   77|       |                val = NULL;
   78|       |            }
   79|       |        }
   80|       |
   81|       |        if (NULL != namew)
   82|       |            _freea(namew);
   83|       |
   84|       |        if (NULL != valw)
   85|       |            _freea(valw);
   86|       |
   87|       |        return val;
   88|       |    }
   89|       |#endif
   90|       |
   91|      2|#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
   92|      2|# if __GLIBC_PREREQ(2, 17)
   93|      2|#  define SECURE_GETENV
   94|      2|    return secure_getenv(name);
   95|      2|# endif
   96|      2|#endif
   97|       |
   98|       |#ifndef SECURE_GETENV
   99|       |    if (OPENSSL_issetugid())
  100|       |        return NULL;
  101|       |    return getenv(name);
  102|       |#endif
  103|      2|}

ossl_fnv1a_hash:
   14|   212k|{
   15|   212k|    uint64_t hash = 0xcbf29ce484222325ULL;
   16|   212k|    size_t i;
   17|       |
   18|  13.7M|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (18:17): [True: 13.5M, False: 212k]
  ------------------
   19|  13.5M|        hash ^= key[i];
   20|  13.5M|        hash *= 0x00000100000001B3ULL;
   21|  13.5M|    }
   22|   212k|    return hash;
   23|   212k|}

ossl_ht_new:
  176|      4|{
  177|      4|    HT *new = OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  178|       |
  179|      4|    if (new == NULL)
  ------------------
  |  Branch (179:9): [True: 0, False: 4]
  ------------------
  180|      0|        return NULL;
  181|       |
  182|      4|    new->atomic_lock = CRYPTO_THREAD_lock_new();
  183|      4|    if (new->atomic_lock == NULL)
  ------------------
  |  Branch (183:9): [True: 0, False: 4]
  ------------------
  184|      0|        goto err;
  185|       |
  186|      4|    memcpy(&new->config, conf, sizeof(*conf));
  187|       |
  188|      4|    if (new->config.init_neighborhoods != 0) {
  ------------------
  |  Branch (188:9): [True: 4, False: 0]
  ------------------
  189|      4|        new->wpd.neighborhood_len = new->config.init_neighborhoods;
  190|       |        /* round up to the next power of 2 */
  191|      4|        new->wpd.neighborhood_len--;
  192|      4|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 1;
  193|      4|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 2;
  194|      4|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 4;
  195|      4|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 8;
  196|      4|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 16;
  197|      4|        new->wpd.neighborhood_len++;
  198|      4|    } else {
  199|      0|        new->wpd.neighborhood_len = DEFAULT_NEIGH_LEN;
  ------------------
  |  |   95|      0|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   94|      0|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  200|      0|    }
  201|       |
  202|      4|    if (new->config.ht_free_fn == NULL)
  ------------------
  |  Branch (202:9): [True: 4, False: 0]
  ------------------
  203|      4|        new->config.ht_free_fn = internal_free_nop;
  204|       |
  205|      4|    new->md = OPENSSL_zalloc(sizeof(*new->md));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  206|      4|    if (new->md == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 4]
  ------------------
  207|      0|        goto err;
  208|       |
  209|      4|    new->md->neighborhoods =
  210|      4|        alloc_new_neighborhood_list(new->wpd.neighborhood_len,
  211|      4|                                    &new->md->neighborhood_ptr_to_free);
  212|      4|    if (new->md->neighborhoods == NULL)
  ------------------
  |  Branch (212:9): [True: 0, False: 4]
  ------------------
  213|      0|        goto err;
  214|      4|    new->md->neighborhood_mask = new->wpd.neighborhood_len - 1;
  215|       |
  216|      4|    new->lock = ossl_rcu_lock_new(1, conf->ctx);
  217|      4|    if (new->lock == NULL)
  ------------------
  |  Branch (217:9): [True: 0, False: 4]
  ------------------
  218|      0|        goto err;
  219|       |
  220|      4|    if (new->config.ht_hash_fn == NULL)
  ------------------
  |  Branch (220:9): [True: 4, False: 0]
  ------------------
  221|      4|        new->config.ht_hash_fn = ossl_fnv1a_hash;
  222|       |
  223|      4|    return new;
  224|       |
  225|      0|err:
  226|      0|    CRYPTO_THREAD_lock_free(new->atomic_lock);
  227|      0|    ossl_rcu_lock_free(new->lock);
  228|      0|    if (new->md != NULL)
  ------------------
  |  Branch (228:9): [True: 0, False: 0]
  ------------------
  229|      0|        OPENSSL_free(new->md->neighborhood_ptr_to_free);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  230|      0|    OPENSSL_free(new->md);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  231|      0|    OPENSSL_free(new);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  232|      0|    return NULL;
  233|      4|}
ossl_ht_write_lock:
  246|      2|{
  247|      2|    ossl_rcu_write_lock(htable->lock);
  248|      2|    htable->wpd.need_sync = 0;
  249|      2|}
ossl_ht_write_unlock:
  252|      2|{
  253|      2|    int need_sync = htable->wpd.need_sync;
  254|       |
  255|      2|    htable->wpd.need_sync = 0;
  256|      2|    ossl_rcu_write_unlock(htable->lock);
  257|      2|    if (need_sync)
  ------------------
  |  Branch (257:9): [True: 2, False: 0]
  ------------------
  258|      2|        ossl_synchronize_rcu(htable->lock);
  259|      2|}
ossl_ht_free:
  320|      2|{
  321|      2|    if (h == NULL)
  ------------------
  |  Branch (321:9): [True: 0, False: 2]
  ------------------
  322|      0|        return;
  323|       |
  324|      2|    ossl_ht_write_lock(h);
  325|      2|    ossl_ht_flush_internal(h);
  326|      2|    ossl_ht_write_unlock(h);
  327|       |    /* Freeing the lock does a final sync for us */
  328|      2|    CRYPTO_THREAD_lock_free(h->atomic_lock);
  329|      2|    ossl_rcu_lock_free(h->lock);
  330|      2|    OPENSSL_free(h->md->neighborhood_ptr_to_free);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  331|      2|    OPENSSL_free(h->md);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  332|      2|    OPENSSL_free(h);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  333|      2|    return;
  334|      2|}
ossl_ht_insert:
  629|    385|{
  630|    385|    struct ht_internal_value_st *newval = NULL;
  631|    385|    uint64_t hash;
  632|    385|    int rc = 0;
  633|    385|    int i;
  634|       |
  635|    385|    if (data->value == NULL)
  ------------------
  |  Branch (635:9): [True: 0, False: 385]
  ------------------
  636|      0|        goto out;
  637|       |
  638|    385|    newval = alloc_new_value(h, key, data->value, data->type_id);
  639|    385|    if (newval == NULL)
  ------------------
  |  Branch (639:9): [True: 0, False: 385]
  ------------------
  640|      0|        goto out;
  641|       |
  642|       |    /*
  643|       |     * we have to take our lock here to prevent other changes
  644|       |     * to the bucket list
  645|       |     */
  646|    385|    hash = h->config.ht_hash_fn(key->keybuf, key->keysize);
  647|       |
  648|    385|    for (i = 0;
  649|    385|         (rc = ossl_ht_insert_locked(h, hash, newval, olddata)) == -1
  ------------------
  |  Branch (649:10): [True: 0, False: 385]
  ------------------
  650|    385|         && i < 4;
  ------------------
  |  Branch (650:13): [True: 0, False: 0]
  ------------------
  651|    385|         ++i)
  652|      0|        if (!grow_hashtable(h, h->wpd.neighborhood_len)) {
  ------------------
  |  Branch (652:13): [True: 0, False: 0]
  ------------------
  653|      0|            rc = -1;
  654|      0|            break;
  655|      0|        }
  656|       |
  657|    385|    if (rc <= 0)
  ------------------
  |  Branch (657:9): [True: 0, False: 385]
  ------------------
  658|      0|        free_value(newval);
  659|       |
  660|    385|out:
  661|    385|    return rc;
  662|    385|}
ossl_ht_get:
  665|   211k|{
  666|   211k|    struct ht_mutable_data_st *md;
  667|   211k|    uint64_t hash;
  668|   211k|    uint64_t neigh_idx_start;
  669|   211k|    uint64_t neigh_idx;
  670|   211k|    struct ht_internal_value_st *ival = NULL;
  671|   211k|    size_t j;
  672|   211k|    uint64_t ehash;
  673|   211k|    int lockless_reads = h->config.lockless_reads;
  674|       |
  675|   211k|    hash = h->config.ht_hash_fn(key->keybuf, key->keysize);
  676|       |
  677|   211k|    md = ossl_rcu_deref(&h->md);
  ------------------
  |  |   30|   211k|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  678|   211k|    neigh_idx = neigh_idx_start = hash & md->neighborhood_mask;
  679|   211k|    do {
  680|   211k|        PREFETCH_NEIGHBORHOOD(md->neighborhoods[neigh_idx]);
  ------------------
  |  |   83|   211k|# define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  681|   231k|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  103|   231k|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  100|   231k|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (681:21): [True: 231k, False: 0]
  ------------------
  682|   231k|            ival = ossl_rcu_deref(&md->neighborhoods[neigh_idx].entries[j].value);
  ------------------
  |  |   30|   231k|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  683|   231k|            if (ival == NULL) {
  ------------------
  |  Branch (683:17): [True: 11.2k, False: 220k]
  ------------------
  684|  11.2k|                if (lockless_reads)
  ------------------
  |  Branch (684:21): [True: 11.2k, False: 0]
  ------------------
  685|       |                    /* lockless_reads implies no deletion, we can break out */
  686|  11.2k|                    return NULL;
  687|      0|                continue;
  688|  11.2k|            }
  689|   220k|            if (!CRYPTO_atomic_load(&md->neighborhoods[neigh_idx].entries[j].hash,
  ------------------
  |  Branch (689:17): [True: 0, False: 220k]
  ------------------
  690|   220k|                                    &ehash, h->atomic_lock))
  691|      0|                return NULL;
  692|   220k|            if (compare_hash(hash, ehash) && match_key(&ival->value.key, key))
  ------------------
  |  Branch (692:17): [True: 200k, False: 19.7k]
  |  Branch (692:46): [True: 200k, False: 0]
  ------------------
  693|   200k|                return (HT_VALUE *)ival;
  694|   220k|        }
  695|      0|        if (!lockless_reads)
  ------------------
  |  Branch (695:13): [True: 0, False: 0]
  ------------------
  696|      0|            break;
  697|       |        /* Continue search in subsequent neighborhoods */
  698|      0|        neigh_idx = (neigh_idx + 1) & md->neighborhood_mask;
  699|      0|    } while (neigh_idx != neigh_idx_start);
  ------------------
  |  Branch (699:14): [True: 0, False: 0]
  ------------------
  700|       |
  701|      0|    return NULL;
  702|   211k|}
hashtable.c:internal_free_nop:
  171|    385|{
  172|    385|    return;
  173|    385|}
hashtable.c:alloc_new_neighborhood_list:
  154|      6|{
  155|      6|    struct ht_neighborhood_st *ret;
  156|       |
  157|      6|    ret = OPENSSL_aligned_alloc(sizeof(struct ht_neighborhood_st) * len,
  ------------------
  |  |  106|      6|        CRYPTO_aligned_alloc(num, alignment, freeptr, \
  |  |  107|      6|                             OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                                            OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  158|      6|                                CACHE_LINE_BYTES, freeptr);
  159|       |
  160|       |    /* fall back to regular malloc */
  161|      6|    if (ret == NULL) {
  ------------------
  |  Branch (161:9): [True: 0, False: 6]
  ------------------
  162|      0|        ret = *freeptr = OPENSSL_malloc(sizeof(struct ht_neighborhood_st) * len);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|      0|        if (ret == NULL)
  ------------------
  |  Branch (163:13): [True: 0, False: 0]
  ------------------
  164|      0|            return NULL;
  165|      0|    }
  166|      6|    memset(ret, 0, sizeof(struct ht_neighborhood_st) * len);
  167|      6|    return ret;
  168|      6|}
hashtable.c:ossl_ht_flush_internal:
  284|      2|{
  285|      2|    struct ht_mutable_data_st *newmd = NULL;
  286|      2|    struct ht_mutable_data_st *oldmd = NULL;
  287|       |
  288|      2|    newmd = OPENSSL_zalloc(sizeof(*newmd));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  289|      2|    if (newmd == NULL)
  ------------------
  |  Branch (289:9): [True: 0, False: 2]
  ------------------
  290|      0|        return 0;
  291|       |
  292|      2|    newmd->neighborhoods = alloc_new_neighborhood_list(DEFAULT_NEIGH_LEN,
  ------------------
  |  |   95|      2|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   94|      2|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  293|      2|                                                       &newmd->neighborhood_ptr_to_free);
  294|      2|    if (newmd->neighborhoods == NULL) {
  ------------------
  |  Branch (294:9): [True: 0, False: 2]
  ------------------
  295|      0|        OPENSSL_free(newmd);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  296|      0|        return 0;
  297|      0|    }
  298|       |
  299|      2|    newmd->neighborhood_mask = DEFAULT_NEIGH_LEN - 1;
  ------------------
  |  |   95|      2|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   94|      2|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  300|       |
  301|       |    /* Swap the old and new mutable data sets */
  302|      2|    oldmd = ossl_rcu_deref(&h->md);
  ------------------
  |  |   30|      2|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  303|      2|    ossl_rcu_assign_ptr(&h->md, &newmd);
  ------------------
  |  |   31|      2|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  304|       |
  305|       |    /* Set the number of entries to 0 */
  306|      2|    h->wpd.value_count = 0;
  307|      2|    h->wpd.neighborhood_len = DEFAULT_NEIGH_LEN;
  ------------------
  |  |   95|      2|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   94|      2|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  308|       |
  309|      2|    ossl_rcu_call(h->lock, free_oldmd, oldmd);
  310|      2|    h->wpd.need_sync = 1;
  311|      2|    return 1;
  312|      2|}
hashtable.c:free_oldmd:
  262|      2|{
  263|      2|    struct ht_mutable_data_st *oldmd = arg;
  264|      2|    size_t i, j;
  265|      2|    size_t neighborhood_len = (size_t)oldmd->neighborhood_mask + 1;
  266|      2|    struct ht_internal_value_st *v;
  267|       |
  268|  4.09k|    for (i = 0; i < neighborhood_len; i++) {
  ------------------
  |  Branch (268:17): [True: 4.09k, False: 2]
  ------------------
  269|  4.09k|        PREFETCH_NEIGHBORHOOD(oldmd->neighborhoods[i + 1]);
  ------------------
  |  |   83|  4.09k|# define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  270|  20.4k|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  103|  20.4k|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  100|  20.4k|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (270:21): [True: 16.3k, False: 4.09k]
  ------------------
  271|  16.3k|            if (oldmd->neighborhoods[i].entries[j].value != NULL) {
  ------------------
  |  Branch (271:17): [True: 385, False: 15.9k]
  ------------------
  272|    385|                v = oldmd->neighborhoods[i].entries[j].value;
  273|    385|                v->ht->config.ht_free_fn((HT_VALUE *)v);
  274|    385|                free_value(v);
  275|    385|            }
  276|  16.3k|        }
  277|  4.09k|    }
  278|       |
  279|      2|    OPENSSL_free(oldmd->neighborhood_ptr_to_free);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  280|      2|    OPENSSL_free(oldmd);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  281|      2|}
hashtable.c:alloc_new_value:
  597|    385|{
  598|    385|    struct ht_internal_value_st *tmp;
  599|    385|    size_t nvsize = sizeof(*tmp);
  600|       |
  601|    385|    if (h->config.collision_check == 1)
  ------------------
  |  Branch (601:9): [True: 385, False: 0]
  ------------------
  602|    385|        nvsize += key->keysize;
  603|       |
  604|    385|    tmp = OPENSSL_malloc(nvsize);
  ------------------
  |  |  102|    385|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    385|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    385|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  605|       |
  606|    385|    if (tmp == NULL)
  ------------------
  |  Branch (606:9): [True: 0, False: 385]
  ------------------
  607|      0|        return NULL;
  608|       |
  609|    385|    tmp->ht = h;
  610|    385|    tmp->value.value = data;
  611|    385|    tmp->value.type_id = type;
  612|    385|    tmp->value.key.keybuf = NULL;
  613|    385|    if (h->config.collision_check) {
  ------------------
  |  Branch (613:9): [True: 385, False: 0]
  ------------------
  614|    385|        tmp->value.key.keybuf = (uint8_t *)(tmp + 1);
  615|    385|        tmp->value.key.keysize = key->keysize;
  616|    385|        memcpy(tmp->value.key.keybuf, key->keybuf, key->keysize);
  617|    385|    }
  618|       |
  619|       |
  620|    385|    return tmp;
  621|    385|}
hashtable.c:ossl_ht_insert_locked:
  532|    385|{
  533|    385|    struct ht_mutable_data_st *md = h->md;
  534|    385|    uint64_t neigh_idx_start = hash & md->neighborhood_mask;
  535|    385|    uint64_t neigh_idx = neigh_idx_start;
  536|    385|    size_t j;
  537|    385|    uint64_t ihash;
  538|    385|    HT_VALUE *ival;
  539|    385|    size_t empty_idx = SIZE_MAX;
  540|    385|    int lockless_reads = h->config.lockless_reads;
  541|       |
  542|    385|    do {
  543|    385|        PREFETCH_NEIGHBORHOOD(md->neighborhoods[neigh_idx]);
  ------------------
  |  |   83|    385|# define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  544|       |
  545|    416|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  103|    416|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  100|    416|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (545:21): [True: 416, False: 0]
  ------------------
  546|    416|            ival = ossl_rcu_deref(&md->neighborhoods[neigh_idx].entries[j].value);
  ------------------
  |  |   30|    416|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  547|    416|            if (ival == NULL) {
  ------------------
  |  Branch (547:17): [True: 385, False: 31]
  ------------------
  548|    385|                empty_idx = j;
  549|       |                /* lockless_reads implies no deletion, we can break out */
  550|    385|                if (lockless_reads)
  ------------------
  |  Branch (550:21): [True: 385, False: 0]
  ------------------
  551|    385|                    goto not_found;
  552|      0|                continue;
  553|    385|            }
  554|     31|            if (!CRYPTO_atomic_load(&md->neighborhoods[neigh_idx].entries[j].hash,
  ------------------
  |  Branch (554:17): [True: 0, False: 31]
  ------------------
  555|     31|                                    &ihash, h->atomic_lock))
  556|      0|                return 0;
  557|     31|            if (compare_hash(hash, ihash) && match_key(&newval->value.key,
  ------------------
  |  Branch (557:17): [True: 0, False: 31]
  |  Branch (557:46): [True: 0, False: 0]
  ------------------
  558|      0|                                                       &ival->key)) {
  559|      0|                if (olddata == NULL) {
  ------------------
  |  Branch (559:21): [True: 0, False: 0]
  ------------------
  560|       |                    /* This would insert a duplicate -> fail */
  561|      0|                    return 0;
  562|      0|                }
  563|       |                /* Do a replacement */
  564|      0|                if (!CRYPTO_atomic_store(&md->neighborhoods[neigh_idx].entries[j].hash,
  ------------------
  |  Branch (564:21): [True: 0, False: 0]
  ------------------
  565|      0|                                         hash, h->atomic_lock))
  566|      0|                    return 0;
  567|      0|                *olddata = (HT_VALUE *)md->neighborhoods[neigh_idx].entries[j].value;
  568|      0|                ossl_rcu_assign_ptr(&md->neighborhoods[neigh_idx].entries[j].value,
  ------------------
  |  |   31|      0|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  569|      0|                                    &newval);
  570|      0|                ossl_rcu_call(h->lock, free_old_ht_value, *olddata);
  571|      0|                h->wpd.need_sync = 1;
  572|      0|                return 1;
  573|      0|            }
  574|     31|        }
  575|      0|        if (!lockless_reads)
  ------------------
  |  Branch (575:13): [True: 0, False: 0]
  ------------------
  576|      0|            break;
  577|       |        /* Continue search in subsequent neighborhoods */
  578|      0|        neigh_idx = (neigh_idx + 1) & md->neighborhood_mask;
  579|      0|    } while (neigh_idx != neigh_idx_start);
  ------------------
  |  Branch (579:14): [True: 0, False: 0]
  ------------------
  580|       |
  581|    385| not_found:
  582|       |    /* If we get to here, its just an insert */
  583|    385|    if (empty_idx == SIZE_MAX)
  ------------------
  |  Branch (583:9): [True: 0, False: 385]
  ------------------
  584|      0|        return -1; /* out of space */
  585|    385|    if (!CRYPTO_atomic_store(&md->neighborhoods[neigh_idx].entries[empty_idx].hash,
  ------------------
  |  Branch (585:9): [True: 0, False: 385]
  ------------------
  586|    385|                             hash, h->atomic_lock))
  587|      0|        return 0;
  588|    385|    h->wpd.value_count++;
  589|    385|    ossl_rcu_assign_ptr(&md->neighborhoods[neigh_idx].entries[empty_idx].value,
  ------------------
  |  |   31|    385|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  590|    385|                        &newval);
  591|    385|    return 1;
  592|    385|}
hashtable.c:free_value:
  624|    385|{
  625|    385|    OPENSSL_free(v);
  ------------------
  |  |  115|    385|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    385|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    385|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  626|    385|}
hashtable.c:compare_hash:
  405|   220k|{
  406|   220k|    return (hash1 == hash2);
  407|   220k|}
hashtable.c:match_key:
  516|   200k|{
  517|       |    /*
  518|       |     * keys match if they are both present, the same size
  519|       |     * and compare equal in memory
  520|       |     */
  521|   200k|    PREFETCH(a->keybuf);
  ------------------
  |  |   84|   200k|# define PREFETCH(x) __builtin_prefetch(x)
  ------------------
  522|   200k|    PREFETCH(b->keybuf);
  ------------------
  |  |   84|   200k|# define PREFETCH(x) __builtin_prefetch(x)
  ------------------
  523|   200k|    if (a->keybuf != NULL && b->keybuf != NULL && a->keysize == b->keysize)
  ------------------
  |  Branch (523:9): [True: 200k, False: 0]
  |  Branch (523:30): [True: 200k, False: 0]
  |  Branch (523:51): [True: 200k, False: 0]
  ------------------
  524|   200k|        return !memcmp(a->keybuf, b->keybuf, a->keysize);
  525|       |
  526|      0|    return 1;
  527|   200k|}

ossl_err_load_HTTP_strings:
   80|      2|{
   81|      2|# ifndef OPENSSL_NO_ERR
   82|      2|    if (ERR_reason_error_string(HTTP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (82:9): [True: 2, False: 0]
  ------------------
   83|      2|        ERR_load_strings_const(HTTP_str_reasons);
   84|      2|# endif
   85|      2|    return 1;
   86|      2|}

ossl_indicator_set_callback_new:
   22|      4|{
   23|      4|    INDICATOR_CB *cb;
   24|       |
   25|      4|    cb = OPENSSL_zalloc(sizeof(*cb));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|      4|    return cb;
   27|      4|}
ossl_indicator_set_callback_free:
   30|      2|{
   31|      2|    OPENSSL_free(cb);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   32|      2|}

OPENSSL_cleanup:
  378|      2|{
  379|      2|    OPENSSL_INIT_STOP *currhandler, *lasthandler;
  380|       |
  381|       |    /*
  382|       |     * At some point we should consider looking at this function with a view to
  383|       |     * moving most/all of this into onfree handlers in OSSL_LIB_CTX.
  384|       |     */
  385|       |
  386|       |    /* If we've not been inited then no need to deinit */
  387|      2|    if (!base_inited)
  ------------------
  |  Branch (387:9): [True: 0, False: 2]
  ------------------
  388|      0|        return;
  389|       |
  390|       |    /* Might be explicitly called and also by atexit */
  391|      2|    if (stopped)
  ------------------
  |  Branch (391:9): [True: 0, False: 2]
  ------------------
  392|      0|        return;
  393|      2|    stopped = 1;
  394|       |
  395|       |    /*
  396|       |     * Thread stop may not get automatically called by the thread library for
  397|       |     * the very last thread in some situations, so call it directly.
  398|       |     */
  399|      2|    OPENSSL_thread_stop();
  400|       |
  401|      2|    currhandler = stop_handlers;
  402|      2|    while (currhandler != NULL) {
  ------------------
  |  Branch (402:12): [True: 0, False: 2]
  ------------------
  403|      0|        currhandler->handler();
  404|      0|        lasthandler = currhandler;
  405|      0|        currhandler = currhandler->next;
  406|      0|        OPENSSL_free(lasthandler);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  407|      0|    }
  408|      2|    stop_handlers = NULL;
  409|       |
  410|      2|    CRYPTO_THREAD_lock_free(optsdone_lock);
  411|      2|    optsdone_lock = NULL;
  412|      2|    CRYPTO_THREAD_lock_free(init_lock);
  413|      2|    init_lock = NULL;
  414|       |
  415|      2|    CRYPTO_THREAD_cleanup_local(&in_init_config_local);
  416|       |
  417|       |    /*
  418|       |     * We assume we are single-threaded for this function, i.e. no race
  419|       |     * conditions for the various "*_inited" vars below.
  420|       |     */
  421|       |
  422|      2|#ifndef OPENSSL_NO_COMP
  423|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_zlib_cleanup()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  424|      2|    ossl_comp_zlib_cleanup();
  425|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_brotli_cleanup()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  426|      2|    ossl_comp_brotli_cleanup();
  427|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_zstd_cleanup()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  428|      2|    ossl_comp_zstd_cleanup();
  429|      2|#endif
  430|       |
  431|      2|    if (async_inited) {
  ------------------
  |  Branch (431:9): [True: 0, False: 2]
  ------------------
  432|      0|        OSSL_TRACE(INIT, "OPENSSL_cleanup: async_deinit()\n");
  ------------------
  |  |  288|      0|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  433|      0|        async_deinit();
  434|      0|    }
  435|       |
  436|       |    /*
  437|       |     * Note that cleanup order is important:
  438|       |     * - ossl_rand_cleanup_int could call an ENGINE's RAND cleanup function so
  439|       |     * must be called before engine_cleanup_int()
  440|       |     * - ENGINEs use CRYPTO_EX_DATA and therefore, must be cleaned up
  441|       |     * before the ex data handlers are wiped during default ossl_lib_ctx deinit.
  442|       |     * - ossl_config_modules_free() can end up in ENGINE code so must be called
  443|       |     * before engine_cleanup_int()
  444|       |     * - ENGINEs and additional EVP algorithms might use added OIDs names so
  445|       |     * ossl_obj_cleanup_int() must be called last
  446|       |     */
  447|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_rand_cleanup_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  448|      2|    ossl_rand_cleanup_int();
  449|       |
  450|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_config_modules_free()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  451|      2|    ossl_config_modules_free();
  452|       |
  453|      2|#ifndef OPENSSL_NO_ENGINE
  454|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: engine_cleanup_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  455|      2|    engine_cleanup_int();
  456|      2|#endif
  457|       |
  458|      2|#ifndef OPENSSL_NO_DEPRECATED_3_0
  459|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_store_cleanup_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  460|      2|    ossl_store_cleanup_int();
  461|      2|#endif
  462|       |
  463|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_lib_ctx_default_deinit()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  464|      2|    ossl_lib_ctx_default_deinit();
  465|       |
  466|      2|    ossl_cleanup_thread();
  467|       |
  468|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: bio_cleanup()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  469|      2|    bio_cleanup();
  470|       |
  471|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: evp_cleanup_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  472|      2|    evp_cleanup_int();
  473|       |
  474|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_obj_cleanup_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  475|      2|    ossl_obj_cleanup_int();
  476|       |
  477|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: err_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  478|      2|    err_cleanup();
  479|       |
  480|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: CRYPTO_secure_malloc_done()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  481|      2|    CRYPTO_secure_malloc_done();
  482|       |
  483|      2|#ifndef OPENSSL_NO_CMP
  484|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: OSSL_CMP_log_close()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  485|      2|    OSSL_CMP_log_close();
  486|      2|#endif
  487|       |
  488|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_trace_cleanup()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  489|      2|    ossl_trace_cleanup();
  490|       |
  491|      2|    base_inited = 0;
  492|      2|}
OPENSSL_init_crypto:
  500|  82.5M|{
  501|  82.5M|    uint64_t tmp;
  502|  82.5M|    int aloaddone = 0;
  503|       |
  504|       |   /* Applications depend on 0 being returned when cleanup was already done */
  505|  82.5M|    if (stopped) {
  ------------------
  |  Branch (505:9): [True: 0, False: 82.5M]
  ------------------
  506|      0|        if (!(opts & OPENSSL_INIT_BASE_ONLY))
  ------------------
  |  |   31|      0|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (506:13): [True: 0, False: 0]
  ------------------
  507|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  508|      0|        return 0;
  509|      0|    }
  510|       |
  511|       |    /*
  512|       |     * We ignore failures from this function. It is probably because we are
  513|       |     * on a platform that doesn't support lockless atomic loads (we may not
  514|       |     * have created optsdone_lock yet so we can't use it). This is just an
  515|       |     * optimisation to skip the full checks in this function if we don't need
  516|       |     * to, so we carry on regardless in the event of failure.
  517|       |     *
  518|       |     * There could be a race here with other threads, so that optsdone has not
  519|       |     * been updated yet, even though the options have in fact been initialised.
  520|       |     * This doesn't matter - it just means we will run the full function
  521|       |     * unnecessarily - but all the critical code is contained in RUN_ONCE
  522|       |     * functions anyway so we are safe.
  523|       |     */
  524|  82.5M|    if (CRYPTO_atomic_load(&optsdone, &tmp, NULL)) {
  ------------------
  |  Branch (524:9): [True: 82.5M, False: 0]
  ------------------
  525|  82.5M|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (525:13): [True: 930k, False: 81.6M]
  ------------------
  526|   930k|            return 1;
  527|  81.6M|        aloaddone = 1;
  528|  81.6M|    }
  529|       |
  530|       |    /*
  531|       |     * At some point we should look at this function with a view to moving
  532|       |     * most/all of this into OSSL_LIB_CTX.
  533|       |     *
  534|       |     * When the caller specifies OPENSSL_INIT_BASE_ONLY, that should be the
  535|       |     * *only* option specified.  With that option we return immediately after
  536|       |     * doing the requested limited initialization.  Note that
  537|       |     * err_shelve_state() called by us via ossl_init_load_crypto_nodelete()
  538|       |     * re-enters OPENSSL_init_crypto() with OPENSSL_INIT_BASE_ONLY, but with
  539|       |     * base already initialized this is a harmless NOOP.
  540|       |     *
  541|       |     * If we remain the only caller of err_shelve_state() the recursion should
  542|       |     * perhaps be removed, but if in doubt, it can be left in place.
  543|       |     */
  544|  81.6M|    if (!RUN_ONCE(&base, ossl_init_base))
  ------------------
  |  |  130|  81.6M|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 81.6M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (544:9): [True: 0, False: 81.6M]
  ------------------
  545|      0|        return 0;
  546|       |
  547|  81.6M|    if (opts & OPENSSL_INIT_BASE_ONLY)
  ------------------
  |  |   31|  81.6M|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (547:9): [True: 81.6M, False: 6]
  ------------------
  548|  81.6M|        return 1;
  549|       |
  550|       |    /*
  551|       |     * optsdone_lock should definitely be set up now, so we can now repeat the
  552|       |     * same check from above but be sure that it will work even on platforms
  553|       |     * without lockless CRYPTO_atomic_load
  554|       |     */
  555|      6|    if (!aloaddone) {
  ------------------
  |  Branch (555:9): [True: 0, False: 6]
  ------------------
  556|      0|        if (!CRYPTO_atomic_load(&optsdone, &tmp, optsdone_lock))
  ------------------
  |  Branch (556:13): [True: 0, False: 0]
  ------------------
  557|      0|            return 0;
  558|      0|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (558:13): [True: 0, False: 0]
  ------------------
  559|      0|            return 1;
  560|      0|    }
  561|       |
  562|       |    /*
  563|       |     * Now we don't always set up exit handlers, the INIT_BASE_ONLY calls
  564|       |     * should not have the side-effect of setting up exit handlers, and
  565|       |     * therefore, this code block is below the INIT_BASE_ONLY-conditioned early
  566|       |     * return above.
  567|       |     */
  568|      6|    if ((opts & OPENSSL_INIT_NO_ATEXIT) != 0) {
  ------------------
  |  |  485|      6|# define OPENSSL_INIT_NO_ATEXIT              0x00080000L
  ------------------
  |  Branch (568:9): [True: 0, False: 6]
  ------------------
  569|      0|        if (!RUN_ONCE_ALT(&register_atexit, ossl_init_no_register_atexit,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (569:13): [True: 0, False: 0]
  ------------------
  570|      0|                          ossl_init_register_atexit))
  571|      0|            return 0;
  572|      6|    } else if (!RUN_ONCE(&register_atexit, ossl_init_register_atexit)) {
  ------------------
  |  |  130|      6|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 6, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (572:16): [True: 0, False: 6]
  ------------------
  573|      0|        return 0;
  574|      0|    }
  575|       |
  576|      6|    if (!RUN_ONCE(&load_crypto_nodelete, ossl_init_load_crypto_nodelete))
  ------------------
  |  |  130|      6|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 6, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (576:9): [True: 0, False: 6]
  ------------------
  577|      0|        return 0;
  578|       |
  579|      6|    if ((opts & OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  466|      6|# define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L
  ------------------
  |  Branch (579:9): [True: 0, False: 6]
  ------------------
  580|      6|            && !RUN_ONCE_ALT(&load_crypto_strings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (580:16): [True: 0, False: 0]
  ------------------
  581|      6|                             ossl_init_no_load_crypto_strings,
  582|      6|                             ossl_init_load_crypto_strings))
  583|      0|        return 0;
  584|       |
  585|      6|    if ((opts & OPENSSL_INIT_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  467|      6|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  |  Branch (585:9): [True: 2, False: 4]
  ------------------
  586|      6|            && !RUN_ONCE(&load_crypto_strings, ossl_init_load_crypto_strings))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (586:16): [True: 0, False: 2]
  ------------------
  587|      0|        return 0;
  588|       |
  589|      6|    if ((opts & OPENSSL_INIT_NO_LOAD_SSL_STRINGS)
  ------------------
  |  | 2806|      6|# define OPENSSL_INIT_NO_LOAD_SSL_STRINGS    0x00100000L
  ------------------
  |  Branch (589:9): [True: 0, False: 6]
  ------------------
  590|      6|        && !RUN_ONCE_ALT(&ssl_strings, ossl_init_no_load_ssl_strings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (590:12): [True: 0, False: 0]
  ------------------
  591|      6|                         ossl_init_load_ssl_strings))
  592|      0|        return 0;
  593|       |
  594|      6|    if ((opts & OPENSSL_INIT_LOAD_SSL_STRINGS)
  ------------------
  |  | 2807|      6|# define OPENSSL_INIT_LOAD_SSL_STRINGS       0x00200000L
  ------------------
  |  Branch (594:9): [True: 2, False: 4]
  ------------------
  595|      6|        && !RUN_ONCE(&ssl_strings, ossl_init_load_ssl_strings))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (595:12): [True: 0, False: 2]
  ------------------
  596|      0|        return 0;
  597|       |
  598|      6|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_CIPHERS)
  ------------------
  |  |  470|      6|# define OPENSSL_INIT_NO_ADD_ALL_CIPHERS     0x00000010L
  ------------------
  |  Branch (598:9): [True: 0, False: 6]
  ------------------
  599|      6|            && !RUN_ONCE_ALT(&add_all_ciphers, ossl_init_no_add_all_ciphers,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (599:16): [True: 0, False: 0]
  ------------------
  600|      6|                             ossl_init_add_all_ciphers))
  601|      0|        return 0;
  602|       |
  603|      6|    if ((opts & OPENSSL_INIT_ADD_ALL_CIPHERS)
  ------------------
  |  |  468|      6|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
  |  Branch (603:9): [True: 2, False: 4]
  ------------------
  604|      6|            && !RUN_ONCE(&add_all_ciphers, ossl_init_add_all_ciphers))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (604:16): [True: 0, False: 2]
  ------------------
  605|      0|        return 0;
  606|       |
  607|      6|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_DIGESTS)
  ------------------
  |  |  471|      6|# define OPENSSL_INIT_NO_ADD_ALL_DIGESTS     0x00000020L
  ------------------
  |  Branch (607:9): [True: 0, False: 6]
  ------------------
  608|      6|            && !RUN_ONCE_ALT(&add_all_digests, ossl_init_no_add_all_digests,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (608:16): [True: 0, False: 0]
  ------------------
  609|      6|                             ossl_init_add_all_digests))
  610|      0|        return 0;
  611|       |
  612|      6|    if ((opts & OPENSSL_INIT_ADD_ALL_DIGESTS)
  ------------------
  |  |  469|      6|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
  |  Branch (612:9): [True: 2, False: 4]
  ------------------
  613|      6|            && !RUN_ONCE(&add_all_digests, ossl_init_add_all_digests))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (613:16): [True: 0, False: 2]
  ------------------
  614|      0|        return 0;
  615|       |
  616|      6|    if ((opts & OPENSSL_INIT_ATFORK)
  ------------------
  |  |  483|      6|# define OPENSSL_INIT_ATFORK                 0x00020000L
  ------------------
  |  Branch (616:9): [True: 0, False: 6]
  ------------------
  617|      6|            && !openssl_init_fork_handlers())
  ------------------
  |  Branch (617:16): [True: 0, False: 0]
  ------------------
  618|      0|        return 0;
  619|       |
  620|      6|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG)
  ------------------
  |  |  473|      6|# define OPENSSL_INIT_NO_LOAD_CONFIG         0x00000080L
  ------------------
  |  Branch (620:9): [True: 0, False: 6]
  ------------------
  621|      6|            && !RUN_ONCE_ALT(&config, ossl_init_no_config, ossl_init_config))
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (621:16): [True: 0, False: 0]
  ------------------
  622|      0|        return 0;
  623|       |
  624|      6|    if (opts & OPENSSL_INIT_LOAD_CONFIG) {
  ------------------
  |  |  472|      6|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (624:9): [True: 4, False: 2]
  ------------------
  625|      4|        int loading = CRYPTO_THREAD_get_local(&in_init_config_local) != NULL;
  626|       |
  627|       |        /* If called recursively from OBJ_ calls, just skip it. */
  628|      4|        if (!loading) {
  ------------------
  |  Branch (628:13): [True: 2, False: 2]
  ------------------
  629|      2|            int ret;
  630|       |
  631|      2|            if (!CRYPTO_THREAD_set_local(&in_init_config_local, (void *)-1))
  ------------------
  |  Branch (631:17): [True: 0, False: 2]
  ------------------
  632|      0|                return 0;
  633|      2|            if (settings == NULL) {
  ------------------
  |  Branch (633:17): [True: 2, False: 0]
  ------------------
  634|      2|                ret = RUN_ONCE(&config, ossl_init_config);
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  635|      2|            } else {
  636|      0|                if (!CRYPTO_THREAD_write_lock(init_lock))
  ------------------
  |  Branch (636:21): [True: 0, False: 0]
  ------------------
  637|      0|                    return 0;
  638|      0|                conf_settings = settings;
  639|      0|                ret = RUN_ONCE_ALT(&config, ossl_init_config_settings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  640|      0|                                   ossl_init_config);
  641|      0|                conf_settings = NULL;
  642|      0|                CRYPTO_THREAD_unlock(init_lock);
  643|      0|            }
  644|       |
  645|      2|            if (ret <= 0)
  ------------------
  |  Branch (645:17): [True: 0, False: 2]
  ------------------
  646|      0|                return 0;
  647|      2|        }
  648|      4|    }
  649|       |
  650|      6|    if ((opts & OPENSSL_INIT_ASYNC)
  ------------------
  |  |  474|      6|# define OPENSSL_INIT_ASYNC                  0x00000100L
  ------------------
  |  Branch (650:9): [True: 0, False: 6]
  ------------------
  651|      6|            && !RUN_ONCE(&async, ossl_init_async))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (651:16): [True: 0, False: 0]
  ------------------
  652|      0|        return 0;
  653|       |
  654|      6|#ifndef OPENSSL_NO_ENGINE
  655|      6|    if ((opts & OPENSSL_INIT_ENGINE_OPENSSL)
  ------------------
  |  |  477|      6|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  |  Branch (655:9): [True: 0, False: 6]
  ------------------
  656|      6|            && !RUN_ONCE(&engine_openssl, ossl_init_engine_openssl))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (656:16): [True: 0, False: 0]
  ------------------
  657|      0|        return 0;
  658|      6|# ifndef OPENSSL_NO_RDRAND
  659|      6|    if ((opts & OPENSSL_INIT_ENGINE_RDRAND)
  ------------------
  |  |  475|      6|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  ------------------
  |  Branch (659:9): [True: 0, False: 6]
  ------------------
  660|      6|            && !RUN_ONCE(&engine_rdrand, ossl_init_engine_rdrand))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (660:16): [True: 0, False: 0]
  ------------------
  661|      0|        return 0;
  662|      6|# endif
  663|      6|    if ((opts & OPENSSL_INIT_ENGINE_DYNAMIC)
  ------------------
  |  |  476|      6|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  ------------------
  |  Branch (663:9): [True: 0, False: 6]
  ------------------
  664|      6|            && !RUN_ONCE(&engine_dynamic, ossl_init_engine_dynamic))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (664:16): [True: 0, False: 0]
  ------------------
  665|      0|        return 0;
  666|      6|# ifndef OPENSSL_NO_STATIC_ENGINE
  667|       |#  ifndef OPENSSL_NO_DEVCRYPTOENG
  668|       |    if ((opts & OPENSSL_INIT_ENGINE_CRYPTODEV)
  669|       |            && !RUN_ONCE(&engine_devcrypto, ossl_init_engine_devcrypto))
  670|       |        return 0;
  671|       |#  endif
  672|      6|#  if !defined(OPENSSL_NO_PADLOCKENG)
  673|      6|    if ((opts & OPENSSL_INIT_ENGINE_PADLOCK)
  ------------------
  |  |  480|      6|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  ------------------
  |  Branch (673:9): [True: 0, False: 6]
  ------------------
  674|      6|            && !RUN_ONCE(&engine_padlock, ossl_init_engine_padlock))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (674:16): [True: 0, False: 0]
  ------------------
  675|      0|        return 0;
  676|      6|#  endif
  677|       |#  if defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_NO_CAPIENG)
  678|       |    if ((opts & OPENSSL_INIT_ENGINE_CAPI)
  679|       |            && !RUN_ONCE(&engine_capi, ossl_init_engine_capi))
  680|       |        return 0;
  681|       |#  endif
  682|      6|#  if !defined(OPENSSL_NO_AFALGENG)
  683|      6|    if ((opts & OPENSSL_INIT_ENGINE_AFALG)
  ------------------
  |  |  481|      6|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  |  Branch (683:9): [True: 0, False: 6]
  ------------------
  684|      6|            && !RUN_ONCE(&engine_afalg, ossl_init_engine_afalg))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (684:16): [True: 0, False: 0]
  ------------------
  685|      0|        return 0;
  686|      6|#  endif
  687|      6|# endif
  688|      6|    if (opts & (OPENSSL_INIT_ENGINE_ALL_BUILTIN
  ------------------
  |  |  497|      6|    (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  475|      6|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  |  |  ------------------
  |  |                   (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  476|      6|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  |  |  ------------------
  |  |  498|      6|    | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  478|      6|# define OPENSSL_INIT_ENGINE_CRYPTODEV       0x00001000L
  |  |  ------------------
  |  |                   | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  479|      6|# define OPENSSL_INIT_ENGINE_CAPI            0x00002000L
  |  |  ------------------
  |  |  499|      6|    OPENSSL_INIT_ENGINE_PADLOCK)
  |  |  ------------------
  |  |  |  |  480|      6|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  |  |  ------------------
  ------------------
  |  Branch (688:9): [True: 0, False: 6]
  ------------------
  689|      6|                | OPENSSL_INIT_ENGINE_OPENSSL
  ------------------
  |  |  477|      6|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  690|      6|                | OPENSSL_INIT_ENGINE_AFALG)) {
  ------------------
  |  |  481|      6|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  691|      0|        ENGINE_register_all_complete();
  692|      0|    }
  693|      6|#endif
  694|       |
  695|      6|    if (!CRYPTO_atomic_or(&optsdone, opts, &tmp, optsdone_lock))
  ------------------
  |  Branch (695:9): [True: 0, False: 6]
  ------------------
  696|      0|        return 0;
  697|       |
  698|      6|    return 1;
  699|      6|}
init.c:ossl_init_base:
   58|      2|{
   59|       |    /* no need to init trace */
   60|       |
   61|      2|    OSSL_TRACE(INIT, "ossl_init_base: setting up stop handlers\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   62|       |#ifndef OPENSSL_NO_CRYPTO_MDEBUG
   63|       |    ossl_malloc_setup_failures();
   64|       |#endif
   65|       |
   66|      2|    if ((optsdone_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (66:9): [True: 0, False: 2]
  ------------------
   67|      2|        || (init_lock = CRYPTO_THREAD_lock_new()) == NULL)
  ------------------
  |  Branch (67:12): [True: 0, False: 2]
  ------------------
   68|      0|        goto err;
   69|       |
   70|      2|    OPENSSL_cpuid_setup();
   71|       |
   72|      2|    if (!ossl_init_thread())
  ------------------
  |  Branch (72:9): [True: 0, False: 2]
  ------------------
   73|      0|        goto err;
   74|       |
   75|      2|    if (!CRYPTO_THREAD_init_local(&in_init_config_local, NULL))
  ------------------
  |  Branch (75:9): [True: 0, False: 2]
  ------------------
   76|      0|        goto err;
   77|       |
   78|      2|    base_inited = 1;
   79|      2|    return 1;
   80|       |
   81|      0|err:
   82|      0|    OSSL_TRACE(INIT, "ossl_init_base failed!\n");
  ------------------
  |  |  288|      0|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   83|      0|    CRYPTO_THREAD_lock_free(optsdone_lock);
   84|      0|    optsdone_lock = NULL;
   85|      0|    CRYPTO_THREAD_lock_free(init_lock);
   86|      0|    init_lock = NULL;
   87|       |
   88|      0|    return 0;
   89|      2|}
init.c:ossl_init_register_atexit:
  101|      2|{
  102|      2|#ifndef OPENSSL_NO_ATEXIT
  103|       |# ifdef OPENSSL_INIT_DEBUG
  104|       |    fprintf(stderr, "OPENSSL_INIT: ossl_init_register_atexit()\n");
  105|       |# endif
  106|      2|# ifndef OPENSSL_SYS_UEFI
  107|       |#  if defined(_WIN32) && !defined(__BORLANDC__)
  108|       |    /* We use _onexit() in preference because it gets called on DLL unload */
  109|       |    if (_onexit(win32atexit) == NULL)
  110|       |        return 0;
  111|       |#  else
  112|      2|    if (atexit(OPENSSL_cleanup) != 0)
  ------------------
  |  Branch (112:9): [True: 0, False: 2]
  ------------------
  113|      0|        return 0;
  114|      2|#  endif
  115|      2|# endif
  116|      2|#endif
  117|       |
  118|      2|    return 1;
  119|      2|}
init.c:ossl_init_load_crypto_nodelete:
  133|      2|{
  134|      2|    OSSL_TRACE(INIT, "ossl_init_load_crypto_nodelete()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  135|       |
  136|       |#if !defined(OPENSSL_USE_NODELETE) \
  137|       |    && !defined(OPENSSL_NO_PINSHARED)
  138|       |# if defined(DSO_WIN32) && !defined(_WIN32_WCE)
  139|       |    {
  140|       |        HMODULE handle = NULL;
  141|       |        BOOL ret;
  142|       |
  143|       |        /* We don't use the DSO route for WIN32 because there is a better way */
  144|       |        ret = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
  145|       |                                | GET_MODULE_HANDLE_EX_FLAG_PIN,
  146|       |                                (void *)&base_inited, &handle);
  147|       |
  148|       |        OSSL_TRACE1(INIT,
  149|       |                    "ossl_init_load_crypto_nodelete: "
  150|       |                    "obtained DSO reference? %s\n",
  151|       |                    (ret == TRUE ? "No!" : "Yes."));
  152|       |        return (ret == TRUE) ? 1 : 0;
  153|       |    }
  154|       |# elif !defined(DSO_NONE)
  155|       |    /*
  156|       |     * Deliberately leak a reference to ourselves. This will force the library
  157|       |     * to remain loaded until the atexit() handler is run at process exit.
  158|       |     */
  159|       |    {
  160|       |        DSO *dso;
  161|       |        void *err;
  162|       |
  163|       |        if (!err_shelve_state(&err))
  164|       |            return 0;
  165|       |
  166|       |        dso = DSO_dsobyaddr(&base_inited, DSO_FLAG_NO_UNLOAD_ON_FREE);
  167|       |        /*
  168|       |         * In case of No!, it is uncertain our exit()-handlers can still be
  169|       |         * called. After dlclose() the whole library might have been unloaded
  170|       |         * already.
  171|       |         */
  172|       |        OSSL_TRACE1(INIT, "obtained DSO reference? %s\n",
  173|       |                    (dso == NULL ? "No!" : "Yes."));
  174|       |        DSO_free(dso);
  175|       |        err_unshelve_state(err);
  176|       |    }
  177|       |# endif
  178|       |#endif
  179|       |
  180|      2|    return 1;
  181|      2|}
init.c:ossl_init_load_crypto_strings:
  186|      2|{
  187|      2|    int ret = 1;
  188|       |    /*
  189|       |     * OPENSSL_NO_AUTOERRINIT is provided here to prevent at compile time
  190|       |     * pulling in all the error strings during static linking
  191|       |     */
  192|      2|#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
  193|      2|    void *err;
  194|       |
  195|      2|    if (!err_shelve_state(&err))
  ------------------
  |  Branch (195:9): [True: 0, False: 2]
  ------------------
  196|      0|        return 0;
  197|       |
  198|      2|    OSSL_TRACE(INIT, "ossl_err_load_crypto_strings()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  199|      2|    ret = ossl_err_load_crypto_strings();
  200|       |
  201|      2|    err_unshelve_state(err);
  202|      2|#endif
  203|      2|    return ret;
  204|      2|}
init.c:ossl_init_load_ssl_strings:
  216|      2|{
  217|       |    /*
  218|       |     * OPENSSL_NO_AUTOERRINIT is provided here to prevent at compile time
  219|       |     * pulling in all the error strings during static linking
  220|       |     */
  221|      2|#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
  222|      2|    OSSL_TRACE(INIT, "ossl_init_load_ssl_strings: ossl_err_load_SSL_strings()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  223|      2|    ossl_err_load_SSL_strings();
  224|      2|#endif
  225|      2|    return 1;
  226|      2|}
init.c:ossl_init_add_all_ciphers:
  237|      2|{
  238|       |    /*
  239|       |     * OPENSSL_NO_AUTOALGINIT is provided here to prevent at compile time
  240|       |     * pulling in all the ciphers during static linking
  241|       |     */
  242|      2|#ifndef OPENSSL_NO_AUTOALGINIT
  243|      2|    OSSL_TRACE(INIT, "openssl_add_all_ciphers_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  244|      2|    openssl_add_all_ciphers_int();
  245|      2|#endif
  246|      2|    return 1;
  247|      2|}
init.c:ossl_init_add_all_digests:
  258|      2|{
  259|       |    /*
  260|       |     * OPENSSL_NO_AUTOALGINIT is provided here to prevent at compile time
  261|       |     * pulling in all the ciphers during static linking
  262|       |     */
  263|      2|#ifndef OPENSSL_NO_AUTOALGINIT
  264|      2|    OSSL_TRACE(INIT, "openssl_add_all_digests()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  265|      2|    openssl_add_all_digests_int();
  266|      2|#endif
  267|      2|    return 1;
  268|      2|}
init.c:ossl_init_config:
  281|      2|{
  282|      2|    int ret = ossl_config_int(NULL);
  283|       |
  284|      2|    config_inited = 1;
  285|      2|    return ret;
  286|      2|}

ossl_init_thread:
  203|      2|{
  204|      2|    if (!CRYPTO_THREAD_init_local(&destructor_key.value,
  ------------------
  |  Branch (204:9): [True: 0, False: 2]
  ------------------
  205|      2|                                  init_thread_destructor))
  206|      0|        return 0;
  207|       |
  208|      2|    return 1;
  209|      2|}
ossl_cleanup_thread:
  212|      2|{
  213|      2|    init_thread_deregister(NULL, 1);
  214|      2|    CRYPTO_THREAD_cleanup_local(&destructor_key.value);
  215|      2|    destructor_key.sane = -1;
  216|      2|}
OPENSSL_thread_stop:
  230|      2|{
  231|      2|    if (destructor_key.sane != -1) {
  ------------------
  |  Branch (231:9): [True: 2, False: 0]
  ------------------
  232|      2|        THREAD_EVENT_HANDLER **hands
  233|      2|            = init_get_thread_local(&destructor_key.value, 0, 0);
  234|      2|        init_thread_stop(NULL, hands);
  235|       |
  236|      2|        init_thread_remove_handlers(hands);
  237|      2|        OPENSSL_free(hands);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  238|      2|    }
  239|      2|}
ossl_ctx_thread_stop:
  242|      2|{
  243|      2|    if (destructor_key.sane != -1) {
  ------------------
  |  Branch (243:9): [True: 2, False: 0]
  ------------------
  244|      2|        THREAD_EVENT_HANDLER **hands
  245|      2|            = init_get_thread_local(&destructor_key.value, 0, 1);
  246|      2|        init_thread_stop(ctx, hands);
  247|      2|    }
  248|      2|}
ossl_init_thread_start:
  369|      3|{
  370|      3|    THREAD_EVENT_HANDLER **hands;
  371|      3|    THREAD_EVENT_HANDLER *hand;
  372|       |#ifdef FIPS_MODULE
  373|       |    OSSL_LIB_CTX *ctx = arg;
  374|       |
  375|       |    /*
  376|       |     * In FIPS mode the list of THREAD_EVENT_HANDLERs is unique per combination
  377|       |     * of OSSL_LIB_CTX and thread. This is because in FIPS mode each
  378|       |     * OSSL_LIB_CTX gets informed about thread stop events individually.
  379|       |     */
  380|       |    CRYPTO_THREAD_LOCAL *local
  381|       |        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX);
  382|       |#else
  383|       |    /*
  384|       |     * Outside of FIPS mode the list of THREAD_EVENT_HANDLERs is unique per
  385|       |     * thread, but may hold multiple OSSL_LIB_CTXs. We only get told about
  386|       |     * thread stop events globally, so we have to ensure all affected
  387|       |     * OSSL_LIB_CTXs are informed.
  388|       |     */
  389|      3|    CRYPTO_THREAD_LOCAL *local = &destructor_key.value;
  390|      3|#endif
  391|       |
  392|      3|    hands = init_get_thread_local(local, 1, 0);
  393|      3|    if (hands == NULL)
  ------------------
  |  Branch (393:9): [True: 0, False: 3]
  ------------------
  394|      0|        return 0;
  395|       |
  396|       |#ifdef FIPS_MODULE
  397|       |    if (*hands == NULL) {
  398|       |        /*
  399|       |         * We've not yet registered any handlers for this thread. We need to get
  400|       |         * libcrypto to tell us about later thread stop events. c_thread_start
  401|       |         * is a callback to libcrypto defined in fipsprov.c
  402|       |         */
  403|       |        if (!ossl_thread_register_fips(ctx))
  404|       |            return 0;
  405|       |    }
  406|       |#endif
  407|       |
  408|      3|    hand = OPENSSL_malloc(sizeof(*hand));
  ------------------
  |  |  102|      3|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  409|      3|    if (hand == NULL)
  ------------------
  |  Branch (409:9): [True: 0, False: 3]
  ------------------
  410|      0|        return 0;
  411|       |
  412|      3|    hand->handfn = handfn;
  413|      3|    hand->arg = arg;
  414|      3|#ifndef FIPS_MODULE
  415|      3|    hand->index = index;
  416|      3|#endif
  417|      3|    hand->next = *hands;
  418|      3|    *hands = hand;
  419|       |
  420|      3|    return 1;
  421|      3|}
ossl_init_thread_deregister:
  477|      1|{
  478|      1|    return init_thread_deregister(index, 0);
  479|      1|}
initthread.c:init_get_thread_local:
   95|      7|{
   96|      7|    THREAD_EVENT_HANDLER **hands = CRYPTO_THREAD_get_local(local);
   97|       |
   98|      7|    if (alloc) {
  ------------------
  |  Branch (98:9): [True: 3, False: 4]
  ------------------
   99|      3|        if (hands == NULL) {
  ------------------
  |  Branch (99:13): [True: 2, False: 1]
  ------------------
  100|       |
  101|      2|            if ((hands = OPENSSL_zalloc(sizeof(*hands))) == NULL)
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (101:17): [True: 0, False: 2]
  ------------------
  102|      0|                return NULL;
  103|       |
  104|      2|            if (!CRYPTO_THREAD_set_local(local, hands)) {
  ------------------
  |  Branch (104:17): [True: 0, False: 2]
  ------------------
  105|      0|                OPENSSL_free(hands);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  106|      0|                return NULL;
  107|      0|            }
  108|       |
  109|      2|#ifndef FIPS_MODULE
  110|      2|            if (!init_thread_push_handlers(hands)) {
  ------------------
  |  Branch (110:17): [True: 0, False: 2]
  ------------------
  111|      0|                CRYPTO_THREAD_set_local(local, NULL);
  112|      0|                OPENSSL_free(hands);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  113|      0|                return NULL;
  114|      0|            }
  115|      2|#endif
  116|      2|        }
  117|      4|    } else if (!keep) {
  ------------------
  |  Branch (117:16): [True: 2, False: 2]
  ------------------
  118|      2|        CRYPTO_THREAD_set_local(local, NULL);
  119|      2|    }
  120|       |
  121|      7|    return hands;
  122|      7|}
initthread.c:init_thread_push_handlers:
  155|      2|{
  156|      2|    int ret;
  157|      2|    GLOBAL_TEVENT_REGISTER *gtr;
  158|       |
  159|      2|    gtr = get_global_tevent_register();
  160|      2|    if (gtr == NULL)
  ------------------
  |  Branch (160:9): [True: 0, False: 2]
  ------------------
  161|      0|        return 0;
  162|       |
  163|      2|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (163:9): [True: 0, False: 2]
  ------------------
  164|      0|        return 0;
  165|      2|    ret = (sk_THREAD_EVENT_HANDLER_PTR_push(gtr->skhands, hands) != 0);
  166|      2|    CRYPTO_THREAD_unlock(gtr->lock);
  167|       |
  168|      2|    return ret;
  169|      2|}
initthread.c:get_global_tevent_register:
   78|      9|{
   79|      9|    if (!RUN_ONCE(&tevent_register_runonce, create_global_tevent_register))
  ------------------
  |  |  130|      9|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 9, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (79:9): [True: 0, False: 9]
  ------------------
   80|      0|        return NULL;
   81|      9|    return glob_tevent_reg;
   82|      9|}
initthread.c:create_global_tevent_register:
   59|      2|{
   60|      2|    glob_tevent_reg = OPENSSL_zalloc(sizeof(*glob_tevent_reg));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|      2|    if (glob_tevent_reg == NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 2]
  ------------------
   62|      0|        return 0;
   63|       |
   64|      2|    glob_tevent_reg->skhands = sk_THREAD_EVENT_HANDLER_PTR_new_null();
   65|      2|    glob_tevent_reg->lock = CRYPTO_THREAD_lock_new();
   66|      2|    if (glob_tevent_reg->skhands == NULL || glob_tevent_reg->lock == NULL) {
  ------------------
  |  Branch (66:9): [True: 0, False: 2]
  |  Branch (66:45): [True: 0, False: 2]
  ------------------
   67|      0|        sk_THREAD_EVENT_HANDLER_PTR_free(glob_tevent_reg->skhands);
   68|      0|        CRYPTO_THREAD_lock_free(glob_tevent_reg->lock);
   69|      0|        OPENSSL_free(glob_tevent_reg);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   70|      0|        glob_tevent_reg = NULL;
   71|      0|        return 0;
   72|      0|    }
   73|       |
   74|      2|    return 1;
   75|      2|}
initthread.c:init_thread_remove_handlers:
  172|      2|{
  173|      2|    GLOBAL_TEVENT_REGISTER *gtr;
  174|      2|    int i;
  175|       |
  176|      2|    gtr = get_global_tevent_register();
  177|      2|    if (gtr == NULL)
  ------------------
  |  Branch (177:9): [True: 0, False: 2]
  ------------------
  178|      0|        return;
  179|      2|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (179:9): [True: 0, False: 2]
  ------------------
  180|      0|        return;
  181|      2|    for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
  ------------------
  |  Branch (181:17): [True: 2, False: 0]
  ------------------
  182|      2|        THREAD_EVENT_HANDLER **hands
  183|      2|            = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i);
  184|       |
  185|      2|        if (hands == handsin) {
  ------------------
  |  Branch (185:13): [True: 2, False: 0]
  ------------------
  186|      2|            sk_THREAD_EVENT_HANDLER_PTR_delete(gtr->skhands, i);
  187|      2|            CRYPTO_THREAD_unlock(gtr->lock);
  188|      2|            return;
  189|      2|        }
  190|      2|    }
  191|      0|    CRYPTO_THREAD_unlock(gtr->lock);
  192|      0|    return;
  193|      2|}
initthread.c:init_thread_stop:
  325|      4|{
  326|      4|    THREAD_EVENT_HANDLER *curr, *prev = NULL, *tmp;
  327|      4|#ifndef FIPS_MODULE
  328|      4|    GLOBAL_TEVENT_REGISTER *gtr;
  329|      4|#endif
  330|       |
  331|       |    /* Can't do much about this */
  332|      4|    if (hands == NULL)
  ------------------
  |  Branch (332:9): [True: 2, False: 2]
  ------------------
  333|      2|        return;
  334|       |
  335|      2|#ifndef FIPS_MODULE
  336|      2|    gtr = get_global_tevent_register();
  337|      2|    if (gtr == NULL)
  ------------------
  |  Branch (337:9): [True: 0, False: 2]
  ------------------
  338|      0|        return;
  339|       |
  340|      2|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (340:9): [True: 0, False: 2]
  ------------------
  341|      0|        return;
  342|      2|#endif
  343|       |
  344|      2|    curr = *hands;
  345|      5|    while (curr != NULL) {
  ------------------
  |  Branch (345:12): [True: 3, False: 2]
  ------------------
  346|      3|        if (arg != NULL && curr->arg != arg) {
  ------------------
  |  Branch (346:13): [True: 0, False: 3]
  |  Branch (346:28): [True: 0, False: 0]
  ------------------
  347|      0|            prev = curr;
  348|      0|            curr = curr->next;
  349|      0|            continue;
  350|      0|        }
  351|      3|        curr->handfn(curr->arg);
  352|      3|        if (prev == NULL)
  ------------------
  |  Branch (352:13): [True: 3, False: 0]
  ------------------
  353|      3|            *hands = curr->next;
  354|      0|        else
  355|      0|            prev->next = curr->next;
  356|       |
  357|      3|        tmp = curr;
  358|      3|        curr = curr->next;
  359|       |
  360|      3|        OPENSSL_free(tmp);
  ------------------
  |  |  115|      3|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  361|      3|    }
  362|      2|#ifndef FIPS_MODULE
  363|      2|    CRYPTO_THREAD_unlock(gtr->lock);
  364|      2|#endif
  365|      2|}
initthread.c:init_thread_deregister:
  425|      3|{
  426|      3|    GLOBAL_TEVENT_REGISTER *gtr;
  427|      3|    int i;
  428|       |
  429|      3|    gtr = get_global_tevent_register();
  430|      3|    if (gtr == NULL)
  ------------------
  |  Branch (430:9): [True: 0, False: 3]
  ------------------
  431|      0|        return 0;
  432|      3|    if (!all) {
  ------------------
  |  Branch (432:9): [True: 1, False: 2]
  ------------------
  433|      1|        if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (433:13): [True: 0, False: 1]
  ------------------
  434|      0|            return 0;
  435|      2|    } else {
  436|      2|        glob_tevent_reg = NULL;
  437|      2|    }
  438|      3|    for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
  ------------------
  |  Branch (438:17): [True: 0, False: 3]
  ------------------
  439|      0|        THREAD_EVENT_HANDLER **hands
  440|      0|            = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i);
  441|      0|        THREAD_EVENT_HANDLER *curr = NULL, *prev = NULL, *tmp;
  442|       |
  443|      0|        if (hands == NULL) {
  ------------------
  |  Branch (443:13): [True: 0, False: 0]
  ------------------
  444|      0|            if (!all)
  ------------------
  |  Branch (444:17): [True: 0, False: 0]
  ------------------
  445|      0|                CRYPTO_THREAD_unlock(gtr->lock);
  446|      0|            return 0;
  447|      0|        }
  448|      0|        curr = *hands;
  449|      0|        while (curr != NULL) {
  ------------------
  |  Branch (449:16): [True: 0, False: 0]
  ------------------
  450|      0|            if (all || curr->index == index) {
  ------------------
  |  Branch (450:17): [True: 0, False: 0]
  |  Branch (450:24): [True: 0, False: 0]
  ------------------
  451|      0|                if (prev != NULL)
  ------------------
  |  Branch (451:21): [True: 0, False: 0]
  ------------------
  452|      0|                    prev->next = curr->next;
  453|      0|                else
  454|      0|                    *hands = curr->next;
  455|      0|                tmp = curr;
  456|      0|                curr = curr->next;
  457|      0|                OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  458|      0|                continue;
  459|      0|            }
  460|      0|            prev = curr;
  461|      0|            curr = curr->next;
  462|      0|        }
  463|      0|        if (all)
  ------------------
  |  Branch (463:13): [True: 0, False: 0]
  ------------------
  464|      0|            OPENSSL_free(hands);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  465|      0|    }
  466|      3|    if (all) {
  ------------------
  |  Branch (466:9): [True: 2, False: 1]
  ------------------
  467|      2|        CRYPTO_THREAD_lock_free(gtr->lock);
  468|      2|        sk_THREAD_EVENT_HANDLER_PTR_free(gtr->skhands);
  469|      2|        OPENSSL_free(gtr);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  470|      2|    } else {
  471|      1|        CRYPTO_THREAD_unlock(gtr->lock);
  472|      1|    }
  473|      3|    return 1;
  474|      3|}

OPENSSL_LH_set_thunks:
   52|    161|{
   53|       |
   54|    161|    if (lh == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 161]
  ------------------
   55|      0|        return NULL;
   56|    161|    lh->compw = cw;
   57|    161|    lh->hashw = hw;
   58|    161|    lh->daw = daw;
   59|    161|    lh->daaw = daaw;
   60|    161|    return lh;
   61|    161|}
OPENSSL_LH_new:
   64|    161|{
   65|    161|    OPENSSL_LHASH *ret;
   66|       |
   67|    161|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  104|    161|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    161|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    161|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (67:9): [True: 0, False: 161]
  ------------------
   68|      0|        return NULL;
   69|    161|    if ((ret->b = OPENSSL_zalloc(sizeof(*ret->b) * MIN_NODES)) == NULL)
  ------------------
  |  |  104|    161|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    161|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    161|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (69:9): [True: 0, False: 161]
  ------------------
   70|      0|        goto err;
   71|    161|    ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
  ------------------
  |  Branch (71:18): [True: 0, False: 161]
  ------------------
   72|    161|    ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
  ------------------
  |  Branch (72:18): [True: 0, False: 161]
  ------------------
   73|    161|    ret->num_nodes = MIN_NODES / 2;
  ------------------
  |  |   39|    161|#define MIN_NODES       16
  ------------------
   74|    161|    ret->num_alloc_nodes = MIN_NODES;
  ------------------
  |  |   39|    161|#define MIN_NODES       16
  ------------------
   75|    161|    ret->pmax = MIN_NODES / 2;
  ------------------
  |  |   39|    161|#define MIN_NODES       16
  ------------------
   76|    161|    ret->up_load = UP_LOAD;
  ------------------
  |  |   40|    161|#define UP_LOAD         (2*LH_LOAD_MULT) /* load times 256 (default 2) */
  |  |  ------------------
  |  |  |  |   85|    161|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   77|    161|    ret->down_load = DOWN_LOAD;
  ------------------
  |  |   41|    161|#define DOWN_LOAD       (LH_LOAD_MULT) /* load times 256 (default 1) */
  |  |  ------------------
  |  |  |  |   85|    161|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   78|    161|    return ret;
   79|       |
   80|      0|err:
   81|      0|    OPENSSL_free(ret->b);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   82|      0|    OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   83|      0|    return NULL;
   84|    161|}
OPENSSL_LH_free:
   87|    155|{
   88|    155|    if (lh == NULL)
  ------------------
  |  Branch (88:9): [True: 2, False: 153]
  ------------------
   89|      2|        return;
   90|       |
   91|    153|    OPENSSL_LH_flush(lh);
   92|    153|    OPENSSL_free(lh->b);
  ------------------
  |  |  115|    153|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    153|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    153|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|    153|    OPENSSL_free(lh);
  ------------------
  |  |  115|    153|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    153|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    153|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|    153|}
OPENSSL_LH_flush:
   97|    413|{
   98|    413|    unsigned int i;
   99|    413|    OPENSSL_LH_NODE *n, *nn;
  100|       |
  101|    413|    if (lh == NULL)
  ------------------
  |  Branch (101:9): [True: 0, False: 413]
  ------------------
  102|      0|        return;
  103|       |
  104|  5.93k|    for (i = 0; i < lh->num_nodes; i++) {
  ------------------
  |  Branch (104:17): [True: 5.52k, False: 413]
  ------------------
  105|  5.52k|        n = lh->b[i];
  106|  9.60k|        while (n != NULL) {
  ------------------
  |  Branch (106:16): [True: 4.08k, False: 5.52k]
  ------------------
  107|  4.08k|            nn = n->next;
  108|  4.08k|            OPENSSL_free(n);
  ------------------
  |  |  115|  4.08k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.08k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.08k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  109|  4.08k|            n = nn;
  110|  4.08k|        }
  111|  5.52k|        lh->b[i] = NULL;
  112|  5.52k|    }
  113|       |
  114|    413|    lh->num_items = 0;
  115|    413|}
OPENSSL_LH_insert:
  118|  10.6k|{
  119|  10.6k|    unsigned long hash;
  120|  10.6k|    OPENSSL_LH_NODE *nn, **rn;
  121|  10.6k|    void *ret;
  122|       |
  123|  10.6k|    lh->error = 0;
  124|  10.6k|    if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
  ------------------
  |  |   85|  10.6k|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (124:9): [True: 2.22k, False: 8.46k]
  |  Branch (124:76): [True: 0, False: 2.22k]
  ------------------
  125|      0|        return NULL;        /* 'lh->error++' already done in 'expand' */
  126|       |
  127|  10.6k|    rn = getrn(lh, data, &hash);
  128|       |
  129|  10.6k|    if (*rn == NULL) {
  ------------------
  |  Branch (129:9): [True: 4.58k, False: 6.10k]
  ------------------
  130|  4.58k|        if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
  ------------------
  |  |  102|  4.58k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.58k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.58k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (130:13): [True: 0, False: 4.58k]
  ------------------
  131|      0|            lh->error++;
  132|      0|            return NULL;
  133|      0|        }
  134|  4.58k|        nn->data = data;
  135|  4.58k|        nn->next = NULL;
  136|  4.58k|        nn->hash = hash;
  137|  4.58k|        *rn = nn;
  138|  4.58k|        ret = NULL;
  139|  4.58k|        lh->num_items++;
  140|  6.10k|    } else {                    /* replace same key */
  141|  6.10k|        ret = (*rn)->data;
  142|  6.10k|        (*rn)->data = data;
  143|  6.10k|    }
  144|  10.6k|    return ret;
  145|  10.6k|}
OPENSSL_LH_delete:
  148|    484|{
  149|    484|    unsigned long hash;
  150|    484|    OPENSSL_LH_NODE *nn, **rn;
  151|    484|    void *ret;
  152|       |
  153|    484|    lh->error = 0;
  154|    484|    rn = getrn(lh, data, &hash);
  155|       |
  156|    484|    if (*rn == NULL) {
  ------------------
  |  Branch (156:9): [True: 0, False: 484]
  ------------------
  157|      0|        return NULL;
  158|    484|    } else {
  159|    484|        nn = *rn;
  160|    484|        *rn = nn->next;
  161|    484|        ret = nn->data;
  162|    484|        OPENSSL_free(nn);
  ------------------
  |  |  115|    484|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    484|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    484|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|    484|    }
  164|       |
  165|    484|    lh->num_items--;
  166|    484|    if ((lh->num_nodes > MIN_NODES) &&
  ------------------
  |  |   39|    484|#define MIN_NODES       16
  ------------------
  |  Branch (166:9): [True: 484, False: 0]
  ------------------
  167|    484|        (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
  ------------------
  |  |   85|    484|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (167:9): [True: 2, False: 482]
  ------------------
  168|      2|        contract(lh);
  169|       |
  170|    484|    return ret;
  171|    484|}
OPENSSL_LH_retrieve:
  174|   119k|{
  175|   119k|    unsigned long hash;
  176|   119k|    OPENSSL_LH_NODE **rn;
  177|       |
  178|   119k|    if (lh->error != 0)
  ------------------
  |  Branch (178:9): [True: 0, False: 119k]
  ------------------
  179|      0|        lh->error = 0;
  180|       |
  181|   119k|    rn = getrn(lh, data, &hash);
  182|       |
  183|   119k|    return *rn == NULL ? NULL : (*rn)->data;
  ------------------
  |  Branch (183:12): [True: 858, False: 118k]
  ------------------
  184|   119k|}
OPENSSL_LH_doall:
  217|    417|{
  218|    417|    if (lh == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 417]
  ------------------
  219|      0|        return;
  220|       |
  221|    417|    doall_util_fn(lh, 0, lh->daw, func, (OPENSSL_LH_DOALL_FUNCARG)NULL,
  222|    417|                  (OPENSSL_LH_DOALL_FUNCARG_THUNK)NULL, NULL);
  223|    417|}
OPENSSL_LH_doall_arg_thunk:
  238|      2|{
  239|      2|    doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC_THUNK)NULL,
  240|      2|                  (OPENSSL_LH_DOALL_FUNC)NULL, fn, daaw, arg);
  241|      2|}
OPENSSL_LH_strhash:
  362|  78.2k|{
  363|  78.2k|    unsigned long ret = 0;
  364|  78.2k|    long n;
  365|  78.2k|    unsigned long v;
  366|  78.2k|    int r;
  367|       |
  368|  78.2k|    if ((c == NULL) || (*c == '\0'))
  ------------------
  |  Branch (368:9): [True: 0, False: 78.2k]
  |  Branch (368:24): [True: 6.66k, False: 71.6k]
  ------------------
  369|  6.66k|        return ret;
  370|       |
  371|  71.6k|    n = 0x100;
  372|   628k|    while (*c) {
  ------------------
  |  Branch (372:12): [True: 556k, False: 71.6k]
  ------------------
  373|   556k|        v = n | (*c);
  374|   556k|        n += 0x100;
  375|   556k|        r = (int)((v >> 2) ^ v) & 0x0f;
  376|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  377|   556k|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  378|   556k|        ret &= 0xFFFFFFFFL;
  379|   556k|        ret ^= v * v;
  380|   556k|        c++;
  381|   556k|    }
  382|  71.6k|    return (ret >> 16) ^ ret;
  383|  78.2k|}
ossl_lh_strcasehash:
  400|   112k|{
  401|   112k|    unsigned long ret = 0;
  402|   112k|    long n;
  403|   112k|    unsigned long v;
  404|   112k|    int r;
  405|       |#if defined(CHARSET_EBCDIC) && !defined(CHARSET_EBCDIC_TEST)
  406|       |    const long int case_adjust = ~0x40;
  407|       |#else
  408|   112k|    const long int case_adjust = ~0x20;
  409|   112k|#endif
  410|       |
  411|   112k|    if (c == NULL || *c == '\0')
  ------------------
  |  Branch (411:9): [True: 0, False: 112k]
  |  Branch (411:22): [True: 0, False: 112k]
  ------------------
  412|      0|        return ret;
  413|       |
  414|  1.37M|    for (n = 0x100; *c != '\0'; n += 0x100) {
  ------------------
  |  Branch (414:21): [True: 1.26M, False: 112k]
  ------------------
  415|  1.26M|        v = n | (case_adjust & *c);
  416|  1.26M|        r = (int)((v >> 2) ^ v) & 0x0f;
  417|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  418|  1.26M|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  419|  1.26M|        ret &= 0xFFFFFFFFL;
  420|  1.26M|        ret ^= v * v;
  421|  1.26M|        c++;
  422|  1.26M|    }
  423|   112k|    return (ret >> 16) ^ ret;
  424|   112k|}
OPENSSL_LH_num_items:
  427|    258|{
  428|    258|    return lh ? lh->num_items : 0;
  ------------------
  |  Branch (428:12): [True: 258, False: 0]
  ------------------
  429|    258|}
OPENSSL_LH_get_down_load:
  432|      8|{
  433|      8|    return lh->down_load;
  434|      8|}
OPENSSL_LH_set_down_load:
  437|     14|{
  438|     14|    lh->down_load = down_load;
  439|     14|}
OPENSSL_LH_error:
  442|    824|{
  443|    824|    return lh->error;
  444|    824|}
lhash.c:doall_util_fn:
  192|    419|{
  193|    419|    int i;
  194|    419|    OPENSSL_LH_NODE *a, *n;
  195|       |
  196|    419|    if (lh == NULL)
  ------------------
  |  Branch (196:9): [True: 0, False: 419]
  ------------------
  197|      0|        return;
  198|       |
  199|       |    /*
  200|       |     * reverse the order so we search from 'top to bottom' We were having
  201|       |     * memory leaks otherwise
  202|       |     */
  203|  5.03k|    for (i = lh->num_nodes - 1; i >= 0; i--) {
  ------------------
  |  Branch (203:33): [True: 4.61k, False: 419]
  ------------------
  204|  4.61k|        a = lh->b[i];
  205|  6.51k|        while (a != NULL) {
  ------------------
  |  Branch (205:16): [True: 1.89k, False: 4.61k]
  ------------------
  206|  1.89k|            n = a->next;
  207|  1.89k|            if (use_arg)
  ------------------
  |  Branch (207:17): [True: 484, False: 1.41k]
  ------------------
  208|    484|                wfunc_arg(a->data, arg, func_arg);
  209|  1.41k|            else
  210|  1.41k|                wfunc(a->data, func);
  211|  1.89k|            a = n;
  212|  1.89k|        }
  213|  4.61k|    }
  214|    419|}
lhash.c:expand:
  244|  2.22k|{
  245|  2.22k|    OPENSSL_LH_NODE **n, **n1, **n2, *np;
  246|  2.22k|    unsigned int p, pmax, nni, j;
  247|  2.22k|    unsigned long hash;
  248|       |
  249|  2.22k|    nni = lh->num_alloc_nodes;
  250|  2.22k|    p = lh->p;
  251|  2.22k|    pmax = lh->pmax;
  252|  2.22k|    if (p + 1 >= pmax) {
  ------------------
  |  Branch (252:9): [True: 22, False: 2.19k]
  ------------------
  253|     22|        j = nni * 2;
  254|     22|        n = OPENSSL_realloc(lh->b, sizeof(OPENSSL_LH_NODE *) * j);
  ------------------
  |  |  109|     22|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     22|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     22|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  255|     22|        if (n == NULL) {
  ------------------
  |  Branch (255:13): [True: 0, False: 22]
  ------------------
  256|      0|            lh->error++;
  257|      0|            return 0;
  258|      0|        }
  259|     22|        lh->b = n;
  260|     22|        memset(n + nni, 0, sizeof(*n) * (j - nni));
  261|     22|        lh->pmax = nni;
  262|     22|        lh->num_alloc_nodes = j;
  263|     22|        lh->p = 0;
  264|  2.19k|    } else {
  265|  2.19k|        lh->p++;
  266|  2.19k|    }
  267|       |
  268|  2.22k|    lh->num_nodes++;
  269|  2.22k|    n1 = &(lh->b[p]);
  270|  2.22k|    n2 = &(lh->b[p + pmax]);
  271|  2.22k|    *n2 = NULL;
  272|       |
  273|  8.96k|    for (np = *n1; np != NULL;) {
  ------------------
  |  Branch (273:20): [True: 6.74k, False: 2.22k]
  ------------------
  274|  6.74k|        hash = np->hash;
  275|  6.74k|        if ((hash % nni) != p) { /* move it */
  ------------------
  |  Branch (275:13): [True: 1.30k, False: 5.44k]
  ------------------
  276|  1.30k|            *n1 = (*n1)->next;
  277|  1.30k|            np->next = *n2;
  278|  1.30k|            *n2 = np;
  279|  1.30k|        } else
  280|  5.44k|            n1 = &((*n1)->next);
  281|  6.74k|        np = *n1;
  282|  6.74k|    }
  283|       |
  284|  2.22k|    return 1;
  285|  2.22k|}
lhash.c:contract:
  288|      2|{
  289|      2|    OPENSSL_LH_NODE **n, *n1, *np;
  290|       |
  291|      2|    np = lh->b[lh->p + lh->pmax - 1];
  292|      2|    lh->b[lh->p + lh->pmax - 1] = NULL; /* 24/07-92 - eay - weird but :-( */
  293|      2|    if (lh->p == 0) {
  ------------------
  |  Branch (293:9): [True: 0, False: 2]
  ------------------
  294|      0|        n = OPENSSL_realloc(lh->b,
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  295|      0|                            (unsigned int)(sizeof(OPENSSL_LH_NODE *) * lh->pmax));
  296|      0|        if (n == NULL) {
  ------------------
  |  Branch (296:13): [True: 0, False: 0]
  ------------------
  297|       |            /* fputs("realloc error in lhash", stderr); */
  298|      0|            lh->error++;
  299|      0|        } else {
  300|      0|            lh->b = n;
  301|      0|        }
  302|      0|        lh->num_alloc_nodes /= 2;
  303|      0|        lh->pmax /= 2;
  304|      0|        lh->p = lh->pmax - 1;
  305|      0|    } else
  306|      2|        lh->p--;
  307|       |
  308|      2|    lh->num_nodes--;
  309|       |
  310|      2|    n1 = lh->b[(int)lh->p];
  311|      2|    if (n1 == NULL)
  ------------------
  |  Branch (311:9): [True: 2, False: 0]
  ------------------
  312|      2|        lh->b[(int)lh->p] = np;
  313|      0|    else {
  314|      0|        while (n1->next != NULL)
  ------------------
  |  Branch (314:16): [True: 0, False: 0]
  ------------------
  315|      0|            n1 = n1->next;
  316|      0|        n1->next = np;
  317|      0|    }
  318|      2|}
lhash.c:getrn:
  322|   130k|{
  323|   130k|    OPENSSL_LH_NODE **ret, *n1;
  324|   130k|    unsigned long hash, nn;
  325|       |
  326|   130k|    if (lh->hashw != NULL)
  ------------------
  |  Branch (326:9): [True: 130k, False: 0]
  ------------------
  327|   130k|        hash = lh->hashw(data, lh->hash);
  328|      0|    else
  329|      0|        hash = lh->hash(data);
  330|       |
  331|   130k|    *rhash = hash;
  332|       |
  333|   130k|    nn = hash % lh->pmax;
  334|   130k|    if (nn < lh->p)
  ------------------
  |  Branch (334:9): [True: 15.0k, False: 115k]
  ------------------
  335|  15.0k|        nn = hash % lh->num_alloc_nodes;
  336|       |
  337|   130k|    ret = &(lh->b[(int)nn]);
  338|   239k|    for (n1 = *ret; n1 != NULL; n1 = n1->next) {
  ------------------
  |  Branch (338:21): [True: 234k, False: 5.44k]
  ------------------
  339|   234k|        if (n1->hash != hash) {
  ------------------
  |  Branch (339:13): [True: 108k, False: 125k]
  ------------------
  340|   108k|            ret = &(n1->next);
  341|   108k|            continue;
  342|   108k|        }
  343|       |
  344|   125k|        if (lh->compw != NULL) {
  ------------------
  |  Branch (344:13): [True: 125k, False: 0]
  ------------------
  345|   125k|            if (lh->compw(n1->data, data, lh->comp) == 0)
  ------------------
  |  Branch (345:17): [True: 125k, False: 420]
  ------------------
  346|   125k|                break;
  347|   125k|        } else {
  348|      0|            if (lh->comp(n1->data, data) == 0)
  ------------------
  |  Branch (348:17): [True: 0, False: 0]
  ------------------
  349|      0|                break;
  350|      0|        }
  351|    420|        ret = &(n1->next);
  352|    420|    }
  353|   130k|    return ret;
  354|   130k|}

CRYPTO_malloc:
  187|  69.8M|{
  188|  69.8M|    void *ptr;
  189|       |
  190|  69.8M|    INCREMENT(malloc_count);
  191|  69.8M|    if (malloc_impl != CRYPTO_malloc) {
  ------------------
  |  Branch (191:9): [True: 0, False: 69.8M]
  ------------------
  192|      0|        ptr = malloc_impl(num, file, line);
  193|      0|        if (ptr != NULL || num == 0)
  ------------------
  |  Branch (193:13): [True: 0, False: 0]
  |  Branch (193:28): [True: 0, False: 0]
  ------------------
  194|      0|            return ptr;
  195|      0|        goto err;
  196|      0|    }
  197|       |
  198|  69.8M|    if (num == 0)
  ------------------
  |  Branch (198:9): [True: 0, False: 69.8M]
  ------------------
  199|      0|        return NULL;
  200|       |
  201|  69.8M|    FAILTEST();
  202|  69.8M|    if (allow_customize) {
  ------------------
  |  Branch (202:9): [True: 2, False: 69.8M]
  ------------------
  203|       |        /*
  204|       |         * Disallow customization after the first allocation. We only set this
  205|       |         * if necessary to avoid a store to the same cache line on every
  206|       |         * allocation.
  207|       |         */
  208|      2|        allow_customize = 0;
  209|      2|    }
  210|       |
  211|  69.8M|    ptr = malloc(num);
  212|  69.8M|    if (ptr != NULL)
  ------------------
  |  Branch (212:9): [True: 69.8M, False: 0]
  ------------------
  213|  69.8M|        return ptr;
  214|      0| err:
  215|       |    /*
  216|       |     * ossl_err_get_state_int() in err.c uses CRYPTO_zalloc(num, NULL, 0) for
  217|       |     * ERR_STATE allocation. Prevent mem alloc error loop while reporting error.
  218|       |     */
  219|      0|    if (file != NULL || line != 0) {
  ------------------
  |  Branch (219:9): [True: 0, False: 0]
  |  Branch (219:25): [True: 0, False: 0]
  ------------------
  220|      0|        ERR_new();
  221|      0|        ERR_set_debug(file, line, NULL);
  222|      0|        ERR_set_error(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE, NULL);
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
                      ERR_set_error(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE, NULL);
  ------------------
  |  |  351|      0|# define ERR_R_MALLOC_FAILURE                    (256|ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  350|      0|# define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  236|      0|# define ERR_RFLAG_FATAL                (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  223|      0|    }
  224|      0|    return NULL;
  225|  69.8M|}
CRYPTO_zalloc:
  228|  22.2M|{
  229|  22.2M|    void *ret;
  230|       |
  231|  22.2M|    ret = CRYPTO_malloc(num, file, line);
  232|  22.2M|    if (ret != NULL)
  ------------------
  |  Branch (232:9): [True: 22.2M, False: 0]
  ------------------
  233|  22.2M|        memset(ret, 0, num);
  234|       |
  235|  22.2M|    return ret;
  236|  22.2M|}
CRYPTO_aligned_alloc:
  240|      6|{
  241|      6|    void *ret;
  242|       |
  243|      6|    *freeptr = NULL;
  244|       |
  245|       |#if defined(OPENSSL_SMALL_FOOTPRINT)
  246|       |    ret = freeptr = NULL;
  247|       |    return ret;
  248|       |#endif
  249|       |
  250|       |    /* Allow non-malloc() allocations as long as no malloc_impl is provided. */
  251|      6|    if (malloc_impl == CRYPTO_malloc) {
  ------------------
  |  Branch (251:9): [True: 6, False: 0]
  ------------------
  252|      6|#if defined(_BSD_SOURCE) || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L)
  253|      6|        if (posix_memalign(&ret, alignment, num))
  ------------------
  |  Branch (253:13): [True: 0, False: 6]
  ------------------
  254|      0|            return NULL;
  255|      6|        *freeptr = ret;
  256|      6|        return ret;
  257|       |#elif defined(_ISOC11_SOURCE)
  258|       |        ret = *freeptr = aligned_alloc(alignment, num);
  259|       |        return ret;
  260|       |#endif
  261|      6|    }
  262|       |
  263|       |    /* we have to do this the hard way */
  264|       |
  265|       |    /*
  266|       |     * Note: Windows supports an _aligned_malloc call, but we choose
  267|       |     * not to use it here, because allocations from that function
  268|       |     * require that they be freed via _aligned_free.  Given that
  269|       |     * we can't differentiate plain malloc blocks from blocks obtained
  270|       |     * via _aligned_malloc, just avoid its use entirely
  271|       |     */
  272|       |
  273|       |    /*
  274|       |     * Step 1: Allocate an amount of memory that is <alignment>
  275|       |     * bytes bigger than requested
  276|       |     */
  277|      0|    *freeptr = CRYPTO_malloc(num + alignment, file, line);
  278|      0|    if (*freeptr == NULL)
  ------------------
  |  Branch (278:9): [True: 0, False: 0]
  ------------------
  279|      0|        return NULL;
  280|       |
  281|       |    /*
  282|       |     * Step 2: Add <alignment - 1> bytes to the pointer
  283|       |     * This will cross the alignment boundary that is
  284|       |     * requested
  285|       |     */
  286|      0|    ret = (void *)((char *)*freeptr + (alignment - 1));
  287|       |
  288|       |    /*
  289|       |     * Step 3: Use the alignment as a mask to translate the
  290|       |     * least significant bits of the allocation at the alignment
  291|       |     * boundary to 0.  ret now holds a pointer to the memory
  292|       |     * buffer at the requested alignment
  293|       |     * NOTE: It is a documented requirement that alignment be a
  294|       |     * power of 2, which is what allows this to work
  295|       |     */
  296|      0|    ret = (void *)((uintptr_t)ret & (uintptr_t)(~(alignment - 1)));
  297|      0|    return ret;
  298|      0|}
CRYPTO_realloc:
  301|  3.04M|{
  302|  3.04M|    INCREMENT(realloc_count);
  303|  3.04M|    if (realloc_impl != CRYPTO_realloc)
  ------------------
  |  Branch (303:9): [True: 0, False: 3.04M]
  ------------------
  304|      0|        return realloc_impl(str, num, file, line);
  305|       |
  306|  3.04M|    if (str == NULL)
  ------------------
  |  Branch (306:9): [True: 2.90M, False: 137k]
  ------------------
  307|  2.90M|        return CRYPTO_malloc(num, file, line);
  308|       |
  309|   137k|    if (num == 0) {
  ------------------
  |  Branch (309:9): [True: 0, False: 137k]
  ------------------
  310|      0|        CRYPTO_free(str, file, line);
  311|      0|        return NULL;
  312|      0|    }
  313|       |
  314|   137k|    FAILTEST();
  315|   137k|    return realloc(str, num);
  316|   137k|}
CRYPTO_clear_realloc:
  320|  2.50M|{
  321|  2.50M|    void *ret = NULL;
  322|       |
  323|  2.50M|    if (str == NULL)
  ------------------
  |  Branch (323:9): [True: 595k, False: 1.90M]
  ------------------
  324|   595k|        return CRYPTO_malloc(num, file, line);
  325|       |
  326|  1.90M|    if (num == 0) {
  ------------------
  |  Branch (326:9): [True: 0, False: 1.90M]
  ------------------
  327|      0|        CRYPTO_clear_free(str, old_len, file, line);
  328|      0|        return NULL;
  329|      0|    }
  330|       |
  331|       |    /* Can't shrink the buffer since memcpy below copies |old_len| bytes. */
  332|  1.90M|    if (num < old_len) {
  ------------------
  |  Branch (332:9): [True: 0, False: 1.90M]
  ------------------
  333|      0|        OPENSSL_cleanse((char*)str + num, old_len - num);
  334|      0|        return str;
  335|      0|    }
  336|       |
  337|  1.90M|    ret = CRYPTO_malloc(num, file, line);
  338|  1.90M|    if (ret != NULL) {
  ------------------
  |  Branch (338:9): [True: 1.90M, False: 0]
  ------------------
  339|  1.90M|        memcpy(ret, str, old_len);
  340|  1.90M|        CRYPTO_clear_free(str, old_len, file, line);
  341|  1.90M|    }
  342|  1.90M|    return ret;
  343|  1.90M|}
CRYPTO_free:
  346|   143M|{
  347|   143M|    INCREMENT(free_count);
  348|   143M|    if (free_impl != CRYPTO_free) {
  ------------------
  |  Branch (348:9): [True: 0, False: 143M]
  ------------------
  349|      0|        free_impl(str, file, line);
  350|      0|        return;
  351|      0|    }
  352|       |
  353|   143M|    free(str);
  354|   143M|}
CRYPTO_clear_free:
  357|  3.50M|{
  358|  3.50M|    if (str == NULL)
  ------------------
  |  Branch (358:9): [True: 123k, False: 3.38M]
  ------------------
  359|   123k|        return;
  360|  3.38M|    if (num)
  ------------------
  |  Branch (360:9): [True: 3.38M, False: 0]
  ------------------
  361|  3.38M|        OPENSSL_cleanse(str, num);
  362|  3.38M|    CRYPTO_free(str, file, line);
  363|  3.38M|}

CRYPTO_secure_malloc_done:
  132|      2|{
  133|      2|#ifndef OPENSSL_NO_SECURE_MEMORY
  134|      2|    if (secure_mem_used == 0) {
  ------------------
  |  Branch (134:9): [True: 2, False: 0]
  ------------------
  135|      2|        sh_done();
  136|      2|        secure_mem_initialized = 0;
  137|      2|        CRYPTO_THREAD_lock_free(sec_malloc_lock);
  138|      2|        sec_malloc_lock = NULL;
  139|      2|        return 1;
  140|      2|    }
  141|      0|#endif /* OPENSSL_NO_SECURE_MEMORY */
  142|      0|    return 0;
  143|      2|}
CRYPTO_secure_zalloc:
  185|   169k|{
  186|   169k|#ifndef OPENSSL_NO_SECURE_MEMORY
  187|   169k|    if (secure_mem_initialized)
  ------------------
  |  Branch (187:9): [True: 0, False: 169k]
  ------------------
  188|       |        /* CRYPTO_secure_malloc() zeroes allocations when it is implemented */
  189|      0|        return CRYPTO_secure_malloc(num, file, line);
  190|   169k|#endif
  191|   169k|    return CRYPTO_zalloc(num, file, line);
  192|   169k|}
CRYPTO_secure_clear_free:
  219|   169k|{
  220|   169k|#ifndef OPENSSL_NO_SECURE_MEMORY
  221|   169k|    size_t actual_size;
  222|       |
  223|   169k|    if (ptr == NULL)
  ------------------
  |  Branch (223:9): [True: 6, False: 169k]
  ------------------
  224|      6|        return;
  225|   169k|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (225:9): [True: 169k, False: 0]
  ------------------
  226|   169k|        OPENSSL_cleanse(ptr, num);
  227|   169k|        CRYPTO_free(ptr, file, line);
  228|   169k|        return;
  229|   169k|    }
  230|      0|    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock))
  ------------------
  |  Branch (230:9): [True: 0, False: 0]
  ------------------
  231|      0|        return;
  232|      0|    actual_size = sh_actual_size(ptr);
  233|      0|    CLEAR(ptr, actual_size);
  ------------------
  |  |   82|      0|#define CLEAR(p, s) OPENSSL_cleanse(p, s)
  ------------------
  234|      0|    secure_mem_used -= actual_size;
  235|      0|    sh_free(ptr);
  236|      0|    CRYPTO_THREAD_unlock(sec_malloc_lock);
  237|       |#else
  238|       |    if (ptr == NULL)
  239|       |        return;
  240|       |    OPENSSL_cleanse(ptr, num);
  241|       |    CRYPTO_free(ptr, file, line);
  242|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  243|      0|}
CRYPTO_secure_allocated:
  246|   169k|{
  247|   169k|#ifndef OPENSSL_NO_SECURE_MEMORY
  248|   169k|    if (!secure_mem_initialized)
  ------------------
  |  Branch (248:9): [True: 169k, False: 0]
  ------------------
  249|   169k|        return 0;
  250|       |    /*
  251|       |     * Only read accesses to the arena take place in sh_allocated() and this
  252|       |     * is only changed by the sh_init() and sh_done() calls which are not
  253|       |     * locked.  Hence, it is safe to make this check without a lock too.
  254|       |     */
  255|      0|    return sh_allocated(ptr);
  256|       |#else
  257|       |    return 0;
  258|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  259|   169k|}
mem_sec.c:sh_done:
  599|      2|{
  600|      2|    OPENSSL_free(sh.freelist);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  601|      2|    OPENSSL_free(sh.bittable);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  602|      2|    OPENSSL_free(sh.bitmalloc);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  603|      2|#if !defined(_WIN32)
  604|      2|    if (sh.map_result != MAP_FAILED && sh.map_size)
  ------------------
  |  Branch (604:9): [True: 2, False: 0]
  |  Branch (604:40): [True: 0, False: 2]
  ------------------
  605|      0|        munmap(sh.map_result, sh.map_size);
  606|       |#else
  607|       |    if (sh.map_result != NULL && sh.map_size)
  608|       |        VirtualFree(sh.map_result, 0, MEM_RELEASE);
  609|       |#endif
  610|      2|    memset(&sh, 0, sizeof(sh));
  611|      2|}

ossl_ml_dsa_key_free:
  131|  34.1k|{
  132|  34.1k|    if (key == NULL)
  ------------------
  |  Branch (132:9): [True: 34.1k, False: 0]
  ------------------
  133|  34.1k|        return;
  134|       |
  135|      0|    EVP_MD_free(key->shake128_md);
  136|      0|    EVP_MD_free(key->shake256_md);
  137|      0|    ossl_ml_dsa_key_reset(key);
  138|      0|    OPENSSL_free(key);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  139|      0|}

ossl_ml_dsa_params_get:
  100|  26.5k|{
  101|  26.5k|    const ML_DSA_PARAMS *p;
  102|       |
  103|  53.1k|    for (p = ml_dsa_params; p->alg != NULL; ++p) {
  ------------------
  |  Branch (103:29): [True: 53.1k, False: 0]
  ------------------
  104|  53.1k|        if (p->evp_type == evp_type)
  ------------------
  |  Branch (104:13): [True: 26.5k, False: 26.5k]
  ------------------
  105|  26.5k|            return p;
  106|  53.1k|    }
  107|      0|    return NULL;
  108|  26.5k|}

ossl_ml_kem_get_vinfo:
 1570|  26.5k|{
 1571|  26.5k|    switch (evp_type) {
  ------------------
  |  Branch (1571:13): [True: 0, False: 26.5k]
  ------------------
 1572|  8.85k|    case EVP_PKEY_ML_KEM_512:
  ------------------
  |  |   93|  8.85k|# define EVP_PKEY_ML_KEM_512            NID_ML_KEM_512
  |  |  ------------------
  |  |  |  | 6613|  8.85k|#define NID_ML_KEM_512          1454
  |  |  ------------------
  ------------------
  |  Branch (1572:5): [True: 8.85k, False: 17.7k]
  ------------------
 1573|  8.85k|        return &vinfo_map[ML_KEM_512_VINFO];
  ------------------
  |  |  173|  8.85k|#define ML_KEM_512_VINFO    0
  ------------------
 1574|  8.85k|    case EVP_PKEY_ML_KEM_768:
  ------------------
  |  |  103|  8.85k|# define EVP_PKEY_ML_KEM_768            NID_ML_KEM_768
  |  |  ------------------
  |  |  |  | 6618|  8.85k|#define NID_ML_KEM_768          1455
  |  |  ------------------
  ------------------
  |  Branch (1574:5): [True: 8.85k, False: 17.7k]
  ------------------
 1575|  8.85k|        return &vinfo_map[ML_KEM_768_VINFO];
  ------------------
  |  |  174|  8.85k|#define ML_KEM_768_VINFO    1
  ------------------
 1576|  8.85k|    case EVP_PKEY_ML_KEM_1024:
  ------------------
  |  |  113|  8.85k|# define EVP_PKEY_ML_KEM_1024           NID_ML_KEM_1024
  |  |  ------------------
  |  |  |  | 6623|  8.85k|#define NID_ML_KEM_1024         1456
  |  |  ------------------
  ------------------
  |  Branch (1576:5): [True: 8.85k, False: 17.7k]
  ------------------
 1577|  8.85k|        return &vinfo_map[ML_KEM_1024_VINFO];
  ------------------
  |  |  175|  8.85k|#define ML_KEM_1024_VINFO   2
  ------------------
 1578|  26.5k|    }
 1579|      0|    return NULL;
 1580|  26.5k|}
ossl_ml_kem_key_free:
 1669|  34.1k|{
 1670|  34.1k|    if (key == NULL)
  ------------------
  |  Branch (1670:9): [True: 34.1k, False: 0]
  ------------------
 1671|  34.1k|        return;
 1672|       |
 1673|      0|    EVP_MD_free(key->shake128_md);
 1674|      0|    EVP_MD_free(key->shake256_md);
 1675|      0|    EVP_MD_free(key->sha3_256_md);
 1676|      0|    EVP_MD_free(key->sha3_512_md);
 1677|       |
 1678|      0|    if (ossl_ml_kem_decoded_key(key)) {
  ------------------
  |  |  207|      0|# define ossl_ml_kem_decoded_key(key)   ((key)->encoded_dk != NULL \
  |  |  ------------------
  |  |  |  Branch (207:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  208|      0|                                         || ((key)->s == NULL && (key)->d != NULL))
  |  |  ------------------
  |  |  |  Branch (208:46): [True: 0, False: 0]
  |  |  |  Branch (208:66): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1679|      0|        OPENSSL_cleanse(key->seedbuf, sizeof(key->seedbuf));
 1680|      0|        if (ossl_ml_kem_have_dkenc(key)) {
  ------------------
  |  |  206|      0|# define ossl_ml_kem_have_dkenc(key)    ((key)->encoded_dk != NULL)
  |  |  ------------------
  |  |  |  Branch (206:41): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1681|      0|            OPENSSL_cleanse(key->encoded_dk, key->vinfo->prvkey_bytes);
 1682|      0|            OPENSSL_free(key->encoded_dk);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1683|      0|        }
 1684|      0|    }
 1685|      0|    ossl_ml_kem_key_reset(key);
 1686|      0|    OPENSSL_free(key);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1687|      0|}

openssl_fopen:
   39|      2|{
   40|      2|    FILE *file = NULL;
   41|       |# if defined(_WIN32) && defined(CP_UTF8)
   42|       |    int sz, len_0;
   43|       |    DWORD flags;
   44|       |# endif
   45|       |
   46|      2|    if (filename == NULL)
  ------------------
  |  Branch (46:9): [True: 0, False: 2]
  ------------------
   47|      0|        return NULL;
   48|       |# if defined(_WIN32) && defined(CP_UTF8)
   49|       |    len_0 = (int)strlen(filename) + 1;
   50|       |
   51|       |    /*
   52|       |     * Basically there are three cases to cover: a) filename is
   53|       |     * pure ASCII string; b) actual UTF-8 encoded string and
   54|       |     * c) locale-ized string, i.e. one containing 8-bit
   55|       |     * characters that are meaningful in current system locale.
   56|       |     * If filename is pure ASCII or real UTF-8 encoded string,
   57|       |     * MultiByteToWideChar succeeds and _wfopen works. If
   58|       |     * filename is locale-ized string, chances are that
   59|       |     * MultiByteToWideChar fails reporting
   60|       |     * ERROR_NO_UNICODE_TRANSLATION, in which case we fall
   61|       |     * back to fopen...
   62|       |     */
   63|       |    if ((sz = MultiByteToWideChar(CP_UTF8, (flags = MB_ERR_INVALID_CHARS),
   64|       |                                  filename, len_0, NULL, 0)) > 0 ||
   65|       |        (GetLastError() == ERROR_INVALID_FLAGS &&
   66|       |         (sz = MultiByteToWideChar(CP_UTF8, (flags = 0),
   67|       |                                   filename, len_0, NULL, 0)) > 0)
   68|       |        ) {
   69|       |        WCHAR wmode[8];
   70|       |        WCHAR *wfilename = _alloca(sz * sizeof(WCHAR));
   71|       |
   72|       |        if (MultiByteToWideChar(CP_UTF8, flags,
   73|       |                                filename, len_0, wfilename, sz) &&
   74|       |            MultiByteToWideChar(CP_UTF8, 0, mode, strlen(mode) + 1,
   75|       |                                wmode, OSSL_NELEM(wmode)) &&
   76|       |            (file = _wfopen(wfilename, wmode)) == NULL &&
   77|       |            (errno == ENOENT || errno == EBADF)
   78|       |            ) {
   79|       |            /*
   80|       |             * UTF-8 decode succeeded, but no file, filename
   81|       |             * could still have been locale-ized...
   82|       |             */
   83|       |            file = fopen(filename, mode);
   84|       |        }
   85|       |    } else if (GetLastError() == ERROR_NO_UNICODE_TRANSLATION) {
   86|       |        file = fopen(filename, mode);
   87|       |    }
   88|       |# elif defined(__DJGPP__)
   89|       |    {
   90|       |        char *newname = NULL;
   91|       |
   92|       |        if (pathconf(filename, _PC_NAME_MAX) <= 12) {  /* 8.3 file system? */
   93|       |            char *iterator;
   94|       |            char lastchar;
   95|       |
   96|       |            if ((newname = OPENSSL_malloc(strlen(filename) + 1)) == NULL)
   97|       |                return NULL;
   98|       |
   99|       |            for (iterator = newname, lastchar = '\0';
  100|       |                *filename; filename++, iterator++) {
  101|       |                if (lastchar == '/' && filename[0] == '.'
  102|       |                    && filename[1] != '.' && filename[1] != '/') {
  103|       |                    /* Leading dots are not permitted in plain DOS. */
  104|       |                    *iterator = '_';
  105|       |                } else {
  106|       |                    *iterator = *filename;
  107|       |                }
  108|       |                lastchar = *filename;
  109|       |            }
  110|       |            *iterator = '\0';
  111|       |            filename = newname;
  112|       |        }
  113|       |        file = fopen(filename, mode);
  114|       |
  115|       |        OPENSSL_free(newname);
  116|       |    }
  117|       |# else
  118|      2|    file = fopen(filename, mode);
  119|      2|# endif
  120|      2|    return file;
  121|      2|}

CRYPTO_strdup:
   23|  1.71M|{
   24|  1.71M|    char *ret;
   25|       |
   26|  1.71M|    if (str == NULL)
  ------------------
  |  Branch (26:9): [True: 0, False: 1.71M]
  ------------------
   27|      0|        return NULL;
   28|  1.71M|    ret = CRYPTO_malloc(strlen(str) + 1, file, line);
   29|  1.71M|    if (ret != NULL)
  ------------------
  |  Branch (29:9): [True: 1.71M, False: 0]
  ------------------
   30|  1.71M|        strcpy(ret, str);
   31|  1.71M|    return ret;
   32|  1.71M|}
CRYPTO_strndup:
   35|  4.85k|{
   36|  4.85k|    size_t maxlen;
   37|  4.85k|    char *ret;
   38|       |
   39|  4.85k|    if (str == NULL)
  ------------------
  |  Branch (39:9): [True: 0, False: 4.85k]
  ------------------
   40|      0|        return NULL;
   41|       |
   42|  4.85k|    maxlen = OPENSSL_strnlen(str, s);
   43|       |
   44|  4.85k|    ret = CRYPTO_malloc(maxlen + 1, file, line);
   45|  4.85k|    if (ret) {
  ------------------
  |  Branch (45:9): [True: 4.85k, False: 0]
  ------------------
   46|  4.85k|        memcpy(ret, str, maxlen);
   47|  4.85k|        ret[maxlen] = CH_ZERO;
  ------------------
  |  |   20|  4.85k|#define CH_ZERO '\0'
  ------------------
   48|  4.85k|    }
   49|  4.85k|    return ret;
   50|  4.85k|}
CRYPTO_memdup:
   53|   195k|{
   54|   195k|    void *ret;
   55|       |
   56|   195k|    if (data == NULL || siz >= INT_MAX)
  ------------------
  |  Branch (56:9): [True: 0, False: 195k]
  |  Branch (56:25): [True: 0, False: 195k]
  ------------------
   57|      0|        return NULL;
   58|       |
   59|   195k|    ret = CRYPTO_malloc(siz, file, line);
   60|   195k|    if (ret == NULL)
  ------------------
  |  Branch (60:9): [True: 0, False: 195k]
  ------------------
   61|      0|        return NULL;
   62|   195k|    return memcpy(ret, data, siz);
   63|   195k|}
OPENSSL_strnlen:
   66|  7.42M|{
   67|  7.42M|    const char *p;
   68|       |
   69|  44.4M|    for (p = str; maxlen-- != 0 && *p != CH_ZERO; ++p) ;
  ------------------
  |  |   20|  44.4M|#define CH_ZERO '\0'
  ------------------
  |  Branch (69:19): [True: 44.4M, False: 5.90k]
  |  Branch (69:36): [True: 37.0M, False: 7.42M]
  ------------------
   70|       |
   71|  7.42M|    return p - str;
   72|  7.42M|}
OPENSSL_strlcpy:
   75|  8.43M|{
   76|  8.43M|    size_t l = 0;
   77|  83.1M|    for (; size > 1 && *src; size--) {
  ------------------
  |  Branch (77:12): [True: 83.1M, False: 4.77k]
  |  Branch (77:24): [True: 74.6M, False: 8.42M]
  ------------------
   78|  74.6M|        *dst++ = *src++;
   79|  74.6M|        l++;
   80|  74.6M|    }
   81|  8.43M|    if (size)
  ------------------
  |  Branch (81:9): [True: 8.43M, False: 473]
  ------------------
   82|  8.43M|        *dst = CH_ZERO;
  ------------------
  |  |   20|  8.43M|#define CH_ZERO '\0'
  ------------------
   83|  8.43M|    return l + strlen(src);
   84|  8.43M|}
OPENSSL_strlcat:
   87|  7.88M|{
   88|  7.88M|    size_t l = 0;
   89|  75.6M|    for (; size > 0 && *dst; size--, dst++)
  ------------------
  |  Branch (89:12): [True: 75.6M, False: 0]
  |  Branch (89:24): [True: 67.7M, False: 7.88M]
  ------------------
   90|  67.7M|        l++;
   91|  7.88M|    return l + OPENSSL_strlcpy(dst, src, size);
   92|  7.88M|}
ossl_buf2hexstr_sep:
  330|    543|{
  331|    543|    char *tmp;
  332|    543|    size_t tmp_n;
  333|       |
  334|    543|    if (buflen == 0)
  ------------------
  |  Branch (334:9): [True: 199, False: 344]
  ------------------
  335|    199|        return OPENSSL_zalloc(1);
  ------------------
  |  |  104|    199|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    199|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    199|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  336|       |
  337|    344|    tmp_n = (sep != CH_ZERO) ? buflen * 3 : 1 + buflen * 2;
  ------------------
  |  |   20|    344|#define CH_ZERO '\0'
  ------------------
  |  Branch (337:13): [True: 344, False: 0]
  ------------------
  338|    344|    if ((tmp = OPENSSL_malloc(tmp_n)) == NULL)
  ------------------
  |  |  102|    344|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    344|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    344|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (338:9): [True: 0, False: 344]
  ------------------
  339|      0|        return NULL;
  340|       |
  341|    344|    if (buf2hexstr_sep(tmp, tmp_n, NULL, buf, buflen, sep))
  ------------------
  |  Branch (341:9): [True: 344, False: 0]
  ------------------
  342|    344|        return tmp;
  343|      0|    OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  344|      0|    return NULL;
  345|    344|}
OPENSSL_buf2hexstr:
  354|    543|{
  355|    543|    return ossl_buf2hexstr_sep(buf, buflen, DEFAULT_SEPARATOR);
  ------------------
  |  |   19|    543|#define DEFAULT_SEPARATOR ':'
  ------------------
  356|    543|}
OPENSSL_strcasecmp:
  407|   784k|{
  408|   784k|    int t;
  409|       |
  410|  4.49M|    while ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) == 0)
  ------------------
  |  Branch (410:12): [True: 4.36M, False: 136k]
  ------------------
  411|  4.36M|        if (*s1++ == '\0')
  ------------------
  |  Branch (411:13): [True: 648k, False: 3.71M]
  ------------------
  412|   648k|            return 0;
  413|   136k|    return t;
  414|   784k|}
OPENSSL_strncasecmp:
  417|  18.1k|{
  418|  18.1k|    int t;
  419|  18.1k|    size_t i;
  420|       |
  421|  53.1k|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (421:17): [True: 36.5k, False: 16.5k]
  ------------------
  422|  36.5k|        if ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) != 0)
  ------------------
  |  Branch (422:13): [True: 1.58k, False: 34.9k]
  ------------------
  423|  1.58k|            return t;
  424|  34.9k|        else if (*s1++ == '\0')
  ------------------
  |  Branch (424:18): [True: 0, False: 34.9k]
  ------------------
  425|      0|            return 0;
  426|  16.5k|    return 0;
  427|  18.1k|}
ossl_to_hex:
  430|  1.13M|{
  431|  1.13M|    static const char hexdig[] = "0123456789ABCDEF";
  432|       |
  433|  1.13M|    return to_hex(buf, n, hexdig);
  434|  1.13M|}
o_str.c:buf2hexstr_sep:
  289|    344|{
  290|    344|    char *q;
  291|    344|    int has_sep = (sep != CH_ZERO);
  ------------------
  |  |   20|    344|#define CH_ZERO '\0'
  ------------------
  292|    344|    size_t i, len = has_sep ? buflen * 3 : 1 + buflen * 2;
  ------------------
  |  Branch (292:21): [True: 344, False: 0]
  ------------------
  293|       |
  294|    344|    if (len == 0)
  ------------------
  |  Branch (294:9): [True: 0, False: 344]
  ------------------
  295|      0|        ++len;
  296|    344|    if (strlength != NULL)
  ------------------
  |  Branch (296:9): [True: 0, False: 344]
  ------------------
  297|      0|        *strlength = len;
  298|    344|    if (str == NULL)
  ------------------
  |  Branch (298:9): [True: 0, False: 344]
  ------------------
  299|      0|        return 1;
  300|       |
  301|    344|    if (str_n < len) {
  ------------------
  |  Branch (301:9): [True: 0, False: 344]
  ------------------
  302|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_SMALL_BUFFER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  303|      0|        return 0;
  304|      0|    }
  305|       |
  306|    344|    q = str;
  307|  1.07k|    for (i = 0; i < buflen; i++) {
  ------------------
  |  Branch (307:17): [True: 734, False: 344]
  ------------------
  308|    734|        q += ossl_to_hex(q, buf[i]);
  309|    734|        if (has_sep)
  ------------------
  |  Branch (309:13): [True: 734, False: 0]
  ------------------
  310|    734|            *q++ = sep;
  311|    734|    }
  312|    344|    if (has_sep && buflen > 0)
  ------------------
  |  Branch (312:9): [True: 344, False: 0]
  |  Branch (312:20): [True: 344, False: 0]
  ------------------
  313|    344|        --q;
  314|    344|    *q = CH_ZERO;
  ------------------
  |  |   20|    344|#define CH_ZERO '\0'
  ------------------
  315|       |
  316|       |#ifdef CHARSET_EBCDIC
  317|       |    ebcdic2ascii(str, str, q - str);
  318|       |#endif
  319|    344|    return 1;
  320|    344|}

OPENSSL_gmtime_adj:
   73|  1.86k|{
   74|  1.86k|    int time_sec, time_year, time_month, time_day;
   75|  1.86k|    long time_jd;
   76|       |
   77|       |    /* Convert time and offset into Julian day and seconds */
   78|  1.86k|    if (!julian_adj(tm, off_day, offset_sec, &time_jd, &time_sec))
  ------------------
  |  Branch (78:9): [True: 0, False: 1.86k]
  ------------------
   79|      0|        return 0;
   80|       |
   81|       |    /* Convert Julian day back to date */
   82|       |
   83|  1.86k|    julian_to_date(time_jd, &time_year, &time_month, &time_day);
   84|       |
   85|  1.86k|    if (time_year < 1900 || time_year > 9999)
  ------------------
  |  Branch (85:9): [True: 219, False: 1.64k]
  |  Branch (85:29): [True: 11, False: 1.63k]
  ------------------
   86|    230|        return 0;
   87|       |
   88|       |    /* Update tm structure */
   89|       |
   90|  1.63k|    tm->tm_year = time_year - 1900;
   91|  1.63k|    tm->tm_mon = time_month - 1;
   92|  1.63k|    tm->tm_mday = time_day;
   93|       |
   94|  1.63k|    tm->tm_hour = time_sec / 3600;
   95|  1.63k|    tm->tm_min = (time_sec / 60) % 60;
   96|  1.63k|    tm->tm_sec = time_sec % 60;
   97|       |
   98|  1.63k|    return 1;
   99|       |
  100|  1.86k|}
o_time.c:julian_adj:
  135|  1.86k|{
  136|  1.86k|    int offset_hms;
  137|  1.86k|    long offset_day, time_jd;
  138|  1.86k|    int time_year, time_month, time_day;
  139|       |    /* split offset into days and day seconds */
  140|  1.86k|    offset_day = offset_sec / SECS_PER_DAY;
  ------------------
  |  |   65|  1.86k|#define SECS_PER_DAY (24 * 60 * 60)
  ------------------
  141|       |    /* Avoid sign issues with % operator */
  142|  1.86k|    offset_hms = offset_sec - (offset_day * SECS_PER_DAY);
  ------------------
  |  |   65|  1.86k|#define SECS_PER_DAY (24 * 60 * 60)
  ------------------
  143|  1.86k|    offset_day += off_day;
  144|       |    /* Add current time seconds to offset */
  145|  1.86k|    offset_hms += tm->tm_hour * 3600 + tm->tm_min * 60 + tm->tm_sec;
  146|       |    /* Adjust day seconds if overflow */
  147|  1.86k|    if (offset_hms >= SECS_PER_DAY) {
  ------------------
  |  |   65|  1.86k|#define SECS_PER_DAY (24 * 60 * 60)
  ------------------
  |  Branch (147:9): [True: 578, False: 1.28k]
  ------------------
  148|    578|        offset_day++;
  149|    578|        offset_hms -= SECS_PER_DAY;
  ------------------
  |  |   65|    578|#define SECS_PER_DAY (24 * 60 * 60)
  ------------------
  150|  1.28k|    } else if (offset_hms < 0) {
  ------------------
  |  Branch (150:16): [True: 852, False: 432]
  ------------------
  151|    852|        offset_day--;
  152|    852|        offset_hms += SECS_PER_DAY;
  ------------------
  |  |   65|    852|#define SECS_PER_DAY (24 * 60 * 60)
  ------------------
  153|    852|    }
  154|       |
  155|       |    /*
  156|       |     * Convert date of time structure into a Julian day number.
  157|       |     */
  158|       |
  159|  1.86k|    time_year = tm->tm_year + 1900;
  160|  1.86k|    time_month = tm->tm_mon + 1;
  161|  1.86k|    time_day = tm->tm_mday;
  162|       |
  163|  1.86k|    time_jd = date_to_julian(time_year, time_month, time_day);
  164|       |
  165|       |    /* Work out Julian day of new date */
  166|  1.86k|    time_jd += offset_day;
  167|       |
  168|  1.86k|    if (time_jd < 0)
  ------------------
  |  Branch (168:9): [True: 0, False: 1.86k]
  ------------------
  169|      0|        return 0;
  170|       |
  171|  1.86k|    *pday = time_jd;
  172|  1.86k|    *psec = offset_hms;
  173|  1.86k|    return 1;
  174|  1.86k|}
o_time.c:date_to_julian:
  180|  1.86k|{
  181|  1.86k|    return (1461 * (y + 4800 + (m - 14) / 12)) / 4 +
  182|  1.86k|        (367 * (m - 2 - 12 * ((m - 14) / 12))) / 12 -
  183|  1.86k|        (3 * ((y + 4900 + (m - 14) / 12) / 100)) / 4 + d - 32075;
  184|  1.86k|}
o_time.c:julian_to_date:
  187|  1.86k|{
  188|  1.86k|    long L = jd + 68569;
  189|  1.86k|    long n = (4 * L) / 146097;
  190|  1.86k|    long i, j;
  191|       |
  192|  1.86k|    L = L - (146097 * n + 3) / 4;
  193|  1.86k|    i = (4000 * (L + 1)) / 1461001;
  194|  1.86k|    L = L - (1461 * i) / 4 + 31;
  195|  1.86k|    j = (80 * L) / 2447;
  196|  1.86k|    *d = L - (2447 * j) / 80;
  197|  1.86k|    L = j / 11;
  198|  1.86k|    *m = j + 2 - (12 * L);
  199|  1.86k|    *y = 100 * (n - 49) + i + L;
  200|  1.86k|}

OBJ_NAME_init:
   64|  1.64k|{
   65|  1.64k|    return RUN_ONCE(&init, o_names_init);
  ------------------
  |  |  130|  1.64k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1.64k, False: 0]
  |  |  ------------------
  ------------------
   66|  1.64k|}
OBJ_NAME_get:
  152|    313|{
  153|    313|    OBJ_NAME on, *ret;
  154|    313|    int num = 0, alias;
  155|    313|    const char *value = NULL;
  156|       |
  157|    313|    if (name == NULL)
  ------------------
  |  Branch (157:9): [True: 0, False: 313]
  ------------------
  158|      0|        return NULL;
  159|    313|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (159:9): [True: 0, False: 313]
  ------------------
  160|      0|        return NULL;
  161|    313|    if (!CRYPTO_THREAD_read_lock(obj_lock))
  ------------------
  |  Branch (161:9): [True: 0, False: 313]
  ------------------
  162|      0|        return NULL;
  163|       |
  164|    313|    alias = type & OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    313|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  165|    313|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    313|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  166|       |
  167|    313|    on.name = name;
  168|    313|    on.type = type;
  169|       |
  170|    388|    for (;;) {
  171|    388|        ret = lh_OBJ_NAME_retrieve(names_lh, &on);
  172|    388|        if (ret == NULL)
  ------------------
  |  Branch (172:13): [True: 48, False: 340]
  ------------------
  173|     48|            break;
  174|    340|        if ((ret->alias) && !alias) {
  ------------------
  |  Branch (174:13): [True: 75, False: 265]
  |  Branch (174:29): [True: 75, False: 0]
  ------------------
  175|     75|            if (++num > 10)
  ------------------
  |  Branch (175:17): [True: 0, False: 75]
  ------------------
  176|      0|                break;
  177|     75|            on.name = ret->data;
  178|    265|        } else {
  179|    265|            value = ret->data;
  180|    265|            break;
  181|    265|        }
  182|    340|    }
  183|       |
  184|    313|    CRYPTO_THREAD_unlock(obj_lock);
  185|    313|    return value;
  186|    313|}
OBJ_NAME_add:
  189|    848|{
  190|    848|    OBJ_NAME *onp, *ret;
  191|    848|    int alias, ok = 0;
  192|       |
  193|    848|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (193:9): [True: 0, False: 848]
  ------------------
  194|      0|        return 0;
  195|       |
  196|    848|    alias = type & OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    848|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  197|    848|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    848|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  198|       |
  199|    848|    onp = OPENSSL_malloc(sizeof(*onp));
  ------------------
  |  |  102|    848|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    848|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    848|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  200|    848|    if (onp == NULL)
  ------------------
  |  Branch (200:9): [True: 0, False: 848]
  ------------------
  201|      0|        return 0;
  202|       |
  203|    848|    onp->name = name;
  204|    848|    onp->alias = alias;
  205|    848|    onp->type = type;
  206|    848|    onp->data = data;
  207|       |
  208|    848|    if (!CRYPTO_THREAD_write_lock(obj_lock)) {
  ------------------
  |  Branch (208:9): [True: 0, False: 848]
  ------------------
  209|      0|        OPENSSL_free(onp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  210|      0|        return 0;
  211|      0|    }
  212|       |
  213|    848|    ret = lh_OBJ_NAME_insert(names_lh, onp);
  214|    848|    if (ret != NULL) {
  ------------------
  |  Branch (214:9): [True: 364, False: 484]
  ------------------
  215|       |        /* free things */
  216|    364|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (216:13): [True: 0, False: 364]
  ------------------
  217|    364|            && (sk_NAME_FUNCS_num(name_funcs_stack) > ret->type)) {
  ------------------
  |  Branch (217:16): [True: 0, False: 0]
  ------------------
  218|       |            /*
  219|       |             * XXX: I'm not sure I understand why the free function should
  220|       |             * get three arguments... -- Richard Levitte
  221|       |             */
  222|      0|            sk_NAME_FUNCS_value(name_funcs_stack,
  223|      0|                                ret->type)->free_func(ret->name, ret->type,
  224|      0|                                                      ret->data);
  225|      0|        }
  226|    364|        OPENSSL_free(ret);
  ------------------
  |  |  115|    364|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    364|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    364|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  227|    484|    } else {
  228|    484|        if (lh_OBJ_NAME_error(names_lh)) {
  ------------------
  |  Branch (228:13): [True: 0, False: 484]
  ------------------
  229|       |            /* ERROR */
  230|      0|            OPENSSL_free(onp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  231|      0|            goto unlock;
  232|      0|        }
  233|    484|    }
  234|       |
  235|    848|    ok = 1;
  236|       |
  237|    848|unlock:
  238|    848|    CRYPTO_THREAD_unlock(obj_lock);
  239|    848|    return ok;
  240|    848|}
OBJ_NAME_remove:
  243|    484|{
  244|    484|    OBJ_NAME on, *ret;
  245|    484|    int ok = 0;
  246|       |
  247|    484|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (247:9): [True: 0, False: 484]
  ------------------
  248|      0|        return 0;
  249|       |
  250|    484|    if (!CRYPTO_THREAD_write_lock(obj_lock))
  ------------------
  |  Branch (250:9): [True: 0, False: 484]
  ------------------
  251|      0|        return 0;
  252|       |
  253|    484|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    484|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  254|    484|    on.name = name;
  255|    484|    on.type = type;
  256|    484|    ret = lh_OBJ_NAME_delete(names_lh, &on);
  257|    484|    if (ret != NULL) {
  ------------------
  |  Branch (257:9): [True: 484, False: 0]
  ------------------
  258|       |        /* free things */
  259|    484|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (259:13): [True: 0, False: 484]
  ------------------
  260|    484|            && (sk_NAME_FUNCS_num(name_funcs_stack) > ret->type)) {
  ------------------
  |  Branch (260:16): [True: 0, False: 0]
  ------------------
  261|       |            /*
  262|       |             * XXX: I'm not sure I understand why the free function should
  263|       |             * get three arguments... -- Richard Levitte
  264|       |             */
  265|      0|            sk_NAME_FUNCS_value(name_funcs_stack,
  266|      0|                                ret->type)->free_func(ret->name, ret->type,
  267|      0|                                                      ret->data);
  268|      0|        }
  269|    484|        OPENSSL_free(ret);
  ------------------
  |  |  115|    484|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    484|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    484|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  270|    484|        ok = 1;
  271|    484|    }
  272|       |
  273|    484|    CRYPTO_THREAD_unlock(obj_lock);
  274|    484|    return ok;
  275|    484|}
OBJ_NAME_do_all:
  293|      2|{
  294|      2|    OBJ_DOALL d;
  295|       |
  296|      2|    d.type = type;
  297|      2|    d.fn = fn;
  298|      2|    d.arg = arg;
  299|       |
  300|      2|    lh_OBJ_NAME_doall_OBJ_DOALL(names_lh, do_all_fn, &d);
  301|      2|}
OBJ_NAME_cleanup:
  368|      8|{
  369|      8|    unsigned long down_load;
  370|       |
  371|      8|    if (names_lh == NULL)
  ------------------
  |  Branch (371:9): [True: 0, False: 8]
  ------------------
  372|      0|        return;
  373|       |
  374|      8|    free_type = type;
  375|      8|    down_load = lh_OBJ_NAME_get_down_load(names_lh);
  376|      8|    lh_OBJ_NAME_set_down_load(names_lh, 0);
  377|       |
  378|      8|    lh_OBJ_NAME_doall(names_lh, names_lh_free_doall);
  379|      8|    if (type < 0) {
  ------------------
  |  Branch (379:9): [True: 2, False: 6]
  ------------------
  380|      2|        lh_OBJ_NAME_free(names_lh);
  381|      2|        sk_NAME_FUNCS_pop_free(name_funcs_stack, name_funcs_free);
  382|      2|        CRYPTO_THREAD_lock_free(obj_lock);
  383|      2|        names_lh = NULL;
  384|      2|        name_funcs_stack = NULL;
  385|      2|        obj_lock = NULL;
  386|      2|    } else
  387|      6|        lh_OBJ_NAME_set_down_load(names_lh, down_load);
  388|      8|}
o_names.c:o_names_init:
   51|      2|{
   52|      2|    names_lh = NULL;
   53|      2|    obj_lock = CRYPTO_THREAD_lock_new();
   54|      2|    if (obj_lock != NULL)
  ------------------
  |  Branch (54:9): [True: 2, False: 0]
  ------------------
   55|      2|        names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
   56|      2|    if (names_lh == NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 2]
  ------------------
   57|      0|        CRYPTO_THREAD_lock_free(obj_lock);
   58|      0|        obj_lock = NULL;
   59|      0|    }
   60|      2|    return names_lh != NULL && obj_lock != NULL;
  ------------------
  |  Branch (60:12): [True: 2, False: 0]
  |  Branch (60:32): [True: 2, False: 0]
  ------------------
   61|      2|}
o_names.c:obj_name_hash:
  136|  1.72k|{
  137|  1.72k|    unsigned long ret;
  138|       |
  139|  1.72k|    if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (139:9): [True: 0, False: 1.72k]
  ------------------
  140|  1.72k|        && (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) {
  ------------------
  |  Branch (140:12): [True: 0, False: 0]
  ------------------
  141|      0|        ret =
  142|      0|            sk_NAME_FUNCS_value(name_funcs_stack,
  143|      0|                                a->type)->hash_func(a->name);
  144|  1.72k|    } else {
  145|  1.72k|        ret = ossl_lh_strcasehash(a->name);
  146|  1.72k|    }
  147|  1.72k|    ret ^= a->type;
  148|  1.72k|    return ret;
  149|  1.72k|}
o_names.c:obj_name_cmp:
  120|  1.18k|{
  121|  1.18k|    int ret;
  122|       |
  123|  1.18k|    ret = a->type - b->type;
  124|  1.18k|    if (ret == 0) {
  ------------------
  |  Branch (124:9): [True: 1.18k, False: 0]
  ------------------
  125|  1.18k|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (125:13): [True: 0, False: 1.18k]
  ------------------
  126|  1.18k|            && (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) {
  ------------------
  |  Branch (126:16): [True: 0, False: 0]
  ------------------
  127|      0|            ret = sk_NAME_FUNCS_value(name_funcs_stack,
  128|      0|                                      a->type)->cmp_func(a->name, b->name);
  129|      0|        } else
  130|  1.18k|            ret = OPENSSL_strcasecmp(a->name, b->name);
  131|  1.18k|    }
  132|  1.18k|    return ret;
  133|  1.18k|}
o_names.c:do_all_fn:
  284|    484|{
  285|    484|    if (name->type == d->type)
  ------------------
  |  Branch (285:9): [True: 242, False: 242]
  ------------------
  286|    242|        d->fn(name, d->arg);
  287|    484|}
o_names.c:names_lh_free_doall:
  354|  1.08k|{
  355|  1.08k|    if (onp == NULL)
  ------------------
  |  Branch (355:9): [True: 0, False: 1.08k]
  ------------------
  356|      0|        return;
  357|       |
  358|  1.08k|    if (free_type < 0 || free_type == onp->type)
  ------------------
  |  Branch (358:9): [True: 0, False: 1.08k]
  |  Branch (358:26): [True: 484, False: 602]
  ------------------
  359|    484|        OBJ_NAME_remove(onp->name, onp->type);
  360|  1.08k|}

ossl_obj_cleanup_int:
  212|      2|{
  213|      2|    if (added != NULL) {
  ------------------
  |  Branch (213:9): [True: 0, False: 2]
  ------------------
  214|      0|        lh_ADDED_OBJ_set_down_load(added, 0);
  215|      0|        lh_ADDED_OBJ_doall(added, cleanup1_doall); /* zero counters */
  216|      0|        lh_ADDED_OBJ_doall(added, cleanup2_doall); /* set counters */
  217|      0|        lh_ADDED_OBJ_doall(added, cleanup3_doall); /* free objects */
  218|      0|        lh_ADDED_OBJ_free(added);
  219|      0|        added = NULL;
  220|      0|    }
  221|      2|    objs_free_locks();
  222|      2|}
OBJ_nid2obj:
  331|  2.54M|{
  332|  2.54M|    ADDED_OBJ ad, *adp = NULL;
  333|  2.54M|    ASN1_OBJECT ob;
  334|       |
  335|  2.54M|    if (n == NID_undef
  ------------------
  |  |   18|  5.08M|#define NID_undef                       0
  ------------------
  |  Branch (335:9): [True: 1.71M, False: 828k]
  ------------------
  336|  2.54M|        || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  | 1353|  1.65M|#define NUM_NID 1496
  ------------------
                      || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  |   18|   828k|#define NID_undef                       0
  ------------------
  |  Branch (336:13): [True: 828k, False: 47]
  |  Branch (336:22): [True: 828k, False: 0]
  |  Branch (336:37): [True: 828k, False: 0]
  ------------------
  337|  2.54M|        return (ASN1_OBJECT *)&(nid_objs[n]);
  338|       |
  339|     47|    ad.type = ADDED_NID;
  ------------------
  |  |   33|     47|#define ADDED_NID       3
  ------------------
  340|     47|    ad.obj = &ob;
  341|     47|    ob.nid = n;
  342|     47|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (342:9): [True: 0, False: 47]
  ------------------
  343|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  344|      0|        return NULL;
  345|      0|    }
  346|     47|    if (added != NULL)
  ------------------
  |  Branch (346:9): [True: 0, False: 47]
  ------------------
  347|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  348|     47|    ossl_obj_unlock(1);
  349|     47|    if (adp != NULL)
  ------------------
  |  Branch (349:9): [True: 0, False: 47]
  ------------------
  350|      0|        return adp->obj;
  351|       |
  352|     47|    ERR_raise(ERR_LIB_OBJ, OBJ_R_UNKNOWN_NID);
  ------------------
  |  |  401|     47|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     47|    (ERR_new(),                                                 \
  |  |  |  |  404|     47|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     47|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     47|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     47|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     47|     ERR_set_error)
  |  |  ------------------
  ------------------
  353|     47|    return NULL;
  354|     47|}
OBJ_nid2sn:
  357|  19.3k|{
  358|  19.3k|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  359|       |
  360|  19.3k|    return ob == NULL ? NULL : ob->sn;
  ------------------
  |  Branch (360:12): [True: 47, False: 19.2k]
  ------------------
  361|  19.3k|}
OBJ_nid2ln:
  364|   273k|{
  365|   273k|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  366|       |
  367|   273k|    return ob == NULL ? NULL : ob->ln;
  ------------------
  |  Branch (367:12): [True: 0, False: 273k]
  ------------------
  368|   273k|}
OBJ_obj2txt:
  469|   393k|{
  470|   393k|    int i, n = 0, len, nid, first, use_bn;
  471|   393k|    BIGNUM *bl;
  472|   393k|    unsigned long l;
  473|   393k|    const unsigned char *p;
  474|   393k|    char tbuf[DECIMAL_SIZE(i) + DECIMAL_SIZE(l) + 2];
  475|   393k|    const char *s;
  476|       |
  477|       |    /* Ensure that, at every state, |buf| is NUL-terminated. */
  478|   393k|    if (buf != NULL && buf_len > 0)
  ------------------
  |  Branch (478:9): [True: 393k, False: 0]
  |  Branch (478:24): [True: 393k, False: 0]
  ------------------
  479|   393k|        buf[0] = '\0';
  480|       |
  481|   393k|    if (a == NULL || a->data == NULL)
  ------------------
  |  Branch (481:9): [True: 0, False: 393k]
  |  Branch (481:22): [True: 1, False: 393k]
  ------------------
  482|      1|        return 0;
  483|       |
  484|   393k|    if (!no_name && (nid = OBJ_obj2nid(a)) != NID_undef) {
  ------------------
  |  |   18|   363k|#define NID_undef                       0
  ------------------
  |  Branch (484:9): [True: 363k, False: 30.2k]
  |  Branch (484:21): [True: 249k, False: 114k]
  ------------------
  485|   249k|        s = OBJ_nid2ln(nid);
  486|   249k|        if (s == NULL)
  ------------------
  |  Branch (486:13): [True: 0, False: 249k]
  ------------------
  487|      0|            s = OBJ_nid2sn(nid);
  488|   249k|        if (s != NULL) {
  ------------------
  |  Branch (488:13): [True: 249k, False: 0]
  ------------------
  489|   249k|            if (buf != NULL)
  ------------------
  |  Branch (489:17): [True: 249k, False: 0]
  ------------------
  490|   249k|                OPENSSL_strlcpy(buf, s, buf_len);
  491|   249k|            return (int)strlen(s);
  492|   249k|        }
  493|   249k|    }
  494|       |
  495|   144k|    len = a->length;
  496|   144k|    p = a->data;
  497|       |
  498|   144k|    first = 1;
  499|   144k|    bl = NULL;
  500|       |
  501|       |    /*
  502|       |     * RFC 2578 (STD 58) says this about OBJECT IDENTIFIERs:
  503|       |     *
  504|       |     * > 3.5. OBJECT IDENTIFIER values
  505|       |     * >
  506|       |     * > An OBJECT IDENTIFIER value is an ordered list of non-negative
  507|       |     * > numbers. For the SMIv2, each number in the list is referred to as a
  508|       |     * > sub-identifier, there are at most 128 sub-identifiers in a value,
  509|       |     * > and each sub-identifier has a maximum value of 2^32-1 (4294967295
  510|       |     * > decimal).
  511|       |     *
  512|       |     * So a legitimate OID according to this RFC is at most (32 * 128 / 7),
  513|       |     * i.e. 586 bytes long.
  514|       |     *
  515|       |     * Ref: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5
  516|       |     */
  517|   144k|    if (len > 586)
  ------------------
  |  Branch (517:9): [True: 108, False: 144k]
  ------------------
  518|    108|        goto err;
  519|       |
  520|   459k|    while (len > 0) {
  ------------------
  |  Branch (520:12): [True: 315k, False: 144k]
  ------------------
  521|   315k|        l = 0;
  522|   315k|        use_bn = 0;
  523|   425k|        for (;;) {
  524|   425k|            unsigned char c = *p++;
  525|       |
  526|   425k|            len--;
  527|   425k|            if (len == 0 && (c & 0x80) != 0)
  ------------------
  |  Branch (527:17): [True: 144k, False: 281k]
  |  Branch (527:29): [True: 0, False: 144k]
  ------------------
  528|      0|                goto err;
  529|   425k|            if (use_bn) {
  ------------------
  |  Branch (529:17): [True: 32.5k, False: 393k]
  ------------------
  530|  32.5k|                if (!BN_add_word(bl, c & 0x7f))
  ------------------
  |  Branch (530:21): [True: 0, False: 32.5k]
  ------------------
  531|      0|                    goto err;
  532|   393k|            } else {
  533|   393k|                l |= c & 0x7f;
  534|   393k|            }
  535|   425k|            if ((c & 0x80) == 0)
  ------------------
  |  Branch (535:17): [True: 315k, False: 110k]
  ------------------
  536|   315k|                break;
  537|   110k|            if (!use_bn && l > (ULONG_MAX >> 7L)) {
  ------------------
  |  Branch (537:17): [True: 81.6k, False: 28.7k]
  |  Branch (537:28): [True: 3.80k, False: 77.8k]
  ------------------
  538|  3.80k|                if (bl == NULL && (bl = BN_new()) == NULL)
  ------------------
  |  Branch (538:21): [True: 2.85k, False: 947]
  |  Branch (538:35): [True: 0, False: 2.85k]
  ------------------
  539|      0|                    goto err;
  540|  3.80k|                if (!BN_set_word(bl, l))
  ------------------
  |  Branch (540:21): [True: 0, False: 3.80k]
  ------------------
  541|      0|                    goto err;
  542|  3.80k|                use_bn = 1;
  543|  3.80k|            }
  544|   110k|            if (use_bn) {
  ------------------
  |  Branch (544:17): [True: 32.5k, False: 77.8k]
  ------------------
  545|  32.5k|                if (!BN_lshift(bl, bl, 7))
  ------------------
  |  Branch (545:21): [True: 0, False: 32.5k]
  ------------------
  546|      0|                    goto err;
  547|  77.8k|            } else {
  548|  77.8k|                l <<= 7L;
  549|  77.8k|            }
  550|   110k|        }
  551|       |
  552|   315k|        if (first) {
  ------------------
  |  Branch (552:13): [True: 144k, False: 171k]
  ------------------
  553|   144k|            first = 0;
  554|   144k|            if (l >= 80) {
  ------------------
  |  Branch (554:17): [True: 28.8k, False: 115k]
  ------------------
  555|  28.8k|                i = 2;
  556|  28.8k|                if (use_bn) {
  ------------------
  |  Branch (556:21): [True: 2.40k, False: 26.4k]
  ------------------
  557|  2.40k|                    if (!BN_sub_word(bl, 80))
  ------------------
  |  Branch (557:25): [True: 0, False: 2.40k]
  ------------------
  558|      0|                        goto err;
  559|  26.4k|                } else {
  560|  26.4k|                    l -= 80;
  561|  26.4k|                }
  562|   115k|            } else {
  563|   115k|                i = (int)(l / 40);
  564|   115k|                l -= (long)(i * 40);
  565|   115k|            }
  566|   144k|            if (buf != NULL && buf_len > 1) {
  ------------------
  |  Branch (566:17): [True: 144k, False: 0]
  |  Branch (566:32): [True: 144k, False: 0]
  ------------------
  567|   144k|                *buf++ = i + '0';
  568|   144k|                *buf = '\0';
  569|   144k|                buf_len--;
  570|   144k|            }
  571|   144k|            n++;
  572|   144k|        }
  573|       |
  574|   315k|        if (use_bn) {
  ------------------
  |  Branch (574:13): [True: 3.80k, False: 311k]
  ------------------
  575|  3.80k|            char *bndec;
  576|  3.80k|            bndec = BN_bn2dec(bl);
  577|  3.80k|            if (!bndec)
  ------------------
  |  Branch (577:17): [True: 0, False: 3.80k]
  ------------------
  578|      0|                goto err;
  579|  3.80k|            i = strlen(bndec);
  580|  3.80k|            if (buf != NULL) {
  ------------------
  |  Branch (580:17): [True: 3.80k, False: 0]
  ------------------
  581|  3.80k|                if (buf_len > 1) {
  ------------------
  |  Branch (581:21): [True: 3.31k, False: 484]
  ------------------
  582|  3.31k|                    *buf++ = '.';
  583|  3.31k|                    *buf = '\0';
  584|  3.31k|                    buf_len--;
  585|  3.31k|                }
  586|  3.80k|                OPENSSL_strlcpy(buf, bndec, buf_len);
  587|  3.80k|                if (i > buf_len) {
  ------------------
  |  Branch (587:21): [True: 672, False: 3.12k]
  ------------------
  588|    672|                    buf += buf_len;
  589|    672|                    buf_len = 0;
  590|  3.12k|                } else {
  591|  3.12k|                    buf += i;
  592|  3.12k|                    buf_len -= i;
  593|  3.12k|                }
  594|  3.80k|            }
  595|  3.80k|            n++;
  596|  3.80k|            n += i;
  597|  3.80k|            OPENSSL_free(bndec);
  ------------------
  |  |  115|  3.80k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.80k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.80k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  598|   311k|        } else {
  599|   311k|            BIO_snprintf(tbuf, sizeof(tbuf), ".%lu", l);
  600|   311k|            i = strlen(tbuf);
  601|   311k|            if (buf && buf_len > 0) {
  ------------------
  |  Branch (601:17): [True: 311k, False: 0]
  |  Branch (601:24): [True: 290k, False: 21.0k]
  ------------------
  602|   290k|                OPENSSL_strlcpy(buf, tbuf, buf_len);
  603|   290k|                if (i > buf_len) {
  ------------------
  |  Branch (603:21): [True: 932, False: 289k]
  ------------------
  604|    932|                    buf += buf_len;
  605|    932|                    buf_len = 0;
  606|   289k|                } else {
  607|   289k|                    buf += i;
  608|   289k|                    buf_len -= i;
  609|   289k|                }
  610|   290k|            }
  611|   311k|            n += i;
  612|   311k|            l = 0;
  613|   311k|        }
  614|   315k|    }
  615|       |
  616|   144k|    BN_free(bl);
  617|   144k|    return n;
  618|       |
  619|    108| err:
  620|    108|    BN_free(bl);
  621|    108|    return -1;
  622|   144k|}
OBJ_ln2nid:
  637|     73|{
  638|     73|    ASN1_OBJECT o;
  639|     73|    const ASN1_OBJECT *oo = &o;
  640|     73|    ADDED_OBJ ad, *adp;
  641|     73|    const unsigned int *op;
  642|     73|    int nid = NID_undef;
  ------------------
  |  |   18|     73|#define NID_undef                       0
  ------------------
  643|       |
  644|     73|    o.ln = s;
  645|     73|    op = OBJ_bsearch_ln(&oo, ln_objs, NUM_LN);
  ------------------
  |  | 4344|     73|#define NUM_LN 1487
  ------------------
  646|     73|    if (op != NULL)
  ------------------
  |  Branch (646:9): [True: 18, False: 55]
  ------------------
  647|     18|        return nid_objs[*op].nid;
  648|     55|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (648:9): [True: 0, False: 55]
  ------------------
  649|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  650|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  651|      0|    }
  652|     55|    if (added != NULL) {
  ------------------
  |  Branch (652:9): [True: 0, False: 55]
  ------------------
  653|      0|        ad.type = ADDED_LNAME;
  ------------------
  |  |   32|      0|#define ADDED_LNAME     2
  ------------------
  654|      0|        ad.obj = &o;
  655|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  656|      0|        if (adp != NULL)
  ------------------
  |  Branch (656:13): [True: 0, False: 0]
  ------------------
  657|      0|            nid = adp->obj->nid;
  658|      0|    }
  659|     55|    ossl_obj_unlock(1);
  660|     55|    return nid;
  661|     55|}
OBJ_sn2nid:
  664|     78|{
  665|     78|    ASN1_OBJECT o;
  666|     78|    const ASN1_OBJECT *oo = &o;
  667|     78|    ADDED_OBJ ad, *adp;
  668|     78|    const unsigned int *op;
  669|     78|    int nid = NID_undef;
  ------------------
  |  |   18|     78|#define NID_undef                       0
  ------------------
  670|       |
  671|     78|    o.sn = s;
  672|     78|    op = OBJ_bsearch_sn(&oo, sn_objs, NUM_SN);
  ------------------
  |  | 2853|     78|#define NUM_SN 1487
  ------------------
  673|     78|    if (op != NULL)
  ------------------
  |  Branch (673:9): [True: 28, False: 50]
  ------------------
  674|     28|        return nid_objs[*op].nid;
  675|     50|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (675:9): [True: 0, False: 50]
  ------------------
  676|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  677|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  678|      0|    }
  679|     50|    if (added != NULL) {
  ------------------
  |  Branch (679:9): [True: 0, False: 50]
  ------------------
  680|      0|        ad.type = ADDED_SNAME;
  ------------------
  |  |   31|      0|#define ADDED_SNAME     1
  ------------------
  681|      0|        ad.obj = &o;
  682|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  683|      0|        if (adp != NULL)
  ------------------
  |  Branch (683:13): [True: 0, False: 0]
  ------------------
  684|      0|            nid = adp->obj->nid;
  685|      0|    }
  686|     50|    ossl_obj_unlock(1);
  687|     50|    return nid;
  688|     50|}
OBJ_bsearch_:
  692|  1.28M|{
  693|  1.28M|    return OBJ_bsearch_ex_(key, base, num, size, cmp, 0);
  694|  1.28M|}
OBJ_bsearch_ex_:
  700|  1.28M|{
  701|  1.28M|    const char *p = ossl_bsearch(key, base, num, size, cmp, flags);
  702|       |
  703|       |#ifdef CHARSET_EBCDIC
  704|       |    /*
  705|       |     * THIS IS A KLUDGE - Because the *_obj is sorted in ASCII order, and I
  706|       |     * don't have perl (yet), we revert to a *LINEAR* search when the object
  707|       |     * wasn't found in the binary search.
  708|       |     */
  709|       |    if (p == NULL) {
  710|       |        const char *base_ = base;
  711|       |        int l, h, i = 0, c = 0;
  712|       |        char *p1;
  713|       |
  714|       |        for (i = 0; i < num; ++i) {
  715|       |            p1 = &(base_[i * size]);
  716|       |            c = (*cmp) (key, p1);
  717|       |            if (c == 0
  718|       |                || (c < 0 && (flags & OBJ_BSEARCH_VALUE_ON_NOMATCH)))
  719|       |                return p1;
  720|       |        }
  721|       |    }
  722|       |#endif
  723|  1.28M|    return p;
  724|  1.28M|}
OBJ_length:
  844|  26.7k|{
  845|  26.7k|    if (obj == NULL)
  ------------------
  |  Branch (845:9): [True: 0, False: 26.7k]
  ------------------
  846|      0|        return 0;
  847|  26.7k|    return obj->length;
  848|  26.7k|}
OBJ_get0_data:
  851|    159|{
  852|    159|    if (obj == NULL)
  ------------------
  |  Branch (852:9): [True: 0, False: 159]
  ------------------
  853|      0|        return NULL;
  854|    159|    return obj->data;
  855|    159|}
OBJ_obj2nid:
  863|  1.83M|{
  864|  1.83M|    return ossl_obj_obj2nid(a, 1);
  865|  1.83M|}
obj_dat.c:objs_free_locks:
   49|      2|{
   50|      2|    CRYPTO_THREAD_lock_free(ossl_obj_lock);
   51|      2|    ossl_obj_lock = NULL;
   52|       |#ifdef TSAN_REQUIRES_LOCKING
   53|       |    CRYPTO_THREAD_lock_free(ossl_obj_nid_lock);
   54|       |    ossl_obj_nid_lock = NULL;
   55|       |#endif
   56|      2|}
obj_dat.c:ossl_obj_read_lock:
   93|   668k|{
   94|   668k|    if (!lock)
  ------------------
  |  Branch (94:9): [True: 0, False: 668k]
  ------------------
   95|      0|        return 1;
   96|   668k|    if (!ossl_init_added_lock())
  ------------------
  |  Branch (96:9): [True: 0, False: 668k]
  ------------------
   97|      0|        return 0;
   98|   668k|    return CRYPTO_THREAD_read_lock(ossl_obj_lock);
   99|   668k|}
obj_dat.c:ossl_init_added_lock:
   75|   668k|{
   76|   668k|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
   77|       |    /* Make sure we've loaded config before checking for any "added" objects */
   78|   668k|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  472|   668k|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
   79|   668k|#endif
   80|   668k|    return RUN_ONCE(&ossl_obj_lock_init, obj_lock_initialise);
  ------------------
  |  |  130|   668k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 668k, False: 0]
  |  |  ------------------
  ------------------
   81|   668k|}
obj_dat.c:obj_lock_initialise:
   59|      1|{
   60|      1|    ossl_obj_lock = CRYPTO_THREAD_lock_new();
   61|      1|    if (ossl_obj_lock == NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 1]
  ------------------
   62|      0|        return 0;
   63|       |
   64|       |#ifdef TSAN_REQUIRES_LOCKING
   65|       |    ossl_obj_nid_lock = CRYPTO_THREAD_lock_new();
   66|       |    if (ossl_obj_nid_lock == NULL) {
   67|       |        objs_free_locks();
   68|       |        return 0;
   69|       |    }
   70|       |#endif
   71|      1|    return 1;
   72|      1|}
obj_dat.c:ossl_obj_unlock:
  102|   668k|{
  103|   668k|    if (lock)
  ------------------
  |  Branch (103:9): [True: 668k, False: 0]
  ------------------
  104|   668k|        CRYPTO_THREAD_unlock(ossl_obj_lock);
  105|   668k|}
obj_dat.c:ln_cmp:
  115|    770|{
  116|    770|    return strcmp((*a)->ln, nid_objs[*b].ln);
  117|    770|}
obj_dat.c:sn_cmp:
  108|    813|{
  109|    813|    return strcmp((*a)->sn, nid_objs[*b].sn);
  110|    813|}
obj_dat.c:ossl_obj_obj2nid:
  387|  1.83M|{
  388|  1.83M|    int nid = NID_undef;
  ------------------
  |  |   18|  1.83M|#define NID_undef                       0
  ------------------
  389|  1.83M|    const unsigned int *op;
  390|  1.83M|    ADDED_OBJ ad, *adp;
  391|       |
  392|  1.83M|    if (a == NULL)
  ------------------
  |  Branch (392:9): [True: 0, False: 1.83M]
  ------------------
  393|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  394|  1.83M|    if (a->nid != NID_undef)
  ------------------
  |  |   18|  1.83M|#define NID_undef                       0
  ------------------
  |  Branch (394:9): [True: 599k, False: 1.23M]
  ------------------
  395|   599k|        return a->nid;
  396|  1.23M|    if (a->length == 0)
  ------------------
  |  Branch (396:9): [True: 60.7k, False: 1.17M]
  ------------------
  397|  60.7k|        return NID_undef;
  ------------------
  |  |   18|  60.7k|#define NID_undef                       0
  ------------------
  398|       |
  399|  1.17M|    op = OBJ_bsearch_obj(&a, obj_objs, NUM_OBJ);
  ------------------
  |  | 5835|  1.17M|#define NUM_OBJ 1344
  ------------------
  400|  1.17M|    if (op != NULL)
  ------------------
  |  Branch (400:9): [True: 508k, False: 668k]
  ------------------
  401|   508k|        return nid_objs[*op].nid;
  402|   668k|    if (!ossl_obj_read_lock(lock)) {
  ------------------
  |  Branch (402:9): [True: 0, False: 668k]
  ------------------
  403|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  404|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  405|      0|    }
  406|   668k|    if (added != NULL) {
  ------------------
  |  Branch (406:9): [True: 0, False: 668k]
  ------------------
  407|      0|        ad.type = ADDED_DATA;
  ------------------
  |  |   30|      0|#define ADDED_DATA      0
  ------------------
  408|      0|        ad.obj = (ASN1_OBJECT *)a; /* casting away const is harmless here */
  409|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  410|      0|        if (adp != NULL)
  ------------------
  |  Branch (410:13): [True: 0, False: 0]
  ------------------
  411|      0|            nid = adp->obj->nid;
  412|      0|    }
  413|   668k|    ossl_obj_unlock(lock);
  414|   668k|    return nid;
  415|   668k|}
obj_dat.c:obj_cmp:
  371|  11.5M|{
  372|  11.5M|    int j;
  373|  11.5M|    const ASN1_OBJECT *a = *ap;
  374|  11.5M|    const ASN1_OBJECT *b = &nid_objs[*bp];
  375|       |
  376|  11.5M|    j = (a->length - b->length);
  377|  11.5M|    if (j)
  ------------------
  |  Branch (377:9): [True: 6.37M, False: 5.13M]
  ------------------
  378|  6.37M|        return j;
  379|  5.13M|    if (a->length == 0)
  ------------------
  |  Branch (379:9): [True: 0, False: 5.13M]
  ------------------
  380|      0|        return 0;
  381|  5.13M|    return memcmp(a->data, b->data, a->length);
  382|  5.13M|}

ossl_err_load_OBJ_strings:
   28|      2|{
   29|      2|#ifndef OPENSSL_NO_ERR
   30|      2|    if (ERR_reason_error_string(OBJ_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (30:9): [True: 2, False: 0]
  ------------------
   31|      2|        ERR_load_strings_const(OBJ_str_reasons);
   32|      2|#endif
   33|      2|    return 1;
   34|      2|}

OBJ_dup:
   17|   226k|{
   18|   226k|    ASN1_OBJECT *r;
   19|       |
   20|   226k|    if (o == NULL)
  ------------------
  |  Branch (20:9): [True: 0, False: 226k]
  ------------------
   21|      0|        return NULL;
   22|       |    /* If object isn't dynamic it's an internal OID which is never freed */
   23|   226k|    if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC))
  ------------------
  |  |  110|   226k|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
  |  Branch (23:9): [True: 31.6k, False: 194k]
  ------------------
   24|  31.6k|        return (ASN1_OBJECT *)o;
   25|       |
   26|   194k|    r = ASN1_OBJECT_new();
   27|   194k|    if (r == NULL) {
  ------------------
  |  Branch (27:9): [True: 0, False: 194k]
  ------------------
   28|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   29|      0|        return NULL;
   30|      0|    }
   31|       |
   32|       |    /* Set dynamic flags so everything gets freed up on error */
   33|       |
   34|   194k|    r->flags = o->flags | (ASN1_OBJECT_FLAG_DYNAMIC |
  ------------------
  |  |  110|   194k|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
   35|   194k|                           ASN1_OBJECT_FLAG_DYNAMIC_STRINGS |
  ------------------
  |  |  112|   194k|# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
  ------------------
   36|   194k|                           ASN1_OBJECT_FLAG_DYNAMIC_DATA);
  ------------------
  |  |  113|   194k|# define ASN1_OBJECT_FLAG_DYNAMIC_DATA    0x08/* internal use */
  ------------------
   37|       |
   38|   194k|    if (o->length > 0 && (r->data = OPENSSL_memdup(o->data, o->length)) == NULL)
  ------------------
  |  |  117|   194k|        CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   194k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   194k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (38:9): [True: 194k, False: 0]
  |  Branch (38:26): [True: 0, False: 194k]
  ------------------
   39|      0|        goto err;
   40|       |
   41|   194k|    r->length = o->length;
   42|   194k|    r->nid = o->nid;
   43|       |
   44|   194k|    if (o->ln != NULL && (r->ln = OPENSSL_strdup(o->ln)) == NULL)
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (44:9): [True: 0, False: 194k]
  |  Branch (44:26): [True: 0, False: 0]
  ------------------
   45|      0|        goto err;
   46|       |
   47|   194k|    if (o->sn != NULL && (r->sn = OPENSSL_strdup(o->sn)) == NULL)
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (47:9): [True: 0, False: 194k]
  |  Branch (47:26): [True: 0, False: 0]
  ------------------
   48|      0|        goto err;
   49|       |
   50|   194k|    return r;
   51|      0| err:
   52|      0|    ASN1_OBJECT_free(r);
   53|      0|    return NULL;
   54|   194k|}

OBJ_sigid_free:
  215|      2|{
  216|      2|    sk_nid_triple_pop_free(sig_app, sid_free);
  217|      2|    sk_nid_triple_free(sigx_app);
  218|      2|    CRYPTO_THREAD_lock_free(sig_lock);
  219|      2|    sig_app = NULL;
  220|      2|    sigx_app = NULL;
  221|      2|    sig_lock = NULL;
  222|      2|}

ossl_err_load_OCSP_strings:
   66|      2|{
   67|      2|# ifndef OPENSSL_NO_ERR
   68|      2|    if (ERR_reason_error_string(OCSP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (68:9): [True: 2, False: 0]
  ------------------
   69|      2|        ERR_load_strings_const(OCSP_str_reasons);
   70|      2|# endif
   71|      2|    return 1;
   72|      2|}

v3_ocsp.c:i2r_ocsp_crlid:
  112|  1.06k|{
  113|  1.06k|    OCSP_CRLID *a = in;
  114|  1.06k|    if (a->crlUrl) {
  ------------------
  |  Branch (114:9): [True: 0, False: 1.06k]
  ------------------
  115|      0|        if (BIO_printf(bp, "%*scrlUrl: ", ind, "") <= 0)
  ------------------
  |  Branch (115:13): [True: 0, False: 0]
  ------------------
  116|      0|            goto err;
  117|      0|        if (!ASN1_STRING_print(bp, (ASN1_STRING *)a->crlUrl))
  ------------------
  |  Branch (117:13): [True: 0, False: 0]
  ------------------
  118|      0|            goto err;
  119|      0|        if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (119:13): [True: 0, False: 0]
  ------------------
  120|      0|            goto err;
  121|      0|    }
  122|  1.06k|    if (a->crlNum) {
  ------------------
  |  Branch (122:9): [True: 1.04k, False: 12]
  ------------------
  123|  1.04k|        if (BIO_printf(bp, "%*scrlNum: ", ind, "") <= 0)
  ------------------
  |  Branch (123:13): [True: 0, False: 1.04k]
  ------------------
  124|      0|            goto err;
  125|  1.04k|        if (i2a_ASN1_INTEGER(bp, a->crlNum) <= 0)
  ------------------
  |  Branch (125:13): [True: 0, False: 1.04k]
  ------------------
  126|      0|            goto err;
  127|  1.04k|        if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (127:13): [True: 0, False: 1.04k]
  ------------------
  128|      0|            goto err;
  129|  1.04k|    }
  130|  1.06k|    if (a->crlTime) {
  ------------------
  |  Branch (130:9): [True: 0, False: 1.06k]
  ------------------
  131|      0|        if (BIO_printf(bp, "%*scrlTime: ", ind, "") <= 0)
  ------------------
  |  Branch (131:13): [True: 0, False: 0]
  ------------------
  132|      0|            goto err;
  133|      0|        if (!ASN1_GENERALIZEDTIME_print(bp, a->crlTime))
  ------------------
  |  Branch (133:13): [True: 0, False: 0]
  ------------------
  134|      0|            goto err;
  135|      0|        if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (135:13): [True: 0, False: 0]
  ------------------
  136|      0|            goto err;
  137|      0|    }
  138|  1.06k|    return 1;
  139|      0| err:
  140|      0|    return 0;
  141|  1.06k|}
v3_ocsp.c:i2r_ocsp_acutoff:
  145|  15.9k|{
  146|  15.9k|    if (BIO_printf(bp, "%*s", ind, "") <= 0)
  ------------------
  |  Branch (146:9): [True: 0, False: 15.9k]
  ------------------
  147|      0|        return 0;
  148|  15.9k|    if (!ASN1_GENERALIZEDTIME_print(bp, cutoff))
  ------------------
  |  Branch (148:9): [True: 15.8k, False: 77]
  ------------------
  149|  15.8k|        return 0;
  150|     77|    return 1;
  151|  15.9k|}
v3_ocsp.c:i2r_object:
  155|     66|{
  156|     66|    if (BIO_printf(bp, "%*s", ind, "") <= 0)
  ------------------
  |  Branch (156:9): [True: 0, False: 66]
  ------------------
  157|      0|        return 0;
  158|     66|    if (i2a_ASN1_OBJECT(bp, oid) <= 0)
  ------------------
  |  Branch (158:9): [True: 0, False: 66]
  ------------------
  159|      0|        return 0;
  160|     66|    return 1;
  161|     66|}
v3_ocsp.c:d2i_ocsp_nonce:
  184|    146|{
  185|    146|    ASN1_OCTET_STRING *os, **pos;
  186|    146|    pos = a;
  187|    146|    if (pos == NULL || *pos == NULL) {
  ------------------
  |  Branch (187:9): [True: 146, False: 0]
  |  Branch (187:24): [True: 0, False: 0]
  ------------------
  188|    146|        os = ASN1_OCTET_STRING_new();
  189|    146|        if (os == NULL)
  ------------------
  |  Branch (189:13): [True: 0, False: 146]
  ------------------
  190|      0|            goto err;
  191|    146|    } else {
  192|      0|        os = *pos;
  193|      0|    }
  194|    146|    if (!ASN1_OCTET_STRING_set(os, *pp, length))
  ------------------
  |  Branch (194:9): [True: 0, False: 146]
  ------------------
  195|      0|        goto err;
  196|       |
  197|    146|    *pp += length;
  198|       |
  199|    146|    if (pos)
  ------------------
  |  Branch (199:9): [True: 0, False: 146]
  ------------------
  200|      0|        *pos = os;
  201|    146|    return os;
  202|       |
  203|      0| err:
  204|      0|    if ((pos == NULL) || (*pos != os))
  ------------------
  |  Branch (204:9): [True: 0, False: 0]
  |  Branch (204:26): [True: 0, False: 0]
  ------------------
  205|      0|        ASN1_OCTET_STRING_free(os);
  206|      0|    ERR_raise(ERR_LIB_OCSP, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  207|      0|    return NULL;
  208|    146|}
v3_ocsp.c:ocsp_nonce_free:
  211|    146|{
  212|    146|    ASN1_OCTET_STRING_free(a);
  213|    146|}
v3_ocsp.c:i2r_ocsp_nonce:
  217|    146|{
  218|    146|    if (BIO_printf(out, "%*s", indent, "") <= 0)
  ------------------
  |  Branch (218:9): [True: 0, False: 146]
  ------------------
  219|      0|        return 0;
  220|    146|    if (i2a_ASN1_STRING(out, nonce, V_ASN1_OCTET_STRING) <= 0)
  ------------------
  |  |   66|    146|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (220:9): [True: 0, False: 146]
  ------------------
  221|      0|        return 0;
  222|    146|    return 1;
  223|    146|}
v3_ocsp.c:i2r_ocsp_serviceloc:
  241|     10|{
  242|     10|    int i;
  243|     10|    OCSP_SERVICELOC *a = in;
  244|     10|    ACCESS_DESCRIPTION *ad;
  245|       |
  246|     10|    if (BIO_printf(bp, "%*sIssuer: ", ind, "") <= 0)
  ------------------
  |  Branch (246:9): [True: 0, False: 10]
  ------------------
  247|      0|        goto err;
  248|     10|    if (X509_NAME_print_ex(bp, a->issuer, 0, XN_FLAG_ONELINE) <= 0)
  ------------------
  |  |  358|     10|# define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
  |  |  ------------------
  |  |  |  |  516|     10|# define ASN1_STRFLGS_RFC2253    (ASN1_STRFLGS_ESC_2253 | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  441|     10|# define ASN1_STRFLGS_ESC_2253           1
  |  |  |  |  ------------------
  |  |  |  |  517|     10|                                ASN1_STRFLGS_ESC_CTRL | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|     10|# define ASN1_STRFLGS_ESC_CTRL           2
  |  |  |  |  ------------------
  |  |  |  |  518|     10|                                ASN1_STRFLGS_ESC_MSB | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  443|     10|# define ASN1_STRFLGS_ESC_MSB            4
  |  |  |  |  ------------------
  |  |  |  |  519|     10|                                ASN1_STRFLGS_UTF8_CONVERT | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  475|     10|# define ASN1_STRFLGS_UTF8_CONVERT       0x10
  |  |  |  |  ------------------
  |  |  |  |  520|     10|                                ASN1_STRFLGS_DUMP_UNKNOWN | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  497|     10|# define ASN1_STRFLGS_DUMP_UNKNOWN       0x100
  |  |  |  |  ------------------
  |  |  |  |  521|     10|                                ASN1_STRFLGS_DUMP_DER)
  |  |  |  |  ------------------
  |  |  |  |  |  |  504|     10|# define ASN1_STRFLGS_DUMP_DER           0x200
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  359|     10|                        ASN1_STRFLGS_ESC_QUOTE | \
  |  |  ------------------
  |  |  |  |  455|     10|# define ASN1_STRFLGS_ESC_QUOTE          8
  |  |  ------------------
  |  |  360|     10|                        XN_FLAG_SEP_CPLUS_SPC | \
  |  |  ------------------
  |  |  |  |  321|     10|# define XN_FLAG_SEP_CPLUS_SPC   (2 << 16)/* ,+ spaced: more readable */
  |  |  ------------------
  |  |  361|     10|                        XN_FLAG_SPC_EQ | \
  |  |  ------------------
  |  |  |  |  336|     10|# define XN_FLAG_SPC_EQ          (1 << 23)/* Put spaces round '=' */
  |  |  ------------------
  |  |  362|     10|                        XN_FLAG_FN_SN)
  |  |  ------------------
  |  |  |  |  331|     10|# define XN_FLAG_FN_SN           0/* Object short name */
  |  |  ------------------
  ------------------
  |  Branch (248:9): [True: 10, False: 0]
  ------------------
  249|     10|        goto err;
  250|      0|    for (i = 0; i < sk_ACCESS_DESCRIPTION_num(a->locator); i++) {
  ------------------
  |  |  212|      0|#define sk_ACCESS_DESCRIPTION_num(sk) OPENSSL_sk_num(ossl_check_const_ACCESS_DESCRIPTION_sk_type(sk))
  ------------------
  |  Branch (250:17): [True: 0, False: 0]
  ------------------
  251|      0|        ad = sk_ACCESS_DESCRIPTION_value(a->locator, i);
  ------------------
  |  |  213|      0|#define sk_ACCESS_DESCRIPTION_value(sk, idx) ((ACCESS_DESCRIPTION *)OPENSSL_sk_value(ossl_check_const_ACCESS_DESCRIPTION_sk_type(sk), (idx)))
  ------------------
  252|      0|        if (BIO_printf(bp, "\n%*s", (2 * ind), "") <= 0)
  ------------------
  |  Branch (252:13): [True: 0, False: 0]
  ------------------
  253|      0|            goto err;
  254|      0|        if (i2a_ASN1_OBJECT(bp, ad->method) <= 0)
  ------------------
  |  Branch (254:13): [True: 0, False: 0]
  ------------------
  255|      0|            goto err;
  256|      0|        if (BIO_puts(bp, " - ") <= 0)
  ------------------
  |  Branch (256:13): [True: 0, False: 0]
  ------------------
  257|      0|            goto err;
  258|      0|        if (GENERAL_NAME_print(bp, ad->location) <= 0)
  ------------------
  |  Branch (258:13): [True: 0, False: 0]
  ------------------
  259|      0|            goto err;
  260|      0|    }
  261|      0|    return 1;
  262|     10| err:
  263|     10|    return 0;
  264|      0|}

WPACKET_allocate_bytes:
   20|  65.3k|{
   21|  65.3k|    if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
  ------------------
  |  Branch (21:9): [True: 0, False: 65.3k]
  ------------------
   22|      0|        return 0;
   23|       |
   24|  65.3k|    pkt->written += len;
   25|  65.3k|    pkt->curr += len;
   26|  65.3k|    return 1;
   27|  65.3k|}
WPACKET_reserve_bytes:
   47|  65.3k|{
   48|       |    /* Internal API, so should not fail */
   49|  65.3k|    if (!ossl_assert(pkt->subs != NULL && len != 0))
  ------------------
  |  |   52|   130k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 65.3k, False: 0]
  |  |  |  Branch (52:43): [True: 65.3k, False: 0]
  |  |  ------------------
  |  |   53|  65.3k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (49:9): [True: 0, False: 65.3k]
  ------------------
   50|      0|        return 0;
   51|       |
   52|  65.3k|    if (pkt->maxsize - pkt->written < len)
  ------------------
  |  Branch (52:9): [True: 0, False: 65.3k]
  ------------------
   53|      0|        return 0;
   54|       |
   55|  65.3k|    if (pkt->buf != NULL && (pkt->buf->length - pkt->written < len)) {
  ------------------
  |  Branch (55:9): [True: 608, False: 64.7k]
  |  Branch (55:29): [True: 90, False: 518]
  ------------------
   56|     90|        size_t newlen;
   57|     90|        size_t reflen;
   58|       |
   59|     90|        reflen = (len > pkt->buf->length) ? len : pkt->buf->length;
  ------------------
  |  Branch (59:18): [True: 86, False: 4]
  ------------------
   60|       |
   61|     90|        if (reflen > SIZE_MAX / 2) {
  ------------------
  |  Branch (61:13): [True: 0, False: 90]
  ------------------
   62|      0|            newlen = SIZE_MAX;
   63|     90|        } else {
   64|     90|            newlen = reflen * 2;
   65|     90|            if (newlen < DEFAULT_BUF_SIZE)
  ------------------
  |  |   17|     90|#define DEFAULT_BUF_SIZE    256
  ------------------
  |  Branch (65:17): [True: 70, False: 20]
  ------------------
   66|     70|                newlen = DEFAULT_BUF_SIZE;
  ------------------
  |  |   17|     70|#define DEFAULT_BUF_SIZE    256
  ------------------
   67|     90|        }
   68|     90|        if (BUF_MEM_grow(pkt->buf, newlen) == 0)
  ------------------
  |  Branch (68:13): [True: 0, False: 90]
  ------------------
   69|      0|            return 0;
   70|     90|    }
   71|  65.3k|    if (allocbytes != NULL) {
  ------------------
  |  Branch (71:9): [True: 65.3k, False: 0]
  ------------------
   72|  65.3k|        *allocbytes = WPACKET_get_curr(pkt);
   73|  65.3k|        if (pkt->endfirst && *allocbytes != NULL)
  ------------------
  |  Branch (73:13): [True: 8, False: 65.3k]
  |  Branch (73:30): [True: 4, False: 4]
  ------------------
   74|      4|            *allocbytes -= len;
   75|  65.3k|    }
   76|       |
   77|  65.3k|    return 1;
   78|  65.3k|}
WPACKET_init_der:
  147|      2|{
  148|       |    /* Internal API, so should not fail */
  149|      2|    if (!ossl_assert(buf != NULL && len > 0))
  ------------------
  |  |   52|      4|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 2, False: 0]
  |  |  |  Branch (52:43): [True: 2, False: 0]
  |  |  ------------------
  |  |   53|      2|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (149:9): [True: 0, False: 2]
  ------------------
  150|      0|        return 0;
  151|       |
  152|      2|    pkt->staticbuf = buf;
  153|      2|    pkt->buf = NULL;
  154|      2|    pkt->maxsize = len;
  155|      2|    pkt->endfirst = 1;
  156|       |
  157|      2|    return wpacket_intern_init_len(pkt, 0);
  158|      2|}
WPACKET_init_len:
  161|     70|{
  162|       |    /* Internal API, so should not fail */
  163|     70|    if (!ossl_assert(buf != NULL))
  ------------------
  |  |   52|     70|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     70|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (163:9): [True: 0, False: 70]
  ------------------
  164|      0|        return 0;
  165|       |
  166|     70|    pkt->staticbuf = NULL;
  167|     70|    pkt->buf = buf;
  168|     70|    pkt->maxsize = maxmaxsize(lenbytes);
  169|     70|    pkt->endfirst = 0;
  170|       |
  171|     70|    return wpacket_intern_init_len(pkt, lenbytes);
  172|     70|}
WPACKET_init_null:
  180|  8.09k|{
  181|  8.09k|    pkt->staticbuf = NULL;
  182|  8.09k|    pkt->buf = NULL;
  183|  8.09k|    pkt->maxsize = maxmaxsize(lenbytes);
  184|  8.09k|    pkt->endfirst = 0;
  185|       |
  186|  8.09k|    return wpacket_intern_init_len(pkt, 0);
  187|  8.09k|}
WPACKET_init_null_der:
  190|      2|{
  191|      2|    pkt->staticbuf = NULL;
  192|      2|    pkt->buf = NULL;
  193|      2|    pkt->maxsize = SIZE_MAX;
  194|      2|    pkt->endfirst = 1;
  195|       |
  196|      2|    return wpacket_intern_init_len(pkt, 0);
  197|      2|}
WPACKET_close:
  335|  24.4k|{
  336|       |    /*
  337|       |     * Internal API, so should not fail - but we do negative testing of this
  338|       |     * so no assert (otherwise the tests fail)
  339|       |     */
  340|  24.4k|    if (pkt->subs == NULL || pkt->subs->parent == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 24.4k]
  |  Branch (340:30): [True: 0, False: 24.4k]
  ------------------
  341|      0|        return 0;
  342|       |
  343|  24.4k|    return wpacket_intern_close(pkt, pkt->subs, 1);
  344|  24.4k|}
WPACKET_finish:
  347|  8.16k|{
  348|  8.16k|    int ret;
  349|       |
  350|       |    /*
  351|       |     * Internal API, so should not fail - but we do negative testing of this
  352|       |     * so no assert (otherwise the tests fail)
  353|       |     */
  354|  8.16k|    if (pkt->subs == NULL || pkt->subs->parent != NULL)
  ------------------
  |  Branch (354:9): [True: 0, False: 8.16k]
  |  Branch (354:30): [True: 0, False: 8.16k]
  ------------------
  355|      0|        return 0;
  356|       |
  357|  8.16k|    ret = wpacket_intern_close(pkt, pkt->subs, 1);
  358|  8.16k|    if (ret) {
  ------------------
  |  Branch (358:9): [True: 8.16k, False: 0]
  ------------------
  359|  8.16k|        OPENSSL_free(pkt->subs);
  ------------------
  |  |  115|  8.16k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  8.16k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  8.16k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  360|  8.16k|        pkt->subs = NULL;
  361|  8.16k|    }
  362|       |
  363|  8.16k|    return ret;
  364|  8.16k|}
WPACKET_start_sub_packet_len__:
  367|  24.4k|{
  368|  24.4k|    WPACKET_SUB *sub;
  369|  24.4k|    unsigned char *lenchars;
  370|       |
  371|       |    /* Internal API, so should not fail */
  372|  24.4k|    if (!ossl_assert(pkt->subs != NULL))
  ------------------
  |  |   52|  24.4k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  24.4k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (372:9): [True: 0, False: 24.4k]
  ------------------
  373|      0|        return 0;
  374|       |
  375|       |    /* We don't support lenbytes greater than 0 when doing endfirst writing */
  376|  24.4k|    if (lenbytes > 0 && pkt->endfirst)
  ------------------
  |  Branch (376:9): [True: 0, False: 24.4k]
  |  Branch (376:25): [True: 0, False: 0]
  ------------------
  377|      0|        return 0;
  378|       |
  379|  24.4k|    if ((sub = OPENSSL_zalloc(sizeof(*sub))) == NULL)
  ------------------
  |  |  104|  24.4k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  24.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  24.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (379:9): [True: 0, False: 24.4k]
  ------------------
  380|      0|        return 0;
  381|       |
  382|  24.4k|    sub->parent = pkt->subs;
  383|  24.4k|    pkt->subs = sub;
  384|  24.4k|    sub->pwritten = pkt->written + lenbytes;
  385|  24.4k|    sub->lenbytes = lenbytes;
  386|       |
  387|  24.4k|    if (lenbytes == 0) {
  ------------------
  |  Branch (387:9): [True: 24.4k, False: 0]
  ------------------
  388|  24.4k|        sub->packet_len = 0;
  389|  24.4k|        return 1;
  390|  24.4k|    }
  391|       |
  392|      0|    sub->packet_len = pkt->written;
  393|       |
  394|      0|    if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars))
  ------------------
  |  Branch (394:9): [True: 0, False: 0]
  ------------------
  395|      0|        return 0;
  396|       |
  397|      0|    return 1;
  398|      0|}
WPACKET_start_sub_packet:
  401|  24.4k|{
  402|  24.4k|    return WPACKET_start_sub_packet_len__(pkt, 0);
  403|  24.4k|}
WPACKET_put_bytes__:
  406|  49.0k|{
  407|  49.0k|    unsigned char *data;
  408|       |
  409|       |    /* Internal API, so should not fail */
  410|  49.0k|    if (!ossl_assert(size <= sizeof(uint64_t))
  ------------------
  |  |   52|  98.0k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  98.0k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (410:9): [True: 0, False: 49.0k]
  ------------------
  411|  49.0k|            || !WPACKET_allocate_bytes(pkt, size, &data)
  ------------------
  |  Branch (411:16): [True: 0, False: 49.0k]
  ------------------
  412|  49.0k|            || !put_value(data, val, size))
  ------------------
  |  Branch (412:16): [True: 0, False: 49.0k]
  ------------------
  413|      0|        return 0;
  414|       |
  415|  49.0k|    return 1;
  416|  49.0k|}
WPACKET_get_total_written:
  487|  8.10k|{
  488|       |    /* Internal API, so should not fail */
  489|  8.10k|    if (!ossl_assert(written != NULL))
  ------------------
  |  |   52|  8.10k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  8.10k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (489:9): [True: 0, False: 8.10k]
  ------------------
  490|      0|        return 0;
  491|       |
  492|  8.10k|    *written = pkt->written;
  493|       |
  494|  8.10k|    return 1;
  495|  8.10k|}
WPACKET_get_length:
  498|  8.09k|{
  499|       |    /* Internal API, so should not fail */
  500|  8.09k|    if (!ossl_assert(pkt->subs != NULL && len != NULL))
  ------------------
  |  |   52|  16.1k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 8.09k, False: 0]
  |  |  |  Branch (52:43): [True: 8.09k, False: 0]
  |  |  ------------------
  |  |   53|  8.09k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (500:9): [True: 0, False: 8.09k]
  ------------------
  501|      0|        return 0;
  502|       |
  503|  8.09k|    *len = pkt->written - pkt->subs->pwritten;
  504|       |
  505|  8.09k|    return 1;
  506|  8.09k|}
WPACKET_get_curr:
  509|  65.3k|{
  510|  65.3k|    unsigned char *buf = GETBUF(pkt);
  ------------------
  |  |   40|  65.3k|#define GETBUF(p)   (((p)->staticbuf != NULL) \
  |  |  ------------------
  |  |  |  Branch (40:22): [True: 4, False: 65.3k]
  |  |  ------------------
  |  |   41|  65.3k|                     ? (p)->staticbuf \
  |  |   42|  65.3k|                     : ((p)->buf != NULL \
  |  |  ------------------
  |  |  |  Branch (42:25): [True: 608, False: 64.7k]
  |  |  ------------------
  |  |   43|  65.3k|                        ? (unsigned char *)(p)->buf->data \
  |  |   44|  65.3k|                        : NULL))
  ------------------
  511|       |
  512|  65.3k|    if (buf == NULL)
  ------------------
  |  Branch (512:9): [True: 64.7k, False: 612]
  ------------------
  513|  64.7k|        return NULL;
  514|       |
  515|    612|    if (pkt->endfirst)
  ------------------
  |  Branch (515:9): [True: 4, False: 608]
  ------------------
  516|      4|        return buf + pkt->maxsize - pkt->curr;
  517|       |
  518|    608|    return buf + pkt->curr;
  519|    612|}
WPACKET_is_null_buf:
  522|  8.09k|{
  523|  8.09k|    return pkt->buf == NULL && pkt->staticbuf == NULL;
  ------------------
  |  Branch (523:12): [True: 8.02k, False: 70]
  |  Branch (523:32): [True: 8.02k, False: 0]
  ------------------
  524|  8.09k|}
WPACKET_cleanup:
  527|      9|{
  528|      9|    WPACKET_SUB *sub, *parent;
  529|       |
  530|     19|    for (sub = pkt->subs; sub != NULL; sub = parent) {
  ------------------
  |  Branch (530:27): [True: 10, False: 9]
  ------------------
  531|     10|        parent = sub->parent;
  532|     10|        OPENSSL_free(sub);
  ------------------
  |  |  115|     10|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  533|     10|    }
  534|      9|    pkt->subs = NULL;
  535|      9|}
packet.c:maxmaxsize:
   96|  8.16k|{
   97|  8.16k|    if (lenbytes >= sizeof(size_t) || lenbytes == 0)
  ------------------
  |  Branch (97:9): [True: 0, False: 8.16k]
  |  Branch (97:39): [True: 8.16k, False: 0]
  ------------------
   98|  8.16k|        return SIZE_MAX;
   99|       |
  100|      0|    return ((size_t)1 << (lenbytes * 8)) - 1 + lenbytes;
  101|  8.16k|}
packet.c:wpacket_intern_init_len:
  104|  8.16k|{
  105|  8.16k|    unsigned char *lenchars;
  106|       |
  107|  8.16k|    pkt->curr = 0;
  108|  8.16k|    pkt->written = 0;
  109|       |
  110|  8.16k|    if ((pkt->subs = OPENSSL_zalloc(sizeof(*pkt->subs))) == NULL)
  ------------------
  |  |  104|  8.16k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  8.16k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  8.16k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (110:9): [True: 0, False: 8.16k]
  ------------------
  111|      0|        return 0;
  112|       |
  113|  8.16k|    if (lenbytes == 0)
  ------------------
  |  Branch (113:9): [True: 8.16k, False: 0]
  ------------------
  114|  8.16k|        return 1;
  115|       |
  116|      0|    pkt->subs->pwritten = lenbytes;
  117|      0|    pkt->subs->lenbytes = lenbytes;
  118|       |
  119|      0|    if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)) {
  ------------------
  |  Branch (119:9): [True: 0, False: 0]
  ------------------
  120|      0|        OPENSSL_free(pkt->subs);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  121|      0|        pkt->subs = NULL;
  122|      0|        return 0;
  123|      0|    }
  124|      0|    pkt->subs->packet_len = 0;
  125|       |
  126|      0|    return 1;
  127|      0|}
packet.c:wpacket_intern_close:
  251|  32.5k|{
  252|  32.5k|    size_t packlen = pkt->written - sub->pwritten;
  253|       |
  254|  32.5k|    if (packlen == 0
  ------------------
  |  Branch (254:9): [True: 4, False: 32.5k]
  ------------------
  255|  32.5k|            && (sub->flags & WPACKET_FLAGS_NON_ZERO_LENGTH) != 0)
  ------------------
  |  |  686|      4|#define WPACKET_FLAGS_NON_ZERO_LENGTH           1
  ------------------
  |  Branch (255:16): [True: 0, False: 4]
  ------------------
  256|      0|        return 0;
  257|       |
  258|  32.5k|    if (packlen == 0
  ------------------
  |  Branch (258:9): [True: 4, False: 32.5k]
  ------------------
  259|  32.5k|            && sub->flags & WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH) {
  ------------------
  |  |  692|      4|#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH    2
  ------------------
  |  Branch (259:16): [True: 0, False: 4]
  ------------------
  260|       |        /* We can't handle this case. Return an error */
  261|      0|        if (!doclose)
  ------------------
  |  Branch (261:13): [True: 0, False: 0]
  ------------------
  262|      0|            return 0;
  263|       |
  264|       |        /* Deallocate any bytes allocated for the length of the WPACKET */
  265|      0|        if ((pkt->curr - sub->lenbytes) == sub->packet_len) {
  ------------------
  |  Branch (265:13): [True: 0, False: 0]
  ------------------
  266|      0|            pkt->written -= sub->lenbytes;
  267|      0|            pkt->curr -= sub->lenbytes;
  268|      0|        }
  269|       |
  270|       |        /* Don't write out the packet length */
  271|      0|        sub->packet_len = 0;
  272|      0|        sub->lenbytes = 0;
  273|      0|    }
  274|       |
  275|       |    /* Write out the WPACKET length if needed */
  276|  32.5k|    if (sub->lenbytes > 0) {
  ------------------
  |  Branch (276:9): [True: 0, False: 32.5k]
  ------------------
  277|      0|        unsigned char *buf = GETBUF(pkt);
  ------------------
  |  |   40|      0|#define GETBUF(p)   (((p)->staticbuf != NULL) \
  |  |  ------------------
  |  |  |  Branch (40:22): [True: 0, False: 0]
  |  |  ------------------
  |  |   41|      0|                     ? (p)->staticbuf \
  |  |   42|      0|                     : ((p)->buf != NULL \
  |  |  ------------------
  |  |  |  Branch (42:25): [True: 0, False: 0]
  |  |  ------------------
  |  |   43|      0|                        ? (unsigned char *)(p)->buf->data \
  |  |   44|      0|                        : NULL))
  ------------------
  278|       |
  279|      0|        if (buf != NULL) {
  ------------------
  |  Branch (279:13): [True: 0, False: 0]
  ------------------
  280|      0|#if !defined OPENSSL_NO_QUIC && !defined FIPS_MODULE
  281|      0|            if ((sub->flags & WPACKET_FLAGS_QUIC_VLINT) == 0) {
  ------------------
  |  |  695|      0|#define WPACKET_FLAGS_QUIC_VLINT                4
  ------------------
  |  Branch (281:17): [True: 0, False: 0]
  ------------------
  282|      0|                if (!put_value(&buf[sub->packet_len], packlen, sub->lenbytes))
  ------------------
  |  Branch (282:21): [True: 0, False: 0]
  ------------------
  283|      0|                    return 0;
  284|      0|            } else {
  285|      0|                if (!put_quic_value(&buf[sub->packet_len], packlen, sub->lenbytes))
  ------------------
  |  Branch (285:21): [True: 0, False: 0]
  ------------------
  286|      0|                    return 0;
  287|      0|            }
  288|       |#else
  289|       |            if (!put_value(&buf[sub->packet_len], packlen, sub->lenbytes))
  290|       |                return 0;
  291|       |#endif
  292|      0|        }
  293|  32.5k|    } else if (pkt->endfirst && sub->parent != NULL
  ------------------
  |  Branch (293:16): [True: 8, False: 32.5k]
  |  Branch (293:33): [True: 4, False: 4]
  ------------------
  294|  32.5k|               && (packlen != 0
  ------------------
  |  Branch (294:20): [True: 0, False: 4]
  ------------------
  295|      4|                   || (sub->flags
  ------------------
  |  Branch (295:23): [True: 4, False: 0]
  ------------------
  296|      4|                       & WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH) == 0)) {
  ------------------
  |  |  692|      4|#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH    2
  ------------------
  297|      4|        size_t tmplen = packlen;
  298|      4|        size_t numlenbytes = 1;
  299|       |
  300|      4|        while ((tmplen = tmplen >> 8) > 0)
  ------------------
  |  Branch (300:16): [True: 0, False: 4]
  ------------------
  301|      0|            numlenbytes++;
  302|      4|        if (!WPACKET_put_bytes__(pkt, packlen, numlenbytes))
  ------------------
  |  Branch (302:13): [True: 0, False: 4]
  ------------------
  303|      0|            return 0;
  304|      4|        if (packlen > 0x7f) {
  ------------------
  |  Branch (304:13): [True: 0, False: 4]
  ------------------
  305|      0|            numlenbytes |= 0x80;
  306|      0|            if (!WPACKET_put_bytes_u8(pkt, numlenbytes))
  ------------------
  |  |  878|      0|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (306:17): [True: 0, False: 0]
  ------------------
  307|      0|                return 0;
  308|      0|        }
  309|      4|    }
  310|       |
  311|  32.5k|    if (doclose) {
  ------------------
  |  Branch (311:9): [True: 32.5k, False: 0]
  ------------------
  312|  32.5k|        pkt->subs = sub->parent;
  313|  32.5k|        OPENSSL_free(sub);
  ------------------
  |  |  115|  32.5k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  32.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  32.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  314|  32.5k|    }
  315|       |
  316|  32.5k|    return 1;
  317|  32.5k|}
packet.c:put_value:
  212|  49.0k|{
  213|  49.0k|    if (data == NULL)
  ------------------
  |  Branch (213:9): [True: 48.5k, False: 472]
  ------------------
  214|  48.5k|        return 1;
  215|       |
  216|    978|    for (data += len - 1; len > 0; len--) {
  ------------------
  |  Branch (216:27): [True: 506, False: 472]
  ------------------
  217|    506|        *data = (unsigned char)(value & 0xff);
  218|    506|        data--;
  219|    506|        value >>= 8;
  220|    506|    }
  221|       |
  222|       |    /* Check whether we could fit the value in the assigned number of bytes */
  223|    472|    if (value > 0)
  ------------------
  |  Branch (223:9): [True: 0, False: 472]
  ------------------
  224|      0|        return 0;
  225|       |
  226|    472|    return 1;
  227|    472|}

ossl_param_build_set_int:
   24|  46.1k|{
   25|  46.1k|    if (bld != NULL)
  ------------------
  |  Branch (25:9): [True: 0, False: 46.1k]
  ------------------
   26|      0|        return OSSL_PARAM_BLD_push_int(bld, key, num);
   27|  46.1k|    p = OSSL_PARAM_locate(p, key);
   28|  46.1k|    if (p != NULL)
  ------------------
  |  Branch (28:9): [True: 0, False: 46.1k]
  ------------------
   29|      0|        return OSSL_PARAM_set_int(p, num);
   30|  46.1k|    return 1;
   31|  46.1k|}
ossl_param_build_set_long:
   35|     19|{
   36|     19|    if (bld != NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 19]
  ------------------
   37|      0|        return OSSL_PARAM_BLD_push_long(bld, key, num);
   38|     19|    p = OSSL_PARAM_locate(p, key);
   39|     19|    if (p != NULL)
  ------------------
  |  Branch (39:9): [True: 0, False: 19]
  ------------------
   40|      0|        return OSSL_PARAM_set_long(p, num);
   41|     19|    return 1;
   42|     19|}
ossl_param_build_set_utf8_string:
   46|  44.2k|{
   47|  44.2k|    if (bld != NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 44.2k]
  ------------------
   48|      0|        return OSSL_PARAM_BLD_push_utf8_string(bld, key, buf, 0);
   49|  44.2k|    p = OSSL_PARAM_locate(p, key);
   50|  44.2k|    if (p != NULL)
  ------------------
  |  Branch (50:9): [True: 0, False: 44.2k]
  ------------------
   51|      0|        return OSSL_PARAM_set_utf8_string(p, buf);
   52|  44.2k|    return 1;
   53|  44.2k|}
ossl_param_build_set_octet_string:
   59|     10|{
   60|     10|    if (bld != NULL)
  ------------------
  |  Branch (60:9): [True: 0, False: 10]
  ------------------
   61|      0|        return OSSL_PARAM_BLD_push_octet_string(bld, key, data, data_len);
   62|       |
   63|     10|    p = OSSL_PARAM_locate(p, key);
   64|     10|    if (p != NULL)
  ------------------
  |  Branch (64:9): [True: 0, False: 10]
  ------------------
   65|      0|        return OSSL_PARAM_set_octet_string(p, data, data_len);
   66|     10|    return 1;
   67|     10|}
ossl_param_build_set_bn_pad:
   71|    731|{
   72|    731|    if (bld != NULL)
  ------------------
  |  Branch (72:9): [True: 0, False: 731]
  ------------------
   73|      0|        return OSSL_PARAM_BLD_push_BN_pad(bld, key, bn, sz);
   74|    731|    p = OSSL_PARAM_locate(p, key);
   75|    731|    if (p != NULL) {
  ------------------
  |  Branch (75:9): [True: 0, False: 731]
  ------------------
   76|      0|        if (sz > p->data_size) {
  ------------------
  |  Branch (76:13): [True: 0, False: 0]
  ------------------
   77|      0|            ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_SMALL_BUFFER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   78|      0|            return 0;
   79|      0|        }
   80|      0|        p->data_size = sz;
   81|      0|        return OSSL_PARAM_set_BN(p, bn);
   82|      0|    }
   83|    731|    return 1;
   84|    731|}
ossl_param_build_set_bn:
   88|  3.40k|{
   89|  3.40k|    if (bld != NULL)
  ------------------
  |  Branch (89:9): [True: 0, False: 3.40k]
  ------------------
   90|      0|        return OSSL_PARAM_BLD_push_BN(bld, key, bn);
   91|       |
   92|  3.40k|    p = OSSL_PARAM_locate(p, key);
   93|  3.40k|    if (p != NULL)
  ------------------
  |  Branch (93:9): [True: 0, False: 3.40k]
  ------------------
   94|      0|        return OSSL_PARAM_set_BN(p, bn) > 0;
   95|  3.40k|    return 1;
   96|  3.40k|}
ossl_param_build_set_multi_key_bn:
  101|    420|{
  102|    420|    int i, sz = sk_BIGNUM_const_num(stk);
  103|    420|    OSSL_PARAM *p;
  104|    420|    const BIGNUM *bn;
  105|       |
  106|    420|    if (bld != NULL) {
  ------------------
  |  Branch (106:9): [True: 0, False: 420]
  ------------------
  107|      0|        for (i = 0; i < sz && names[i] != NULL; ++i) {
  ------------------
  |  Branch (107:21): [True: 0, False: 0]
  |  Branch (107:31): [True: 0, False: 0]
  ------------------
  108|      0|            bn = sk_BIGNUM_const_value(stk, i);
  109|      0|            if (bn != NULL && !OSSL_PARAM_BLD_push_BN(bld, names[i], bn))
  ------------------
  |  Branch (109:17): [True: 0, False: 0]
  |  Branch (109:31): [True: 0, False: 0]
  ------------------
  110|      0|                return 0;
  111|      0|        }
  112|      0|        return 1;
  113|      0|    }
  114|       |
  115|  1.88k|    for (i = 0; i < sz && names[i] != NULL; ++i) {
  ------------------
  |  Branch (115:17): [True: 1.53k, False: 351]
  |  Branch (115:27): [True: 1.46k, False: 69]
  ------------------
  116|  1.46k|        bn = sk_BIGNUM_const_value(stk, i);
  117|  1.46k|        p = OSSL_PARAM_locate(params, names[i]);
  118|  1.46k|        if (p != NULL && bn != NULL) {
  ------------------
  |  Branch (118:13): [True: 0, False: 1.46k]
  |  Branch (118:26): [True: 0, False: 0]
  ------------------
  119|      0|            if (!OSSL_PARAM_set_BN(p, bn))
  ------------------
  |  Branch (119:17): [True: 0, False: 0]
  ------------------
  120|      0|                return 0;
  121|      0|        }
  122|  1.46k|    }
  123|    420|    return 1;
  124|    420|}

OSSL_PARAM_locate:
   54|   675k|{
   55|   675k|    if (p != NULL && key != NULL)
  ------------------
  |  Branch (55:9): [True: 675k, False: 6]
  |  Branch (55:22): [True: 675k, False: 0]
  ------------------
   56|  2.04M|        for (; p->key != NULL; p++)
  ------------------
  |  Branch (56:16): [True: 1.63M, False: 410k]
  ------------------
   57|  1.63M|            if (strcmp(key, p->key) == 0)
  ------------------
  |  Branch (57:17): [True: 265k, False: 1.37M]
  ------------------
   58|   265k|                return p;
   59|   410k|    return NULL;
   60|   675k|}
OSSL_PARAM_locate_const:
   63|   316k|{
   64|   316k|    return OSSL_PARAM_locate((OSSL_PARAM *)p, key);
   65|   316k|}
OSSL_PARAM_modified:
   81|      3|{
   82|      3|    return p != NULL && p->return_size != OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|      3|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
  |  Branch (82:12): [True: 3, False: 0]
  |  Branch (82:25): [True: 0, False: 3]
  ------------------
   83|      3|}
OSSL_PARAM_get_int:
  267|  28.0k|{
  268|  28.0k|#ifndef OPENSSL_SMALL_FOOTPRINT
  269|  28.0k|    switch (sizeof(int)) {
  ------------------
  |  Branch (269:13): [Folded - Ignored]
  ------------------
  270|  28.0k|    case sizeof(int32_t):
  ------------------
  |  Branch (270:5): [True: 28.0k, False: 0]
  ------------------
  271|  28.0k|        return OSSL_PARAM_get_int32(p, (int32_t *)val);
  272|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (272:5): [True: 0, False: 28.0k]
  ------------------
  273|      0|        return OSSL_PARAM_get_int64(p, (int64_t *)val);
  274|  28.0k|    }
  275|      0|#endif
  276|      0|    return general_get_int(p, val, sizeof(*val));
  277|  28.0k|}
OSSL_PARAM_set_int:
  280|  33.2k|{
  281|  33.2k|#ifndef OPENSSL_SMALL_FOOTPRINT
  282|  33.2k|    switch (sizeof(int)) {
  ------------------
  |  Branch (282:13): [Folded - Ignored]
  ------------------
  283|  33.2k|    case sizeof(int32_t):
  ------------------
  |  Branch (283:5): [True: 33.2k, False: 0]
  ------------------
  284|  33.2k|        return OSSL_PARAM_set_int32(p, (int32_t)val);
  285|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (285:5): [True: 0, False: 33.2k]
  ------------------
  286|      0|        return OSSL_PARAM_set_int64(p, (int64_t)val);
  287|  33.2k|    }
  288|      0|#endif
  289|      0|    return general_set_int(p, &val, sizeof(val));
  290|  33.2k|}
OSSL_PARAM_construct_int:
  293|  70.6k|{
  294|  70.6k|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(int));
  ------------------
  |  |  106|  70.6k|# define OSSL_PARAM_INTEGER              1
  ------------------
  295|  70.6k|}
OSSL_PARAM_construct_uint:
  324|      2|{
  325|      2|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|      2|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  326|      2|                                sizeof(unsigned int));
  327|      2|}
OSSL_PARAM_get_int32:
  393|  28.0k|{
  394|  28.0k|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (394:9): [True: 0, False: 28.0k]
  |  Branch (394:24): [True: 0, False: 28.0k]
  ------------------
  395|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  396|      0|        return 0;
  397|      0|    }
  398|       |
  399|  28.0k|    if (p->data == NULL) {
  ------------------
  |  Branch (399:9): [True: 0, False: 28.0k]
  ------------------
  400|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  401|      0|        return 0;
  402|      0|    }
  403|       |
  404|  28.0k|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|  28.0k|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (404:9): [True: 28.0k, False: 0]
  ------------------
  405|  28.0k|#ifndef OPENSSL_SMALL_FOOTPRINT
  406|  28.0k|        int64_t i64;
  407|       |
  408|  28.0k|        switch (p->data_size) {
  ------------------
  |  Branch (408:17): [True: 0, False: 28.0k]
  ------------------
  409|  28.0k|        case sizeof(int32_t):
  ------------------
  |  Branch (409:9): [True: 28.0k, False: 0]
  ------------------
  410|  28.0k|            *val = *(const int32_t *)p->data;
  411|  28.0k|            return 1;
  412|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (412:9): [True: 0, False: 28.0k]
  ------------------
  413|      0|            i64 = *(const int64_t *)p->data;
  414|      0|            if (i64 >= INT32_MIN && i64 <= INT32_MAX) {
  ------------------
  |  Branch (414:17): [True: 0, False: 0]
  |  Branch (414:37): [True: 0, False: 0]
  ------------------
  415|      0|                *val = (int32_t)i64;
  416|      0|                return 1;
  417|      0|            }
  418|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  419|      0|            return 0;
  420|  28.0k|        }
  421|      0|#endif
  422|      0|        return general_get_int(p, val, sizeof(*val));
  423|       |
  424|  28.0k|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      0|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (424:16): [True: 0, False: 0]
  ------------------
  425|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  426|      0|        uint32_t u32;
  427|      0|        uint64_t u64;
  428|       |
  429|      0|        switch (p->data_size) {
  ------------------
  |  Branch (429:17): [True: 0, False: 0]
  ------------------
  430|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (430:9): [True: 0, False: 0]
  ------------------
  431|      0|            u32 = *(const uint32_t *)p->data;
  432|      0|            if (u32 <= INT32_MAX) {
  ------------------
  |  Branch (432:17): [True: 0, False: 0]
  ------------------
  433|      0|                *val = (int32_t)u32;
  434|      0|                return 1;
  435|      0|            }
  436|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  437|      0|            return 0;
  438|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (438:9): [True: 0, False: 0]
  ------------------
  439|      0|            u64 = *(const uint64_t *)p->data;
  440|      0|            if (u64 <= INT32_MAX) {
  ------------------
  |  Branch (440:17): [True: 0, False: 0]
  ------------------
  441|      0|                *val = (int32_t)u64;
  442|      0|                return 1;
  443|      0|            }
  444|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  445|      0|            return 0;
  446|      0|        }
  447|      0|#endif
  448|      0|        return general_get_int(p, val, sizeof(*val));
  449|       |
  450|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (450:16): [True: 0, False: 0]
  ------------------
  451|      0|#ifndef OPENSSL_SYS_UEFI
  452|      0|        double d;
  453|       |
  454|      0|        switch (p->data_size) {
  ------------------
  |  Branch (454:17): [True: 0, False: 0]
  ------------------
  455|      0|        case sizeof(double):
  ------------------
  |  Branch (455:9): [True: 0, False: 0]
  ------------------
  456|      0|            d = *(const double *)p->data;
  457|      0|            if (d >= INT32_MIN && d <= INT32_MAX && d == (int32_t)d) {
  ------------------
  |  Branch (457:17): [True: 0, False: 0]
  |  Branch (457:35): [True: 0, False: 0]
  |  Branch (457:53): [True: 0, False: 0]
  ------------------
  458|      0|                *val = (int32_t)d;
  459|      0|                return 1;
  460|      0|            }
  461|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  462|      0|            return 0;
  463|      0|        }
  464|      0|        err_unsupported_real;
  ------------------
  |  |   39|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  465|      0|        return 0;
  466|      0|#endif
  467|      0|    }
  468|      0|    err_bad_type;
  ------------------
  |  |   35|  28.0k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  469|      0|    return 0;
  470|  28.0k|}
OSSL_PARAM_set_int32:
  473|  33.2k|{
  474|  33.2k|    if (p == NULL) {
  ------------------
  |  Branch (474:9): [True: 0, False: 33.2k]
  ------------------
  475|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  476|      0|        return 0;
  477|      0|    }
  478|  33.2k|    p->return_size = 0;
  479|  33.2k|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|  33.2k|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (479:9): [True: 33.2k, False: 0]
  ------------------
  480|  33.2k|#ifndef OPENSSL_SMALL_FOOTPRINT
  481|  33.2k|        p->return_size = sizeof(int32_t); /* Minimum expected size */
  482|  33.2k|        if (p->data == NULL)
  ------------------
  |  Branch (482:13): [True: 0, False: 33.2k]
  ------------------
  483|      0|            return 1;
  484|  33.2k|        switch (p->data_size) {
  ------------------
  |  Branch (484:17): [True: 0, False: 33.2k]
  ------------------
  485|  33.2k|        case sizeof(int32_t):
  ------------------
  |  Branch (485:9): [True: 33.2k, False: 0]
  ------------------
  486|  33.2k|            *(int32_t *)p->data = val;
  487|  33.2k|            return 1;
  488|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (488:9): [True: 0, False: 33.2k]
  ------------------
  489|      0|            p->return_size = sizeof(int64_t);
  490|      0|            *(int64_t *)p->data = (int64_t)val;
  491|      0|            return 1;
  492|  33.2k|        }
  493|      0|#endif
  494|      0|        return general_set_int(p, &val, sizeof(val));
  495|  33.2k|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER && val >= 0) {
  ------------------
  |  |  107|      0|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (495:16): [True: 0, False: 0]
  |  Branch (495:63): [True: 0, False: 0]
  ------------------
  496|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  497|      0|        p->return_size = sizeof(uint32_t); /* Minimum expected size */
  498|      0|        if (p->data == NULL)
  ------------------
  |  Branch (498:13): [True: 0, False: 0]
  ------------------
  499|      0|            return 1;
  500|      0|        switch (p->data_size) {
  ------------------
  |  Branch (500:17): [True: 0, False: 0]
  ------------------
  501|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (501:9): [True: 0, False: 0]
  ------------------
  502|      0|            *(uint32_t *)p->data = (uint32_t)val;
  503|      0|            return 1;
  504|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (504:9): [True: 0, False: 0]
  ------------------
  505|      0|            p->return_size = sizeof(uint64_t);
  506|      0|            *(uint64_t *)p->data = (uint64_t)val;
  507|      0|            return 1;
  508|      0|        }
  509|      0|#endif
  510|      0|        return general_set_int(p, &val, sizeof(val));
  511|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (511:16): [True: 0, False: 0]
  ------------------
  512|      0|#ifndef OPENSSL_SYS_UEFI
  513|      0|        uint32_t u32;
  514|      0|        unsigned int shift;
  515|       |
  516|      0|        p->return_size = sizeof(double);
  517|      0|        if (p->data == NULL)
  ------------------
  |  Branch (517:13): [True: 0, False: 0]
  ------------------
  518|      0|            return 1;
  519|      0|        switch (p->data_size) {
  ------------------
  |  Branch (519:17): [True: 0, False: 0]
  ------------------
  520|      0|        case sizeof(double):
  ------------------
  |  Branch (520:9): [True: 0, False: 0]
  ------------------
  521|      0|            shift = real_shift();
  522|      0|            if (shift < 8 * sizeof(val) - 1) {
  ------------------
  |  Branch (522:17): [True: 0, False: 0]
  ------------------
  523|      0|                u32 = val < 0 ? -val : val;
  ------------------
  |  Branch (523:23): [True: 0, False: 0]
  ------------------
  524|      0|                if ((u32 >> shift) != 0) {
  ------------------
  |  Branch (524:21): [True: 0, False: 0]
  ------------------
  525|      0|                    err_inexact;
  ------------------
  |  |   28|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  526|      0|                    return 0;
  527|      0|                }
  528|      0|            }
  529|      0|            *(double *)p->data = (double)val;
  530|      0|            return 1;
  531|      0|        }
  532|      0|        err_unsupported_real;
  ------------------
  |  |   39|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  533|      0|        return 0;
  534|      0|#endif
  535|      0|    }
  536|      0|    err_bad_type;
  ------------------
  |  |   35|  33.2k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  537|      0|    return 0;
  538|  33.2k|}
OSSL_PARAM_set_uint64:
  938|  58.8k|{
  939|  58.8k|    if (p == NULL) {
  ------------------
  |  Branch (939:9): [True: 0, False: 58.8k]
  ------------------
  940|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  941|      0|        return 0;
  942|      0|    }
  943|  58.8k|    p->return_size = 0;
  944|       |
  945|  58.8k|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|  58.8k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (945:9): [True: 58.8k, False: 0]
  ------------------
  946|  58.8k|#ifndef OPENSSL_SMALL_FOOTPRINT
  947|  58.8k|        if (p->data == NULL) {
  ------------------
  |  Branch (947:13): [True: 0, False: 58.8k]
  ------------------
  948|      0|            p->return_size = sizeof(uint64_t); /* Expected size */
  949|      0|            return 1;
  950|      0|        }
  951|  58.8k|        switch (p->data_size) {
  ------------------
  |  Branch (951:17): [True: 0, False: 58.8k]
  ------------------
  952|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (952:9): [True: 0, False: 58.8k]
  ------------------
  953|      0|            if (val <= UINT32_MAX) {
  ------------------
  |  Branch (953:17): [True: 0, False: 0]
  ------------------
  954|      0|                p->return_size = sizeof(uint32_t);
  955|      0|                *(uint32_t *)p->data = (uint32_t)val;
  956|      0|                return 1;
  957|      0|            }
  958|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  959|      0|            return 0;
  960|  58.8k|        case sizeof(uint64_t):
  ------------------
  |  Branch (960:9): [True: 58.8k, False: 0]
  ------------------
  961|  58.8k|            p->return_size = sizeof(uint64_t);
  962|  58.8k|            *(uint64_t *)p->data = val;
  963|  58.8k|            return 1;
  964|  58.8k|        }
  965|      0|#endif
  966|      0|        return general_set_uint(p, &val, sizeof(val));
  967|  58.8k|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (967:16): [True: 0, False: 0]
  ------------------
  968|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  969|      0|        if (p->data == NULL) {
  ------------------
  |  Branch (969:13): [True: 0, False: 0]
  ------------------
  970|      0|            p->return_size = sizeof(int64_t); /* Expected size */
  971|      0|            return 1;
  972|      0|        }
  973|      0|        switch (p->data_size) {
  ------------------
  |  Branch (973:17): [True: 0, False: 0]
  ------------------
  974|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (974:9): [True: 0, False: 0]
  ------------------
  975|      0|            if (val <= INT32_MAX) {
  ------------------
  |  Branch (975:17): [True: 0, False: 0]
  ------------------
  976|      0|                p->return_size = sizeof(int32_t);
  977|      0|                *(int32_t *)p->data = (int32_t)val;
  978|      0|                return 1;
  979|      0|            }
  980|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  981|      0|            return 0;
  982|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (982:9): [True: 0, False: 0]
  ------------------
  983|      0|            if (val <= INT64_MAX) {
  ------------------
  |  Branch (983:17): [True: 0, False: 0]
  ------------------
  984|      0|                p->return_size = sizeof(int64_t);
  985|      0|                *(int64_t *)p->data = (int64_t)val;
  986|      0|                return 1;
  987|      0|            }
  988|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  989|      0|            return 0;
  990|      0|        }
  991|      0|#endif
  992|      0|        return general_set_uint(p, &val, sizeof(val));
  993|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (993:16): [True: 0, False: 0]
  ------------------
  994|      0|#ifndef OPENSSL_SYS_UEFI
  995|      0|        switch (p->data_size) {
  ------------------
  |  Branch (995:17): [True: 0, False: 0]
  ------------------
  996|      0|        case sizeof(double):
  ------------------
  |  Branch (996:9): [True: 0, False: 0]
  ------------------
  997|      0|            if ((val >> real_shift()) == 0) {
  ------------------
  |  Branch (997:17): [True: 0, False: 0]
  ------------------
  998|      0|                p->return_size = sizeof(double);
  999|      0|                *(double *)p->data = (double)val;
 1000|      0|                return 1;
 1001|      0|            }
 1002|      0|            err_inexact;
  ------------------
  |  |   28|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
 1003|      0|            return 0;
 1004|      0|        }
 1005|      0|        err_unsupported_real;
  ------------------
  |  |   39|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1006|      0|        return 0;
 1007|      0|#endif
 1008|      0|    }
 1009|      0|    err_bad_type;
  ------------------
  |  |   35|  58.8k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1010|      0|    return 0;
 1011|  58.8k|}
OSSL_PARAM_set_size_t:
 1033|  58.8k|{
 1034|  58.8k|#ifndef OPENSSL_SMALL_FOOTPRINT
 1035|  58.8k|    switch (sizeof(size_t)) {
  ------------------
  |  Branch (1035:13): [Folded - Ignored]
  ------------------
 1036|      0|    case sizeof(uint32_t):
  ------------------
  |  Branch (1036:5): [True: 0, False: 58.8k]
  ------------------
 1037|      0|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
 1038|  58.8k|    case sizeof(uint64_t):
  ------------------
  |  Branch (1038:5): [True: 58.8k, False: 0]
  ------------------
 1039|  58.8k|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
 1040|  58.8k|    }
 1041|      0|#endif
 1042|      0|    return general_set_uint(p, &val, sizeof(val));
 1043|  58.8k|}
OSSL_PARAM_construct_size_t:
 1046|  58.8k|{
 1047|  58.8k|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|  58.8k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
 1048|  58.8k|                                sizeof(size_t));
 1049|  58.8k|}
OSSL_PARAM_construct_time_t:
 1078|      2|{
 1079|      2|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(time_t));
  ------------------
  |  |  106|      2|# define OSSL_PARAM_INTEGER              1
  ------------------
 1080|      2|}
OSSL_PARAM_get_utf8_string:
 1380|  34.1k|{
 1381|  34.1k|    int ret = get_string_internal(p, (void **)val, &max_len, NULL,
 1382|  34.1k|                                  OSSL_PARAM_UTF8_STRING);
  ------------------
  |  |  117|  34.1k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
 1383|       |
 1384|       |    /*
 1385|       |     * We try to ensure that the copied string is terminated with a
 1386|       |     * NUL byte.  That should be easy, just place a NUL byte at
 1387|       |     * |((char*)*val)[p->data_size]|.
 1388|       |     * Unfortunately, we have seen cases where |p->data_size| doesn't
 1389|       |     * correctly reflect the length of the string, and just happens
 1390|       |     * to be out of bounds according to |max_len|, so in that case, we
 1391|       |     * make the extra step of trying to find the true length of the
 1392|       |     * string that |p->data| points at, and use that as an index to
 1393|       |     * place the NUL byte in |*val|.
 1394|       |     */
 1395|  34.1k|    size_t data_length = p->data_size;
 1396|       |
 1397|  34.1k|    if (ret == 0)
  ------------------
  |  Branch (1397:9): [True: 0, False: 34.1k]
  ------------------
 1398|      0|        return 0;
 1399|  34.1k|    if (data_length >= max_len)
  ------------------
  |  Branch (1399:9): [True: 0, False: 34.1k]
  ------------------
 1400|      0|        data_length = OPENSSL_strnlen(p->data, data_length);
 1401|  34.1k|    if (data_length >= max_len) {
  ------------------
  |  Branch (1401:9): [True: 0, False: 34.1k]
  ------------------
 1402|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_NO_SPACE_FOR_TERMINATING_NULL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1403|      0|        return 0;            /* No space for a terminating NUL byte */
 1404|      0|    }
 1405|  34.1k|    (*val)[data_length] = '\0';
 1406|       |
 1407|  34.1k|    return ret;
 1408|  34.1k|}
OSSL_PARAM_construct_utf8_string:
 1462|   125k|{
 1463|   125k|    if (buf != NULL && bsize == 0)
  ------------------
  |  Branch (1463:9): [True: 125k, False: 0]
  |  Branch (1463:24): [True: 125k, False: 0]
  ------------------
 1464|   125k|        bsize = strlen(buf);
 1465|   125k|    return ossl_param_construct(key, OSSL_PARAM_UTF8_STRING, buf, bsize);
  ------------------
  |  |  117|   125k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
 1466|   125k|}
OSSL_PARAM_construct_octet_string:
 1470|  33.9k|{
 1471|  33.9k|    return ossl_param_construct(key, OSSL_PARAM_OCTET_STRING, buf, bsize);
  ------------------
  |  |  123|  33.9k|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
 1472|  33.9k|}
OSSL_PARAM_construct_end:
 1661|  42.2k|{
 1662|  42.2k|    OSSL_PARAM end = OSSL_PARAM_END;
  ------------------
  |  |   25|  42.2k|    { NULL, 0, NULL, 0, 0 }
  ------------------
 1663|       |
 1664|  42.2k|    return end;
 1665|  42.2k|}
OSSL_PARAM_get_utf8_string_ptr:
 1690|  76.9k|{
 1691|  76.9k|    return get_string_ptr_internal(p, (const void **)val, NULL,
 1692|  76.9k|                                   OSSL_PARAM_UTF8_PTR,
  ------------------
  |  |  141|  76.9k|# define OSSL_PARAM_UTF8_PTR             6
  ------------------
 1693|  76.9k|                                   OSSL_PARAM_UTF8_STRING);
  ------------------
  |  |  117|  76.9k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
 1694|  76.9k|}
params.c:ossl_param_construct:
   69|   289k|{
   70|   289k|    OSSL_PARAM res;
   71|       |
   72|   289k|    res.key = key;
   73|   289k|    res.data_type = data_type;
   74|   289k|    res.data = data;
   75|   289k|    res.data_size = data_size;
   76|   289k|    res.return_size = OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|   289k|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
   77|   289k|    return res;
   78|   289k|}
params.c:get_string_internal:
 1332|  34.1k|{
 1333|  34.1k|    size_t sz, alloc_sz;
 1334|       |
 1335|  34.1k|    if ((val == NULL && used_len == NULL) || p == NULL) {
  ------------------
  |  Branch (1335:10): [True: 0, False: 34.1k]
  |  Branch (1335:25): [True: 0, False: 0]
  |  Branch (1335:46): [True: 0, False: 34.1k]
  ------------------
 1336|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1337|      0|        return 0;
 1338|      0|    }
 1339|  34.1k|    if (p->data_type != type) {
  ------------------
  |  Branch (1339:9): [True: 0, False: 34.1k]
  ------------------
 1340|      0|        err_bad_type;
  ------------------
  |  |   35|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1341|      0|        return 0;
 1342|      0|    }
 1343|       |
 1344|  34.1k|    sz = p->data_size;
 1345|       |    /*
 1346|       |     * If the input size is 0, or the input string needs NUL byte
 1347|       |     * termination, allocate an extra byte.
 1348|       |     */
 1349|  34.1k|    alloc_sz = sz + (type == OSSL_PARAM_UTF8_STRING || sz == 0);
  ------------------
  |  |  117|  68.2k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (1349:22): [True: 34.1k, False: 0]
  |  Branch (1349:56): [True: 0, False: 0]
  ------------------
 1350|       |
 1351|  34.1k|    if (used_len != NULL)
  ------------------
  |  Branch (1351:9): [True: 0, False: 34.1k]
  ------------------
 1352|      0|        *used_len = sz;
 1353|       |
 1354|  34.1k|    if (p->data == NULL) {
  ------------------
  |  Branch (1354:9): [True: 0, False: 34.1k]
  ------------------
 1355|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1356|      0|        return 0;
 1357|      0|    }
 1358|       |
 1359|  34.1k|    if (val == NULL)
  ------------------
  |  Branch (1359:9): [True: 0, False: 34.1k]
  ------------------
 1360|      0|        return 1;
 1361|       |
 1362|  34.1k|    if (*val == NULL) {
  ------------------
  |  Branch (1362:9): [True: 33.9k, False: 142]
  ------------------
 1363|  33.9k|        char *const q = OPENSSL_malloc(alloc_sz);
  ------------------
  |  |  102|  33.9k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  33.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  33.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1364|       |
 1365|  33.9k|        if (q == NULL)
  ------------------
  |  Branch (1365:13): [True: 0, False: 33.9k]
  ------------------
 1366|      0|            return 0;
 1367|  33.9k|        *val = q;
 1368|  33.9k|        *max_len = alloc_sz;
 1369|  33.9k|    }
 1370|       |
 1371|  34.1k|    if (*max_len < sz) {
  ------------------
  |  Branch (1371:9): [True: 0, False: 34.1k]
  ------------------
 1372|      0|        err_too_small;
  ------------------
  |  |   33|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_SMALL_BUFFER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1373|      0|        return 0;
 1374|      0|    }
 1375|  34.1k|    memcpy(*val, p->data, sz);
 1376|  34.1k|    return 1;
 1377|  34.1k|}
params.c:get_string_ptr_internal:
 1670|  76.9k|{
 1671|  76.9k|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (1671:9): [True: 0, False: 76.9k]
  |  Branch (1671:24): [True: 0, False: 76.9k]
  ------------------
 1672|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1673|      0|        return 0;
 1674|      0|    }
 1675|       |
 1676|  76.9k|    if (p->data_type == ref_type)
  ------------------
  |  Branch (1676:9): [True: 0, False: 76.9k]
  ------------------
 1677|      0|        return get_ptr_internal_skip_checks(p, (const void **)val, used_len);
 1678|       |
 1679|  76.9k|    if (p->data_type != type) {
  ------------------
  |  Branch (1679:9): [True: 0, False: 76.9k]
  ------------------
 1680|      0|        err_bad_type;
  ------------------
  |  |   35|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1681|      0|        return 0;
 1682|      0|    }
 1683|  76.9k|    if (used_len != NULL)
  ------------------
  |  Branch (1683:9): [True: 0, False: 76.9k]
  ------------------
 1684|      0|        *used_len = p->data_size;
 1685|  76.9k|    *val = p->data;
 1686|  76.9k|    return 1;
 1687|  76.9k|}

ossl_pw_clear_passphrase_data:
   17|  76.2k|{
   18|  76.2k|    if (data != NULL) {
  ------------------
  |  Branch (18:9): [True: 76.2k, False: 0]
  ------------------
   19|  76.2k|        if (data->type == is_expl_passphrase)
  ------------------
  |  Branch (19:13): [True: 0, False: 76.2k]
  ------------------
   20|      0|            OPENSSL_clear_free(data->_.expl_passphrase.passphrase_copy,
  ------------------
  |  |  113|      0|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   21|  76.2k|                               data->_.expl_passphrase.passphrase_len);
   22|  76.2k|        ossl_pw_clear_passphrase_cache(data);
   23|  76.2k|        memset(data, 0, sizeof(*data));
   24|  76.2k|    }
   25|  76.2k|}
ossl_pw_clear_passphrase_cache:
   28|   113k|{
   29|   113k|    OPENSSL_clear_free(data->cached_passphrase, data->cached_passphrase_len);
  ------------------
  |  |  113|   113k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   113k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   113k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   30|   113k|    data->cached_passphrase = NULL;
   31|   113k|}
ossl_pw_set_ossl_passphrase_cb:
   68|  1.62k|{
   69|  1.62k|    if (!ossl_assert(data != NULL && cb != NULL)) {
  ------------------
  |  |   52|  3.24k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 1.62k, False: 0]
  |  |  |  Branch (52:43): [True: 1.62k, False: 0]
  |  |  ------------------
  |  |   53|  1.62k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (69:9): [True: 0, False: 1.62k]
  ------------------
   70|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   71|      0|        return 0;
   72|      0|    }
   73|  1.62k|    ossl_pw_clear_passphrase_data(data);
   74|  1.62k|    data->type = is_ossl_passphrase;
   75|  1.62k|    data->_.ossl_passphrase.passphrase_cb = cb;
   76|  1.62k|    data->_.ossl_passphrase.passphrase_cbarg = cbarg;
   77|  1.62k|    return 1;
   78|  1.62k|}
ossl_pw_enable_passphrase_caching:
   95|  37.6k|{
   96|  37.6k|    data->flag_cache_passphrase = 1;
   97|  37.6k|    return 1;
   98|  37.6k|}

ossl_err_load_PEM_strings:
   70|      2|{
   71|      2|#ifndef OPENSSL_NO_ERR
   72|      2|    if (ERR_reason_error_string(PEM_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (72:9): [True: 2, False: 0]
  ------------------
   73|      2|        ERR_load_strings_const(PEM_str_reasons);
   74|      2|#endif
   75|      2|    return 1;
   76|      2|}

ossl_err_load_PKCS12_strings:
   56|      2|{
   57|      2|#ifndef OPENSSL_NO_ERR
   58|      2|    if (ERR_reason_error_string(PKCS12_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (58:9): [True: 2, False: 0]
  ------------------
   59|      2|        ERR_load_strings_const(PKCS12_str_reasons);
   60|      2|#endif
   61|      2|    return 1;
   62|      2|}

pk7_asn1.c:pk7_cb:
   35|   243k|{
   36|   243k|    ASN1_STREAM_ARG *sarg = exarg;
   37|   243k|    PKCS7 **pp7 = (PKCS7 **)pval;
   38|       |
   39|   243k|    switch (operation) {
  ------------------
  |  Branch (39:13): [True: 243k, False: 0]
  ------------------
   40|       |
   41|      0|    case ASN1_OP_STREAM_PRE:
  ------------------
  |  |  752|      0|# define ASN1_OP_STREAM_PRE      10
  ------------------
  |  Branch (41:5): [True: 0, False: 243k]
  ------------------
   42|      0|        if (PKCS7_stream(&sarg->boundary, *pp7) <= 0)
  ------------------
  |  Branch (42:13): [True: 0, False: 0]
  ------------------
   43|      0|            return 0;
   44|       |        /* fall through */
   45|      0|    case ASN1_OP_DETACHED_PRE:
  ------------------
  |  |  754|      0|# define ASN1_OP_DETACHED_PRE    12
  ------------------
  |  Branch (45:5): [True: 0, False: 243k]
  ------------------
   46|      0|        sarg->ndef_bio = PKCS7_dataInit(*pp7, sarg->out);
   47|      0|        if (!sarg->ndef_bio)
  ------------------
  |  Branch (47:13): [True: 0, False: 0]
  ------------------
   48|      0|            return 0;
   49|      0|        break;
   50|       |
   51|      0|    case ASN1_OP_STREAM_POST:
  ------------------
  |  |  753|      0|# define ASN1_OP_STREAM_POST     11
  ------------------
  |  Branch (51:5): [True: 0, False: 243k]
  ------------------
   52|      0|    case ASN1_OP_DETACHED_POST:
  ------------------
  |  |  755|      0|# define ASN1_OP_DETACHED_POST   13
  ------------------
  |  Branch (52:5): [True: 0, False: 243k]
  ------------------
   53|      0|        if (PKCS7_dataFinal(*pp7, sarg->ndef_bio) <= 0)
  ------------------
  |  Branch (53:13): [True: 0, False: 0]
  ------------------
   54|      0|            return 0;
   55|      0|        break;
   56|       |
   57|   243k|    }
   58|   243k|    return 1;
   59|   243k|}
pk7_asn1.c:si_cb:
  139|  60.7k|{
  140|  60.7k|    if (operation == ASN1_OP_FREE_POST) {
  ------------------
  |  |  745|  60.7k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (140:9): [True: 11.5k, False: 49.1k]
  ------------------
  141|  11.5k|        PKCS7_SIGNER_INFO *si = (PKCS7_SIGNER_INFO *)*pval;
  142|  11.5k|        EVP_PKEY_free(si->pkey);
  143|  11.5k|    }
  144|  60.7k|    return 1;
  145|  60.7k|}
pk7_asn1.c:ri_cb:
  182|  58.1k|{
  183|  58.1k|    if (operation == ASN1_OP_FREE_POST) {
  ------------------
  |  |  745|  58.1k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (183:9): [True: 11.1k, False: 46.9k]
  ------------------
  184|  11.1k|        PKCS7_RECIP_INFO *ri = (PKCS7_RECIP_INFO *)*pval;
  185|  11.1k|        X509_free(ri->cert);
  186|  11.1k|    }
  187|  58.1k|    return 1;
  188|  58.1k|}

PKCS7_ctrl:
   21|      3|{
   22|      3|    int nid;
   23|      3|    long ret;
   24|       |
   25|      3|    nid = OBJ_obj2nid(p7->type);
   26|       |
   27|      3|    switch (cmd) {
   28|       |    /* NOTE(emilia): does not support detached digested data. */
   29|      0|    case PKCS7_OP_SET_DETACHED_SIGNATURE:
  ------------------
  |  |  249|      0|# define PKCS7_OP_SET_DETACHED_SIGNATURE 1
  ------------------
  |  Branch (29:5): [True: 0, False: 3]
  ------------------
   30|      0|        if (nid == NID_pkcs7_signed) {
  ------------------
  |  |  679|      0|#define NID_pkcs7_signed                22
  ------------------
  |  Branch (30:13): [True: 0, False: 0]
  ------------------
   31|      0|            if (p7->d.sign == NULL) {
  ------------------
  |  Branch (31:17): [True: 0, False: 0]
  ------------------
   32|      0|                ERR_raise(ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   33|      0|                ret = 0;
   34|      0|                break;
   35|      0|            }
   36|      0|            ret = p7->detached = (int)larg;
   37|      0|            if (ret && PKCS7_type_is_data(p7->d.sign->contents)) {
  ------------------
  |  |  260|      0|# define PKCS7_type_is_data(a)   (OBJ_obj2nid((a)->type) == NID_pkcs7_data)
  |  |  ------------------
  |  |  |  |  675|      0|#define NID_pkcs7_data          21
  |  |  ------------------
  |  |  |  Branch (260:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (37:17): [True: 0, False: 0]
  ------------------
   38|      0|                ASN1_OCTET_STRING *os;
   39|      0|                os = p7->d.sign->contents->d.data;
   40|      0|                ASN1_OCTET_STRING_free(os);
   41|      0|                p7->d.sign->contents->d.data = NULL;
   42|      0|            }
   43|      0|        } else {
   44|      0|            ERR_raise(ERR_LIB_PKCS7,
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   45|      0|                      PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE);
   46|      0|            ret = 0;
   47|      0|        }
   48|      0|        break;
   49|      3|    case PKCS7_OP_GET_DETACHED_SIGNATURE:
  ------------------
  |  |  250|      3|# define PKCS7_OP_GET_DETACHED_SIGNATURE 2
  ------------------
  |  Branch (49:5): [True: 3, False: 0]
  ------------------
   50|      3|        if (nid == NID_pkcs7_signed) {
  ------------------
  |  |  679|      3|#define NID_pkcs7_signed                22
  ------------------
  |  Branch (50:13): [True: 3, False: 0]
  ------------------
   51|      3|            if (p7->d.sign == NULL || p7->d.sign->contents->d.ptr == NULL)
  ------------------
  |  Branch (51:17): [True: 1, False: 2]
  |  Branch (51:39): [True: 1, False: 1]
  ------------------
   52|      2|                ret = 1;
   53|      1|            else
   54|      1|                ret = 0;
   55|       |
   56|      3|            p7->detached = ret;
   57|      3|        } else {
   58|      0|            ERR_raise(ERR_LIB_PKCS7,
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   59|      0|                      PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE);
   60|      0|            ret = 0;
   61|      0|        }
   62|       |
   63|      3|        break;
   64|      0|    default:
  ------------------
  |  Branch (64:5): [True: 0, False: 3]
  ------------------
   65|      0|        ERR_raise(ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_OPERATION);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   66|      0|        ret = 0;
   67|      3|    }
   68|      3|    return ret;
   69|      3|}

ossl_err_load_PKCS7_strings:
   92|      2|{
   93|      2|#ifndef OPENSSL_NO_ERR
   94|      2|    if (ERR_reason_error_string(PKCS7_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (94:9): [True: 2, False: 0]
  ------------------
   95|      2|        ERR_load_strings_const(PKCS7_str_reasons);
   96|      2|#endif
   97|      2|    return 1;
   98|      2|}

ossl_property_defns_free:
   52|      2|{
   53|      2|    LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns = vproperty_defns;
  ------------------
  |  |  149|      2|# define LHASH_OF(type) struct lhash_st_##type
  ------------------
   54|       |
   55|      2|    if (property_defns != NULL) {
  ------------------
  |  Branch (55:9): [True: 2, False: 0]
  ------------------
   56|      2|        lh_PROPERTY_DEFN_ELEM_doall(property_defns,
   57|      2|                                    &property_defn_free);
   58|      2|        lh_PROPERTY_DEFN_ELEM_free(property_defns);
   59|      2|    }
   60|      2|}
ossl_property_defns_new:
   62|      4|void *ossl_property_defns_new(OSSL_LIB_CTX *ctx) {
   63|      4|    return lh_PROPERTY_DEFN_ELEM_new(&property_defn_hash, &property_defn_cmp);
   64|      4|}
ossl_prop_defn_get:
   67|    399|{
   68|    399|    PROPERTY_DEFN_ELEM elem, *r;
   69|    399|    LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns;
  ------------------
  |  |  149|    399|# define LHASH_OF(type) struct lhash_st_##type
  ------------------
   70|       |
   71|    399|    property_defns = ossl_lib_ctx_get_data(ctx,
   72|    399|                                           OSSL_LIB_CTX_PROPERTY_DEFN_INDEX);
  ------------------
  |  |  100|    399|# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX            2
  ------------------
   73|    399|    if (!ossl_assert(property_defns != NULL) || !ossl_lib_ctx_read_lock(ctx))
  ------------------
  |  |   52|    798|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    798|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (73:9): [True: 0, False: 399]
  |  Branch (73:49): [True: 0, False: 399]
  ------------------
   74|      0|        return NULL;
   75|       |
   76|    399|    elem.prop = prop;
   77|    399|    r = lh_PROPERTY_DEFN_ELEM_retrieve(property_defns, &elem);
   78|    399|    ossl_lib_ctx_unlock(ctx);
   79|    399|    if (r == NULL || !ossl_assert(r->defn != NULL))
  ------------------
  |  |   52|    342|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    342|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (79:9): [True: 57, False: 342]
  |  Branch (79:22): [True: 0, False: 342]
  ------------------
   80|     57|        return NULL;
   81|    342|    return r->defn;
   82|    399|}
ossl_prop_defn_set:
   91|     57|{
   92|     57|    PROPERTY_DEFN_ELEM elem, *old, *p = NULL;
   93|     57|    size_t len;
   94|     57|    LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns;
  ------------------
  |  |  149|     57|# define LHASH_OF(type) struct lhash_st_##type
  ------------------
   95|     57|    int res = 1;
   96|       |
   97|     57|    property_defns = ossl_lib_ctx_get_data(ctx,
   98|     57|                                           OSSL_LIB_CTX_PROPERTY_DEFN_INDEX);
  ------------------
  |  |  100|     57|# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX            2
  ------------------
   99|     57|    if (property_defns == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 57]
  ------------------
  100|      0|        return 0;
  101|       |
  102|     57|    if (prop == NULL)
  ------------------
  |  Branch (102:9): [True: 0, False: 57]
  ------------------
  103|      0|        return 1;
  104|       |
  105|     57|    if (!ossl_lib_ctx_write_lock(ctx))
  ------------------
  |  Branch (105:9): [True: 0, False: 57]
  ------------------
  106|      0|        return 0;
  107|     57|    elem.prop = prop;
  108|     57|    if (pl == NULL) {
  ------------------
  |  Branch (108:9): [True: 0, False: 57]
  ------------------
  109|      0|        lh_PROPERTY_DEFN_ELEM_delete(property_defns, &elem);
  110|      0|        goto end;
  111|      0|    }
  112|       |    /* check if property definition is in the cache already */
  113|     57|    if ((p = lh_PROPERTY_DEFN_ELEM_retrieve(property_defns, &elem)) != NULL) {
  ------------------
  |  Branch (113:9): [True: 0, False: 57]
  ------------------
  114|      0|        ossl_property_free(*pl);
  115|      0|        *pl = p->defn;
  116|      0|        goto end;
  117|      0|    }
  118|     57|    len = strlen(prop);
  119|     57|    p = OPENSSL_malloc(sizeof(*p) + len);
  ------------------
  |  |  102|     57|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     57|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     57|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  120|     57|    if (p != NULL) {
  ------------------
  |  Branch (120:9): [True: 57, False: 0]
  ------------------
  121|     57|        p->prop = p->body;
  122|     57|        p->defn = *pl;
  123|     57|        memcpy(p->body, prop, len + 1);
  124|     57|        old = lh_PROPERTY_DEFN_ELEM_insert(property_defns, p);
  125|     57|        if (!ossl_assert(old == NULL))
  ------------------
  |  |   52|     57|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     57|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (125:13): [True: 0, False: 57]
  ------------------
  126|       |            /* This should not happen. An existing entry is handled above. */
  127|      0|            goto end;
  128|     57|        if (!lh_PROPERTY_DEFN_ELEM_error(property_defns))
  ------------------
  |  Branch (128:13): [True: 57, False: 0]
  ------------------
  129|     57|            goto end;
  130|     57|    }
  131|      0|    OPENSSL_free(p);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  132|      0|    res = 0;
  133|     57| end:
  134|     57|    ossl_lib_ctx_unlock(ctx);
  135|     57|    return res;
  136|      0|}
defn_cache.c:property_defn_free:
   46|     57|{
   47|     57|    ossl_property_free(elem->defn);
   48|     57|    OPENSSL_free(elem);
  ------------------
  |  |  115|     57|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     57|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     57|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   49|     57|}
defn_cache.c:property_defn_hash:
   35|    513|{
   36|    513|    return OPENSSL_LH_strhash(a->prop);
   37|    513|}
defn_cache.c:property_defn_cmp:
   41|    342|{
   42|    342|    return strcmp(a->prop, b->prop);
   43|    342|}

ossl_ctx_global_properties_free:
  115|      2|{
  116|      2|    OSSL_GLOBAL_PROPERTIES *globp = vglobp;
  117|       |
  118|      2|    if (globp != NULL) {
  ------------------
  |  Branch (118:9): [True: 2, False: 0]
  ------------------
  119|      2|        ossl_property_free(globp->list);
  120|      2|        OPENSSL_free(globp);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  121|      2|    }
  122|      2|}
ossl_ctx_global_properties_new:
  125|      4|{
  126|      4|    return OPENSSL_zalloc(sizeof(OSSL_GLOBAL_PROPERTIES));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  127|      4|}
ossl_ctx_global_properties:
  131|      7|{
  132|      7|    OSSL_GLOBAL_PROPERTIES *globp;
  133|       |
  134|      7|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  135|      7|    if (loadconfig && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
  ------------------
  |  |  472|      0|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (135:9): [True: 0, False: 7]
  |  Branch (135:23): [True: 0, False: 0]
  ------------------
  136|      0|        return NULL;
  137|      7|#endif
  138|      7|    globp = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_GLOBAL_PROPERTIES);
  ------------------
  |  |  114|      7|# define OSSL_LIB_CTX_GLOBAL_PROPERTIES             14
  ------------------
  139|       |
  140|      7|    return globp != NULL ? &globp->list : NULL;
  ------------------
  |  Branch (140:12): [True: 7, False: 0]
  ------------------
  141|      7|}
ossl_method_store_new:
  244|     16|{
  245|     16|    OSSL_METHOD_STORE *res;
  246|       |
  247|     16|    res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |  104|     16|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  248|     16|    if (res != NULL) {
  ------------------
  |  Branch (248:9): [True: 16, False: 0]
  ------------------
  249|     16|        res->ctx = ctx;
  250|     16|        if ((res->algs = ossl_sa_ALGORITHM_new()) == NULL
  ------------------
  |  Branch (250:13): [True: 0, False: 16]
  ------------------
  251|     16|            || (res->lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (251:16): [True: 0, False: 16]
  ------------------
  252|     16|            || (res->biglock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (252:16): [True: 0, False: 16]
  ------------------
  253|      0|            ossl_method_store_free(res);
  254|      0|            return NULL;
  255|      0|        }
  256|     16|    }
  257|     16|    return res;
  258|     16|}
ossl_method_store_free:
  261|      8|{
  262|      8|    if (store != NULL) {
  ------------------
  |  Branch (262:9): [True: 8, False: 0]
  ------------------
  263|      8|        if (store->algs != NULL)
  ------------------
  |  Branch (263:13): [True: 8, False: 0]
  ------------------
  264|      8|            ossl_sa_ALGORITHM_doall_arg(store->algs, &alg_cleanup, store);
  265|      8|        ossl_sa_ALGORITHM_free(store->algs);
  266|      8|        CRYPTO_THREAD_lock_free(store->lock);
  267|      8|        CRYPTO_THREAD_lock_free(store->biglock);
  268|      8|        OPENSSL_free(store);
  ------------------
  |  |  115|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  269|      8|    }
  270|      8|}
ossl_method_lock_store:
  273|  13.2k|{
  274|  13.2k|    return store != NULL ? CRYPTO_THREAD_write_lock(store->biglock) : 0;
  ------------------
  |  Branch (274:12): [True: 13.2k, False: 0]
  ------------------
  275|  13.2k|}
ossl_method_unlock_store:
  278|  13.2k|{
  279|  13.2k|    return store != NULL ? CRYPTO_THREAD_unlock(store->biglock) : 0;
  ------------------
  |  Branch (279:12): [True: 13.2k, False: 0]
  ------------------
  280|  13.2k|}
ossl_method_store_add:
  321|    399|{
  322|    399|    ALGORITHM *alg = NULL;
  323|    399|    IMPLEMENTATION *impl;
  324|    399|    int ret = 0;
  325|    399|    int i;
  326|       |
  327|    399|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (327:9): [True: 0, False: 399]
  |  Branch (327:21): [True: 0, False: 399]
  |  Branch (327:39): [True: 0, False: 399]
  ------------------
  328|      0|        return 0;
  329|       |
  330|    399|    if (properties == NULL)
  ------------------
  |  Branch (330:9): [True: 0, False: 399]
  ------------------
  331|      0|        properties = "";
  332|       |
  333|    399|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|    399|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    399|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (333:9): [True: 0, False: 399]
  ------------------
  334|      0|        return 0;
  335|       |
  336|       |    /* Create new entry */
  337|    399|    impl = OPENSSL_malloc(sizeof(*impl));
  ------------------
  |  |  102|    399|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    399|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    399|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  338|    399|    if (impl == NULL)
  ------------------
  |  Branch (338:9): [True: 0, False: 399]
  ------------------
  339|      0|        return 0;
  340|    399|    impl->method.method = method;
  341|    399|    impl->method.up_ref = method_up_ref;
  342|    399|    impl->method.free = method_destruct;
  343|    399|    if (!ossl_method_up_ref(&impl->method)) {
  ------------------
  |  Branch (343:9): [True: 0, False: 399]
  ------------------
  344|      0|        OPENSSL_free(impl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  345|      0|        return 0;
  346|      0|    }
  347|    399|    impl->provider = prov;
  348|       |
  349|       |    /* Insert into the hash table if required */
  350|    399|    if (!ossl_property_write_lock(store)) {
  ------------------
  |  Branch (350:9): [True: 0, False: 399]
  ------------------
  351|      0|        impl_free(impl);
  352|      0|        return 0;
  353|      0|    }
  354|       |
  355|       |    /*
  356|       |     * Flush the alg cache of any implementation that already exists
  357|       |     * for this id.
  358|       |     * This is done to ensure that on the next lookup we go through the
  359|       |     * provider comparison in ossl_method_store_fetch.  If we don't do this
  360|       |     * then this new method won't be given a chance to get selected.
  361|       |     * NOTE: This doesn't actually remove the method from the backing store
  362|       |     * It just ensures that we query the backing store when (re)-adding a
  363|       |     * method to the algorithm cache, in case the one selected by the next
  364|       |     * query selects a different implementation
  365|       |     */
  366|    399|    ossl_method_cache_flush(store, nid);
  367|       |
  368|       |    /*
  369|       |     * Parse the properties associated with this method, and convert it to a
  370|       |     * property list stored against the implementation for later comparison
  371|       |     * during fetch operations
  372|       |     */
  373|    399|    if ((impl->properties = ossl_prop_defn_get(store->ctx, properties)) == NULL) {
  ------------------
  |  Branch (373:9): [True: 57, False: 342]
  ------------------
  374|     57|        impl->properties = ossl_parse_property(store->ctx, properties);
  375|     57|        if (impl->properties == NULL)
  ------------------
  |  Branch (375:13): [True: 0, False: 57]
  ------------------
  376|      0|            goto err;
  377|     57|        if (!ossl_prop_defn_set(store->ctx, properties, &impl->properties)) {
  ------------------
  |  Branch (377:13): [True: 0, False: 57]
  ------------------
  378|      0|            ossl_property_free(impl->properties);
  379|      0|            impl->properties = NULL;
  380|      0|            goto err;
  381|      0|        }
  382|     57|    }
  383|       |
  384|       |    /*
  385|       |     * Check if we have an algorithm cache already for this nid.  If so use
  386|       |     * it, otherwise, create it, and insert it into the store
  387|       |     */
  388|    399|    alg = ossl_method_store_retrieve(store, nid);
  389|    399|    if (alg == NULL) {
  ------------------
  |  Branch (389:9): [True: 141, False: 258]
  ------------------
  390|    141|        if ((alg = OPENSSL_zalloc(sizeof(*alg))) == NULL
  ------------------
  |  |  104|    141|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    141|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    141|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (390:13): [True: 0, False: 141]
  ------------------
  391|    141|                || (alg->impls = sk_IMPLEMENTATION_new_null()) == NULL
  ------------------
  |  Branch (391:20): [True: 0, False: 141]
  ------------------
  392|    141|                || (alg->cache = lh_QUERY_new(&query_hash, &query_cmp)) == NULL)
  ------------------
  |  Branch (392:20): [True: 0, False: 141]
  ------------------
  393|      0|            goto err;
  394|    141|        alg->nid = nid;
  395|    141|        if (!ossl_method_store_insert(store, alg))
  ------------------
  |  Branch (395:13): [True: 0, False: 141]
  ------------------
  396|      0|            goto err;
  397|    141|        OSSL_TRACE2(QUERY, "Inserted an alg with nid %d into the store %p\n", nid, (void *)store);
  ------------------
  |  |  293|    141|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|    141|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  398|    141|    }
  399|       |
  400|       |    /* Push onto stack if there isn't one there already */
  401|  1.44k|    for (i = 0; i < sk_IMPLEMENTATION_num(alg->impls); i++) {
  ------------------
  |  Branch (401:17): [True: 1.05k, False: 399]
  ------------------
  402|  1.05k|        const IMPLEMENTATION *tmpimpl = sk_IMPLEMENTATION_value(alg->impls, i);
  403|       |
  404|  1.05k|        if (tmpimpl->provider == impl->provider
  ------------------
  |  Branch (404:13): [True: 1.05k, False: 0]
  ------------------
  405|  1.05k|            && tmpimpl->properties == impl->properties)
  ------------------
  |  Branch (405:16): [True: 0, False: 1.05k]
  ------------------
  406|      0|            break;
  407|  1.05k|    }
  408|       |
  409|    399|    if (i == sk_IMPLEMENTATION_num(alg->impls)
  ------------------
  |  Branch (409:9): [True: 399, False: 0]
  ------------------
  410|    399|        && sk_IMPLEMENTATION_push(alg->impls, impl)) {
  ------------------
  |  Branch (410:12): [True: 399, False: 0]
  ------------------
  411|    399|        ret = 1;
  412|    399|#ifndef FIPS_MODULE
  413|    399|        OSSL_TRACE_BEGIN(QUERY) {
  ------------------
  |  |  220|    399|    do {                                        \
  |  |  221|    399|        BIO *trc_out = NULL;                    \
  |  |  222|    399|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  414|      0|            BIO_printf(trc_out, "Adding to method store "
  415|      0|                       "nid: %d\nproperties: %s\nprovider: %s\n",
  416|      0|                       nid, properties,
  417|      0|                       ossl_provider_name(prov) == NULL ? "none" :
  ------------------
  |  Branch (417:24): [True: 0, False: 0]
  ------------------
  418|      0|                       ossl_provider_name(prov));
  419|    399|        } OSSL_TRACE_END(QUERY);
  ------------------
  |  |  225|    399|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  420|    399|#endif
  421|    399|    }
  422|    399|    ossl_property_unlock(store);
  423|    399|    if (ret == 0)
  ------------------
  |  Branch (423:9): [True: 0, False: 399]
  ------------------
  424|      0|        impl_free(impl);
  425|    399|    return ret;
  426|       |
  427|      0|err:
  428|      0|    ossl_property_unlock(store);
  429|      0|    alg_cleanup(0, alg, NULL);
  430|      0|    impl_free(impl);
  431|      0|    return 0;
  432|    399|}
ossl_method_store_do_all:
  567|  6.59k|{
  568|  6.59k|    int i, j;
  569|  6.59k|    int numalgs, numimps;
  570|  6.59k|    STACK_OF(ALGORITHM) *tmpalgs;
  ------------------
  |  |   31|  6.59k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  571|  6.59k|    ALGORITHM *alg;
  572|       |
  573|  6.59k|    if (store != NULL) {
  ------------------
  |  Branch (573:9): [True: 6.59k, False: 0]
  ------------------
  574|       |
  575|  6.59k|        if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (575:13): [True: 0, False: 6.59k]
  ------------------
  576|      0|            return;
  577|       |       
  578|  6.59k|        tmpalgs = sk_ALGORITHM_new_reserve(NULL,
  579|  6.59k|                                           ossl_sa_ALGORITHM_num(store->algs));
  580|  6.59k|        if (tmpalgs == NULL) {
  ------------------
  |  Branch (580:13): [True: 0, False: 6.59k]
  ------------------
  581|      0|            ossl_property_unlock(store);
  582|      0|            return;
  583|      0|        }
  584|       |
  585|  6.59k|        ossl_sa_ALGORITHM_doall_arg(store->algs, alg_copy, tmpalgs);
  586|  6.59k|        ossl_property_unlock(store);
  587|  6.59k|        numalgs = sk_ALGORITHM_num(tmpalgs);
  588|   208k|        for (i = 0; i < numalgs; i++) {
  ------------------
  |  Branch (588:21): [True: 201k, False: 6.59k]
  ------------------
  589|   201k|            alg = sk_ALGORITHM_value(tmpalgs, i);
  590|   201k|            numimps = sk_IMPLEMENTATION_num(alg->impls);
  591|  1.71M|            for (j = 0; j < numimps; j++)
  ------------------
  |  Branch (591:25): [True: 1.50M, False: 201k]
  ------------------
  592|  1.50M|                alg_do_one(alg, sk_IMPLEMENTATION_value(alg->impls, j), fn, fnarg);
  593|   201k|        }
  594|  6.59k|        sk_ALGORITHM_free(tmpalgs);
  595|  6.59k|    }
  596|  6.59k|}
ossl_method_store_fetch:
  624|      7|{
  625|      7|    OSSL_PROPERTY_LIST **plp;
  626|      7|    ALGORITHM *alg;
  627|      7|    IMPLEMENTATION *impl, *best_impl = NULL;
  628|      7|    OSSL_PROPERTY_LIST *pq = NULL, *p2 = NULL;
  629|      7|    const OSSL_PROVIDER *prov = prov_rw != NULL ? *prov_rw : NULL;
  ------------------
  |  Branch (629:33): [True: 7, False: 0]
  ------------------
  630|      7|    int ret = 0;
  631|      7|    int j, best = -1, score, optional;
  632|       |
  633|      7|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (633:9): [True: 0, False: 7]
  |  Branch (633:21): [True: 0, False: 7]
  |  Branch (633:39): [True: 0, False: 7]
  ------------------
  634|      0|        return 0;
  635|       |
  636|      7|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  637|      7|    if (ossl_lib_ctx_is_default(store->ctx)
  ------------------
  |  Branch (637:9): [True: 7, False: 0]
  ------------------
  638|      7|            && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
  ------------------
  |  |  472|      7|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (638:16): [True: 0, False: 7]
  ------------------
  639|      0|        return 0;
  640|      7|#endif
  641|       |
  642|       |    /* This only needs to be a read lock, because the query won't create anything */
  643|      7|    if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (643:9): [True: 0, False: 7]
  ------------------
  644|      0|        return 0;
  645|       |
  646|      7|    OSSL_TRACE2(QUERY, "Retrieving by nid %d from store %p\n", nid, (void *)store);
  ------------------
  |  |  293|      7|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|      7|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  647|      7|    alg = ossl_method_store_retrieve(store, nid);
  648|      7|    if (alg == NULL) {
  ------------------
  |  Branch (648:9): [True: 0, False: 7]
  ------------------
  649|      0|        ossl_property_unlock(store);
  650|      0|        OSSL_TRACE2(QUERY, "Failed to retrieve by nid %d from store %p\n", nid, (void *)store);
  ------------------
  |  |  293|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  651|      0|        return 0;
  652|      0|    }
  653|      7|    OSSL_TRACE2(QUERY, "Retrieved by nid %d from store %p\n", nid, (void *)store);
  ------------------
  |  |  293|      7|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|      7|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  654|       |
  655|       |    /*
  656|       |     * If a property query string is provided, convert it to an
  657|       |     * OSSL_PROPERTY_LIST structure
  658|       |     */
  659|      7|    if (prop_query != NULL)
  ------------------
  |  Branch (659:9): [True: 7, False: 0]
  ------------------
  660|      7|        p2 = pq = ossl_parse_query(store->ctx, prop_query, 0);
  661|       |
  662|       |    /*
  663|       |     * If the library context has default properties specified
  664|       |     * then merge those with the properties passed to this function
  665|       |     */
  666|      7|    plp = ossl_ctx_global_properties(store->ctx, 0);
  667|      7|    if (plp != NULL && *plp != NULL) {
  ------------------
  |  Branch (667:9): [True: 7, False: 0]
  |  Branch (667:24): [True: 0, False: 7]
  ------------------
  668|      0|        if (pq == NULL) {
  ------------------
  |  Branch (668:13): [True: 0, False: 0]
  ------------------
  669|      0|            pq = *plp;
  670|      0|        } else {
  671|      0|            p2 = ossl_property_merge(pq, *plp);
  672|      0|            ossl_property_free(pq);
  673|      0|            if (p2 == NULL)
  ------------------
  |  Branch (673:17): [True: 0, False: 0]
  ------------------
  674|      0|                goto fin;
  675|      0|            pq = p2;
  676|      0|        }
  677|      0|    }
  678|       |
  679|       |    /*
  680|       |     * Search for a provider that provides this implementation.
  681|       |     * If the requested provider is NULL, then any provider will do,
  682|       |     * otherwise we should try to find the one that matches the requested
  683|       |     * provider.  Note that providers are given implicit preference via the
  684|       |     * ordering of the implementation stack
  685|       |     */
  686|      7|    if (pq == NULL) {
  ------------------
  |  Branch (686:9): [True: 0, False: 7]
  ------------------
  687|      0|        for (j = 0; j < sk_IMPLEMENTATION_num(alg->impls); j++) {
  ------------------
  |  Branch (687:21): [True: 0, False: 0]
  ------------------
  688|      0|            if ((impl = sk_IMPLEMENTATION_value(alg->impls, j)) != NULL
  ------------------
  |  Branch (688:17): [True: 0, False: 0]
  ------------------
  689|      0|                && (prov == NULL || impl->provider == prov)) {
  ------------------
  |  Branch (689:21): [True: 0, False: 0]
  |  Branch (689:37): [True: 0, False: 0]
  ------------------
  690|      0|                best_impl = impl;
  691|      0|                ret = 1;
  692|      0|                break;
  693|      0|            }
  694|      0|        }
  695|      0|        goto fin;
  696|      0|    }
  697|       |
  698|       |    /*
  699|       |     * If there are optional properties specified
  700|       |     * then run the search again, and select the provider that matches the
  701|       |     * most options
  702|       |     */
  703|      7|    optional = ossl_property_has_optional(pq);
  704|      7|    for (j = 0; j < sk_IMPLEMENTATION_num(alg->impls); j++) {
  ------------------
  |  Branch (704:17): [True: 7, False: 0]
  ------------------
  705|      7|        if ((impl = sk_IMPLEMENTATION_value(alg->impls, j)) != NULL
  ------------------
  |  Branch (705:13): [True: 7, False: 0]
  ------------------
  706|      7|            && (prov == NULL || impl->provider == prov)) {
  ------------------
  |  Branch (706:17): [True: 7, False: 0]
  |  Branch (706:33): [True: 0, False: 0]
  ------------------
  707|      7|            score = ossl_property_match_count(pq, impl->properties);
  708|      7|            if (score > best) {
  ------------------
  |  Branch (708:17): [True: 7, False: 0]
  ------------------
  709|      7|                best_impl = impl;
  710|      7|                best = score;
  711|      7|                ret = 1;
  712|      7|                if (!optional)
  ------------------
  |  Branch (712:21): [True: 7, False: 0]
  ------------------
  713|      7|                    goto fin;
  714|      7|            }
  715|      7|        }
  716|      7|    }
  717|      7|fin:
  718|      7|    if (ret && ossl_method_up_ref(&best_impl->method)) {
  ------------------
  |  Branch (718:9): [True: 7, False: 0]
  |  Branch (718:16): [True: 7, False: 0]
  ------------------
  719|      7|        *method = best_impl->method.method;
  720|      7|        if (prov_rw != NULL)
  ------------------
  |  Branch (720:13): [True: 7, False: 0]
  ------------------
  721|      7|            *prov_rw = best_impl->provider;
  722|      7|    } else {
  723|      0|        ret = 0;
  724|      0|    }
  725|       |
  726|      7|#ifndef FIPS_MODULE
  727|      7|    OSSL_TRACE_BEGIN(QUERY) {
  ------------------
  |  |  220|      7|    do {                                        \
  |  |  221|      7|        BIO *trc_out = NULL;                    \
  |  |  222|      7|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  728|      0|        char buf[512];
  729|      0|        int size;
  730|       |
  731|      0|        size = ossl_property_list_to_string(NULL, pq, buf, 512);
  732|      0|        BIO_printf(trc_out, "method store query with properties %s "
  733|      0|                   "resolves to provider %s\n",
  734|      0|                   size == 0 ? "none" : buf,
  ------------------
  |  Branch (734:20): [True: 0, False: 0]
  ------------------
  735|      0|                   best_impl == NULL ? "none" :
  ------------------
  |  Branch (735:20): [True: 0, False: 0]
  ------------------
  736|      0|                   ossl_provider_name(best_impl->provider));
  737|      7|    } OSSL_TRACE_END(QUERY);
  ------------------
  |  |  225|      7|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  738|      7|#endif
  739|       |
  740|      7|    ossl_property_unlock(store);
  741|      7|    ossl_property_free(p2);
  742|      7|    return ret;
  743|      7|}
ossl_method_store_cache_flush_all:
  761|      8|{
  762|      8|    if (!ossl_property_write_lock(store))
  ------------------
  |  Branch (762:9): [True: 0, False: 8]
  ------------------
  763|      0|        return 0;
  764|      8|    ossl_sa_ALGORITHM_doall(store->algs, &impl_cache_flush_alg);
  765|      8|    store->cache_nelem = 0;
  766|      8|    ossl_property_unlock(store);
  767|      8|    return 1;
  768|      8|}
ossl_method_store_cache_get:
  846|  6.65k|{
  847|  6.65k|    ALGORITHM *alg;
  848|  6.65k|    QUERY elem, *r;
  849|  6.65k|    int res = 0;
  850|       |
  851|  6.65k|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (851:9): [True: 0, False: 6.65k]
  |  Branch (851:21): [True: 0, False: 6.65k]
  |  Branch (851:38): [True: 0, False: 6.65k]
  ------------------
  852|      0|        return 0;
  853|       |
  854|  6.65k|    if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (854:9): [True: 0, False: 6.65k]
  ------------------
  855|      0|        return 0;
  856|  6.65k|    alg = ossl_method_store_retrieve(store, nid);
  857|  6.65k|    if (alg == NULL)
  ------------------
  |  Branch (857:9): [True: 1, False: 6.65k]
  ------------------
  858|      1|        goto err;
  859|       |
  860|  6.65k|    elem.query = prop_query;
  861|  6.65k|    elem.provider = prov;
  862|  6.65k|    r = lh_QUERY_retrieve(alg->cache, &elem);
  863|  6.65k|    if (r == NULL)
  ------------------
  |  Branch (863:9): [True: 4, False: 6.65k]
  ------------------
  864|      4|        goto err;
  865|  6.65k|    if (ossl_method_up_ref(&r->method)) {
  ------------------
  |  Branch (865:9): [True: 6.65k, False: 0]
  ------------------
  866|  6.65k|        *method = r->method.method;
  867|  6.65k|        res = 1;
  868|  6.65k|    }
  869|  6.65k|err:
  870|  6.65k|    ossl_property_unlock(store);
  871|  6.65k|    return res;
  872|  6.65k|}
ossl_method_store_cache_set:
  878|      7|{
  879|      7|    QUERY elem, *old, *p = NULL;
  880|      7|    ALGORITHM *alg;
  881|      7|    size_t len;
  882|      7|    int res = 1;
  883|       |
  884|      7|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (884:9): [True: 0, False: 7]
  |  Branch (884:21): [True: 0, False: 7]
  |  Branch (884:38): [True: 0, False: 7]
  ------------------
  885|      0|        return 0;
  886|       |
  887|      7|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|      7|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      7|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (887:9): [True: 0, False: 7]
  ------------------
  888|      0|        return 0;
  889|       |
  890|      7|    if (!ossl_property_write_lock(store))
  ------------------
  |  Branch (890:9): [True: 0, False: 7]
  ------------------
  891|      0|        return 0;
  892|      7|    if (store->cache_need_flush)
  ------------------
  |  Branch (892:9): [True: 0, False: 7]
  ------------------
  893|      0|        ossl_method_cache_flush_some(store);
  894|      7|    alg = ossl_method_store_retrieve(store, nid);
  895|      7|    if (alg == NULL)
  ------------------
  |  Branch (895:9): [True: 0, False: 7]
  ------------------
  896|      0|        goto err;
  897|       |
  898|      7|    if (method == NULL) {
  ------------------
  |  Branch (898:9): [True: 0, False: 7]
  ------------------
  899|      0|        elem.query = prop_query;
  900|      0|        elem.provider = prov;
  901|      0|        if ((old = lh_QUERY_delete(alg->cache, &elem)) != NULL) {
  ------------------
  |  Branch (901:13): [True: 0, False: 0]
  ------------------
  902|      0|            impl_cache_free(old);
  903|      0|            store->cache_nelem--;
  904|      0|        }
  905|      0|        goto end;
  906|      0|    }
  907|      7|    p = OPENSSL_malloc(sizeof(*p) + (len = strlen(prop_query)));
  ------------------
  |  |  102|      7|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      7|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      7|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  908|      7|    if (p != NULL) {
  ------------------
  |  Branch (908:9): [True: 7, False: 0]
  ------------------
  909|      7|        p->query = p->body;
  910|      7|        p->provider = prov;
  911|      7|        p->method.method = method;
  912|      7|        p->method.up_ref = method_up_ref;
  913|      7|        p->method.free = method_destruct;
  914|      7|        if (!ossl_method_up_ref(&p->method))
  ------------------
  |  Branch (914:13): [True: 0, False: 7]
  ------------------
  915|      0|            goto err;
  916|      7|        memcpy((char *)p->query, prop_query, len + 1);
  917|      7|        if ((old = lh_QUERY_insert(alg->cache, p)) != NULL) {
  ------------------
  |  Branch (917:13): [True: 0, False: 7]
  ------------------
  918|      0|            impl_cache_free(old);
  919|      0|            goto end;
  920|      0|        }
  921|      7|        if (!lh_QUERY_error(alg->cache)) {
  ------------------
  |  Branch (921:13): [True: 7, False: 0]
  ------------------
  922|      7|            if (++store->cache_nelem >= IMPL_CACHE_FLUSH_THRESHOLD)
  ------------------
  |  |   34|      7|#define IMPL_CACHE_FLUSH_THRESHOLD  500
  ------------------
  |  Branch (922:17): [True: 0, False: 7]
  ------------------
  923|      0|                store->cache_need_flush = 1;
  924|      7|            goto end;
  925|      7|        }
  926|      0|        ossl_method_free(&p->method);
  927|      0|    }
  928|      0|err:
  929|      0|    res = 0;
  930|      0|    OPENSSL_free(p);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  931|      7|end:
  932|      7|    ossl_property_unlock(store);
  933|      7|    return res;
  934|      0|}
property.c:alg_cleanup:
  226|    141|{
  227|    141|    OSSL_METHOD_STORE *store = arg;
  228|       |
  229|    141|    if (a != NULL) {
  ------------------
  |  Branch (229:9): [True: 141, False: 0]
  ------------------
  230|    141|        sk_IMPLEMENTATION_pop_free(a->impls, &impl_free);
  231|    141|        lh_QUERY_doall(a->cache, &impl_cache_free);
  232|    141|        lh_QUERY_free(a->cache);
  233|    141|        OPENSSL_free(a);
  ------------------
  |  |  115|    141|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    141|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    141|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  234|    141|    }
  235|    141|    if (store != NULL)
  ------------------
  |  Branch (235:9): [True: 141, False: 0]
  ------------------
  236|    141|        ossl_sa_ALGORITHM_set(store->algs, idx, NULL);
  237|    141|}
property.c:ossl_method_up_ref:
  163|  7.06k|{
  164|  7.06k|    return (*method->up_ref)(method->method);
  165|  7.06k|}
property.c:ossl_property_write_lock:
  178|    414|{
  179|    414|    return p != NULL ? CRYPTO_THREAD_write_lock(p->lock) : 0;
  ------------------
  |  Branch (179:12): [True: 414, False: 0]
  ------------------
  180|    414|}
property.c:impl_free:
  204|    399|{
  205|    399|    if (impl != NULL) {
  ------------------
  |  Branch (205:9): [True: 399, False: 0]
  ------------------
  206|    399|        ossl_method_free(&impl->method);
  207|    399|        OPENSSL_free(impl);
  ------------------
  |  |  115|    399|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    399|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    399|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  208|    399|    }
  209|    399|}
property.c:ossl_method_store_retrieve:
  283|  7.46k|{
  284|  7.46k|    return ossl_sa_ALGORITHM_get(store->algs, nid);
  285|  7.46k|}
property.c:query_hash:
  188|  6.66k|{
  189|  6.66k|    return OPENSSL_LH_strhash(a->query);
  190|  6.66k|}
property.c:query_cmp:
  193|  6.65k|{
  194|  6.65k|    int res = strcmp(a->query, b->query);
  195|       |
  196|  6.65k|    if (res == 0 && a->provider != NULL && b->provider != NULL)
  ------------------
  |  Branch (196:9): [True: 6.65k, False: 0]
  |  Branch (196:21): [True: 6.65k, False: 0]
  |  Branch (196:44): [True: 0, False: 6.65k]
  ------------------
  197|      0|        res = b->provider > a->provider ? 1
  ------------------
  |  Branch (197:15): [True: 0, False: 0]
  ------------------
  198|      0|            : b->provider < a->provider ? -1
  ------------------
  |  Branch (198:15): [True: 0, False: 0]
  ------------------
  199|      0|            : 0;
  200|  6.65k|    return res;
  201|  6.65k|}
property.c:ossl_method_store_insert:
  288|    141|{
  289|    141|    return ossl_sa_ALGORITHM_set(store->algs, alg->nid, alg);
  290|    141|}
property.c:ossl_property_unlock:
  183|  13.6k|{
  184|  13.6k|    return p != 0 ? CRYPTO_THREAD_unlock(p->lock) : 0;
  ------------------
  |  Branch (184:12): [True: 13.6k, False: 0]
  ------------------
  185|  13.6k|}
property.c:ossl_method_cache_flush_alg:
  747|    258|{
  748|    258|    store->cache_nelem -= lh_QUERY_num_items(alg->cache);
  749|    258|    impl_cache_flush_alg(0, alg);
  750|    258|}
property.c:ossl_property_read_lock:
  173|  13.2k|{
  174|  13.2k|    return p != NULL ? CRYPTO_THREAD_read_lock(p->lock) : 0;
  ------------------
  |  Branch (174:12): [True: 13.2k, False: 0]
  ------------------
  175|  13.2k|}
property.c:alg_copy:
  558|   201k|{
  559|   201k|    STACK_OF(ALGORITHM) *newalg = arg;
  ------------------
  |  |   31|   201k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  560|       |
  561|   201k|    (void)sk_ALGORITHM_push(newalg, alg);
  562|   201k|}
property.c:alg_do_one:
  553|  1.50M|{
  554|  1.50M|    fn(alg->nid, impl->method.method, fnarg);
  555|  1.50M|}
property.c:ossl_method_cache_flush:
  753|    399|{
  754|    399|    ALGORITHM *alg = ossl_method_store_retrieve(store, nid);
  755|       |
  756|    399|    if (alg != NULL)
  ------------------
  |  Branch (756:9): [True: 258, False: 141]
  ------------------
  757|    258|        ossl_method_cache_flush_alg(store, alg);
  758|    399|}
property.c:impl_cache_flush_alg:
  220|    258|{
  221|    258|    lh_QUERY_doall(alg->cache, &impl_cache_free);
  222|    258|    lh_QUERY_flush(alg->cache);
  223|    258|}
property.c:impl_cache_free:
  212|      7|{
  213|      7|    if (elem != NULL) {
  ------------------
  |  Branch (213:9): [True: 7, False: 0]
  ------------------
  214|      7|        ossl_method_free(&elem->method);
  215|      7|        OPENSSL_free(elem);
  ------------------
  |  |  115|      7|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      7|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      7|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  216|      7|    }
  217|      7|}
property.c:ossl_method_free:
  168|    406|{
  169|    406|    (*method->free)(method->method);
  170|    406|}

ossl_err_load_PROP_strings:
   40|      2|{
   41|      2|#ifndef OPENSSL_NO_ERR
   42|      2|    if (ERR_reason_error_string(PROP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (42:9): [True: 2, False: 0]
  ------------------
   43|      2|        ERR_load_strings_const(PROP_str_reasons);
   44|      2|#endif
   45|      2|    return 1;
   46|      2|}

ossl_parse_property:
  346|    374|{
  347|    374|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  348|    374|    OSSL_PROPERTY_LIST *res = NULL;
  349|    374|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   31|    374|# define STACK_OF(type) struct stack_st_##type
  ------------------
  350|    374|    const char *s = defn;
  351|    374|    int done;
  352|       |
  353|    374|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (353:9): [True: 0, False: 374]
  |  Branch (353:22): [True: 0, False: 374]
  ------------------
  354|      0|        return NULL;
  355|       |
  356|    374|    s = skip_space(s);
  357|    374|    done = *s == '\0';
  358|  1.81k|    while (!done) {
  ------------------
  |  Branch (358:12): [True: 1.44k, False: 374]
  ------------------
  359|  1.44k|        const char *start = s;
  360|       |
  361|  1.44k|        prop = OPENSSL_malloc(sizeof(*prop));
  ------------------
  |  |  102|  1.44k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.44k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.44k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  362|  1.44k|        if (prop == NULL)
  ------------------
  |  Branch (362:13): [True: 0, False: 1.44k]
  ------------------
  363|      0|            goto err;
  364|  1.44k|        memset(&prop->v, 0, sizeof(prop->v));
  365|  1.44k|        prop->optional = 0;
  366|  1.44k|        if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (366:13): [True: 0, False: 1.44k]
  ------------------
  367|      0|            goto err;
  368|  1.44k|        prop->oper = OSSL_PROPERTY_OPER_EQ;
  369|  1.44k|        if (prop->name_idx == 0) {
  ------------------
  |  Branch (369:13): [True: 0, False: 1.44k]
  ------------------
  370|      0|            ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |   35|      0|# define PROP_R_PARSE_FAILED                              108
  ------------------
  371|      0|                           "Unknown name HERE-->%s", start);
  372|      0|            goto err;
  373|      0|        }
  374|  1.44k|        if (match_ch(&s, '=')) {
  ------------------
  |  Branch (374:13): [True: 1.44k, False: 0]
  ------------------
  375|  1.44k|            if (!parse_value(ctx, &s, prop, 1)) {
  ------------------
  |  Branch (375:17): [True: 0, False: 1.44k]
  ------------------
  376|      0|                ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |   34|      0|# define PROP_R_NO_VALUE                                  107
  ------------------
  377|      0|                               "HERE-->%s", start);
  378|      0|                goto err;
  379|      0|            }
  380|  1.44k|        } else {
  381|       |            /* A name alone means a true Boolean */
  382|      0|            prop->type = OSSL_PROPERTY_TYPE_STRING;
  383|      0|            prop->v.str_val = OSSL_PROPERTY_TRUE;
  ------------------
  |  |   37|      0|#define OSSL_PROPERTY_TRUE      1
  ------------------
  384|      0|        }
  385|       |
  386|  1.44k|        if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop))
  ------------------
  |  Branch (386:13): [True: 0, False: 1.44k]
  ------------------
  387|      0|            goto err;
  388|  1.44k|        prop = NULL;
  389|  1.44k|        done = !match_ch(&s, ',');
  390|  1.44k|    }
  391|    374|    if (*s != '\0') {
  ------------------
  |  Branch (391:9): [True: 0, False: 374]
  ------------------
  392|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |   37|      0|# define PROP_R_TRAILING_CHARACTERS                       110
  ------------------
  393|      0|                       "HERE-->%s", s);
  394|      0|        goto err;
  395|      0|    }
  396|    374|    res = stack_to_property_list(ctx, sk);
  397|       |
  398|    374|err:
  399|    374|    OPENSSL_free(prop);
  ------------------
  |  |  115|    374|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    374|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    374|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  400|    374|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  401|    374|    return res;
  402|    374|}
ossl_parse_query:
  406|      7|{
  407|      7|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   31|      7|# define STACK_OF(type) struct stack_st_##type
  ------------------
  408|      7|    OSSL_PROPERTY_LIST *res = NULL;
  409|      7|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  410|      7|    int done;
  411|       |
  412|      7|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (412:9): [True: 0, False: 7]
  |  Branch (412:22): [True: 0, False: 7]
  ------------------
  413|      0|        return NULL;
  414|       |
  415|      7|    s = skip_space(s);
  416|      7|    done = *s == '\0';
  417|      7|    while (!done) {
  ------------------
  |  Branch (417:12): [True: 0, False: 7]
  ------------------
  418|      0|        prop = OPENSSL_malloc(sizeof(*prop));
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  419|      0|        if (prop == NULL)
  ------------------
  |  Branch (419:13): [True: 0, False: 0]
  ------------------
  420|      0|            goto err;
  421|      0|        memset(&prop->v, 0, sizeof(prop->v));
  422|       |
  423|      0|        if (match_ch(&s, '-')) {
  ------------------
  |  Branch (423:13): [True: 0, False: 0]
  ------------------
  424|      0|            prop->oper = OSSL_PROPERTY_OVERRIDE;
  425|      0|            prop->optional = 0;
  426|      0|            if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (426:17): [True: 0, False: 0]
  ------------------
  427|      0|                goto err;
  428|      0|            goto skip_value;
  429|      0|        }
  430|      0|        prop->optional = match_ch(&s, '?');
  431|      0|        if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (431:13): [True: 0, False: 0]
  ------------------
  432|      0|            goto err;
  433|       |
  434|      0|        if (match_ch(&s, '=')) {
  ------------------
  |  Branch (434:13): [True: 0, False: 0]
  ------------------
  435|      0|            prop->oper = OSSL_PROPERTY_OPER_EQ;
  436|      0|        } else if (MATCH(&s, "!=")) {
  ------------------
  |  |   43|      0|#define MATCH(s, m) match(s, m, sizeof(m) - 1)
  |  |  ------------------
  |  |  |  Branch (43:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  437|      0|            prop->oper = OSSL_PROPERTY_OPER_NE;
  438|      0|        } else {
  439|       |            /* A name alone is a Boolean comparison for true */
  440|      0|            prop->oper = OSSL_PROPERTY_OPER_EQ;
  441|      0|            prop->type = OSSL_PROPERTY_TYPE_STRING;
  442|      0|            prop->v.str_val = OSSL_PROPERTY_TRUE;
  ------------------
  |  |   37|      0|#define OSSL_PROPERTY_TRUE      1
  ------------------
  443|      0|            goto skip_value;
  444|      0|        }
  445|      0|        if (!parse_value(ctx, &s, prop, create_values))
  ------------------
  |  Branch (445:13): [True: 0, False: 0]
  ------------------
  446|      0|            prop->type = OSSL_PROPERTY_TYPE_VALUE_UNDEFINED;
  447|       |
  448|      0|skip_value:
  449|      0|        if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop))
  ------------------
  |  Branch (449:13): [True: 0, False: 0]
  ------------------
  450|      0|            goto err;
  451|      0|        prop = NULL;
  452|      0|        done = !match_ch(&s, ',');
  453|      0|    }
  454|      7|    if (*s != '\0') {
  ------------------
  |  Branch (454:9): [True: 0, False: 7]
  ------------------
  455|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |   37|      0|# define PROP_R_TRAILING_CHARACTERS                       110
  ------------------
  456|      0|                       "HERE-->%s", s);
  457|      0|        goto err;
  458|      0|    }
  459|      7|    res = stack_to_property_list(ctx, sk);
  460|       |
  461|      7|err:
  462|      7|    OPENSSL_free(prop);
  ------------------
  |  |  115|      7|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      7|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      7|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  463|      7|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  464|      7|    return res;
  465|      7|}
ossl_property_match_count:
  473|      7|{
  474|      7|    const OSSL_PROPERTY_DEFINITION *const q = query->properties;
  475|      7|    const OSSL_PROPERTY_DEFINITION *const d = defn->properties;
  476|      7|    int i = 0, j = 0, matches = 0;
  477|      7|    OSSL_PROPERTY_OPER oper;
  478|       |
  479|      7|    while (i < query->num_properties) {
  ------------------
  |  Branch (479:12): [True: 0, False: 7]
  ------------------
  480|      0|        if ((oper = q[i].oper) == OSSL_PROPERTY_OVERRIDE) {
  ------------------
  |  Branch (480:13): [True: 0, False: 0]
  ------------------
  481|      0|            i++;
  482|      0|            continue;
  483|      0|        }
  484|      0|        if (j < defn->num_properties) {
  ------------------
  |  Branch (484:13): [True: 0, False: 0]
  ------------------
  485|      0|            if (q[i].name_idx > d[j].name_idx) {  /* skip defn, not in query */
  ------------------
  |  Branch (485:17): [True: 0, False: 0]
  ------------------
  486|      0|                j++;
  487|      0|                continue;
  488|      0|            }
  489|      0|            if (q[i].name_idx == d[j].name_idx) { /* both in defn and query */
  ------------------
  |  Branch (489:17): [True: 0, False: 0]
  ------------------
  490|      0|                const int eq = q[i].type == d[j].type
  ------------------
  |  Branch (490:32): [True: 0, False: 0]
  ------------------
  491|      0|                               && memcmp(&q[i].v, &d[j].v, sizeof(q[i].v)) == 0;
  ------------------
  |  Branch (491:35): [True: 0, False: 0]
  ------------------
  492|       |
  493|      0|                if ((eq && oper == OSSL_PROPERTY_OPER_EQ)
  ------------------
  |  Branch (493:22): [True: 0, False: 0]
  |  Branch (493:28): [True: 0, False: 0]
  ------------------
  494|      0|                    || (!eq && oper == OSSL_PROPERTY_OPER_NE))
  ------------------
  |  Branch (494:25): [True: 0, False: 0]
  |  Branch (494:32): [True: 0, False: 0]
  ------------------
  495|      0|                    matches++;
  496|      0|                else if (!q[i].optional)
  ------------------
  |  Branch (496:26): [True: 0, False: 0]
  ------------------
  497|      0|                    return -1;
  498|      0|                i++;
  499|      0|                j++;
  500|      0|                continue;
  501|      0|            }
  502|      0|        }
  503|       |
  504|       |        /*
  505|       |         * Handle the cases of a missing value and a query with no corresponding
  506|       |         * definition.  The former fails for any comparison except inequality,
  507|       |         * the latter is treated as a comparison against the Boolean false.
  508|       |         */
  509|      0|        if (q[i].type == OSSL_PROPERTY_TYPE_VALUE_UNDEFINED) {
  ------------------
  |  Branch (509:13): [True: 0, False: 0]
  ------------------
  510|      0|            if (oper == OSSL_PROPERTY_OPER_NE)
  ------------------
  |  Branch (510:17): [True: 0, False: 0]
  ------------------
  511|      0|                matches++;
  512|      0|            else if (!q[i].optional)
  ------------------
  |  Branch (512:22): [True: 0, False: 0]
  ------------------
  513|      0|                return -1;
  514|      0|        } else if (q[i].type != OSSL_PROPERTY_TYPE_STRING
  ------------------
  |  Branch (514:20): [True: 0, False: 0]
  ------------------
  515|      0|                   || (oper == OSSL_PROPERTY_OPER_EQ
  ------------------
  |  Branch (515:24): [True: 0, False: 0]
  ------------------
  516|      0|                       && q[i].v.str_val != OSSL_PROPERTY_FALSE)
  ------------------
  |  |   38|      0|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (516:27): [True: 0, False: 0]
  ------------------
  517|      0|                   || (oper == OSSL_PROPERTY_OPER_NE
  ------------------
  |  Branch (517:24): [True: 0, False: 0]
  ------------------
  518|      0|                       && q[i].v.str_val == OSSL_PROPERTY_FALSE)) {
  ------------------
  |  |   38|      0|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (518:27): [True: 0, False: 0]
  ------------------
  519|      0|            if (!q[i].optional)
  ------------------
  |  Branch (519:17): [True: 0, False: 0]
  ------------------
  520|      0|                return -1;
  521|      0|        } else {
  522|      0|            matches++;
  523|      0|        }
  524|      0|        i++;
  525|      0|    }
  526|      7|    return matches;
  527|      7|}
ossl_property_free:
  530|    383|{
  531|    383|    OPENSSL_free(p);
  ------------------
  |  |  115|    383|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    383|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    383|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  532|    383|}
ossl_property_parse_init:
  575|      4|{
  576|      4|    static const char *const predefined_names[] = {
  577|      4|        "provider",     /* Name of provider (default, legacy, fips) */
  578|      4|        "version",      /* Version number of this provider */
  579|      4|        "fips",         /* FIPS validated or FIPS supporting algorithm */
  580|      4|        "output",       /* Output type for encoders */
  581|      4|        "input",        /* Input type for decoders */
  582|      4|        "structure",    /* Structure name for encoders and decoders */
  583|      4|    };
  584|      4|    size_t i;
  585|       |
  586|     28|    for (i = 0; i < OSSL_NELEM(predefined_names); i++)
  ------------------
  |  |   14|     28|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (586:17): [True: 24, False: 4]
  ------------------
  587|     24|        if (ossl_property_name(ctx, predefined_names[i], 1) == 0)
  ------------------
  |  Branch (587:13): [True: 0, False: 24]
  ------------------
  588|      0|            goto err;
  589|       |
  590|       |    /*
  591|       |     * Pre-populate the two Boolean values. We must do them before any other
  592|       |     * values and in this order so that we get the same index as the global
  593|       |     * OSSL_PROPERTY_TRUE and OSSL_PROPERTY_FALSE values
  594|       |     */
  595|      4|    if ((ossl_property_value(ctx, "yes", 1) != OSSL_PROPERTY_TRUE)
  ------------------
  |  |   37|      4|#define OSSL_PROPERTY_TRUE      1
  ------------------
  |  Branch (595:9): [True: 0, False: 4]
  ------------------
  596|      4|        || (ossl_property_value(ctx, "no", 1) != OSSL_PROPERTY_FALSE))
  ------------------
  |  |   38|      4|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (596:12): [True: 0, False: 4]
  ------------------
  597|      0|        goto err;
  598|       |
  599|      4|    return 1;
  600|      0|err:
  601|      0|    return 0;
  602|      4|}
property_parse.c:pd_compare:
  289|  1.39k|{
  290|  1.39k|    const OSSL_PROPERTY_DEFINITION *pd1 = *p1;
  291|  1.39k|    const OSSL_PROPERTY_DEFINITION *pd2 = *p2;
  292|       |
  293|  1.39k|    if (pd1->name_idx < pd2->name_idx)
  ------------------
  |  Branch (293:9): [True: 1.39k, False: 0]
  ------------------
  294|  1.39k|        return -1;
  295|      0|    if (pd1->name_idx > pd2->name_idx)
  ------------------
  |  Branch (295:9): [True: 0, False: 0]
  ------------------
  296|      0|        return 1;
  297|      0|    return 0;
  298|      0|}
property_parse.c:skip_space:
   26|  5.77k|{
   27|  5.77k|    while (ossl_isspace(*s))
  ------------------
  |  |   82|  5.77k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  5.77k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 0, False: 5.77k]
  |  |  ------------------
  ------------------
   28|      0|        s++;
   29|  5.77k|    return s;
   30|  5.77k|}
property_parse.c:parse_name:
   58|  1.44k|{
   59|  1.44k|    char name[100];
   60|  1.44k|    int err = 0;
   61|  1.44k|    size_t i = 0;
   62|  1.44k|    const char *s = *t;
   63|  1.44k|    int user_name = 0;
   64|       |
   65|  1.44k|    for (;;) {
   66|  1.44k|        if (!ossl_isalpha(*s)) {
  ------------------
  |  |   71|  1.44k|# define ossl_isalpha(c)        (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|  1.44k|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  1.44k|# define CTYPE_MASK_lower       0x1
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|  1.44k|# define CTYPE_MASK_upper       0x2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (66:13): [True: 0, False: 1.44k]
  ------------------
   67|      0|            ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER,
  ------------------
  |  |   30|      0|# define PROP_R_NOT_AN_IDENTIFIER                         103
  ------------------
   68|      0|                           "HERE-->%s", *t);
   69|      0|            return 0;
   70|      0|        }
   71|  9.52k|        do {
   72|  9.52k|            if (i < sizeof(name) - 1)
  ------------------
  |  Branch (72:17): [True: 9.52k, False: 0]
  ------------------
   73|  9.52k|                name[i++] = ossl_tolower(*s);
   74|      0|            else
   75|      0|                err = 1;
   76|  9.52k|        } while (*++s == '_' || ossl_isalnum(*s));
  ------------------
  |  |   70|  9.52k|# define ossl_isalnum(c)        (ossl_ctype_check((c), CTYPE_MASK_alnum))
  |  |  ------------------
  |  |  |  |   41|  9.52k|# define CTYPE_MASK_alnum   (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  9.52k|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   27|  9.52k|# define CTYPE_MASK_lower       0x1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   28|  9.52k|# define CTYPE_MASK_upper       0x2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alnum   (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  9.52k|# define CTYPE_MASK_digit       0x4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (70:33): [True: 8.08k, False: 1.44k]
  |  |  ------------------
  ------------------
  |  Branch (76:18): [True: 0, False: 9.52k]
  ------------------
   77|  1.44k|        if (*s != '.')
  ------------------
  |  Branch (77:13): [True: 1.44k, False: 0]
  ------------------
   78|  1.44k|            break;
   79|      0|        user_name = 1;
   80|      0|        if (i < sizeof(name) - 1)
  ------------------
  |  Branch (80:13): [True: 0, False: 0]
  ------------------
   81|      0|            name[i++] = *s;
   82|      0|        else
   83|      0|            err = 1;
   84|      0|        s++;
   85|      0|    }
   86|  1.44k|    name[i] = '\0';
   87|  1.44k|    if (err) {
  ------------------
  |  Branch (87:9): [True: 0, False: 1.44k]
  ------------------
   88|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_NAME_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NAME_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NAME_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |   27|      0|# define PROP_R_NAME_TOO_LONG                             100
  ------------------
   89|      0|        return 0;
   90|      0|    }
   91|  1.44k|    *t = skip_space(s);
   92|  1.44k|    *idx = ossl_property_name(ctx, name, user_name && create);
  ------------------
  |  Branch (92:42): [True: 0, False: 1.44k]
  |  Branch (92:55): [True: 0, False: 0]
  ------------------
   93|  1.44k|    return 1;
   94|  1.44k|}
property_parse.c:match_ch:
   33|  2.88k|{
   34|  2.88k|    const char *s = *t;
   35|       |
   36|  2.88k|    if (*s == m) {
  ------------------
  |  Branch (36:9): [True: 2.50k, False: 374]
  ------------------
   37|  2.50k|        *t = skip_space(s + 1);
   38|  2.50k|        return 1;
   39|  2.50k|    }
   40|    374|    return 0;
   41|  2.88k|}
property_parse.c:parse_value:
  258|  1.44k|{
  259|  1.44k|    const char *s = *t;
  260|  1.44k|    int r = 0;
  261|       |
  262|  1.44k|    if (*s == '"' || *s == '\'') {
  ------------------
  |  Branch (262:9): [True: 0, False: 1.44k]
  |  Branch (262:22): [True: 0, False: 1.44k]
  ------------------
  263|      0|        s++;
  264|      0|        r = parse_string(ctx, &s, s[-1], res, create);
  265|  1.44k|    } else if (*s == '+') {
  ------------------
  |  Branch (265:16): [True: 0, False: 1.44k]
  ------------------
  266|      0|        s++;
  267|      0|        r = parse_number(&s, res);
  268|  1.44k|    } else if (*s == '-') {
  ------------------
  |  Branch (268:16): [True: 0, False: 1.44k]
  ------------------
  269|      0|        s++;
  270|      0|        r = parse_number(&s, res);
  271|      0|        res->v.int_val = -res->v.int_val;
  272|  1.44k|    } else if (*s == '0' && s[1] == 'x') {
  ------------------
  |  Branch (272:16): [True: 0, False: 1.44k]
  |  Branch (272:29): [True: 0, False: 0]
  ------------------
  273|      0|        s += 2;
  274|      0|        r = parse_hex(&s, res);
  275|  1.44k|    } else if (*s == '0' && ossl_isdigit(s[1])) {
  ------------------
  |  Branch (275:16): [True: 0, False: 1.44k]
  |  Branch (275:29): [True: 0, False: 0]
  ------------------
  276|      0|        s++;
  277|      0|        r = parse_oct(&s, res);
  278|  1.44k|    } else if (ossl_isdigit(*s)) {
  ------------------
  |  Branch (278:16): [True: 0, False: 1.44k]
  ------------------
  279|      0|        return parse_number(t, res);
  280|  1.44k|    } else if (ossl_isalpha(*s))
  ------------------
  |  |   71|  1.44k|# define ossl_isalpha(c)        (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|  1.44k|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  1.44k|# define CTYPE_MASK_lower       0x1
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|  1.44k|# define CTYPE_MASK_upper       0x2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:33): [True: 1.44k, False: 0]
  |  |  ------------------
  ------------------
  281|  1.44k|        return parse_unquoted(ctx, t, res, create);
  282|      0|    if (r)
  ------------------
  |  Branch (282:9): [True: 0, False: 0]
  ------------------
  283|      0|        *t = s;
  284|      0|    return r;
  285|  1.44k|}
property_parse.c:parse_unquoted:
  226|  1.44k|{
  227|  1.44k|    char v[1000];
  228|  1.44k|    const char *s = *t;
  229|  1.44k|    size_t i = 0;
  230|  1.44k|    int err = 0;
  231|       |
  232|  1.44k|    if (*s == '\0' || *s == ',')
  ------------------
  |  Branch (232:9): [True: 0, False: 1.44k]
  |  Branch (232:23): [True: 0, False: 1.44k]
  ------------------
  233|      0|        return 0;
  234|  11.4k|    while (ossl_isprint(*s) && !ossl_isspace(*s) && *s != ',') {
  ------------------
  |  |   80|  22.9k|# define ossl_isprint(c)        (ossl_ctype_check((c), CTYPE_MASK_print))
  |  |  ------------------
  |  |  |  |   35|  11.4k|# define CTYPE_MASK_print       0x100
  |  |  ------------------
  |  |  |  Branch (80:33): [True: 11.0k, False: 374]
  |  |  ------------------
  ------------------
                  while (ossl_isprint(*s) && !ossl_isspace(*s) && *s != ',') {
  ------------------
  |  |   82|  22.5k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  11.0k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  ------------------
  |  Branch (234:32): [True: 11.0k, False: 0]
  |  Branch (234:53): [True: 10.0k, False: 1.06k]
  ------------------
  235|  10.0k|        if (i < sizeof(v) - 1)
  ------------------
  |  Branch (235:13): [True: 10.0k, False: 0]
  ------------------
  236|  10.0k|            v[i++] = ossl_tolower(*s);
  237|      0|        else
  238|      0|            err = 1;
  239|  10.0k|        s++;
  240|  10.0k|    }
  241|  1.44k|    if (!ossl_isspace(*s) && *s != '\0' && *s != ',') {
  ------------------
  |  |   82|  2.88k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  1.44k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  ------------------
  |  Branch (241:9): [True: 1.44k, False: 0]
  |  Branch (241:30): [True: 1.06k, False: 374]
  |  Branch (241:44): [True: 0, False: 1.06k]
  ------------------
  242|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER,
  ------------------
  |  |   28|      0|# define PROP_R_NOT_AN_ASCII_CHARACTER                    101
  ------------------
  243|      0|                       "HERE-->%s", s);
  244|      0|        return 0;
  245|      0|    }
  246|  1.44k|    v[i] = 0;
  247|  1.44k|    if (err)
  ------------------
  |  Branch (247:9): [True: 0, False: 1.44k]
  ------------------
  248|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |   36|      0|# define PROP_R_STRING_TOO_LONG                           109
  ------------------
  249|  1.44k|    else if ((res->v.str_val = ossl_property_value(ctx, v, create)) == 0)
  ------------------
  |  Branch (249:14): [True: 0, False: 1.44k]
  ------------------
  250|      0|        err = 1;
  251|  1.44k|    *t = skip_space(s);
  252|  1.44k|    res->type = OSSL_PROPERTY_TYPE_STRING;
  253|  1.44k|    return !err;
  254|  1.44k|}
property_parse.c:stack_to_property_list:
  314|    381|{
  315|    381|    const int n = sk_OSSL_PROPERTY_DEFINITION_num(sk);
  316|    381|    OSSL_PROPERTY_LIST *r;
  317|    381|    OSSL_PROPERTY_IDX prev_name_idx = 0;
  318|    381|    int i;
  319|       |
  320|    381|    r = OPENSSL_malloc(sizeof(*r)
  ------------------
  |  |  102|    762|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    381|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    381|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (102:23): [True: 7, False: 374]
  |  |  ------------------
  ------------------
  321|    381|                       + (n <= 0 ? 0 : n - 1) * sizeof(r->properties[0]));
  322|    381|    if (r != NULL) {
  ------------------
  |  Branch (322:9): [True: 381, False: 0]
  ------------------
  323|    381|        sk_OSSL_PROPERTY_DEFINITION_sort(sk);
  324|       |
  325|    381|        r->has_optional = 0;
  326|  1.82k|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (326:21): [True: 1.44k, False: 381]
  ------------------
  327|  1.44k|            r->properties[i] = *sk_OSSL_PROPERTY_DEFINITION_value(sk, i);
  328|  1.44k|            r->has_optional |= r->properties[i].optional;
  329|       |
  330|       |            /* Check for duplicated names */
  331|  1.44k|            if (i > 0 && r->properties[i].name_idx == prev_name_idx) {
  ------------------
  |  Branch (331:17): [True: 1.06k, False: 374]
  |  Branch (331:26): [True: 0, False: 1.06k]
  ------------------
  332|      0|                OPENSSL_free(r);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  333|      0|                ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |   35|      0|# define PROP_R_PARSE_FAILED                              108
  ------------------
  334|      0|                               "Duplicated name `%s'",
  335|      0|                               ossl_property_name_str(ctx, prev_name_idx));
  336|      0|                return NULL;
  337|      0|            }
  338|  1.44k|            prev_name_idx = r->properties[i].name_idx;
  339|  1.44k|        }
  340|    381|        r->num_properties = n;
  341|    381|    }
  342|    381|    return r;
  343|    381|}
property_parse.c:pd_free:
  301|  1.44k|{
  302|  1.44k|    OPENSSL_free(pd);
  ------------------
  |  |  115|  1.44k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.44k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.44k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  303|  1.44k|}

ossl_property_find_property:
   26|  68.0k|{
   27|  68.0k|    OSSL_PROPERTY_IDX name_idx;
   28|       |
   29|  68.0k|    if (list == NULL || name == NULL
  ------------------
  |  Branch (29:9): [True: 0, False: 68.0k]
  |  Branch (29:25): [True: 0, False: 68.0k]
  ------------------
   30|  68.0k|        || (name_idx = ossl_property_name(libctx, name, 0)) == 0)
  ------------------
  |  Branch (30:12): [True: 0, False: 68.0k]
  ------------------
   31|      0|        return NULL;
   32|       |
   33|  68.0k|    return ossl_bsearch(&name_idx, list->properties, list->num_properties,
   34|  68.0k|                        sizeof(*list->properties), &property_idx_cmp, 0);
   35|  68.0k|}
ossl_property_get_string_value:
   44|  62.2k|{
   45|  62.2k|    const char *value = NULL;
   46|       |
   47|  62.2k|    if (prop != NULL && prop->type == OSSL_PROPERTY_TYPE_STRING)
  ------------------
  |  Branch (47:9): [True: 62.2k, False: 0]
  |  Branch (47:25): [True: 62.2k, False: 0]
  ------------------
   48|  62.2k|        value = ossl_property_value_str(libctx, prop->v.str_val);
   49|  62.2k|    return value;
   50|  62.2k|}
ossl_property_has_optional:
   63|      7|{
   64|      7|    return query->has_optional ? 1 : 0;
  ------------------
  |  Branch (64:12): [True: 0, False: 7]
  ------------------
   65|      7|}
property_query.c:property_idx_cmp:
   15|   107k|{
   16|   107k|    OSSL_PROPERTY_IDX key = *(const OSSL_PROPERTY_IDX *)keyp;
   17|   107k|    const OSSL_PROPERTY_DEFINITION *defn =
   18|   107k|            (const OSSL_PROPERTY_DEFINITION *)compare;
   19|       |
   20|   107k|    return key - defn->name_idx;
   21|   107k|}

ossl_property_string_data_free:
   77|      2|{
   78|      2|    PROPERTY_STRING_DATA *propdata = vpropdata;
   79|       |
   80|      2|    if (propdata == NULL)
  ------------------
  |  Branch (80:9): [True: 0, False: 2]
  ------------------
   81|      0|        return;
   82|       |
   83|      2|    CRYPTO_THREAD_lock_free(propdata->lock);
   84|      2|    property_table_free(&propdata->prop_names);
   85|      2|    property_table_free(&propdata->prop_values);
   86|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
   87|      2|    sk_OPENSSL_CSTRING_free(propdata->prop_namelist);
  ------------------
  |  |  261|      2|#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
  ------------------
   88|      2|    sk_OPENSSL_CSTRING_free(propdata->prop_valuelist);
  ------------------
  |  |  261|      2|#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
  ------------------
   89|      2|    propdata->prop_namelist = propdata->prop_valuelist = NULL;
   90|      2|#endif
   91|      2|    propdata->prop_name_idx = propdata->prop_value_idx = 0;
   92|       |
   93|      2|    OPENSSL_free(propdata);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|      2|}
ossl_property_string_data_new:
   96|      4|void *ossl_property_string_data_new(OSSL_LIB_CTX *ctx) {
   97|      4|    PROPERTY_STRING_DATA *propdata = OPENSSL_zalloc(sizeof(*propdata));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   98|       |
   99|      4|    if (propdata == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 4]
  ------------------
  100|      0|        return NULL;
  101|       |
  102|      4|    propdata->lock = CRYPTO_THREAD_lock_new();
  103|      4|    propdata->prop_names = lh_PROPERTY_STRING_new(&property_hash,
  104|      4|                                                  &property_cmp);
  105|      4|    propdata->prop_values = lh_PROPERTY_STRING_new(&property_hash,
  106|      4|                                                   &property_cmp);
  107|      4|#ifndef OPENSSL_SMALL_FOOTPRINT
  108|      4|    propdata->prop_namelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  258|      4|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  109|      4|    propdata->prop_valuelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  258|      4|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  110|      4|#endif
  111|      4|    if (propdata->lock == NULL
  ------------------
  |  Branch (111:9): [True: 0, False: 4]
  ------------------
  112|      4|#ifndef OPENSSL_SMALL_FOOTPRINT
  113|      4|            || propdata->prop_namelist == NULL
  ------------------
  |  Branch (113:16): [True: 0, False: 4]
  ------------------
  114|      4|            || propdata->prop_valuelist == NULL
  ------------------
  |  Branch (114:16): [True: 0, False: 4]
  ------------------
  115|      4|#endif
  116|      4|            || propdata->prop_names == NULL
  ------------------
  |  Branch (116:16): [True: 0, False: 4]
  ------------------
  117|      4|            || propdata->prop_values == NULL) {
  ------------------
  |  Branch (117:16): [True: 0, False: 4]
  ------------------
  118|      0|        ossl_property_string_data_free(propdata);
  119|      0|        return NULL;
  120|      0|    }
  121|      4|    return propdata;
  122|      4|}
ossl_property_name:
  253|  69.5k|{
  254|  69.5k|    return ossl_property_string(ctx, 1, create, s);
  255|  69.5k|}
ossl_property_value:
  264|  1.44k|{
  265|  1.44k|    return ossl_property_string(ctx, 0, create, s);
  266|  1.44k|}
ossl_property_value_str:
  269|  62.2k|{
  270|  62.2k|    return ossl_property_str(0, ctx, idx);
  271|  62.2k|}
property_string.c:property_table_free:
   66|      4|{
   67|      4|    PROP_TABLE *t = *pt;
   68|       |
   69|      4|    if (t != NULL) {
  ------------------
  |  Branch (69:9): [True: 4, False: 0]
  ------------------
   70|      4|        lh_PROPERTY_STRING_doall(t, &property_free);
   71|      4|        lh_PROPERTY_STRING_free(t);
   72|      4|        *pt = NULL;
   73|      4|    }
   74|      4|}
property_string.c:property_free:
   61|     37|{
   62|     37|    OPENSSL_free(ps);
  ------------------
  |  |  115|     37|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     37|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     37|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   63|     37|}
property_string.c:property_hash:
   51|  71.0k|{
   52|  71.0k|    return OPENSSL_LH_strhash(a->s);
   53|  71.0k|}
property_string.c:property_cmp:
   56|  70.9k|{
   57|  70.9k|    return strcmp(a->s, b->s);
   58|  70.9k|}
property_string.c:ossl_property_string:
  144|  70.9k|{
  145|  70.9k|    PROPERTY_STRING p, *ps, *ps_new;
  146|  70.9k|    PROP_TABLE *t;
  147|  70.9k|    OSSL_PROPERTY_IDX *pidx;
  148|  70.9k|    PROPERTY_STRING_DATA *propdata
  149|  70.9k|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX);
  ------------------
  |  |  101|  70.9k|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  150|       |
  151|  70.9k|    if (propdata == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 70.9k]
  ------------------
  152|      0|        return 0;
  153|       |
  154|  70.9k|    t = name ? propdata->prop_names : propdata->prop_values;
  ------------------
  |  Branch (154:9): [True: 69.5k, False: 1.44k]
  ------------------
  155|  70.9k|    p.s = s;
  156|  70.9k|    if (!CRYPTO_THREAD_read_lock(propdata->lock)) {
  ------------------
  |  Branch (156:9): [True: 0, False: 70.9k]
  ------------------
  157|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  158|      0|        return 0;
  159|      0|    }
  160|  70.9k|    ps = lh_PROPERTY_STRING_retrieve(t, &p);
  161|  70.9k|    if (ps == NULL && create) {
  ------------------
  |  Branch (161:9): [True: 53, False: 70.9k]
  |  Branch (161:23): [True: 53, False: 0]
  ------------------
  162|     53|        CRYPTO_THREAD_unlock(propdata->lock);
  163|     53|        if (!CRYPTO_THREAD_write_lock(propdata->lock)) {
  ------------------
  |  Branch (163:13): [True: 0, False: 53]
  ------------------
  164|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_UNABLE_TO_GET_WRITE_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  165|      0|            return 0;
  166|      0|        }
  167|     53|        pidx = name ? &propdata->prop_name_idx : &propdata->prop_value_idx;
  ------------------
  |  Branch (167:16): [True: 24, False: 29]
  ------------------
  168|     53|        ps = lh_PROPERTY_STRING_retrieve(t, &p);
  169|     53|        if (ps == NULL && (ps_new = new_property_string(s, pidx)) != NULL) {
  ------------------
  |  Branch (169:13): [True: 53, False: 0]
  |  Branch (169:27): [True: 53, False: 0]
  ------------------
  170|     53|#ifndef OPENSSL_SMALL_FOOTPRINT
  171|     53|            STACK_OF(OPENSSL_CSTRING) *slist;
  ------------------
  |  |   31|     53|# define STACK_OF(type) struct stack_st_##type
  ------------------
  172|       |
  173|     53|            slist = name ? propdata->prop_namelist : propdata->prop_valuelist;
  ------------------
  |  Branch (173:21): [True: 24, False: 29]
  ------------------
  174|     53|            if (sk_OPENSSL_CSTRING_push(slist, ps_new->s) <= 0) {
  ------------------
  |  |  265|     53|#define sk_OPENSSL_CSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
  ------------------
  |  Branch (174:17): [True: 0, False: 53]
  ------------------
  175|      0|                property_free(ps_new);
  176|      0|                CRYPTO_THREAD_unlock(propdata->lock);
  177|      0|                return 0;
  178|      0|            }
  179|     53|#endif
  180|     53|            lh_PROPERTY_STRING_insert(t, ps_new);
  181|     53|            if (lh_PROPERTY_STRING_error(t)) {
  ------------------
  |  Branch (181:17): [True: 0, False: 53]
  ------------------
  182|       |                /*-
  183|       |                 * Undo the previous push which means also decrementing the
  184|       |                 * index and freeing the allocated storage.
  185|       |                 */
  186|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  187|      0|                sk_OPENSSL_CSTRING_pop(slist);
  ------------------
  |  |  267|      0|#define sk_OPENSSL_CSTRING_pop(sk) ((const char *)OPENSSL_sk_pop(ossl_check_OPENSSL_CSTRING_sk_type(sk)))
  ------------------
  188|      0|#endif
  189|      0|                property_free(ps_new);
  190|      0|                --*pidx;
  191|      0|                CRYPTO_THREAD_unlock(propdata->lock);
  192|      0|                return 0;
  193|      0|            }
  194|     53|            ps = ps_new;
  195|     53|        }
  196|     53|    }
  197|  70.9k|    CRYPTO_THREAD_unlock(propdata->lock);
  198|  70.9k|    return ps != NULL ? ps->idx : 0;
  ------------------
  |  Branch (198:12): [True: 70.9k, False: 0]
  ------------------
  199|  70.9k|}
property_string.c:new_property_string:
  126|     53|{
  127|     53|    const size_t l = strlen(s);
  128|     53|    PROPERTY_STRING *ps = OPENSSL_malloc(sizeof(*ps) + l);
  ------------------
  |  |  102|     53|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     53|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     53|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  129|       |
  130|     53|    if (ps != NULL) {
  ------------------
  |  Branch (130:9): [True: 53, False: 0]
  ------------------
  131|     53|        memcpy(ps->body, s, l + 1);
  132|     53|        ps->s = ps->body;
  133|     53|        ps->idx = ++*pidx;
  134|     53|        if (ps->idx == 0) {
  ------------------
  |  Branch (134:13): [True: 0, False: 53]
  ------------------
  135|      0|            OPENSSL_free(ps);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  136|      0|            return NULL;
  137|      0|        }
  138|     53|    }
  139|     53|    return ps;
  140|     53|}
property_string.c:ossl_property_str:
  218|  62.2k|{
  219|  62.2k|    const char *r;
  220|  62.2k|    PROPERTY_STRING_DATA *propdata
  221|  62.2k|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX);
  ------------------
  |  |  101|  62.2k|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  222|       |
  223|  62.2k|    if (propdata == NULL)
  ------------------
  |  Branch (223:9): [True: 0, False: 62.2k]
  ------------------
  224|      0|        return NULL;
  225|       |
  226|  62.2k|    if (!CRYPTO_THREAD_read_lock(propdata->lock)) {
  ------------------
  |  Branch (226:9): [True: 0, False: 62.2k]
  ------------------
  227|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  228|      0|        return NULL;
  229|      0|    }
  230|       |#ifdef OPENSSL_SMALL_FOOTPRINT
  231|       |    {
  232|       |        struct find_str_st findstr;
  233|       |
  234|       |        findstr.str = NULL;
  235|       |        findstr.idx = idx;
  236|       |
  237|       |        lh_PROPERTY_STRING_doall_arg(name ? propdata->prop_names
  238|       |                                          : propdata->prop_values,
  239|       |                                     find_str_fn, &findstr);
  240|       |        r = findstr.str;
  241|       |    }
  242|       |#else
  243|  62.2k|    r = sk_OPENSSL_CSTRING_value(name ? propdata->prop_namelist
  ------------------
  |  |  256|   124k|#define sk_OPENSSL_CSTRING_value(sk, idx) ((const char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_CSTRING_sk_type(sk), (idx)))
  |  |  ------------------
  |  |  |  Branch (256:116): [True: 0, False: 62.2k]
  |  |  ------------------
  ------------------
  244|  62.2k|                                      : propdata->prop_valuelist, idx - 1);
  245|  62.2k|#endif
  246|  62.2k|    CRYPTO_THREAD_unlock(propdata->lock);
  247|       |
  248|  62.2k|    return r;
  249|  62.2k|}

OSSL_PROVIDER_try_load_ex:
   20|      2|{
   21|      2|    OSSL_PROVIDER *prov = NULL, *actual;
   22|      2|    int isnew = 0;
   23|       |
   24|       |    /* Find it or create it */
   25|      2|    if ((prov = ossl_provider_find(libctx, name, 0)) == NULL) {
  ------------------
  |  Branch (25:9): [True: 2, False: 0]
  ------------------
   26|      2|        if ((prov = ossl_provider_new(libctx, name, NULL, params, 0)) == NULL)
  ------------------
  |  Branch (26:13): [True: 0, False: 2]
  ------------------
   27|      0|            return NULL;
   28|      2|        isnew = 1;
   29|      2|    }
   30|       |
   31|      2|    if (!ossl_provider_activate(prov, 1, 0)) {
  ------------------
  |  Branch (31:9): [True: 0, False: 2]
  ------------------
   32|      0|        ossl_provider_free(prov);
   33|      0|        return NULL;
   34|      0|    }
   35|       |
   36|      2|    actual = prov;
   37|      2|    if (isnew && !ossl_provider_add_to_store(prov, &actual, retain_fallbacks)) {
  ------------------
  |  Branch (37:9): [True: 2, False: 0]
  |  Branch (37:18): [True: 0, False: 2]
  ------------------
   38|      0|        ossl_provider_deactivate(prov, 1);
   39|      0|        ossl_provider_free(prov);
   40|      0|        return NULL;
   41|      0|    }
   42|      2|    if (actual != prov) {
  ------------------
  |  Branch (42:9): [True: 0, False: 2]
  ------------------
   43|      0|        if (!ossl_provider_activate(actual, 1, 0)) {
  ------------------
  |  Branch (43:13): [True: 0, False: 0]
  ------------------
   44|      0|            ossl_provider_free(actual);
   45|      0|            return NULL;
   46|      0|        }
   47|      0|    }
   48|       |
   49|      2|    return actual;
   50|      2|}
OSSL_PROVIDER_try_load:
   54|      2|{
   55|      2|    return OSSL_PROVIDER_try_load_ex(libctx, name, NULL, retain_fallbacks);
   56|      2|}
OSSL_PROVIDER_get0_provider_ctx:
  104|  1.42M|{
  105|  1.42M|    return ossl_provider_ctx(prov);
  106|  1.42M|}
OSSL_PROVIDER_add_builtin:
  128|      2|{
  129|      2|    OSSL_PROVIDER_INFO entry;
  130|       |
  131|      2|    if (name == NULL || init_fn == NULL) {
  ------------------
  |  Branch (131:9): [True: 0, False: 2]
  |  Branch (131:25): [True: 0, False: 2]
  ------------------
  132|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  133|      0|        return 0;
  134|      0|    }
  135|      2|    memset(&entry, 0, sizeof(entry));
  136|      2|    entry.name = OPENSSL_strdup(name);
  ------------------
  |  |  119|      2|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|      2|    if (entry.name == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 2]
  ------------------
  138|      0|        return 0;
  139|      2|    entry.init = init_fn;
  140|      2|    if (!ossl_provider_info_add_to_store(libctx, &entry)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 2]
  ------------------
  141|      0|        ossl_provider_info_clear(&entry);
  142|      0|        return 0;
  143|      0|    }
  144|      2|    return 1;
  145|      2|}

ossl_child_prov_ctx_new:
   38|      4|{
   39|      4|    return OPENSSL_zalloc(sizeof(struct child_prov_globals));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      4|}
ossl_child_prov_ctx_free:
   43|      2|{
   44|      2|    struct child_prov_globals *gbl = vgbl;
   45|       |
   46|      2|    CRYPTO_THREAD_lock_free(gbl->lock);
   47|      2|    OPENSSL_free(gbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|      2|}

ossl_prov_conf_ctx_new:
   31|      4|{
   32|      4|    PROVIDER_CONF_GLOBAL *pcgbl = OPENSSL_zalloc(sizeof(*pcgbl));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|       |
   34|      4|    if (pcgbl == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 4]
  ------------------
   35|      0|        return NULL;
   36|       |
   37|      4|    pcgbl->lock = CRYPTO_THREAD_lock_new();
   38|      4|    if (pcgbl->lock == NULL) {
  ------------------
  |  Branch (38:9): [True: 0, False: 4]
  ------------------
   39|      0|        OPENSSL_free(pcgbl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      0|        return NULL;
   41|      0|    }
   42|       |
   43|      4|    return pcgbl;
   44|      4|}
ossl_prov_conf_ctx_free:
   47|      2|{
   48|      2|    PROVIDER_CONF_GLOBAL *pcgbl = vpcgbl;
   49|       |
   50|      2|    sk_OSSL_PROVIDER_pop_free(pcgbl->activated_providers,
   51|      2|                              ossl_provider_free);
   52|       |
   53|      2|    OSSL_TRACE(CONF, "Cleaned up providers\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   54|      2|    CRYPTO_THREAD_lock_free(pcgbl->lock);
   55|      2|    OPENSSL_free(pcgbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   56|      2|}

ossl_provider_info_clear:
  281|      2|{
  282|      2|    OPENSSL_free(info->name);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  283|      2|    OPENSSL_free(info->path);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  284|      2|    sk_INFOPAIR_pop_free(info->parameters, infopair_free);
  285|      2|}
ossl_provider_store_free:
  288|      2|{
  289|      2|    struct provider_store_st *store = vstore;
  290|      2|    size_t i;
  291|       |
  292|      2|    if (store == NULL)
  ------------------
  |  Branch (292:9): [True: 0, False: 2]
  ------------------
  293|      0|        return;
  294|      2|    store->freeing = 1;
  295|      2|    OPENSSL_free(store->default_path);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  296|      2|    sk_OSSL_PROVIDER_pop_free(store->providers, provider_deactivate_free);
  297|      2|#ifndef FIPS_MODULE
  298|      2|    sk_OSSL_PROVIDER_CHILD_CB_pop_free(store->child_cbs,
  299|      2|                                       ossl_provider_child_cb_free);
  300|      2|#endif
  301|      2|    CRYPTO_THREAD_lock_free(store->default_path_lock);
  302|      2|    CRYPTO_THREAD_lock_free(store->lock);
  303|      4|    for (i = 0; i < store->numprovinfo; i++)
  ------------------
  |  Branch (303:17): [True: 2, False: 2]
  ------------------
  304|      2|        ossl_provider_info_clear(&store->provinfo[i]);
  305|      2|    OPENSSL_free(store->provinfo);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  306|      2|    OPENSSL_free(store);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  307|      2|}
ossl_provider_store_new:
  310|      4|{
  311|      4|    struct provider_store_st *store = OPENSSL_zalloc(sizeof(*store));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  312|       |
  313|      4|    if (store == NULL
  ------------------
  |  Branch (313:9): [True: 0, False: 4]
  ------------------
  314|      4|        || (store->providers = sk_OSSL_PROVIDER_new(ossl_provider_cmp)) == NULL
  ------------------
  |  Branch (314:12): [True: 0, False: 4]
  ------------------
  315|      4|        || (store->default_path_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (315:12): [True: 0, False: 4]
  ------------------
  316|      4|#ifndef FIPS_MODULE
  317|      4|        || (store->child_cbs = sk_OSSL_PROVIDER_CHILD_CB_new_null()) == NULL
  ------------------
  |  Branch (317:12): [True: 0, False: 4]
  ------------------
  318|      4|#endif
  319|      4|        || (store->lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (319:12): [True: 0, False: 4]
  ------------------
  320|      0|        ossl_provider_store_free(store);
  321|      0|        return NULL;
  322|      0|    }
  323|      4|    store->libctx = ctx;
  324|      4|    store->use_fallbacks = 1;
  325|       |
  326|      4|    return store;
  327|      4|}
ossl_provider_info_add_to_store:
  357|      2|{
  358|      2|    struct provider_store_st *store = get_provider_store(libctx);
  359|      2|    int ret = 0;
  360|       |
  361|      2|    if (entry->name == NULL) {
  ------------------
  |  Branch (361:9): [True: 0, False: 2]
  ------------------
  362|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  363|      0|        return 0;
  364|      0|    }
  365|       |
  366|      2|    if (store == NULL) {
  ------------------
  |  Branch (366:9): [True: 0, False: 2]
  ------------------
  367|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  368|      0|        return 0;
  369|      0|    }
  370|       |
  371|      2|    if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (371:9): [True: 0, False: 2]
  ------------------
  372|      0|        return 0;
  373|      2|    if (store->provinfosz == 0) {
  ------------------
  |  Branch (373:9): [True: 2, False: 0]
  ------------------
  374|      2|        store->provinfo = OPENSSL_zalloc(sizeof(*store->provinfo)
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  375|      2|                                         * BUILTINS_BLOCK_SIZE);
  376|      2|        if (store->provinfo == NULL)
  ------------------
  |  Branch (376:13): [True: 0, False: 2]
  ------------------
  377|      0|            goto err;
  378|      2|        store->provinfosz = BUILTINS_BLOCK_SIZE;
  ------------------
  |  |  353|      2|#define BUILTINS_BLOCK_SIZE     10
  ------------------
  379|      2|    } else if (store->numprovinfo == store->provinfosz) {
  ------------------
  |  Branch (379:16): [True: 0, False: 0]
  ------------------
  380|      0|        OSSL_PROVIDER_INFO *tmpbuiltins;
  381|      0|        size_t newsz = store->provinfosz + BUILTINS_BLOCK_SIZE;
  ------------------
  |  |  353|      0|#define BUILTINS_BLOCK_SIZE     10
  ------------------
  382|       |
  383|      0|        tmpbuiltins = OPENSSL_realloc(store->provinfo,
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  384|      0|                                      sizeof(*store->provinfo) * newsz);
  385|      0|        if (tmpbuiltins == NULL)
  ------------------
  |  Branch (385:13): [True: 0, False: 0]
  ------------------
  386|      0|            goto err;
  387|      0|        store->provinfo = tmpbuiltins;
  388|      0|        store->provinfosz = newsz;
  389|      0|    }
  390|      2|    store->provinfo[store->numprovinfo] = *entry;
  391|      2|    store->numprovinfo++;
  392|       |
  393|      2|    ret = 1;
  394|      2| err:
  395|      2|    CRYPTO_THREAD_unlock(store->lock);
  396|      2|    return ret;
  397|      2|}
ossl_provider_find:
  401|      2|{
  402|      2|    struct provider_store_st *store = NULL;
  403|      2|    OSSL_PROVIDER *prov = NULL;
  404|       |
  405|      2|    if ((store = get_provider_store(libctx)) != NULL) {
  ------------------
  |  Branch (405:9): [True: 2, False: 0]
  ------------------
  406|      2|        OSSL_PROVIDER tmpl = { 0, };
  407|      2|        int i;
  408|       |
  409|      2|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  410|       |        /*
  411|       |         * Make sure any providers are loaded from config before we try to find
  412|       |         * them.
  413|       |         */
  414|      2|        if (!noconfig) {
  ------------------
  |  Branch (414:13): [True: 2, False: 0]
  ------------------
  415|      2|            if (ossl_lib_ctx_is_default(libctx))
  ------------------
  |  Branch (415:17): [True: 2, False: 0]
  ------------------
  416|      2|                OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  472|      2|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  417|      2|        }
  418|      2|#endif
  419|       |
  420|      2|        tmpl.name = (char *)name;
  421|      2|        if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (421:13): [True: 0, False: 2]
  ------------------
  422|      0|            return NULL;
  423|      2|        sk_OSSL_PROVIDER_sort(store->providers);
  424|      2|        if ((i = sk_OSSL_PROVIDER_find(store->providers, &tmpl)) != -1)
  ------------------
  |  Branch (424:13): [True: 0, False: 2]
  ------------------
  425|      0|            prov = sk_OSSL_PROVIDER_value(store->providers, i);
  426|      2|        CRYPTO_THREAD_unlock(store->lock);
  427|      2|        if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (427:13): [True: 0, False: 2]
  |  Branch (427:29): [True: 0, False: 0]
  ------------------
  428|      0|            prov = NULL;
  429|      2|    }
  430|       |
  431|      2|    return prov;
  432|      2|}
ossl_provider_up_ref:
  477|    401|{
  478|    401|    int ref = 0;
  479|       |
  480|    401|    if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0)
  ------------------
  |  Branch (480:9): [True: 0, False: 401]
  ------------------
  481|      0|        return 0;
  482|       |
  483|    401|#ifndef FIPS_MODULE
  484|    401|    if (prov->ischild) {
  ------------------
  |  Branch (484:9): [True: 0, False: 401]
  ------------------
  485|      0|        if (!ossl_provider_up_ref_parent(prov, 0)) {
  ------------------
  |  Branch (485:13): [True: 0, False: 0]
  ------------------
  486|      0|            ossl_provider_free(prov);
  487|      0|            return 0;
  488|      0|        }
  489|      0|    }
  490|    401|#endif
  491|       |
  492|    401|    return ref;
  493|    401|}
ossl_provider_new:
  522|      2|{
  523|      2|    struct provider_store_st *store = NULL;
  524|      2|    OSSL_PROVIDER_INFO template;
  525|      2|    OSSL_PROVIDER *prov = NULL;
  526|       |
  527|      2|    if ((store = get_provider_store(libctx)) == NULL)
  ------------------
  |  Branch (527:9): [True: 0, False: 2]
  ------------------
  528|      0|        return NULL;
  529|       |
  530|      2|    memset(&template, 0, sizeof(template));
  531|      2|    if (init_function == NULL) {
  ------------------
  |  Branch (531:9): [True: 2, False: 0]
  ------------------
  532|      2|        const OSSL_PROVIDER_INFO *p;
  533|      2|        size_t i;
  534|      2|        int chosen = 0;
  535|       |
  536|       |        /* Check if this is a predefined builtin provider */
  537|      8|        for (p = ossl_predefined_providers; p->name != NULL; p++) {
  ------------------
  |  Branch (537:45): [True: 6, False: 2]
  ------------------
  538|      6|            if (strcmp(p->name, name) != 0)
  ------------------
  |  Branch (538:17): [True: 6, False: 0]
  ------------------
  539|      6|                continue;
  540|       |            /* These compile-time templates always have NULL parameters */
  541|      0|            template = *p;
  542|      0|            chosen = 1;
  543|      0|            break;
  544|      6|        }
  545|      2|        if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (545:13): [True: 0, False: 2]
  ------------------
  546|      0|            return NULL;
  547|      2|        for (i = 0, p = store->provinfo; i < store->numprovinfo; p++, i++) {
  ------------------
  |  Branch (547:42): [True: 2, False: 0]
  ------------------
  548|      2|            if (strcmp(p->name, name) != 0)
  ------------------
  |  Branch (548:17): [True: 0, False: 2]
  ------------------
  549|      0|                continue;
  550|       |            /* For built-in providers, copy just implicit parameters. */
  551|      2|            if (!chosen)
  ------------------
  |  Branch (551:17): [True: 2, False: 0]
  ------------------
  552|      2|                template = *p;
  553|       |            /*
  554|       |             * Explicit parameters override config-file defaults.  If an empty
  555|       |             * parameter set is desired, a non-NULL empty set must be provided.
  556|       |             */
  557|      2|            if (params != NULL || p->parameters == NULL) {
  ------------------
  |  Branch (557:17): [True: 0, False: 2]
  |  Branch (557:35): [True: 2, False: 0]
  ------------------
  558|      2|                template.parameters = NULL;
  559|      2|                break;
  560|      2|            }
  561|       |            /* Always copy to avoid sharing/mutation. */
  562|      0|            template.parameters = sk_INFOPAIR_deep_copy(p->parameters,
  563|      0|                                                        infopair_copy,
  564|      0|                                                        infopair_free);
  565|      0|            if (template.parameters == NULL)
  ------------------
  |  Branch (565:17): [True: 0, False: 0]
  ------------------
  566|      0|                return NULL;
  567|      0|            break;
  568|      0|        }
  569|      2|        CRYPTO_THREAD_unlock(store->lock);
  570|      2|    } else {
  571|      0|        template.init = init_function;
  572|      0|    }
  573|       |
  574|      2|    if (params != NULL) {
  ------------------
  |  Branch (574:9): [True: 0, False: 2]
  ------------------
  575|      0|        int i;
  576|       |
  577|       |        /* Don't leak if already non-NULL */
  578|      0|        if (template.parameters == NULL)
  ------------------
  |  Branch (578:13): [True: 0, False: 0]
  ------------------
  579|      0|            template.parameters = sk_INFOPAIR_new_null();
  580|      0|        if (template.parameters == NULL)
  ------------------
  |  Branch (580:13): [True: 0, False: 0]
  ------------------
  581|      0|            return NULL;
  582|       |
  583|      0|        for (i = 0; params[i].key != NULL; i++) {
  ------------------
  |  Branch (583:21): [True: 0, False: 0]
  ------------------
  584|      0|            if (params[i].data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (584:17): [True: 0, False: 0]
  ------------------
  585|      0|                continue;
  586|      0|            if (ossl_provider_info_add_parameter(&template, params[i].key,
  ------------------
  |  Branch (586:17): [True: 0, False: 0]
  ------------------
  587|      0|                                                 (char *)params[i].data) <= 0) {
  588|      0|                sk_INFOPAIR_pop_free(template.parameters, infopair_free);
  589|      0|                return NULL;
  590|      0|            }
  591|      0|        }
  592|      0|    }
  593|       |
  594|       |    /* provider_new() generates an error, so no need here */
  595|      2|    prov = provider_new(name, template.init, template.parameters);
  596|       |
  597|       |    /* If we copied the parameters, free them */
  598|      2|    if (template.parameters != NULL)
  ------------------
  |  Branch (598:9): [True: 0, False: 2]
  ------------------
  599|      0|        sk_INFOPAIR_pop_free(template.parameters, infopair_free);
  600|       |
  601|      2|    if (prov == NULL)
  ------------------
  |  Branch (601:9): [True: 0, False: 2]
  ------------------
  602|      0|        return NULL;
  603|       |
  604|      2|    if (!ossl_provider_set_module_path(prov, template.path)) {
  ------------------
  |  Branch (604:9): [True: 0, False: 2]
  ------------------
  605|      0|        ossl_provider_free(prov);
  606|      0|        return NULL;
  607|      0|    }
  608|       |
  609|      2|    prov->libctx = libctx;
  610|      2|#ifndef FIPS_MODULE
  611|      2|    prov->error_lib = ERR_get_next_error_library();
  612|      2|#endif
  613|       |
  614|       |    /*
  615|       |     * At this point, the provider is only partially "loaded".  To be
  616|       |     * fully "loaded", ossl_provider_activate() must also be called and it must
  617|       |     * then be added to the provider store.
  618|       |     */
  619|       |
  620|      2|    return prov;
  621|      2|}
ossl_provider_add_to_store:
  648|      2|{
  649|      2|    struct provider_store_st *store;
  650|      2|    int idx;
  651|      2|    OSSL_PROVIDER tmpl = { 0, };
  652|      2|    OSSL_PROVIDER *actualtmp = NULL;
  653|       |
  654|      2|    if (actualprov != NULL)
  ------------------
  |  Branch (654:9): [True: 2, False: 0]
  ------------------
  655|      2|        *actualprov = NULL;
  656|       |
  657|      2|    if ((store = get_provider_store(prov->libctx)) == NULL)
  ------------------
  |  Branch (657:9): [True: 0, False: 2]
  ------------------
  658|      0|        return 0;
  659|       |
  660|      2|    if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (660:9): [True: 0, False: 2]
  ------------------
  661|      0|        return 0;
  662|       |
  663|      2|    tmpl.name = (char *)prov->name;
  664|      2|    idx = sk_OSSL_PROVIDER_find(store->providers, &tmpl);
  665|      2|    if (idx == -1)
  ------------------
  |  Branch (665:9): [True: 2, False: 0]
  ------------------
  666|      2|        actualtmp = prov;
  667|      0|    else
  668|      0|        actualtmp = sk_OSSL_PROVIDER_value(store->providers, idx);
  669|       |
  670|      2|    if (idx == -1) {
  ------------------
  |  Branch (670:9): [True: 2, False: 0]
  ------------------
  671|      2|        if (sk_OSSL_PROVIDER_push(store->providers, prov) == 0)
  ------------------
  |  Branch (671:13): [True: 0, False: 2]
  ------------------
  672|      0|            goto err;
  673|      2|        prov->store = store;
  674|      2|        if (!create_provider_children(prov)) {
  ------------------
  |  Branch (674:13): [True: 0, False: 2]
  ------------------
  675|      0|            sk_OSSL_PROVIDER_delete_ptr(store->providers, prov);
  676|      0|            goto err;
  677|      0|        }
  678|      2|        if (!retain_fallbacks)
  ------------------
  |  Branch (678:13): [True: 0, False: 2]
  ------------------
  679|      0|            store->use_fallbacks = 0;
  680|      2|    }
  681|       |
  682|      2|    CRYPTO_THREAD_unlock(store->lock);
  683|       |
  684|      2|    if (actualprov != NULL) {
  ------------------
  |  Branch (684:9): [True: 2, False: 0]
  ------------------
  685|      2|        if (!ossl_provider_up_ref(actualtmp)) {
  ------------------
  |  Branch (685:13): [True: 0, False: 2]
  ------------------
  686|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  687|      0|            actualtmp = NULL;
  688|      0|            return 0;
  689|      0|        }
  690|      2|        *actualprov = actualtmp;
  691|      2|    }
  692|       |
  693|      2|    if (idx >= 0) {
  ------------------
  |  Branch (693:9): [True: 0, False: 2]
  ------------------
  694|       |        /*
  695|       |         * The provider is already in the store. Probably two threads
  696|       |         * independently initialised their own provider objects with the same
  697|       |         * name and raced to put them in the store. This thread lost. We
  698|       |         * deactivate the one we just created and use the one that already
  699|       |         * exists instead.
  700|       |         * If we get here then we know we did not create provider children
  701|       |         * above, so we inform ossl_provider_deactivate not to attempt to remove
  702|       |         * any.
  703|       |         */
  704|      0|        ossl_provider_deactivate(prov, 0);
  705|      0|        ossl_provider_free(prov);
  706|      0|    }
  707|      2|#ifndef FIPS_MODULE
  708|      2|    else {
  709|       |        /*
  710|       |         * This can be done outside the lock. We tolerate other threads getting
  711|       |         * the wrong result briefly when creating OSSL_DECODER_CTXs.
  712|       |         */
  713|      2|        ossl_decoder_cache_flush(prov->libctx);
  714|      2|    }
  715|      2|#endif
  716|       |
  717|      2|    return 1;
  718|       |
  719|      0| err:
  720|      0|    CRYPTO_THREAD_unlock(store->lock);
  721|      0|    return 0;
  722|      2|}
ossl_provider_free:
  725|    402|{
  726|    402|    if (prov != NULL) {
  ------------------
  |  Branch (726:9): [True: 402, False: 0]
  ------------------
  727|    402|        int ref = 0;
  728|       |
  729|    402|        CRYPTO_DOWN_REF(&prov->refcnt, &ref);
  730|       |
  731|       |        /*
  732|       |         * When the refcount drops to zero, we clean up the provider.
  733|       |         * Note that this also does teardown, which may seem late,
  734|       |         * considering that init happens on first activation.  However,
  735|       |         * there may be other structures hanging on to the provider after
  736|       |         * the last deactivation and may therefore need full access to the
  737|       |         * provider's services.  Therefore, we deinit late.
  738|       |         */
  739|    402|        if (ref == 0) {
  ------------------
  |  Branch (739:13): [True: 1, False: 401]
  ------------------
  740|      1|            if (prov->flag_initialized) {
  ------------------
  |  Branch (740:17): [True: 1, False: 0]
  ------------------
  741|      1|                ossl_provider_teardown(prov);
  742|      1|#ifndef OPENSSL_NO_ERR
  743|      1|# ifndef FIPS_MODULE
  744|      1|                if (prov->error_strings != NULL) {
  ------------------
  |  Branch (744:21): [True: 0, False: 1]
  ------------------
  745|      0|                    ERR_unload_strings(prov->error_lib, prov->error_strings);
  746|      0|                    OPENSSL_free(prov->error_strings);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  747|      0|                    prov->error_strings = NULL;
  748|      0|                }
  749|      1|# endif
  750|      1|#endif
  751|      1|                OPENSSL_free(prov->operation_bits);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  752|      1|                prov->operation_bits = NULL;
  753|      1|                prov->operation_bits_sz = 0;
  754|      1|                prov->flag_initialized = 0;
  755|      1|            }
  756|       |
  757|      1|#ifndef FIPS_MODULE
  758|       |            /*
  759|       |             * We deregister thread handling whether or not the provider was
  760|       |             * initialized. If init was attempted but was not successful then
  761|       |             * the provider may still have registered a thread handler.
  762|       |             */
  763|      1|            ossl_init_thread_deregister(prov);
  764|      1|            DSO_free(prov->module);
  765|      1|#endif
  766|      1|            OPENSSL_free(prov->name);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  767|      1|            OPENSSL_free(prov->path);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  768|      1|            sk_INFOPAIR_pop_free(prov->parameters, infopair_free);
  769|      1|            CRYPTO_THREAD_lock_free(prov->opbits_lock);
  770|      1|            CRYPTO_THREAD_lock_free(prov->flag_lock);
  771|      1|            CRYPTO_THREAD_lock_free(prov->activatecnt_lock);
  772|      1|            CRYPTO_FREE_REF(&prov->refcnt);
  773|      1|            OPENSSL_free(prov);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  774|      1|        }
  775|    401|#ifndef FIPS_MODULE
  776|    401|        else if (prov->ischild) {
  ------------------
  |  Branch (776:18): [True: 0, False: 401]
  ------------------
  777|      0|            ossl_provider_free_parent(prov, 0);
  778|      0|        }
  779|    402|#endif
  780|    402|    }
  781|    402|}
ossl_provider_set_module_path:
  785|      2|{
  786|      2|    OPENSSL_free(prov->path);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  787|      2|    prov->path = NULL;
  788|      2|    if (module_path == NULL)
  ------------------
  |  Branch (788:9): [True: 2, False: 0]
  ------------------
  789|      2|        return 1;
  790|      0|    if ((prov->path = OPENSSL_strdup(module_path)) != NULL)
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (790:9): [True: 0, False: 0]
  ------------------
  791|      0|        return 1;
  792|      0|    return 0;
  793|      0|}
OSSL_PROVIDER_get_conf_parameters:
  831|      3|{
  832|      3|    int i;
  833|       |
  834|      3|    if (prov->parameters == NULL)
  ------------------
  |  Branch (834:9): [True: 0, False: 3]
  ------------------
  835|      0|        return 1;
  836|       |
  837|      3|    for (i = 0; i < sk_INFOPAIR_num(prov->parameters); i++) {
  ------------------
  |  Branch (837:17): [True: 0, False: 3]
  ------------------
  838|      0|        INFOPAIR *pair = sk_INFOPAIR_value(prov->parameters, i);
  839|      0|        OSSL_PARAM *p = OSSL_PARAM_locate(params, pair->name);
  840|       |
  841|      0|        if (p != NULL
  ------------------
  |  Branch (841:13): [True: 0, False: 0]
  ------------------
  842|      0|            && !OSSL_PARAM_set_utf8_ptr(p, pair->value))
  ------------------
  |  Branch (842:16): [True: 0, False: 0]
  ------------------
  843|      0|            return 0;
  844|      0|    }
  845|      3|    return 1;
  846|      3|}
ossl_provider_activate:
 1397|      2|{
 1398|      2|    int count;
 1399|       |
 1400|      2|    if (prov == NULL)
  ------------------
  |  Branch (1400:9): [True: 0, False: 2]
  ------------------
 1401|      0|        return 0;
 1402|      2|#ifndef FIPS_MODULE
 1403|       |    /*
 1404|       |     * If aschild is true, then we only actually do the activation if the
 1405|       |     * provider is a child. If its not, this is still success.
 1406|       |     */
 1407|      2|    if (aschild && !prov->ischild)
  ------------------
  |  Branch (1407:9): [True: 0, False: 2]
  |  Branch (1407:20): [True: 0, False: 0]
  ------------------
 1408|      0|        return 1;
 1409|      2|#endif
 1410|      2|    if ((count = provider_activate(prov, 1, upcalls)) > 0)
  ------------------
  |  Branch (1410:9): [True: 2, False: 0]
  ------------------
 1411|      2|        return count == 1 ? provider_flush_store_cache(prov) : 1;
  ------------------
  |  Branch (1411:16): [True: 2, False: 0]
  ------------------
 1412|       |
 1413|      0|    return 0;
 1414|      2|}
ossl_provider_deactivate:
 1417|      3|{
 1418|      3|    int count;
 1419|       |
 1420|      3|    if (prov == NULL
  ------------------
  |  Branch (1420:9): [True: 0, False: 3]
  ------------------
 1421|      3|            || (count = provider_deactivate(prov, 1, removechildren)) < 0)
  ------------------
  |  Branch (1421:16): [True: 0, False: 3]
  ------------------
 1422|      0|        return 0;
 1423|      3|    return count == 0 ? provider_remove_store_methods(prov) : 1;
  ------------------
  |  Branch (1423:12): [True: 3, False: 0]
  ------------------
 1424|      3|}
ossl_provider_ctx:
 1427|  1.42M|{
 1428|  1.42M|    return prov != NULL ? prov->provctx : NULL;
  ------------------
  |  Branch (1428:12): [True: 1.42M, False: 0]
  ------------------
 1429|  1.42M|}
ossl_provider_doall_activated:
 1528|  6.60k|{
 1529|  6.60k|    int ret = 0, curr, max, ref = 0;
 1530|  6.60k|    struct provider_store_st *store = get_provider_store(ctx);
 1531|  6.60k|    STACK_OF(OSSL_PROVIDER) *provs = NULL;
  ------------------
  |  |   31|  6.60k|# define STACK_OF(type) struct stack_st_##type
  ------------------
 1532|       |
 1533|  6.60k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
 1534|       |    /*
 1535|       |     * Make sure any providers are loaded from config before we try to use
 1536|       |     * them.
 1537|       |     */
 1538|  6.60k|    if (ossl_lib_ctx_is_default(ctx))
  ------------------
  |  Branch (1538:9): [True: 6.60k, False: 0]
  ------------------
 1539|  6.60k|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  472|  6.60k|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
 1540|  6.60k|#endif
 1541|       |
 1542|  6.60k|    if (store == NULL)
  ------------------
  |  Branch (1542:9): [True: 0, False: 6.60k]
  ------------------
 1543|      0|        return 1;
 1544|  6.60k|    if (!provider_activate_fallbacks(store))
  ------------------
  |  Branch (1544:9): [True: 0, False: 6.60k]
  ------------------
 1545|      0|        return 0;
 1546|       |
 1547|       |    /*
 1548|       |     * Under lock, grab a copy of the provider list and up_ref each
 1549|       |     * provider so that they don't disappear underneath us.
 1550|       |     */
 1551|  6.60k|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1551:9): [True: 0, False: 6.60k]
  ------------------
 1552|      0|        return 0;
 1553|  6.60k|    provs = sk_OSSL_PROVIDER_dup(store->providers);
 1554|  6.60k|    if (provs == NULL) {
  ------------------
  |  Branch (1554:9): [True: 0, False: 6.60k]
  ------------------
 1555|      0|        CRYPTO_THREAD_unlock(store->lock);
 1556|      0|        return 0;
 1557|      0|    }
 1558|  6.60k|    max = sk_OSSL_PROVIDER_num(provs);
 1559|       |    /*
 1560|       |     * We work backwards through the stack so that we can safely delete items
 1561|       |     * as we go.
 1562|       |     */
 1563|  19.8k|    for (curr = max - 1; curr >= 0; curr--) {
  ------------------
  |  Branch (1563:26): [True: 13.2k, False: 6.60k]
  ------------------
 1564|  13.2k|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1565|       |
 1566|  13.2k|        if (!CRYPTO_THREAD_read_lock(prov->flag_lock))
  ------------------
  |  Branch (1566:13): [True: 0, False: 13.2k]
  ------------------
 1567|      0|            goto err_unlock;
 1568|  13.2k|        if (prov->flag_activated) {
  ------------------
  |  Branch (1568:13): [True: 13.2k, False: 0]
  ------------------
 1569|       |            /*
 1570|       |             * We call CRYPTO_UP_REF directly rather than ossl_provider_up_ref
 1571|       |             * to avoid upping the ref count on the parent provider, which we
 1572|       |             * must not do while holding locks.
 1573|       |             */
 1574|  13.2k|            if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0) {
  ------------------
  |  Branch (1574:17): [True: 0, False: 13.2k]
  ------------------
 1575|      0|                CRYPTO_THREAD_unlock(prov->flag_lock);
 1576|      0|                goto err_unlock;
 1577|      0|            }
 1578|       |            /*
 1579|       |             * It's already activated, but we up the activated count to ensure
 1580|       |             * it remains activated until after we've called the user callback.
 1581|       |             * In theory this could mean the parent provider goes inactive,
 1582|       |             * whilst still activated in the child for a short period. That's ok.
 1583|       |             */
 1584|  13.2k|            if (!CRYPTO_atomic_add(&prov->activatecnt, 1, &ref,
  ------------------
  |  Branch (1584:17): [True: 0, False: 13.2k]
  ------------------
 1585|  13.2k|                                   prov->activatecnt_lock)) {
 1586|      0|                CRYPTO_DOWN_REF(&prov->refcnt, &ref);
 1587|      0|                CRYPTO_THREAD_unlock(prov->flag_lock);
 1588|      0|                goto err_unlock;
 1589|      0|            }
 1590|  13.2k|        } else {
 1591|      0|            sk_OSSL_PROVIDER_delete(provs, curr);
 1592|      0|            max--;
 1593|      0|        }
 1594|  13.2k|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1595|  13.2k|    }
 1596|  6.60k|    CRYPTO_THREAD_unlock(store->lock);
 1597|       |
 1598|       |    /*
 1599|       |     * Now, we sweep through all providers not under lock
 1600|       |     */
 1601|  19.8k|    for (curr = 0; curr < max; curr++) {
  ------------------
  |  Branch (1601:20): [True: 13.2k, False: 6.60k]
  ------------------
 1602|  13.2k|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1603|       |
 1604|  13.2k|        if (!cb(prov, cbdata)) {
  ------------------
  |  Branch (1604:13): [True: 0, False: 13.2k]
  ------------------
 1605|      0|            curr = -1;
 1606|      0|            goto finish;
 1607|      0|        }
 1608|  13.2k|    }
 1609|  6.60k|    curr = -1;
 1610|       |
 1611|  6.60k|    ret = 1;
 1612|  6.60k|    goto finish;
 1613|       |
 1614|      0| err_unlock:
 1615|      0|    CRYPTO_THREAD_unlock(store->lock);
 1616|  6.60k| finish:
 1617|       |    /*
 1618|       |     * The pop_free call doesn't do what we want on an error condition. We
 1619|       |     * either start from the first item in the stack, or part way through if
 1620|       |     * we only processed some of the items.
 1621|       |     */
 1622|  19.8k|    for (curr++; curr < max; curr++) {
  ------------------
  |  Branch (1622:18): [True: 13.2k, False: 6.60k]
  ------------------
 1623|  13.2k|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1624|       |
 1625|  13.2k|        if (!CRYPTO_atomic_add(&prov->activatecnt, -1, &ref,
  ------------------
  |  Branch (1625:13): [True: 0, False: 13.2k]
  ------------------
 1626|  13.2k|                               prov->activatecnt_lock)) {
 1627|      0|            ret = 0;
 1628|      0|            continue;
 1629|      0|        }
 1630|  13.2k|        if (ref < 1) {
  ------------------
  |  Branch (1630:13): [True: 0, False: 13.2k]
  ------------------
 1631|       |            /*
 1632|       |             * Looks like we need to deactivate properly. We could just have
 1633|       |             * done this originally, but it involves taking a write lock so
 1634|       |             * we avoid it. We up the count again and do a full deactivation
 1635|       |             */
 1636|      0|            if (CRYPTO_atomic_add(&prov->activatecnt, 1, &ref,
  ------------------
  |  Branch (1636:17): [True: 0, False: 0]
  ------------------
 1637|      0|                                  prov->activatecnt_lock))
 1638|      0|                provider_deactivate(prov, 0, 1);
 1639|      0|            else
 1640|      0|                ret = 0;
 1641|      0|        }
 1642|       |        /*
 1643|       |         * As above where we did the up-ref, we don't call ossl_provider_free
 1644|       |         * to avoid making upcalls. There should always be at least one ref
 1645|       |         * to the provider in the store, so this should never drop to 0.
 1646|       |         */
 1647|  13.2k|        if (!CRYPTO_DOWN_REF(&prov->refcnt, &ref)) {
  ------------------
  |  Branch (1647:13): [True: 0, False: 13.2k]
  ------------------
 1648|      0|            ret = 0;
 1649|      0|            continue;
 1650|      0|        }
 1651|       |        /*
 1652|       |         * Not much we can do if this assert ever fails. So we don't use
 1653|       |         * ossl_assert here.
 1654|       |         */
 1655|  13.2k|        assert(ref > 0);
 1656|  13.2k|    }
 1657|  6.60k|    sk_OSSL_PROVIDER_free(provs);
 1658|  6.60k|    return ret;
 1659|  6.60k|}
ossl_provider_name:
 1683|      2|{
 1684|      2|    return prov->name;
 1685|      2|}
ossl_provider_libctx:
 1720|   235k|{
 1721|   235k|    return prov != NULL ? prov->libctx : NULL;
  ------------------
  |  Branch (1721:12): [True: 229k, False: 6.59k]
  ------------------
 1722|   235k|}
ossl_provider_teardown:
 1737|      1|{
 1738|      1|    if (prov->teardown != NULL
  ------------------
  |  Branch (1738:9): [True: 1, False: 0]
  ------------------
 1739|      1|#ifndef FIPS_MODULE
 1740|      1|            && !prov->ischild
  ------------------
  |  Branch (1740:16): [True: 1, False: 0]
  ------------------
 1741|      1|#endif
 1742|      1|        ) {
 1743|      1|#ifndef FIPS_MODULE
 1744|      1|        OSSL_TRACE_BEGIN(PROVIDER) {
  ------------------
  |  |  220|      1|    do {                                        \
  |  |  221|      1|        BIO *trc_out = NULL;                    \
  |  |  222|      1|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1745|      0|            BIO_printf(trc_out, "(provider %s) calling teardown\n",
 1746|      0|                       ossl_provider_name(prov));
 1747|      1|        } OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  225|      1|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1748|      1|#endif
 1749|      1|        prov->teardown(prov->provctx);
 1750|      1|    }
 1751|      1|}
ossl_provider_query_operation:
 1936|  13.2k|{
 1937|  13.2k|    const OSSL_ALGORITHM *res;
 1938|       |
 1939|  13.2k|    if (prov->query_operation == NULL) {
  ------------------
  |  Branch (1939:9): [True: 0, False: 13.2k]
  ------------------
 1940|      0|#ifndef FIPS_MODULE
 1941|      0|        OSSL_TRACE_BEGIN(PROVIDER) {
  ------------------
  |  |  220|      0|    do {                                        \
  |  |  221|      0|        BIO *trc_out = NULL;                    \
  |  |  222|      0|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1942|      0|            BIO_printf(trc_out, "provider %s lacks query operation!\n",
 1943|      0|                       prov->name);
 1944|      0|        } OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  225|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1945|      0|#endif
 1946|      0|        return NULL;
 1947|      0|    }
 1948|       |
 1949|  13.2k|    res = prov->query_operation(prov->provctx, operation_id, no_cache);
 1950|  13.2k|#ifndef FIPS_MODULE
 1951|  13.2k|    OSSL_TRACE_BEGIN(PROVIDER) {
  ------------------
  |  |  220|  13.2k|    do {                                        \
  |  |  221|  13.2k|        BIO *trc_out = NULL;                    \
  |  |  222|  13.2k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1952|      0|        const OSSL_ALGORITHM *idx;
 1953|      0|        if (res != NULL) {
  ------------------
  |  Branch (1953:13): [True: 0, False: 0]
  ------------------
 1954|      0|            BIO_printf(trc_out,
 1955|      0|                       "(provider %s) Calling query, available algs are:\n", prov->name);
 1956|       |
 1957|      0|            for (idx = res; idx->algorithm_names != NULL; idx++) {
  ------------------
  |  Branch (1957:29): [True: 0, False: 0]
  ------------------
 1958|      0|                BIO_printf(trc_out,
 1959|      0|                           "(provider %s) names %s, prop_def %s, desc %s\n",
 1960|      0|                           prov->name,
 1961|      0|                           idx->algorithm_names == NULL ? "none" :
  ------------------
  |  Branch (1961:28): [True: 0, False: 0]
  ------------------
 1962|      0|                           idx->algorithm_names,
 1963|      0|                           idx->property_definition == NULL ? "none" :
  ------------------
  |  Branch (1963:28): [True: 0, False: 0]
  ------------------
 1964|      0|                           idx->property_definition,
 1965|      0|                           idx->algorithm_description == NULL ? "none" :
  ------------------
  |  Branch (1965:28): [True: 0, False: 0]
  ------------------
 1966|      0|                           idx->algorithm_description);
 1967|      0|            }
 1968|      0|        } else {
 1969|      0|            BIO_printf(trc_out, "(provider %s) query_operation failed\n", prov->name);
 1970|      0|        }
 1971|  13.2k|    } OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  225|  13.2k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1972|  13.2k|#endif
 1973|       |
 1974|       |#if defined(OPENSSL_NO_CACHED_FETCH)
 1975|       |    /* Forcing the non-caching of queries */
 1976|       |    if (no_cache != NULL)
 1977|       |        *no_cache = 1;
 1978|       |#endif
 1979|  13.2k|    return res;
 1980|  13.2k|}
ossl_provider_unquery_operation:
 1999|  13.2k|{
 2000|  13.2k|    if (prov->unquery_operation != NULL) {
  ------------------
  |  Branch (2000:9): [True: 0, False: 13.2k]
  ------------------
 2001|      0|#ifndef FIPS_MODULE
 2002|      0|        OSSL_TRACE_BEGIN(PROVIDER) {
  ------------------
  |  |  220|      0|    do {                                        \
  |  |  221|      0|        BIO *trc_out = NULL;                    \
  |  |  222|      0|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2003|      0|            BIO_printf(trc_out,
 2004|      0|                       "(provider %s) Calling unquery"
 2005|      0|                       " with operation %d\n",
 2006|      0|                       prov->name,
 2007|      0|                       operation_id);
 2008|      0|        } OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  225|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2009|      0|#endif
 2010|      0|        prov->unquery_operation(prov->provctx, operation_id, algs);
 2011|      0|    }
 2012|  13.2k|}
ossl_provider_set_operation_bit:
 2015|     12|{
 2016|     12|    size_t byte = bitnum / 8;
 2017|     12|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 2018|       |
 2019|     12|    if (!CRYPTO_THREAD_write_lock(provider->opbits_lock))
  ------------------
  |  Branch (2019:9): [True: 0, False: 12]
  ------------------
 2020|      0|        return 0;
 2021|     12|    if (provider->operation_bits_sz <= byte) {
  ------------------
  |  Branch (2021:9): [True: 4, False: 8]
  ------------------
 2022|      4|        unsigned char *tmp = OPENSSL_realloc(provider->operation_bits,
  ------------------
  |  |  109|      4|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2023|      4|                                             byte + 1);
 2024|       |
 2025|      4|        if (tmp == NULL) {
  ------------------
  |  Branch (2025:13): [True: 0, False: 4]
  ------------------
 2026|      0|            CRYPTO_THREAD_unlock(provider->opbits_lock);
 2027|      0|            return 0;
 2028|      0|        }
 2029|      4|        provider->operation_bits = tmp;
 2030|      4|        memset(provider->operation_bits + provider->operation_bits_sz,
 2031|      4|               '\0', byte + 1 - provider->operation_bits_sz);
 2032|      4|        provider->operation_bits_sz = byte + 1;
 2033|      4|    }
 2034|     12|    provider->operation_bits[byte] |= bit;
 2035|     12|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 2036|     12|    return 1;
 2037|     12|}
ossl_provider_test_operation_bit:
 2041|  13.2k|{
 2042|  13.2k|    size_t byte = bitnum / 8;
 2043|  13.2k|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 2044|       |
 2045|  13.2k|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|  13.2k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  13.2k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (2045:9): [True: 0, False: 13.2k]
  ------------------
 2046|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 2047|      0|        return 0;
 2048|      0|    }
 2049|       |
 2050|  13.2k|    *result = 0;
 2051|  13.2k|    if (!CRYPTO_THREAD_read_lock(provider->opbits_lock))
  ------------------
  |  Branch (2051:9): [True: 0, False: 13.2k]
  ------------------
 2052|      0|        return 0;
 2053|  13.2k|    if (provider->operation_bits_sz > byte)
  ------------------
  |  Branch (2053:9): [True: 13.2k, False: 4]
  ------------------
 2054|  13.2k|        *result = ((provider->operation_bits[byte] & bit) != 0);
 2055|  13.2k|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 2056|  13.2k|    return 1;
 2057|  13.2k|}
provider_core.c:provider_deactivate_free:
  237|      3|{
  238|      3|    if (prov->flag_activated)
  ------------------
  |  Branch (238:9): [True: 3, False: 0]
  ------------------
  239|      3|        ossl_provider_deactivate(prov, 1);
  240|      3|    ossl_provider_free(prov);
  241|      3|}
provider_core.c:get_provider_store:
  330|  6.62k|{
  331|  6.62k|    struct provider_store_st *store = NULL;
  332|       |
  333|  6.62k|    store = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_PROVIDER_STORE_INDEX);
  ------------------
  |  |   99|  6.62k|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  334|  6.62k|    if (store == NULL)
  ------------------
  |  Branch (334:9): [True: 0, False: 6.62k]
  ------------------
  335|  6.62k|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  336|  6.62k|    return store;
  337|  6.62k|}
provider_core.c:provider_new:
  442|      3|{
  443|      3|    OSSL_PROVIDER *prov = NULL;
  444|       |
  445|      3|    if ((prov = OPENSSL_zalloc(sizeof(*prov))) == NULL)
  ------------------
  |  |  104|      3|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (445:9): [True: 0, False: 3]
  ------------------
  446|      0|        return NULL;
  447|      3|    if (!CRYPTO_NEW_REF(&prov->refcnt, 1)) {
  ------------------
  |  Branch (447:9): [True: 0, False: 3]
  ------------------
  448|      0|        OPENSSL_free(prov);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  449|      0|        return NULL;
  450|      0|    }
  451|      3|    if ((prov->activatecnt_lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (451:9): [True: 0, False: 3]
  ------------------
  452|      0|        ossl_provider_free(prov);
  453|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  454|      0|        return NULL;
  455|      0|    }
  456|       |
  457|      3|    if ((prov->opbits_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (457:9): [True: 0, False: 3]
  ------------------
  458|      3|        || (prov->flag_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (458:12): [True: 0, False: 3]
  ------------------
  459|      3|        || (prov->parameters = sk_INFOPAIR_deep_copy(parameters,
  ------------------
  |  Branch (459:12): [True: 0, False: 3]
  ------------------
  460|      3|                                                     infopair_copy,
  461|      3|                                                     infopair_free)) == NULL) {
  462|      0|        ossl_provider_free(prov);
  463|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  464|      0|        return NULL;
  465|      0|    }
  466|      3|    if ((prov->name = OPENSSL_strdup(name)) == NULL) {
  ------------------
  |  |  119|      3|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (466:9): [True: 0, False: 3]
  ------------------
  467|      0|        ossl_provider_free(prov);
  468|      0|        return NULL;
  469|      0|    }
  470|       |
  471|      3|    prov->init_function = init_function;
  472|       |
  473|      3|    return prov;
  474|      3|}
provider_core.c:create_provider_children:
  625|      2|{
  626|      2|    int ret = 1;
  627|      2|#ifndef FIPS_MODULE
  628|      2|    struct provider_store_st *store = prov->store;
  629|      2|    OSSL_PROVIDER_CHILD_CB *child_cb;
  630|      2|    int i, max;
  631|       |
  632|      2|    max = sk_OSSL_PROVIDER_CHILD_CB_num(store->child_cbs);
  633|      2|    for (i = 0; i < max; i++) {
  ------------------
  |  Branch (633:17): [True: 0, False: 2]
  ------------------
  634|       |        /*
  635|       |         * This is newly activated (activatecnt == 1), so we need to
  636|       |         * create child providers as necessary.
  637|       |         */
  638|      0|        child_cb = sk_OSSL_PROVIDER_CHILD_CB_value(store->child_cbs, i);
  639|      0|        ret &= child_cb->create_cb((OSSL_CORE_HANDLE *)prov, child_cb->cbdata);
  640|      0|    }
  641|      2|#endif
  642|       |
  643|      2|    return ret;
  644|      2|}
provider_core.c:provider_activate:
 1257|      3|{
 1258|      3|    int count = -1;
 1259|      3|    struct provider_store_st *store;
 1260|      3|    int ret = 1;
 1261|       |
 1262|      3|    store = prov->store;
 1263|       |    /*
 1264|       |    * If the provider hasn't been added to the store, then we don't need
 1265|       |    * any locks because we've not shared it with other threads.
 1266|       |    */
 1267|      3|    if (store == NULL) {
  ------------------
  |  Branch (1267:9): [True: 3, False: 0]
  ------------------
 1268|      3|        lock = 0;
 1269|      3|        if (!provider_init(prov))
  ------------------
  |  Branch (1269:13): [True: 0, False: 3]
  ------------------
 1270|      0|            return -1;
 1271|      3|    }
 1272|       |
 1273|      3|#ifndef FIPS_MODULE
 1274|      3|    if (prov->random_bytes != NULL
  ------------------
  |  Branch (1274:9): [True: 0, False: 3]
  ------------------
 1275|      3|            && !ossl_rand_check_random_provider_on_load(prov->libctx, prov))
  ------------------
  |  Branch (1275:16): [True: 0, False: 0]
  ------------------
 1276|      0|        return -1;
 1277|       |
 1278|      3|    if (prov->ischild && upcalls && !ossl_provider_up_ref_parent(prov, 1))
  ------------------
  |  Branch (1278:9): [True: 0, False: 3]
  |  Branch (1278:26): [True: 0, False: 0]
  |  Branch (1278:37): [True: 0, False: 0]
  ------------------
 1279|      0|        return -1;
 1280|      3|#endif
 1281|       |
 1282|      3|    if (lock && !CRYPTO_THREAD_read_lock(store->lock)) {
  ------------------
  |  Branch (1282:9): [True: 0, False: 3]
  |  Branch (1282:17): [True: 0, False: 0]
  ------------------
 1283|      0|#ifndef FIPS_MODULE
 1284|      0|        if (prov->ischild && upcalls)
  ------------------
  |  Branch (1284:13): [True: 0, False: 0]
  |  Branch (1284:30): [True: 0, False: 0]
  ------------------
 1285|      0|            ossl_provider_free_parent(prov, 1);
 1286|      0|#endif
 1287|      0|        return -1;
 1288|      0|    }
 1289|       |
 1290|      3|    if (lock && !CRYPTO_THREAD_write_lock(prov->flag_lock)) {
  ------------------
  |  Branch (1290:9): [True: 0, False: 3]
  |  Branch (1290:17): [True: 0, False: 0]
  ------------------
 1291|      0|        CRYPTO_THREAD_unlock(store->lock);
 1292|      0|#ifndef FIPS_MODULE
 1293|      0|        if (prov->ischild && upcalls)
  ------------------
  |  Branch (1293:13): [True: 0, False: 0]
  |  Branch (1293:30): [True: 0, False: 0]
  ------------------
 1294|      0|            ossl_provider_free_parent(prov, 1);
 1295|      0|#endif
 1296|      0|        return -1;
 1297|      0|    }
 1298|      3|    if (CRYPTO_atomic_add(&prov->activatecnt, 1, &count, prov->activatecnt_lock)) {
  ------------------
  |  Branch (1298:9): [True: 3, False: 0]
  ------------------
 1299|      3|        prov->flag_activated = 1;
 1300|       |
 1301|      3|        if (count == 1 && store != NULL) {
  ------------------
  |  Branch (1301:13): [True: 3, False: 0]
  |  Branch (1301:27): [True: 0, False: 3]
  ------------------
 1302|      0|            ret = create_provider_children(prov);
 1303|      0|        }
 1304|      3|    }
 1305|      3|    if (lock) {
  ------------------
  |  Branch (1305:9): [True: 0, False: 3]
  ------------------
 1306|      0|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1307|      0|        CRYPTO_THREAD_unlock(store->lock);
 1308|       |        /*
 1309|       |         * This can be done outside the lock. We tolerate other threads getting
 1310|       |         * the wrong result briefly when creating OSSL_DECODER_CTXs.
 1311|       |         */
 1312|      0|#ifndef FIPS_MODULE
 1313|      0|        if (count == 1)
  ------------------
  |  Branch (1313:13): [True: 0, False: 0]
  ------------------
 1314|      0|            ossl_decoder_cache_flush(prov->libctx);
 1315|      0|#endif
 1316|      0|    }
 1317|       |
 1318|      3|    if (!ret)
  ------------------
  |  Branch (1318:9): [True: 0, False: 3]
  ------------------
 1319|      0|        return -1;
 1320|       |
 1321|      3|    return count;
 1322|      3|}
provider_core.c:provider_init:
  940|      3|{
  941|      3|    const OSSL_DISPATCH *provider_dispatch = NULL;
  942|      3|    void *tmp_provctx = NULL;    /* safety measure */
  943|      3|#ifndef OPENSSL_NO_ERR
  944|      3|# ifndef FIPS_MODULE
  945|      3|    OSSL_FUNC_provider_get_reason_strings_fn *p_get_reason_strings = NULL;
  946|      3|# endif
  947|      3|#endif
  948|      3|    int ok = 0;
  949|       |
  950|      3|    if (!ossl_assert(!prov->flag_initialized)) {
  ------------------
  |  |   52|      3|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      3|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (950:9): [True: 0, False: 3]
  ------------------
  951|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  952|      0|        goto end;
  953|      0|    }
  954|       |
  955|       |    /*
  956|       |     * If the init function isn't set, it indicates that this provider is
  957|       |     * a loadable module.
  958|       |     */
  959|      3|    if (prov->init_function == NULL) {
  ------------------
  |  Branch (959:9): [True: 0, False: 3]
  ------------------
  960|       |#ifdef FIPS_MODULE
  961|       |        goto end;
  962|       |#else
  963|      0|        if (prov->module == NULL) {
  ------------------
  |  Branch (963:13): [True: 0, False: 0]
  ------------------
  964|      0|            char *allocated_path = NULL;
  965|      0|            const char *module_path = NULL;
  966|      0|            char *merged_path = NULL;
  967|      0|            const char *load_dir = NULL;
  968|      0|            char *allocated_load_dir = NULL;
  969|      0|            struct provider_store_st *store;
  970|       |
  971|      0|            if ((prov->module = DSO_new()) == NULL) {
  ------------------
  |  Branch (971:17): [True: 0, False: 0]
  ------------------
  972|       |                /* DSO_new() generates an error already */
  973|      0|                goto end;
  974|      0|            }
  975|       |
  976|      0|            if ((store = get_provider_store(prov->libctx)) == NULL
  ------------------
  |  Branch (976:17): [True: 0, False: 0]
  ------------------
  977|      0|                    || !CRYPTO_THREAD_read_lock(store->default_path_lock))
  ------------------
  |  Branch (977:24): [True: 0, False: 0]
  ------------------
  978|      0|                goto end;
  979|       |
  980|      0|            if (store->default_path != NULL) {
  ------------------
  |  Branch (980:17): [True: 0, False: 0]
  ------------------
  981|      0|                allocated_load_dir = OPENSSL_strdup(store->default_path);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  982|      0|                CRYPTO_THREAD_unlock(store->default_path_lock);
  983|      0|                if (allocated_load_dir == NULL)
  ------------------
  |  Branch (983:21): [True: 0, False: 0]
  ------------------
  984|      0|                    goto end;
  985|      0|                load_dir = allocated_load_dir;
  986|      0|            } else {
  987|      0|                CRYPTO_THREAD_unlock(store->default_path_lock);
  988|      0|            }
  989|       |
  990|      0|            if (load_dir == NULL) {
  ------------------
  |  Branch (990:17): [True: 0, False: 0]
  ------------------
  991|      0|                load_dir = ossl_safe_getenv("OPENSSL_MODULES");
  992|      0|                if (load_dir == NULL)
  ------------------
  |  Branch (992:21): [True: 0, False: 0]
  ------------------
  993|      0|                    load_dir = ossl_get_modulesdir();
  994|      0|            }
  995|       |
  996|      0|            DSO_ctrl(prov->module, DSO_CTRL_SET_FLAGS,
  ------------------
  |  |   19|      0|# define DSO_CTRL_SET_FLAGS      2
  ------------------
  997|      0|                     DSO_FLAG_NAME_TRANSLATION_EXT_ONLY, NULL);
  ------------------
  |  |   41|      0|# define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY      0x02
  ------------------
  998|       |
  999|      0|            module_path = prov->path;
 1000|      0|            if (module_path == NULL)
  ------------------
  |  Branch (1000:17): [True: 0, False: 0]
  ------------------
 1001|      0|                module_path = allocated_path =
 1002|      0|                    DSO_convert_filename(prov->module, prov->name);
 1003|      0|            if (module_path != NULL)
  ------------------
  |  Branch (1003:17): [True: 0, False: 0]
  ------------------
 1004|      0|                merged_path = DSO_merge(prov->module, module_path, load_dir);
 1005|       |
 1006|      0|            if (merged_path == NULL
  ------------------
  |  Branch (1006:17): [True: 0, False: 0]
  ------------------
 1007|      0|                || (DSO_load(prov->module, merged_path, NULL, 0)) == NULL) {
  ------------------
  |  Branch (1007:20): [True: 0, False: 0]
  ------------------
 1008|      0|                DSO_free(prov->module);
 1009|      0|                prov->module = NULL;
 1010|      0|            }
 1011|       |
 1012|      0|            OPENSSL_free(merged_path);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1013|      0|            OPENSSL_free(allocated_path);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1014|      0|            OPENSSL_free(allocated_load_dir);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1015|      0|        }
 1016|       |
 1017|      0|        if (prov->module == NULL) {
  ------------------
  |  Branch (1017:13): [True: 0, False: 0]
  ------------------
 1018|       |            /* DSO has already recorded errors, this is just a tracepoint */
 1019|      0|            ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_DSO_LIB,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_DSO_LIB,
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_DSO_LIB,
  ------------------
  |  |  335|      0|# define ERR_R_DSO_LIB          (ERR_LIB_DSO/* 37 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   98|      0|# define ERR_LIB_DSO             37
  |  |  ------------------
  |  |               # define ERR_R_DSO_LIB          (ERR_LIB_DSO/* 37 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1020|      0|                           "name=%s", prov->name);
 1021|      0|            goto end;
 1022|      0|        }
 1023|       |
 1024|      0|        prov->init_function = (OSSL_provider_init_fn *)
 1025|      0|            DSO_bind_func(prov->module, "OSSL_provider_init");
 1026|      0|#endif
 1027|      0|    }
 1028|       |
 1029|       |    /* Check for and call the initialise function for the provider. */
 1030|      3|    if (prov->init_function == NULL) {
  ------------------
  |  Branch (1030:9): [True: 0, False: 3]
  ------------------
 1031|      0|        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_UNSUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_UNSUPPORTED,
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_UNSUPPORTED,
  ------------------
  |  |  363|      0|# define ERR_R_UNSUPPORTED                       (268|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1032|      0|                       "name=%s, provider has no provider init function",
 1033|      0|                       prov->name);
 1034|      0|        goto end;
 1035|      0|    }
 1036|      3|#ifndef FIPS_MODULE
 1037|      3|    OSSL_TRACE_BEGIN(PROVIDER) {
  ------------------
  |  |  220|      3|    do {                                        \
  |  |  221|      3|        BIO *trc_out = NULL;                    \
  |  |  222|      3|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1038|      0|        BIO_printf(trc_out,
 1039|      0|                   "(provider %s) initalizing\n", prov->name);
 1040|      3|    } OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  225|      3|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1041|      3|#endif
 1042|       |
 1043|      3|    if (!prov->init_function((OSSL_CORE_HANDLE *)prov, core_dispatch,
  ------------------
  |  Branch (1043:9): [True: 0, False: 3]
  ------------------
 1044|      3|                             &provider_dispatch, &tmp_provctx)) {
 1045|      0|        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL,
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL,
  ------------------
  |  |  356|      0|# define ERR_R_INIT_FAIL                         (261|ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  350|      0|# define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  236|      0|# define ERR_RFLAG_FATAL                (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1046|      0|                       "name=%s", prov->name);
 1047|      0|        goto end;
 1048|      0|    }
 1049|      3|    prov->provctx = tmp_provctx;
 1050|      3|    prov->dispatch = provider_dispatch;
 1051|       |
 1052|      3|    if (provider_dispatch != NULL) {
  ------------------
  |  Branch (1052:9): [True: 3, False: 0]
  ------------------
 1053|     12|        for (; provider_dispatch->function_id != 0; provider_dispatch++) {
  ------------------
  |  Branch (1053:16): [True: 9, False: 3]
  ------------------
 1054|      9|            switch (provider_dispatch->function_id) {
  ------------------
  |  Branch (1054:21): [True: 0, False: 9]
  ------------------
 1055|      3|            case OSSL_FUNC_PROVIDER_TEARDOWN:
  ------------------
  |  |  257|      3|# define OSSL_FUNC_PROVIDER_TEARDOWN           1024
  ------------------
  |  Branch (1055:13): [True: 3, False: 6]
  ------------------
 1056|      3|                prov->teardown =
 1057|      3|                    OSSL_FUNC_provider_teardown(provider_dispatch);
 1058|      3|                break;
 1059|      1|            case OSSL_FUNC_PROVIDER_GETTABLE_PARAMS:
  ------------------
  |  |  259|      1|# define OSSL_FUNC_PROVIDER_GETTABLE_PARAMS    1025
  ------------------
  |  Branch (1059:13): [True: 1, False: 8]
  ------------------
 1060|      1|                prov->gettable_params =
 1061|      1|                    OSSL_FUNC_provider_gettable_params(provider_dispatch);
 1062|      1|                break;
 1063|      1|            case OSSL_FUNC_PROVIDER_GET_PARAMS:
  ------------------
  |  |  262|      1|# define OSSL_FUNC_PROVIDER_GET_PARAMS         1026
  ------------------
  |  Branch (1063:13): [True: 1, False: 8]
  ------------------
 1064|      1|                prov->get_params =
 1065|      1|                    OSSL_FUNC_provider_get_params(provider_dispatch);
 1066|      1|                break;
 1067|      0|            case OSSL_FUNC_PROVIDER_SELF_TEST:
  ------------------
  |  |  277|      0|# define OSSL_FUNC_PROVIDER_SELF_TEST          1031
  ------------------
  |  Branch (1067:13): [True: 0, False: 9]
  ------------------
 1068|      0|                prov->self_test =
 1069|      0|                    OSSL_FUNC_provider_self_test(provider_dispatch);
 1070|      0|                break;
 1071|      0|            case OSSL_FUNC_PROVIDER_RANDOM_BYTES:
  ------------------
  |  |  279|      0|# define OSSL_FUNC_PROVIDER_RANDOM_BYTES       1032
  ------------------
  |  Branch (1071:13): [True: 0, False: 9]
  ------------------
 1072|      0|                prov->random_bytes =
 1073|      0|                    OSSL_FUNC_provider_random_bytes(provider_dispatch);
 1074|      0|                break;
 1075|      1|            case OSSL_FUNC_PROVIDER_GET_CAPABILITIES:
  ------------------
  |  |  274|      1|# define OSSL_FUNC_PROVIDER_GET_CAPABILITIES   1030
  ------------------
  |  Branch (1075:13): [True: 1, False: 8]
  ------------------
 1076|      1|                prov->get_capabilities =
 1077|      1|                    OSSL_FUNC_provider_get_capabilities(provider_dispatch);
 1078|      1|                break;
 1079|      3|            case OSSL_FUNC_PROVIDER_QUERY_OPERATION:
  ------------------
  |  |  265|      3|# define OSSL_FUNC_PROVIDER_QUERY_OPERATION    1027
  ------------------
  |  Branch (1079:13): [True: 3, False: 6]
  ------------------
 1080|      3|                prov->query_operation =
 1081|      3|                    OSSL_FUNC_provider_query_operation(provider_dispatch);
 1082|      3|                break;
 1083|      0|            case OSSL_FUNC_PROVIDER_UNQUERY_OPERATION:
  ------------------
  |  |  268|      0|# define OSSL_FUNC_PROVIDER_UNQUERY_OPERATION  1028
  ------------------
  |  Branch (1083:13): [True: 0, False: 9]
  ------------------
 1084|      0|                prov->unquery_operation =
 1085|      0|                    OSSL_FUNC_provider_unquery_operation(provider_dispatch);
 1086|      0|                break;
 1087|      0|#ifndef OPENSSL_NO_ERR
 1088|      0|# ifndef FIPS_MODULE
 1089|      0|            case OSSL_FUNC_PROVIDER_GET_REASON_STRINGS:
  ------------------
  |  |  271|      0|# define OSSL_FUNC_PROVIDER_GET_REASON_STRINGS 1029
  ------------------
  |  Branch (1089:13): [True: 0, False: 9]
  ------------------
 1090|      0|                p_get_reason_strings =
 1091|      0|                    OSSL_FUNC_provider_get_reason_strings(provider_dispatch);
 1092|      0|                break;
 1093|      9|# endif
 1094|      9|#endif
 1095|      9|            }
 1096|      9|        }
 1097|      3|    }
 1098|       |
 1099|      3|#ifndef OPENSSL_NO_ERR
 1100|      3|# ifndef FIPS_MODULE
 1101|      3|    if (p_get_reason_strings != NULL) {
  ------------------
  |  Branch (1101:9): [True: 0, False: 3]
  ------------------
 1102|      0|        const OSSL_ITEM *reasonstrings = p_get_reason_strings(prov->provctx);
 1103|      0|        size_t cnt, cnt2;
 1104|       |
 1105|       |        /*
 1106|       |         * ERR_load_strings() handles ERR_STRING_DATA rather than OSSL_ITEM,
 1107|       |         * although they are essentially the same type.
 1108|       |         * Furthermore, ERR_load_strings() patches the array's error number
 1109|       |         * with the error library number, so we need to make a copy of that
 1110|       |         * array either way.
 1111|       |         */
 1112|      0|        cnt = 0;
 1113|      0|        while (reasonstrings[cnt].id != 0) {
  ------------------
  |  Branch (1113:16): [True: 0, False: 0]
  ------------------
 1114|      0|            if (ERR_GET_LIB(reasonstrings[cnt].id) != 0)
  ------------------
  |  Branch (1114:17): [True: 0, False: 0]
  ------------------
 1115|      0|                goto end;
 1116|      0|            cnt++;
 1117|      0|        }
 1118|      0|        cnt++;                   /* One for the terminating item */
 1119|       |
 1120|       |        /* Allocate one extra item for the "library" name */
 1121|      0|        prov->error_strings =
 1122|      0|            OPENSSL_zalloc(sizeof(ERR_STRING_DATA) * (cnt + 1));
  ------------------
  |  |  104|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1123|      0|        if (prov->error_strings == NULL)
  ------------------
  |  Branch (1123:13): [True: 0, False: 0]
  ------------------
 1124|      0|            goto end;
 1125|       |
 1126|       |        /*
 1127|       |         * Set the "library" name.
 1128|       |         */
 1129|      0|        prov->error_strings[0].error = ERR_PACK(prov->error_lib, 0, 0);
  ------------------
  |  |  279|      0|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|      0|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|      0|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|      0|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|      0|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
 1130|      0|        prov->error_strings[0].string = prov->name;
 1131|       |        /*
 1132|       |         * Copy reasonstrings item 0..cnt-1 to prov->error_trings positions
 1133|       |         * 1..cnt.
 1134|       |         */
 1135|      0|        for (cnt2 = 1; cnt2 <= cnt; cnt2++) {
  ------------------
  |  Branch (1135:24): [True: 0, False: 0]
  ------------------
 1136|      0|            prov->error_strings[cnt2].error = (int)reasonstrings[cnt2-1].id;
 1137|      0|            prov->error_strings[cnt2].string = reasonstrings[cnt2-1].ptr;
 1138|      0|        }
 1139|       |
 1140|      0|        ERR_load_strings(prov->error_lib, prov->error_strings);
 1141|      0|    }
 1142|      3|# endif
 1143|      3|#endif
 1144|       |
 1145|       |    /* With this flag set, this provider has become fully "loaded". */
 1146|      3|    prov->flag_initialized = 1;
 1147|      3|    ok = 1;
 1148|       |
 1149|      3| end:
 1150|      3|    return ok;
 1151|      3|}
provider_core.c:core_get_params:
 2309|      3|{
 2310|      3|    OSSL_PARAM *p;
 2311|       |    /*
 2312|       |     * We created this object originally and we know it is actually an
 2313|       |     * OSSL_PROVIDER *, so the cast is safe
 2314|       |     */
 2315|      3|    OSSL_PROVIDER *prov = (OSSL_PROVIDER *)handle;
 2316|       |
 2317|      3|    if ((p = OSSL_PARAM_locate(params, OSSL_PROV_PARAM_CORE_VERSION)) != NULL)
  ------------------
  |  |  495|      3|# define OSSL_PROV_PARAM_CORE_VERSION "openssl-version"
  ------------------
  |  Branch (2317:9): [True: 0, False: 3]
  ------------------
 2318|      0|        OSSL_PARAM_set_utf8_ptr(p, OPENSSL_VERSION_STR);
  ------------------
  |  |   77|      0|# define OPENSSL_VERSION_STR "3.6.0"
  ------------------
 2319|      3|    if ((p = OSSL_PARAM_locate(params, OSSL_PROV_PARAM_CORE_PROV_NAME)) != NULL)
  ------------------
  |  |  494|      3|# define OSSL_PROV_PARAM_CORE_PROV_NAME "provider-name"
  ------------------
  |  Branch (2319:9): [True: 0, False: 3]
  ------------------
 2320|      0|        OSSL_PARAM_set_utf8_ptr(p, prov->name);
 2321|       |
 2322|      3|#ifndef FIPS_MODULE
 2323|      3|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (2323:9): [True: 0, False: 3]
  ------------------
 2324|      3|                               OSSL_PROV_PARAM_CORE_MODULE_FILENAME)) != NULL)
  ------------------
  |  |  493|      3|# define OSSL_PROV_PARAM_CORE_MODULE_FILENAME "module-filename"
  ------------------
 2325|      0|        OSSL_PARAM_set_utf8_ptr(p, ossl_provider_module_path(prov));
 2326|      3|#endif
 2327|       |
 2328|      3|    return OSSL_PROVIDER_get_conf_parameters(prov, params);
 2329|      3|}
provider_core.c:core_get_libctx:
 2332|      1|{
 2333|       |    /*
 2334|       |     * We created this object originally and we know it is actually an
 2335|       |     * OSSL_PROVIDER *, so the cast is safe
 2336|       |     */
 2337|      1|    OSSL_PROVIDER *prov = (OSSL_PROVIDER *)handle;
 2338|       |
 2339|       |    /*
 2340|       |     * Using ossl_provider_libctx would be wrong as that returns
 2341|       |     * NULL for |prov| == NULL and NULL libctx has a special meaning
 2342|       |     * that does not apply here. Here |prov| == NULL can happen only in
 2343|       |     * case of a coding error.
 2344|       |     */
 2345|      1|    assert(prov != NULL);
 2346|      1|    return (OPENSSL_CORE_CTX *)prov->libctx;
 2347|      1|}
provider_core.c:provider_flush_store_cache:
 1325|      2|{
 1326|      2|    struct provider_store_st *store;
 1327|      2|    int freeing;
 1328|       |
 1329|      2|    if ((store = get_provider_store(prov->libctx)) == NULL)
  ------------------
  |  Branch (1329:9): [True: 0, False: 2]
  ------------------
 1330|      0|        return 0;
 1331|       |
 1332|      2|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1332:9): [True: 0, False: 2]
  ------------------
 1333|      0|        return 0;
 1334|      2|    freeing = store->freeing;
 1335|      2|    CRYPTO_THREAD_unlock(store->lock);
 1336|       |
 1337|      2|    if (!freeing) {
  ------------------
  |  Branch (1337:9): [True: 2, False: 0]
  ------------------
 1338|      2|        int acc
 1339|      2|            = evp_method_store_cache_flush(prov->libctx)
 1340|      2|#ifndef FIPS_MODULE
 1341|      2|            + ossl_encoder_store_cache_flush(prov->libctx)
 1342|      2|            + ossl_decoder_store_cache_flush(prov->libctx)
 1343|      2|            + ossl_store_loader_store_cache_flush(prov->libctx)
 1344|      2|#endif
 1345|      2|            ;
 1346|       |
 1347|      2|#ifndef FIPS_MODULE
 1348|      2|        return acc == 4;
 1349|       |#else
 1350|       |        return acc == 1;
 1351|       |#endif
 1352|      2|    }
 1353|      0|    return 1;
 1354|      2|}
provider_core.c:provider_deactivate:
 1161|      3|{
 1162|      3|    int count;
 1163|      3|    struct provider_store_st *store;
 1164|      3|#ifndef FIPS_MODULE
 1165|      3|    int freeparent = 0;
 1166|      3|#endif
 1167|      3|    int lock = 1;
 1168|       |
 1169|      3|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|      3|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      3|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1169:9): [True: 0, False: 3]
  ------------------
 1170|      0|        return -1;
 1171|       |
 1172|      3|#ifndef FIPS_MODULE
 1173|      3|    if (prov->random_bytes != NULL
  ------------------
  |  Branch (1173:9): [True: 0, False: 3]
  ------------------
 1174|      3|            && !ossl_rand_check_random_provider_on_unload(prov->libctx, prov))
  ------------------
  |  Branch (1174:16): [True: 0, False: 0]
  ------------------
 1175|      0|        return -1;
 1176|      3|#endif
 1177|       |
 1178|       |    /*
 1179|       |     * No need to lock if we've got no store because we've not been shared with
 1180|       |     * other threads.
 1181|       |     */
 1182|      3|    store = get_provider_store(prov->libctx);
 1183|      3|    if (store == NULL)
  ------------------
  |  Branch (1183:9): [True: 0, False: 3]
  ------------------
 1184|      0|        lock = 0;
 1185|       |
 1186|      3|    if (lock && !CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1186:9): [True: 3, False: 0]
  |  Branch (1186:17): [True: 0, False: 3]
  ------------------
 1187|      0|        return -1;
 1188|      3|    if (lock && !CRYPTO_THREAD_write_lock(prov->flag_lock)) {
  ------------------
  |  Branch (1188:9): [True: 3, False: 0]
  |  Branch (1188:17): [True: 0, False: 3]
  ------------------
 1189|      0|        CRYPTO_THREAD_unlock(store->lock);
 1190|      0|        return -1;
 1191|      0|    }
 1192|       |
 1193|      3|    if (!CRYPTO_atomic_add(&prov->activatecnt, -1, &count, prov->activatecnt_lock)) {
  ------------------
  |  Branch (1193:9): [True: 0, False: 3]
  ------------------
 1194|      0|        if (lock) {
  ------------------
  |  Branch (1194:13): [True: 0, False: 0]
  ------------------
 1195|      0|            CRYPTO_THREAD_unlock(prov->flag_lock);
 1196|      0|            CRYPTO_THREAD_unlock(store->lock);
 1197|      0|        }
 1198|      0|        return -1;
 1199|      0|    }
 1200|       |
 1201|      3|#ifndef FIPS_MODULE
 1202|      3|    if (count >= 1 && prov->ischild && upcalls) {
  ------------------
  |  Branch (1202:9): [True: 0, False: 3]
  |  Branch (1202:23): [True: 0, False: 0]
  |  Branch (1202:40): [True: 0, False: 0]
  ------------------
 1203|       |        /*
 1204|       |         * We have had a direct activation in this child libctx so we need to
 1205|       |         * now down the ref count in the parent provider. We do the actual down
 1206|       |         * ref outside of the flag_lock, since it could involve getting other
 1207|       |         * locks.
 1208|       |         */
 1209|      0|        freeparent = 1;
 1210|      0|    }
 1211|      3|#endif
 1212|       |
 1213|      3|    if (count < 1)
  ------------------
  |  Branch (1213:9): [True: 3, False: 0]
  ------------------
 1214|      3|        prov->flag_activated = 0;
 1215|      0|#ifndef FIPS_MODULE
 1216|      0|    else
 1217|      0|        removechildren = 0;
 1218|      3|#endif
 1219|       |
 1220|      3|#ifndef FIPS_MODULE
 1221|      3|    if (removechildren && store != NULL) {
  ------------------
  |  Branch (1221:9): [True: 3, False: 0]
  |  Branch (1221:27): [True: 3, False: 0]
  ------------------
 1222|      3|        int i, max = sk_OSSL_PROVIDER_CHILD_CB_num(store->child_cbs);
 1223|      3|        OSSL_PROVIDER_CHILD_CB *child_cb;
 1224|       |
 1225|      3|        for (i = 0; i < max; i++) {
  ------------------
  |  Branch (1225:21): [True: 0, False: 3]
  ------------------
 1226|      0|            child_cb = sk_OSSL_PROVIDER_CHILD_CB_value(store->child_cbs, i);
 1227|      0|            child_cb->remove_cb((OSSL_CORE_HANDLE *)prov, child_cb->cbdata);
 1228|      0|        }
 1229|      3|    }
 1230|      3|#endif
 1231|      3|    if (lock) {
  ------------------
  |  Branch (1231:9): [True: 3, False: 0]
  ------------------
 1232|      3|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1233|      3|        CRYPTO_THREAD_unlock(store->lock);
 1234|       |        /*
 1235|       |         * This can be done outside the lock. We tolerate other threads getting
 1236|       |         * the wrong result briefly when creating OSSL_DECODER_CTXs.
 1237|       |         */
 1238|      3|#ifndef FIPS_MODULE
 1239|      3|        if (count < 1)
  ------------------
  |  Branch (1239:13): [True: 3, False: 0]
  ------------------
 1240|      3|            ossl_decoder_cache_flush(prov->libctx);
 1241|      3|#endif
 1242|      3|    }
 1243|      3|#ifndef FIPS_MODULE
 1244|      3|    if (freeparent)
  ------------------
  |  Branch (1244:9): [True: 0, False: 3]
  ------------------
 1245|      0|        ossl_provider_free_parent(prov, 1);
 1246|      3|#endif
 1247|       |
 1248|       |    /* We don't deinit here, that's done in ossl_provider_free() */
 1249|      3|    return count;
 1250|      3|}
provider_core.c:provider_remove_store_methods:
 1357|      3|{
 1358|      3|    struct provider_store_st *store;
 1359|      3|    int freeing;
 1360|       |
 1361|      3|    if ((store = get_provider_store(prov->libctx)) == NULL)
  ------------------
  |  Branch (1361:9): [True: 0, False: 3]
  ------------------
 1362|      0|        return 0;
 1363|       |
 1364|      3|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1364:9): [True: 0, False: 3]
  ------------------
 1365|      0|        return 0;
 1366|      3|    freeing = store->freeing;
 1367|      3|    CRYPTO_THREAD_unlock(store->lock);
 1368|       |
 1369|      3|    if (!freeing) {
  ------------------
  |  Branch (1369:9): [True: 0, False: 3]
  ------------------
 1370|      0|        int acc;
 1371|       |
 1372|      0|        if (!CRYPTO_THREAD_write_lock(prov->opbits_lock))
  ------------------
  |  Branch (1372:13): [True: 0, False: 0]
  ------------------
 1373|      0|            return 0;
 1374|      0|        OPENSSL_free(prov->operation_bits);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1375|      0|        prov->operation_bits = NULL;
 1376|      0|        prov->operation_bits_sz = 0;
 1377|      0|        CRYPTO_THREAD_unlock(prov->opbits_lock);
 1378|       |
 1379|      0|        acc = evp_method_store_remove_all_provided(prov)
 1380|      0|#ifndef FIPS_MODULE
 1381|      0|            + ossl_encoder_store_remove_all_provided(prov)
 1382|      0|            + ossl_decoder_store_remove_all_provided(prov)
 1383|      0|            + ossl_store_loader_store_remove_all_provided(prov)
 1384|      0|#endif
 1385|      0|            ;
 1386|       |
 1387|      0|#ifndef FIPS_MODULE
 1388|      0|        return acc == 4;
 1389|       |#else
 1390|       |        return acc == 1;
 1391|       |#endif
 1392|      0|    }
 1393|      3|    return 1;
 1394|      3|}
provider_core.c:provider_activate_fallbacks:
 1437|  6.60k|{
 1438|  6.60k|    int use_fallbacks;
 1439|  6.60k|    int activated_fallback_count = 0;
 1440|  6.60k|    int ret = 0;
 1441|  6.60k|    const OSSL_PROVIDER_INFO *p;
 1442|       |
 1443|  6.60k|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1443:9): [True: 0, False: 6.60k]
  ------------------
 1444|      0|        return 0;
 1445|  6.60k|    use_fallbacks = store->use_fallbacks;
 1446|  6.60k|    CRYPTO_THREAD_unlock(store->lock);
 1447|  6.60k|    if (!use_fallbacks)
  ------------------
  |  Branch (1447:9): [True: 6.60k, False: 1]
  ------------------
 1448|  6.60k|        return 1;
 1449|       |
 1450|      1|    if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (1450:9): [True: 0, False: 1]
  ------------------
 1451|      0|        return 0;
 1452|       |    /* Check again, just in case another thread changed it */
 1453|      1|    use_fallbacks = store->use_fallbacks;
 1454|      1|    if (!use_fallbacks) {
  ------------------
  |  Branch (1454:9): [True: 0, False: 1]
  ------------------
 1455|      0|        CRYPTO_THREAD_unlock(store->lock);
 1456|      0|        return 1;
 1457|      0|    }
 1458|       |
 1459|      4|    for (p = ossl_predefined_providers; p->name != NULL; p++) {
  ------------------
  |  Branch (1459:41): [True: 3, False: 1]
  ------------------
 1460|      3|        OSSL_PROVIDER *prov = NULL;
 1461|      3|        OSSL_PROVIDER_INFO *info = store->provinfo;
 1462|      3|        STACK_OF(INFOPAIR) *params = NULL;
  ------------------
  |  |   31|      3|# define STACK_OF(type) struct stack_st_##type
  ------------------
 1463|      3|        size_t i;
 1464|       |
 1465|      3|        if (!p->is_fallback)
  ------------------
  |  Branch (1465:13): [True: 2, False: 1]
  ------------------
 1466|      2|            continue;
 1467|       |
 1468|      2|        for (i = 0; i < store->numprovinfo; info++, i++) {
  ------------------
  |  Branch (1468:21): [True: 1, False: 1]
  ------------------
 1469|      1|            if (strcmp(info->name, p->name) != 0)
  ------------------
  |  Branch (1469:17): [True: 1, False: 0]
  ------------------
 1470|      1|                continue;
 1471|      0|            params = info->parameters;
 1472|      0|            break;
 1473|      1|        }
 1474|       |
 1475|       |        /*
 1476|       |         * We use the internal constructor directly here,
 1477|       |         * otherwise we get a call loop
 1478|       |         */
 1479|      1|        prov = provider_new(p->name, p->init, params);
 1480|      1|        if (prov == NULL)
  ------------------
  |  Branch (1480:13): [True: 0, False: 1]
  ------------------
 1481|      0|            goto err;
 1482|      1|        prov->libctx = store->libctx;
 1483|      1|#ifndef FIPS_MODULE
 1484|      1|        prov->error_lib = ERR_get_next_error_library();
 1485|      1|#endif
 1486|       |
 1487|       |        /*
 1488|       |         * We are calling provider_activate while holding the store lock. This
 1489|       |         * means the init function will be called while holding a lock. Normally
 1490|       |         * we try to avoid calling a user callback while holding a lock.
 1491|       |         * However, fallbacks are never third party providers so we accept this.
 1492|       |         */
 1493|      1|        if (provider_activate(prov, 0, 0) < 0) {
  ------------------
  |  Branch (1493:13): [True: 0, False: 1]
  ------------------
 1494|      0|            ossl_provider_free(prov);
 1495|      0|            goto err;
 1496|      0|        }
 1497|      1|        prov->store = store;
 1498|      1|        if (sk_OSSL_PROVIDER_push(store->providers, prov) == 0) {
  ------------------
  |  Branch (1498:13): [True: 0, False: 1]
  ------------------
 1499|      0|            ossl_provider_free(prov);
 1500|      0|            goto err;
 1501|      0|        }
 1502|      1|        activated_fallback_count++;
 1503|      1|    }
 1504|       |
 1505|      1|    if (activated_fallback_count > 0) {
  ------------------
  |  Branch (1505:9): [True: 1, False: 0]
  ------------------
 1506|      1|        store->use_fallbacks = 0;
 1507|      1|        ret = 1;
 1508|      1|    }
 1509|      1| err:
 1510|      1|    CRYPTO_THREAD_unlock(store->lock);
 1511|      1|    return ret;
 1512|      1|}

ossl_err_load_RAND_strings:
  105|      2|{
  106|      2|#ifndef OPENSSL_NO_ERR
  107|      2|    if (ERR_reason_error_string(RAND_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (107:9): [True: 2, False: 0]
  ------------------
  108|      2|        ERR_load_strings_const(RAND_str_reasons);
  109|      2|#endif
  110|      2|    return 1;
  111|      2|}

ossl_rand_cleanup_int:
  180|      2|{
  181|      2|# ifndef OPENSSL_NO_DEPRECATED_3_0
  182|      2|    const RAND_METHOD *meth = default_RAND_meth;
  183|       |
  184|      2|    if (!rand_inited)
  ------------------
  |  Branch (184:9): [True: 1, False: 1]
  ------------------
  185|      1|        return;
  186|       |
  187|      1|    if (meth != NULL && meth->cleanup != NULL)
  ------------------
  |  Branch (187:9): [True: 1, False: 0]
  |  Branch (187:25): [True: 0, False: 1]
  ------------------
  188|      0|        meth->cleanup();
  189|      1|    RAND_set_rand_method(NULL);
  190|      1|# endif     /* !OPENSSL_NO_DEPRECATED_3_0 */
  191|      1|    ossl_rand_pool_cleanup();
  192|      1|# ifndef OPENSSL_NO_ENGINE
  193|      1|    CRYPTO_THREAD_lock_free(rand_engine_lock);
  194|      1|    rand_engine_lock = NULL;
  195|      1|# endif     /* !OPENSSL_NO_ENGINE */
  196|      1|# ifndef OPENSSL_NO_DEPRECATED_3_0
  197|      1|    CRYPTO_THREAD_lock_free(rand_meth_lock);
  198|      1|    rand_meth_lock = NULL;
  199|      1|# endif     /* !OPENSSL_NO_DEPRECATED_3_0 */
  200|      1|    ossl_release_default_drbg_ctx();
  201|      1|    rand_inited = 0;
  202|      1|}
RAND_set_rand_method:
  281|      1|{
  282|      1|    return rand_set_rand_method_internal(meth, NULL);
  283|      1|}
RAND_get_rand_method:
  286|  58.7k|{
  287|  58.7k|    const RAND_METHOD *tmp_meth = NULL;
  288|       |
  289|  58.7k|    if (!RUN_ONCE(&rand_init, do_rand_init))
  ------------------
  |  |  130|  58.7k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 58.7k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (289:9): [True: 0, False: 58.7k]
  ------------------
  290|      0|        return NULL;
  291|       |
  292|  58.7k|    if (rand_meth_lock == NULL)
  ------------------
  |  Branch (292:9): [True: 0, False: 58.7k]
  ------------------
  293|      0|        return NULL;
  294|       |
  295|  58.7k|    if (!CRYPTO_THREAD_read_lock(rand_meth_lock))
  ------------------
  |  Branch (295:9): [True: 0, False: 58.7k]
  ------------------
  296|      0|        return NULL;
  297|  58.7k|    tmp_meth = default_RAND_meth;
  298|  58.7k|    CRYPTO_THREAD_unlock(rand_meth_lock);
  299|  58.7k|    if (tmp_meth != NULL)
  ------------------
  |  Branch (299:9): [True: 58.7k, False: 1]
  ------------------
  300|  58.7k|        return tmp_meth;
  301|       |
  302|      1|    if (!CRYPTO_THREAD_write_lock(rand_meth_lock))
  ------------------
  |  Branch (302:9): [True: 0, False: 1]
  ------------------
  303|      0|        return NULL;
  304|      1|    if (default_RAND_meth == NULL) {
  ------------------
  |  Branch (304:9): [True: 1, False: 0]
  ------------------
  305|      1|#  ifndef OPENSSL_NO_ENGINE
  306|      1|        ENGINE *e;
  307|       |
  308|       |        /* If we have an engine that can do RAND, use it. */
  309|      1|        if ((e = ENGINE_get_default_RAND()) != NULL
  ------------------
  |  Branch (309:13): [True: 0, False: 1]
  ------------------
  310|      1|                && (tmp_meth = ENGINE_get_RAND(e)) != NULL) {
  ------------------
  |  Branch (310:20): [True: 0, False: 0]
  ------------------
  311|      0|            funct_ref = e;
  312|      0|            default_RAND_meth = tmp_meth;
  313|      1|        } else {
  314|      1|            ENGINE_finish(e);
  315|      1|            default_RAND_meth = &ossl_rand_meth;
  316|      1|        }
  317|       |#  else
  318|       |        default_RAND_meth = &ossl_rand_meth;
  319|       |#  endif
  320|      1|    }
  321|      1|    tmp_meth = default_RAND_meth;
  322|      1|    CRYPTO_THREAD_unlock(rand_meth_lock);
  323|      1|    return tmp_meth;
  324|      1|}
RAND_priv_bytes_ex:
  438|  58.7k|{
  439|  58.7k|    RAND_GLOBAL *dgbl;
  440|  58.7k|    EVP_RAND_CTX *rand;
  441|  58.7k|#if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE)
  442|  58.7k|    const RAND_METHOD *meth = RAND_get_rand_method();
  443|       |
  444|  58.7k|    if (meth != NULL && meth != RAND_OpenSSL()) {
  ------------------
  |  Branch (444:9): [True: 58.7k, False: 0]
  |  Branch (444:25): [True: 0, False: 58.7k]
  ------------------
  445|      0|        if (meth->bytes != NULL)
  ------------------
  |  Branch (445:13): [True: 0, False: 0]
  ------------------
  446|      0|            return meth->bytes(buf, num);
  447|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  448|      0|        return -1;
  449|      0|    }
  450|  58.7k|#endif
  451|       |
  452|  58.7k|    dgbl = rand_get_global(ctx);
  453|  58.7k|    if (dgbl == NULL)
  ------------------
  |  Branch (453:9): [True: 0, False: 58.7k]
  ------------------
  454|      0|        return 0;
  455|  58.7k|#ifndef FIPS_MODULE
  456|  58.7k|    if (dgbl->random_provider != NULL)
  ------------------
  |  Branch (456:9): [True: 0, False: 58.7k]
  ------------------
  457|      0|        return ossl_provider_random_bytes(dgbl->random_provider,
  458|      0|                                          OSSL_PROV_RANDOM_PRIVATE,
  ------------------
  |  |  125|      0|# define OSSL_PROV_RANDOM_PRIVATE    1
  ------------------
  459|      0|                                          buf, num, strength);
  460|  58.7k|#endif      /* !FIPS_MODULE */
  461|  58.7k|    rand = rand_get0_private(ctx, dgbl);
  462|  58.7k|    if (rand != NULL)
  ------------------
  |  Branch (462:9): [True: 58.7k, False: 0]
  ------------------
  463|  58.7k|        return EVP_RAND_generate(rand, buf, num, strength, 0, NULL, 0);
  464|       |
  465|      0|    return 0;
  466|  58.7k|}
ossl_rand_ctx_new:
  520|      4|{
  521|      4|    RAND_GLOBAL *dgbl = OPENSSL_zalloc(sizeof(*dgbl));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  522|       |
  523|      4|    if (dgbl == NULL)
  ------------------
  |  Branch (523:9): [True: 0, False: 4]
  ------------------
  524|      0|        return NULL;
  525|       |
  526|      4|#ifndef FIPS_MODULE
  527|       |    /*
  528|       |     * We need to ensure that base libcrypto thread handling has been
  529|       |     * initialised.
  530|       |     */
  531|      4|    OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL);
  ------------------
  |  |   31|      4|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  532|       |
  533|       |    /* Prepopulate the random provider name */
  534|      4|    dgbl->random_provider_name = OPENSSL_strdup(random_provider_fips_name);
  ------------------
  |  |  119|      4|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  535|      4|    if (dgbl->random_provider_name == NULL)
  ------------------
  |  Branch (535:9): [True: 0, False: 4]
  ------------------
  536|      0|        goto err0;
  537|      4|#endif
  538|       |
  539|      4|    dgbl->lock = CRYPTO_THREAD_lock_new();
  540|      4|    if (dgbl->lock == NULL)
  ------------------
  |  Branch (540:9): [True: 0, False: 4]
  ------------------
  541|      0|        goto err1;
  542|       |
  543|      4|    if (!CRYPTO_THREAD_init_local(&dgbl->private, NULL))
  ------------------
  |  Branch (543:9): [True: 0, False: 4]
  ------------------
  544|      0|        goto err1;
  545|       |
  546|      4|    if (!CRYPTO_THREAD_init_local(&dgbl->public, NULL))
  ------------------
  |  Branch (546:9): [True: 0, False: 4]
  ------------------
  547|      0|        goto err2;
  548|       |
  549|      4|    return dgbl;
  550|       |
  551|      0| err2:
  552|      0|    CRYPTO_THREAD_cleanup_local(&dgbl->private);
  553|      0| err1:
  554|      0|    CRYPTO_THREAD_lock_free(dgbl->lock);
  555|      0|#ifndef FIPS_MODULE
  556|      0| err0:
  557|      0|    OPENSSL_free(dgbl->random_provider_name);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  558|      0|#endif
  559|      0|    OPENSSL_free(dgbl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  560|      0|    return NULL;
  561|      0|}
ossl_rand_ctx_free:
  564|      2|{
  565|      2|    RAND_GLOBAL *dgbl = vdgbl;
  566|       |
  567|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (567:9): [True: 0, False: 2]
  ------------------
  568|      0|        return;
  569|       |
  570|      2|    CRYPTO_THREAD_lock_free(dgbl->lock);
  571|      2|    CRYPTO_THREAD_cleanup_local(&dgbl->private);
  572|      2|    CRYPTO_THREAD_cleanup_local(&dgbl->public);
  573|      2|    EVP_RAND_CTX_free(dgbl->primary);
  574|      2|    EVP_RAND_CTX_free(dgbl->seed);
  575|      2|#ifndef FIPS_MODULE
  576|      2|    OPENSSL_free(dgbl->random_provider_name);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  577|      2|#endif      /* !FIPS_MODULE */
  578|      2|    OPENSSL_free(dgbl->rng_name);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  579|      2|    OPENSSL_free(dgbl->rng_cipher);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  580|      2|    OPENSSL_free(dgbl->rng_digest);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  581|      2|    OPENSSL_free(dgbl->rng_propq);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  582|      2|    OPENSSL_free(dgbl->seed_name);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  583|      2|    OPENSSL_free(dgbl->seed_propq);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  584|       |
  585|      2|    OPENSSL_free(dgbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  586|      2|}
RAND_set_DRBG_type:
 1067|      2|{
 1068|      2|    RAND_GLOBAL *dgbl = rand_get_global(ctx);
 1069|       |
 1070|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (1070:9): [True: 0, False: 2]
  ------------------
 1071|      0|        return 0;
 1072|      2|    if (dgbl->primary != NULL) {
  ------------------
  |  Branch (1072:9): [True: 0, False: 2]
  ------------------
 1073|      0|        ERR_raise(ERR_LIB_CRYPTO, RAND_R_ALREADY_INSTANTIATED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1074|      0|        return 0;
 1075|      0|    }
 1076|      2|    return random_set_string(&dgbl->rng_name, drbg)
  ------------------
  |  Branch (1076:12): [True: 2, False: 0]
  ------------------
 1077|      2|        && random_set_string(&dgbl->rng_propq, propq)
  ------------------
  |  Branch (1077:12): [True: 2, False: 0]
  ------------------
 1078|      2|        && random_set_string(&dgbl->rng_cipher, cipher)
  ------------------
  |  Branch (1078:12): [True: 2, False: 0]
  ------------------
 1079|      2|        && random_set_string(&dgbl->rng_digest, digest);
  ------------------
  |  Branch (1079:12): [True: 2, False: 0]
  ------------------
 1080|      2|}
rand_lib.c:do_rand_init:
  148|      1|{
  149|      1|# ifndef OPENSSL_NO_ENGINE
  150|      1|    rand_engine_lock = CRYPTO_THREAD_lock_new();
  151|      1|    if (rand_engine_lock == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 1]
  ------------------
  152|      0|        return 0;
  153|      1|# endif     /* !OPENSSL_NO_ENGINE */
  154|       |
  155|      1|# ifndef OPENSSL_NO_DEPRECATED_3_0
  156|      1|    rand_meth_lock = CRYPTO_THREAD_lock_new();
  157|      1|    if (rand_meth_lock == NULL)
  ------------------
  |  Branch (157:9): [True: 0, False: 1]
  ------------------
  158|      0|        goto err;
  159|      1|# endif     /* !OPENSSL_NO_DEPRECATED_3_0 */
  160|       |
  161|      1|    if (!ossl_rand_pool_init())
  ------------------
  |  Branch (161:9): [True: 0, False: 1]
  ------------------
  162|      0|        goto err;
  163|       |
  164|      1|    rand_inited = 1;
  165|      1|    return 1;
  166|       |
  167|      0| err:
  168|      0|# ifndef OPENSSL_NO_DEPRECATED_3_0
  169|      0|    CRYPTO_THREAD_lock_free(rand_meth_lock);
  170|      0|    rand_meth_lock = NULL;
  171|      0|# endif     /* !OPENSSL_NO_DEPRECATED_3_0 */
  172|      0|# ifndef OPENSSL_NO_ENGINE
  173|      0|    CRYPTO_THREAD_lock_free(rand_engine_lock);
  174|      0|    rand_engine_lock = NULL;
  175|      0|# endif     /* !OPENSSL_NO_ENGINE */
  176|      0|    return 0;
  177|      1|}
rand_lib.c:rand_set_rand_method_internal:
  265|      1|{
  266|      1|    if (!RUN_ONCE(&rand_init, do_rand_init))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (266:9): [True: 0, False: 1]
  ------------------
  267|      0|        return 0;
  268|       |
  269|      1|    if (!CRYPTO_THREAD_write_lock(rand_meth_lock))
  ------------------
  |  Branch (269:9): [True: 0, False: 1]
  ------------------
  270|      0|        return 0;
  271|      1|#  ifndef OPENSSL_NO_ENGINE
  272|      1|    ENGINE_finish(funct_ref);
  273|      1|    funct_ref = e;
  274|      1|#  endif
  275|      1|    default_RAND_meth = meth;
  276|      1|    CRYPTO_THREAD_unlock(rand_meth_lock);
  277|      1|    return 1;
  278|      1|}
rand_lib.c:rand_get_global:
  100|  58.7k|{
  101|  58.7k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DRBG_INDEX);
  ------------------
  |  |  103|  58.7k|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  102|  58.7k|}
rand_lib.c:rand_get0_primary:
  760|      1|{
  761|      1|    EVP_RAND_CTX *ret, *seed, *newseed = NULL, *primary;
  762|       |
  763|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (763:9): [True: 0, False: 1]
  ------------------
  764|      0|        return NULL;
  765|       |
  766|      1|    if (!CRYPTO_THREAD_read_lock(dgbl->lock))
  ------------------
  |  Branch (766:9): [True: 0, False: 1]
  ------------------
  767|      0|        return NULL;
  768|       |
  769|      1|    ret = dgbl->primary;
  770|      1|    seed = dgbl->seed;
  771|      1|    CRYPTO_THREAD_unlock(dgbl->lock);
  772|       |
  773|      1|    if (ret != NULL)
  ------------------
  |  Branch (773:9): [True: 0, False: 1]
  ------------------
  774|      0|        return ret;
  775|       |
  776|      1|#if !defined(FIPS_MODULE) || !defined(OPENSSL_NO_FIPS_JITTER)
  777|       |    /* Create a seed source for libcrypto or jitter enabled FIPS provider */
  778|      1|    if (seed == NULL) {
  ------------------
  |  Branch (778:9): [True: 1, False: 0]
  ------------------
  779|      1|        ERR_set_mark();
  780|      1|        seed = newseed = rand_new_seed(ctx);
  781|      1|        ERR_pop_to_mark();
  782|      1|    }
  783|      1|#endif  /* !FIPS_MODULE || !OPENSSL_NO_FIPS_JITTER */
  784|       |
  785|       |#if defined(FIPS_MODULE)
  786|       |    /* The FIPS provider has entropy health tests instead of the primary */
  787|       |    ret = rand_new_crngt(ctx, seed);
  788|       |#else   /* FIPS_MODULE */
  789|      1|    ret = rand_new_drbg(ctx, seed, PRIMARY_RESEED_INTERVAL,
  ------------------
  |  |   23|      1|# define PRIMARY_RESEED_INTERVAL                 (1 << 8)
  ------------------
  790|      1|                        PRIMARY_RESEED_TIME_INTERVAL);
  ------------------
  |  |   25|      1|# define PRIMARY_RESEED_TIME_INTERVAL            (60 * 60) /* 1 hour */
  ------------------
  791|      1|#endif  /* FIPS_MODULE */
  792|       |
  793|       |    /*
  794|       |     * The primary DRBG may be shared between multiple threads so we must
  795|       |     * enable locking.
  796|       |     */
  797|      1|    if (ret == NULL || !EVP_RAND_enable_locking(ret)) {
  ------------------
  |  Branch (797:9): [True: 0, False: 1]
  |  Branch (797:24): [True: 0, False: 1]
  ------------------
  798|      0|        if (ret != NULL) {
  ------------------
  |  Branch (798:13): [True: 0, False: 0]
  ------------------
  799|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_UNABLE_TO_ENABLE_LOCKING);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  800|      0|            EVP_RAND_CTX_free(ret);
  801|      0|        }
  802|      0|        if (newseed == NULL)
  ------------------
  |  Branch (802:13): [True: 0, False: 0]
  ------------------
  803|      0|            return NULL;
  804|       |        /* else carry on and store seed */
  805|      0|        ret = NULL;
  806|      0|    }
  807|       |
  808|      1|    if (!CRYPTO_THREAD_write_lock(dgbl->lock))
  ------------------
  |  Branch (808:9): [True: 0, False: 1]
  ------------------
  809|      0|        return NULL;
  810|       |
  811|      1|    primary = dgbl->primary;
  812|      1|    if (primary != NULL) {
  ------------------
  |  Branch (812:9): [True: 0, False: 1]
  ------------------
  813|      0|        CRYPTO_THREAD_unlock(dgbl->lock);
  814|      0|        EVP_RAND_CTX_free(ret);
  815|      0|        EVP_RAND_CTX_free(newseed);
  816|      0|        return primary;
  817|      0|    }
  818|      1|    if (newseed != NULL)
  ------------------
  |  Branch (818:9): [True: 1, False: 0]
  ------------------
  819|      1|        dgbl->seed = newseed;
  820|      1|    dgbl->primary = ret;
  821|      1|    CRYPTO_THREAD_unlock(dgbl->lock);
  822|       |
  823|      1|    return ret;
  824|      1|}
rand_lib.c:rand_new_seed:
  608|      1|{
  609|      1|    EVP_RAND *rand;
  610|      1|    const char *propq;
  611|      1|    char *name;
  612|      1|    EVP_RAND_CTX *ctx = NULL;
  613|      1|# ifdef OPENSSL_NO_FIPS_JITTER
  614|      1|    RAND_GLOBAL *dgbl = rand_get_global(libctx);
  615|       |
  616|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (616:9): [True: 0, False: 1]
  ------------------
  617|      0|        return NULL;
  618|      1|    propq = dgbl->seed_propq;
  619|      1|    name = dgbl->seed_name != NULL ? dgbl->seed_name
  ------------------
  |  Branch (619:12): [True: 0, False: 1]
  ------------------
  620|      1|                                   : OPENSSL_MSTR(OPENSSL_DEFAULT_SEED_SRC);
  ------------------
  |  |   20|      1|# define OPENSSL_MSTR(x) OPENSSL_MSTR_HELPER(x)
  |  |  ------------------
  |  |  |  |   19|      1|# define OPENSSL_MSTR_HELPER(x) #x
  |  |  ------------------
  ------------------
  621|       |# else /* !OPENSSL_NO_FIPS_JITTER */
  622|       |    name = "JITTER";
  623|       |    propq = "";
  624|       |# endif /* OPENSSL_NO_FIPS_JITTER */
  625|       |
  626|      1|    rand = EVP_RAND_fetch(libctx, name, propq);
  627|      1|    if (rand == NULL) {
  ------------------
  |  Branch (627:9): [True: 0, False: 1]
  ------------------
  628|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_FETCH_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  629|      0|        goto err;
  630|      0|    }
  631|      1|    ctx = EVP_RAND_CTX_new(rand, NULL);
  632|      1|    EVP_RAND_free(rand);
  633|      1|    if (ctx == NULL) {
  ------------------
  |  Branch (633:9): [True: 0, False: 1]
  ------------------
  634|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_CREATE_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  635|      0|        goto err;
  636|      0|    }
  637|      1|    if (!EVP_RAND_instantiate(ctx, 0, 0, NULL, 0, NULL)) {
  ------------------
  |  Branch (637:9): [True: 0, False: 1]
  ------------------
  638|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  639|      0|        goto err;
  640|      0|    }
  641|      1|    return ctx;
  642|      0| err:
  643|      0|    EVP_RAND_CTX_free(ctx);
  644|      0|    return NULL;
  645|      1|}
rand_lib.c:rand_new_drbg:
  668|      2|{
  669|      2|    EVP_RAND *rand;
  670|      2|    RAND_GLOBAL *dgbl = rand_get_global(libctx);
  671|      2|    EVP_RAND_CTX *ctx;
  672|      2|    OSSL_PARAM params[9], *p = params;
  673|      2|    const OSSL_PARAM *settables;
  674|      2|    const char *prov_name;
  675|      2|    char *name, *cipher;
  676|      2|    int use_df = 1;
  677|       |
  678|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (678:9): [True: 0, False: 2]
  ------------------
  679|      0|        return NULL;
  680|      2|    name = dgbl->rng_name != NULL ? dgbl->rng_name : "CTR-DRBG";
  ------------------
  |  Branch (680:12): [True: 2, False: 0]
  ------------------
  681|      2|    rand = EVP_RAND_fetch(libctx, name, dgbl->rng_propq);
  682|      2|    if (rand == NULL) {
  ------------------
  |  Branch (682:9): [True: 0, False: 2]
  ------------------
  683|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_FETCH_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  684|      0|        return NULL;
  685|      0|    }
  686|      2|    prov_name = ossl_provider_name(EVP_RAND_get0_provider(rand));
  687|      2|    ctx = EVP_RAND_CTX_new(rand, parent);
  688|      2|    EVP_RAND_free(rand);
  689|      2|    if (ctx == NULL) {
  ------------------
  |  Branch (689:9): [True: 0, False: 2]
  ------------------
  690|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_CREATE_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  691|      0|        return NULL;
  692|      0|    }
  693|       |
  694|      2|    settables = EVP_RAND_CTX_settable_params(ctx);
  695|      2|    if (OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_CIPHER)) {
  ------------------
  |  |  227|      2|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  121|      2|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  |  Branch (695:9): [True: 0, False: 2]
  ------------------
  696|      0|        cipher = dgbl->rng_cipher != NULL ? dgbl->rng_cipher : "AES-256-CTR";
  ------------------
  |  Branch (696:18): [True: 0, False: 0]
  ------------------
  697|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_CIPHER,
  ------------------
  |  |  227|      0|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  121|      0|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  698|      0|                                                cipher, 0);
  699|      0|    }
  700|      2|    if (dgbl->rng_digest != NULL
  ------------------
  |  Branch (700:9): [True: 0, False: 2]
  ------------------
  701|      2|            && OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_DIGEST))
  ------------------
  |  |  228|      0|# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  122|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  ------------------
  ------------------
  |  Branch (701:16): [True: 0, False: 0]
  ------------------
  702|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_DIGEST,
  ------------------
  |  |  228|      0|# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  122|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  ------------------
  ------------------
  703|      0|                                                dgbl->rng_digest, 0);
  704|      2|    if (prov_name != NULL)
  ------------------
  |  Branch (704:9): [True: 2, False: 0]
  ------------------
  705|      2|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_PROV_PARAM_CORE_PROV_NAME,
  ------------------
  |  |  494|      2|# define OSSL_PROV_PARAM_CORE_PROV_NAME "provider-name"
  ------------------
  706|      2|                                                (char *)prov_name, 0);
  707|      2|    if (dgbl->rng_propq != NULL)
  ------------------
  |  Branch (707:9): [True: 0, False: 2]
  ------------------
  708|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_PROPERTIES,
  ------------------
  |  |  242|      0|# define OSSL_DRBG_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  126|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  709|      0|                                                dgbl->rng_propq, 0);
  710|      2|    if (OSSL_PARAM_locate_const(settables, OSSL_ALG_PARAM_MAC))
  ------------------
  |  |  125|      2|# define OSSL_ALG_PARAM_MAC "mac"
  ------------------
  |  Branch (710:9): [True: 0, False: 2]
  ------------------
  711|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_ALG_PARAM_MAC, "HMAC", 0);
  ------------------
  |  |  125|      0|# define OSSL_ALG_PARAM_MAC "mac"
  ------------------
  712|      2|    if (OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_USE_DF))
  ------------------
  |  |  249|      2|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  |  Branch (712:9): [True: 0, False: 2]
  ------------------
  713|      0|        *p++ = OSSL_PARAM_construct_int(OSSL_DRBG_PARAM_USE_DF, &use_df);
  ------------------
  |  |  249|      0|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  714|      2|    *p++ = OSSL_PARAM_construct_uint(OSSL_DRBG_PARAM_RESEED_REQUESTS,
  ------------------
  |  |  245|      2|# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
  ------------------
  715|      2|                                     &reseed_interval);
  716|      2|    *p++ = OSSL_PARAM_construct_time_t(OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL,
  ------------------
  |  |  247|      2|# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
  ------------------
  717|      2|                                       &reseed_time_interval);
  718|      2|    *p = OSSL_PARAM_construct_end();
  719|      2|    if (!EVP_RAND_instantiate(ctx, 0, 0, NULL, 0, params)) {
  ------------------
  |  Branch (719:9): [True: 0, False: 2]
  ------------------
  720|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  721|      0|        EVP_RAND_CTX_free(ctx);
  722|      0|        return NULL;
  723|      0|    }
  724|      2|    return ctx;
  725|      2|}
rand_lib.c:rand_delete_thread_state:
  589|      1|{
  590|      1|    OSSL_LIB_CTX *ctx = arg;
  591|      1|    RAND_GLOBAL *dgbl = rand_get_global(ctx);
  592|      1|    EVP_RAND_CTX *rand;
  593|       |
  594|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (594:9): [True: 0, False: 1]
  ------------------
  595|      0|        return;
  596|       |
  597|      1|    rand = CRYPTO_THREAD_get_local(&dgbl->public);
  598|      1|    CRYPTO_THREAD_set_local(&dgbl->public, NULL);
  599|      1|    EVP_RAND_CTX_free(rand);
  600|       |
  601|      1|    rand = CRYPTO_THREAD_get_local(&dgbl->private);
  602|      1|    CRYPTO_THREAD_set_local(&dgbl->private, NULL);
  603|      1|    EVP_RAND_CTX_free(rand);
  604|      1|}
rand_lib.c:rand_get0_private:
  881|  58.7k|{
  882|  58.7k|    EVP_RAND_CTX *rand, *primary;
  883|       |
  884|  58.7k|    rand = CRYPTO_THREAD_get_local(&dgbl->private);
  885|  58.7k|    if (rand == NULL) {
  ------------------
  |  Branch (885:9): [True: 1, False: 58.7k]
  ------------------
  886|      1|        primary = rand_get0_primary(ctx, dgbl);
  887|      1|        if (primary == NULL)
  ------------------
  |  Branch (887:13): [True: 0, False: 1]
  ------------------
  888|      0|            return NULL;
  889|       |
  890|      1|        ctx = ossl_lib_ctx_get_concrete(ctx);
  891|       |
  892|      1|        if (ctx == NULL)
  ------------------
  |  Branch (892:13): [True: 0, False: 1]
  ------------------
  893|      0|            return NULL;
  894|       |        /*
  895|       |         * If the public is also NULL then this is the first time we've
  896|       |         * used this thread.
  897|       |         */
  898|      1|        if (CRYPTO_THREAD_get_local(&dgbl->public) == NULL
  ------------------
  |  Branch (898:13): [True: 1, False: 0]
  ------------------
  899|      1|                && !ossl_init_thread_start(NULL, ctx, rand_delete_thread_state))
  ------------------
  |  Branch (899:20): [True: 0, False: 1]
  ------------------
  900|      0|            return NULL;
  901|      1|        rand = rand_new_drbg(ctx, primary, SECONDARY_RESEED_INTERVAL,
  ------------------
  |  |   24|      1|# define SECONDARY_RESEED_INTERVAL               (1 << 16)
  ------------------
  902|      1|                             SECONDARY_RESEED_TIME_INTERVAL);
  ------------------
  |  |   26|      1|# define SECONDARY_RESEED_TIME_INTERVAL          (7 * 60)  /* 7 minutes */
  ------------------
  903|      1|        CRYPTO_THREAD_set_local(&dgbl->private, rand);
  904|      1|    }
  905|  58.7k|    return rand;
  906|  58.7k|}
rand_lib.c:random_set_string:
  961|      8|{
  962|      8|    char *d = NULL;
  963|       |
  964|      8|    if (s != NULL) {
  ------------------
  |  Branch (964:9): [True: 2, False: 6]
  ------------------
  965|      2|        d = OPENSSL_strdup(s);
  ------------------
  |  |  119|      2|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  966|      2|        if (d == NULL)
  ------------------
  |  Branch (966:13): [True: 0, False: 2]
  ------------------
  967|      0|            return 0;
  968|      2|    }
  969|      8|    OPENSSL_free(*p);
  ------------------
  |  |  115|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  970|      8|    *p = d;
  971|      8|    return 1;
  972|      8|}

RAND_OpenSSL:
   63|  58.7k|{
   64|  58.7k|    return &ossl_rand_meth;
   65|  58.7k|}

rsa_ameth.c:rsa_pub_decode:
   77|     58|{
   78|     58|    const unsigned char *p;
   79|     58|    int pklen;
   80|     58|    X509_ALGOR *alg;
   81|     58|    RSA *rsa = NULL;
   82|       |
   83|     58|    if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &alg, pubkey))
  ------------------
  |  Branch (83:9): [True: 0, False: 58]
  ------------------
   84|      0|        return 0;
   85|     58|    if ((rsa = d2i_RSAPublicKey(NULL, &p, pklen)) == NULL)
  ------------------
  |  Branch (85:9): [True: 9, False: 49]
  ------------------
   86|      9|        return 0;
   87|     49|    if (!ossl_rsa_param_decode(rsa, alg)) {
  ------------------
  |  Branch (87:9): [True: 2, False: 47]
  ------------------
   88|      2|        RSA_free(rsa);
   89|      2|        return 0;
   90|      2|    }
   91|       |
   92|     47|    RSA_clear_flags(rsa, RSA_FLAG_TYPE_MASK);
  ------------------
  |  |  117|     47|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
   93|     47|    switch (pkey->ameth->pkey_id) {
   94|     43|    case EVP_PKEY_RSA:
  ------------------
  |  |   63|     43|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|     43|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  |  Branch (94:5): [True: 43, False: 4]
  ------------------
   95|     43|        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSA);
  ------------------
  |  |  118|     43|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
   96|     43|        break;
   97|      4|    case EVP_PKEY_RSA_PSS:
  ------------------
  |  |   65|      4|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      4|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (97:5): [True: 4, False: 43]
  ------------------
   98|      4|        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSASSAPSS);
  ------------------
  |  |  119|      4|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
   99|      4|        break;
  100|      0|    default:
  ------------------
  |  Branch (100:5): [True: 0, False: 47]
  ------------------
  101|       |        /* Leave the type bits zero */
  102|      0|        break;
  103|     47|    }
  104|       |
  105|     47|    if (!EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, rsa)) {
  ------------------
  |  Branch (105:9): [True: 0, False: 47]
  ------------------
  106|      0|        RSA_free(rsa);
  107|      0|        return 0;
  108|      0|    }
  109|     47|    return 1;
  110|     47|}
rsa_ameth.c:rsa_param_encode:
   31|      2|{
   32|      2|    const RSA *rsa = pkey->pkey.rsa;
   33|       |
   34|      2|    *pstr = NULL;
   35|       |    /* If RSA it's just NULL type */
   36|      2|    if (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK) != RSA_FLAG_TYPE_RSASSAPSS) {
  ------------------
  |  |  117|      2|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
                  if (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK) != RSA_FLAG_TYPE_RSASSAPSS) {
  ------------------
  |  |  119|      2|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (36:9): [True: 0, False: 2]
  ------------------
   37|      0|        *pstrtype = V_ASN1_NULL;
  ------------------
  |  |   67|      0|# define V_ASN1_NULL                     5
  ------------------
   38|      0|        return 1;
   39|      0|    }
   40|       |    /* If no PSS parameters we omit parameters entirely */
   41|      2|    if (rsa->pss == NULL) {
  ------------------
  |  Branch (41:9): [True: 0, False: 2]
  ------------------
   42|      0|        *pstrtype = V_ASN1_UNDEF;
  ------------------
  |  |   60|      0|# define V_ASN1_UNDEF                    -1
  ------------------
   43|      0|        return 1;
   44|      0|    }
   45|       |    /* Encode PSS parameters */
   46|      2|    if (ASN1_item_pack(rsa->pss, ASN1_ITEM_rptr(RSA_PSS_PARAMS), pstr) == NULL)
  ------------------
  |  |  427|      2|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  |  Branch (46:9): [True: 0, False: 2]
  ------------------
   47|      0|        return 0;
   48|       |
   49|      2|    *pstrtype = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|      2|# define V_ASN1_SEQUENCE                 16
  ------------------
   50|      2|    return 1;
   51|      2|}
rsa_ameth.c:pkey_rsa_print:
  301|    367|{
  302|    367|    const RSA *x = pkey->pkey.rsa;
  303|    367|    char *str;
  304|    367|    const char *s;
  305|    367|    int ret = 0, mod_len = 0, ex_primes;
  306|       |
  307|    367|    if (x->n != NULL)
  ------------------
  |  Branch (307:9): [True: 367, False: 0]
  ------------------
  308|    367|        mod_len = BN_num_bits(x->n);
  309|    367|    ex_primes = sk_RSA_PRIME_INFO_num(x->prime_infos);
  310|       |
  311|    367|    if (!BIO_indent(bp, off, 128))
  ------------------
  |  Branch (311:9): [True: 0, False: 367]
  ------------------
  312|      0|        goto err;
  313|       |
  314|    367|    if (BIO_printf(bp, "%s ", pkey_is_pss(pkey) ?  "RSA-PSS" : "RSA") <= 0)
  ------------------
  |  |  151|    367|#define pkey_is_pss(pkey) (pkey->ameth->pkey_id == EVP_PKEY_RSA_PSS)
  |  |  ------------------
  |  |  |  |   65|    367|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  |  |  ------------------
  |  |  |  |  |  |  583|    367|#define NID_rsassaPss           912
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (151:27): [True: 2, False: 365]
  |  |  ------------------
  ------------------
  |  Branch (314:9): [True: 0, False: 367]
  ------------------
  315|      0|        goto err;
  316|       |
  317|    367|    if (priv && x->d) {
  ------------------
  |  Branch (317:9): [True: 367, False: 0]
  |  Branch (317:17): [True: 367, False: 0]
  ------------------
  318|    367|        if (BIO_printf(bp, "Private-Key: (%d bit, %d primes)\n",
  ------------------
  |  Branch (318:13): [True: 0, False: 367]
  ------------------
  319|    367|                       mod_len, ex_primes <= 0 ? 2 : ex_primes + 2) <= 0)
  ------------------
  |  Branch (319:33): [True: 48, False: 319]
  ------------------
  320|      0|            goto err;
  321|    367|        str = "modulus:";
  322|    367|        s = "publicExponent:";
  323|    367|    } else {
  324|      0|        if (BIO_printf(bp, "Public-Key: (%d bit)\n", mod_len) <= 0)
  ------------------
  |  Branch (324:13): [True: 0, False: 0]
  ------------------
  325|      0|            goto err;
  326|      0|        str = "Modulus:";
  327|      0|        s = "Exponent:";
  328|      0|    }
  329|    367|    if (!ASN1_bn_print(bp, str, x->n, NULL, off))
  ------------------
  |  Branch (329:9): [True: 0, False: 367]
  ------------------
  330|      0|        goto err;
  331|    367|    if (!ASN1_bn_print(bp, s, x->e, NULL, off))
  ------------------
  |  Branch (331:9): [True: 0, False: 367]
  ------------------
  332|      0|        goto err;
  333|    367|    if (priv) {
  ------------------
  |  Branch (333:9): [True: 367, False: 0]
  ------------------
  334|    367|        int i;
  335|       |
  336|    367|        if (!ASN1_bn_print(bp, "privateExponent:", x->d, NULL, off))
  ------------------
  |  Branch (336:13): [True: 0, False: 367]
  ------------------
  337|      0|            goto err;
  338|    367|        if (!ASN1_bn_print(bp, "prime1:", x->p, NULL, off))
  ------------------
  |  Branch (338:13): [True: 0, False: 367]
  ------------------
  339|      0|            goto err;
  340|    367|        if (!ASN1_bn_print(bp, "prime2:", x->q, NULL, off))
  ------------------
  |  Branch (340:13): [True: 0, False: 367]
  ------------------
  341|      0|            goto err;
  342|    367|        if (!ASN1_bn_print(bp, "exponent1:", x->dmp1, NULL, off))
  ------------------
  |  Branch (342:13): [True: 0, False: 367]
  ------------------
  343|      0|            goto err;
  344|    367|        if (!ASN1_bn_print(bp, "exponent2:", x->dmq1, NULL, off))
  ------------------
  |  Branch (344:13): [True: 0, False: 367]
  ------------------
  345|      0|            goto err;
  346|    367|        if (!ASN1_bn_print(bp, "coefficient:", x->iqmp, NULL, off))
  ------------------
  |  Branch (346:13): [True: 0, False: 367]
  ------------------
  347|      0|            goto err;
  348|  18.4k|        for (i = 0; i < sk_RSA_PRIME_INFO_num(x->prime_infos); i++) {
  ------------------
  |  Branch (348:21): [True: 18.0k, False: 367]
  ------------------
  349|       |            /* print multi-prime info */
  350|  18.0k|            BIGNUM *bn = NULL;
  351|  18.0k|            RSA_PRIME_INFO *pinfo;
  352|  18.0k|            int j;
  353|       |
  354|  18.0k|            pinfo = sk_RSA_PRIME_INFO_value(x->prime_infos, i);
  355|  72.2k|            for (j = 0; j < 3; j++) {
  ------------------
  |  Branch (355:25): [True: 54.2k, False: 18.0k]
  ------------------
  356|  54.2k|                if (!BIO_indent(bp, off, 128))
  ------------------
  |  Branch (356:21): [True: 0, False: 54.2k]
  ------------------
  357|      0|                    goto err;
  358|  54.2k|                switch (j) {
  359|  18.0k|                case 0:
  ------------------
  |  Branch (359:17): [True: 18.0k, False: 36.1k]
  ------------------
  360|  18.0k|                    if (BIO_printf(bp, "prime%d:", i + 3) <= 0)
  ------------------
  |  Branch (360:25): [True: 0, False: 18.0k]
  ------------------
  361|      0|                        goto err;
  362|  18.0k|                    bn = pinfo->r;
  363|  18.0k|                    break;
  364|  18.0k|                case 1:
  ------------------
  |  Branch (364:17): [True: 18.0k, False: 36.1k]
  ------------------
  365|  18.0k|                    if (BIO_printf(bp, "exponent%d:", i + 3) <= 0)
  ------------------
  |  Branch (365:25): [True: 0, False: 18.0k]
  ------------------
  366|      0|                        goto err;
  367|  18.0k|                    bn = pinfo->d;
  368|  18.0k|                    break;
  369|  18.0k|                case 2:
  ------------------
  |  Branch (369:17): [True: 18.0k, False: 36.1k]
  ------------------
  370|  18.0k|                    if (BIO_printf(bp, "coefficient%d:", i + 3) <= 0)
  ------------------
  |  Branch (370:25): [True: 0, False: 18.0k]
  ------------------
  371|      0|                        goto err;
  372|  18.0k|                    bn = pinfo->t;
  373|  18.0k|                    break;
  374|      0|                default:
  ------------------
  |  Branch (374:17): [True: 0, False: 54.2k]
  ------------------
  375|      0|                    break;
  376|  54.2k|                }
  377|  54.2k|                if (!ASN1_bn_print(bp, "", bn, NULL, off))
  ------------------
  |  Branch (377:21): [True: 0, False: 54.2k]
  ------------------
  378|      0|                    goto err;
  379|  54.2k|            }
  380|  18.0k|        }
  381|    367|    }
  382|    367|    if (pkey_is_pss(pkey) && !rsa_pss_param_print(bp, 1, x->pss, off))
  ------------------
  |  |  151|    734|#define pkey_is_pss(pkey) (pkey->ameth->pkey_id == EVP_PKEY_RSA_PSS)
  |  |  ------------------
  |  |  |  |   65|    367|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  |  |  ------------------
  |  |  |  |  |  |  583|    367|#define NID_rsassaPss           912
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (151:27): [True: 2, False: 365]
  |  |  ------------------
  ------------------
  |  Branch (382:30): [True: 0, False: 2]
  ------------------
  383|      0|        goto err;
  384|    367|    ret = 1;
  385|    367| err:
  386|    367|    return ret;
  387|    367|}
rsa_ameth.c:rsa_pss_param_print:
  207|      2|{
  208|      2|    int rv = 0;
  209|      2|    X509_ALGOR *maskHash = NULL;
  210|       |
  211|      2|    if (!BIO_indent(bp, indent, 128))
  ------------------
  |  Branch (211:9): [True: 0, False: 2]
  ------------------
  212|      0|        goto err;
  213|      2|    if (pss_key) {
  ------------------
  |  Branch (213:9): [True: 2, False: 0]
  ------------------
  214|      2|        if (pss == NULL) {
  ------------------
  |  Branch (214:13): [True: 0, False: 2]
  ------------------
  215|      0|            if (BIO_puts(bp, "No PSS parameter restrictions\n") <= 0)
  ------------------
  |  Branch (215:17): [True: 0, False: 0]
  ------------------
  216|      0|                return 0;
  217|      0|            return 1;
  218|      2|        } else {
  219|      2|            if (BIO_puts(bp, "PSS parameter restrictions:") <= 0)
  ------------------
  |  Branch (219:17): [True: 0, False: 2]
  ------------------
  220|      0|                return 0;
  221|      2|        }
  222|      2|    } else if (pss == NULL) {
  ------------------
  |  Branch (222:16): [True: 0, False: 0]
  ------------------
  223|      0|        if (BIO_puts(bp, "(INVALID PSS PARAMETERS)\n") <= 0)
  ------------------
  |  Branch (223:13): [True: 0, False: 0]
  ------------------
  224|      0|            return 0;
  225|      0|        return 1;
  226|      0|    }
  227|      2|    if (BIO_puts(bp, "\n") <= 0)
  ------------------
  |  Branch (227:9): [True: 0, False: 2]
  ------------------
  228|      0|        goto err;
  229|      2|    if (pss_key)
  ------------------
  |  Branch (229:9): [True: 2, False: 0]
  ------------------
  230|      2|        indent += 2;
  231|      2|    if (!BIO_indent(bp, indent, 128))
  ------------------
  |  Branch (231:9): [True: 0, False: 2]
  ------------------
  232|      0|        goto err;
  233|      2|    if (BIO_puts(bp, "Hash Algorithm: ") <= 0)
  ------------------
  |  Branch (233:9): [True: 0, False: 2]
  ------------------
  234|      0|        goto err;
  235|       |
  236|      2|    if (pss->hashAlgorithm) {
  ------------------
  |  Branch (236:9): [True: 0, False: 2]
  ------------------
  237|      0|        if (i2a_ASN1_OBJECT(bp, pss->hashAlgorithm->algorithm) <= 0)
  ------------------
  |  Branch (237:13): [True: 0, False: 0]
  ------------------
  238|      0|            goto err;
  239|      2|    } else if (BIO_puts(bp, "sha1 (default)") <= 0) {
  ------------------
  |  Branch (239:16): [True: 0, False: 2]
  ------------------
  240|      0|        goto err;
  241|      0|    }
  242|       |
  243|      2|    if (BIO_puts(bp, "\n") <= 0)
  ------------------
  |  Branch (243:9): [True: 0, False: 2]
  ------------------
  244|      0|        goto err;
  245|       |
  246|      2|    if (!BIO_indent(bp, indent, 128))
  ------------------
  |  Branch (246:9): [True: 0, False: 2]
  ------------------
  247|      0|        goto err;
  248|       |
  249|      2|    if (BIO_puts(bp, "Mask Algorithm: ") <= 0)
  ------------------
  |  Branch (249:9): [True: 0, False: 2]
  ------------------
  250|      0|        goto err;
  251|      2|    if (pss->maskGenAlgorithm) {
  ------------------
  |  Branch (251:9): [True: 0, False: 2]
  ------------------
  252|      0|        if (i2a_ASN1_OBJECT(bp, pss->maskGenAlgorithm->algorithm) <= 0)
  ------------------
  |  Branch (252:13): [True: 0, False: 0]
  ------------------
  253|      0|            goto err;
  254|      0|        if (BIO_puts(bp, " with ") <= 0)
  ------------------
  |  Branch (254:13): [True: 0, False: 0]
  ------------------
  255|      0|            goto err;
  256|      0|        maskHash = ossl_x509_algor_mgf1_decode(pss->maskGenAlgorithm);
  257|      0|        if (maskHash != NULL) {
  ------------------
  |  Branch (257:13): [True: 0, False: 0]
  ------------------
  258|      0|            if (i2a_ASN1_OBJECT(bp, maskHash->algorithm) <= 0)
  ------------------
  |  Branch (258:17): [True: 0, False: 0]
  ------------------
  259|      0|                goto err;
  260|      0|        } else if (BIO_puts(bp, "INVALID") <= 0) {
  ------------------
  |  Branch (260:20): [True: 0, False: 0]
  ------------------
  261|      0|            goto err;
  262|      0|        }
  263|      2|    } else if (BIO_puts(bp, "mgf1 with sha1 (default)") <= 0) {
  ------------------
  |  Branch (263:16): [True: 0, False: 2]
  ------------------
  264|      0|        goto err;
  265|      0|    }
  266|      2|    BIO_puts(bp, "\n");
  267|       |
  268|      2|    if (!BIO_indent(bp, indent, 128))
  ------------------
  |  Branch (268:9): [True: 0, False: 2]
  ------------------
  269|      0|        goto err;
  270|      2|    if (BIO_printf(bp, "%s Salt Length: 0x", pss_key ? "Minimum" : "") <= 0)
  ------------------
  |  Branch (270:9): [True: 0, False: 2]
  |  Branch (270:46): [True: 2, False: 0]
  ------------------
  271|      0|        goto err;
  272|      2|    if (pss->saltLength) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2]
  ------------------
  273|      0|        if (i2a_ASN1_INTEGER(bp, pss->saltLength) <= 0)
  ------------------
  |  Branch (273:13): [True: 0, False: 0]
  ------------------
  274|      0|            goto err;
  275|      2|    } else if (BIO_puts(bp, "14 (default)") <= 0) {
  ------------------
  |  Branch (275:16): [True: 0, False: 2]
  ------------------
  276|      0|        goto err;
  277|      0|    }
  278|      2|    BIO_puts(bp, "\n");
  279|       |
  280|      2|    if (!BIO_indent(bp, indent, 128))
  ------------------
  |  Branch (280:9): [True: 0, False: 2]
  ------------------
  281|      0|        goto err;
  282|      2|    if (BIO_puts(bp, "Trailer Field: 0x") <= 0)
  ------------------
  |  Branch (282:9): [True: 0, False: 2]
  ------------------
  283|      0|        goto err;
  284|      2|    if (pss->trailerField) {
  ------------------
  |  Branch (284:9): [True: 0, False: 2]
  ------------------
  285|      0|        if (i2a_ASN1_INTEGER(bp, pss->trailerField) <= 0)
  ------------------
  |  Branch (285:13): [True: 0, False: 0]
  ------------------
  286|      0|            goto err;
  287|      2|    } else if (BIO_puts(bp, "01 (default)") <= 0) {
  ------------------
  |  Branch (287:16): [True: 0, False: 2]
  ------------------
  288|      0|        goto err;
  289|      0|    }
  290|      2|    BIO_puts(bp, "\n");
  291|       |
  292|      2|    rv = 1;
  293|       |
  294|      2| err:
  295|      2|    X509_ALGOR_free(maskHash);
  296|      2|    return rv;
  297|       |
  298|      2|}
rsa_ameth.c:rsa_priv_decode:
  174|     12|{
  175|     12|    int ret = 0;
  176|     12|    RSA *rsa = ossl_rsa_key_from_pkcs8(p8, NULL, NULL);
  177|       |
  178|     12|    if (rsa != NULL) {
  ------------------
  |  Branch (178:9): [True: 5, False: 7]
  ------------------
  179|      5|        ret = 1;
  180|      5|        EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, rsa);
  181|      5|    }
  182|     12|    return ret;
  183|     12|}
rsa_ameth.c:rsa_priv_encode:
  146|      2|{
  147|      2|    unsigned char *rk = NULL;
  148|      2|    int rklen;
  149|      2|    ASN1_STRING *str;
  150|      2|    int strtype;
  151|       |
  152|      2|    if (!rsa_param_encode(pkey, &str, &strtype))
  ------------------
  |  Branch (152:9): [True: 0, False: 2]
  ------------------
  153|      0|        return 0;
  154|      2|    rklen = i2d_RSAPrivateKey(pkey->pkey.rsa, &rk);
  155|       |
  156|      2|    if (rklen <= 0) {
  ------------------
  |  Branch (156:9): [True: 0, False: 2]
  ------------------
  157|      0|        ERR_raise(ERR_LIB_RSA, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  158|      0|        ASN1_STRING_free(str);
  159|      0|        return 0;
  160|      0|    }
  161|       |
  162|      2|    if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(pkey->ameth->pkey_id), 0,
  ------------------
  |  Branch (162:9): [True: 0, False: 2]
  ------------------
  163|      2|                         strtype, str, rk, rklen)) {
  164|      0|        ERR_raise(ERR_LIB_RSA, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  165|      0|        ASN1_STRING_free(str);
  166|      0|        OPENSSL_clear_free(rk, rklen);
  ------------------
  |  |  113|      0|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  167|      0|        return 0;
  168|      0|    }
  169|       |
  170|      2|    return 1;
  171|      2|}
rsa_ameth.c:rsa_priv_print:
  397|    367|{
  398|    367|    return pkey_rsa_print(bp, pkey, indent, 1);
  399|    367|}
rsa_ameth.c:int_rsa_free:
  201|  9.20k|{
  202|  9.20k|    RSA_free(pkey->pkey.rsa);
  203|  9.20k|}
rsa_ameth.c:old_rsa_priv_decode:
  131|  9.13k|{
  132|  9.13k|    RSA *rsa;
  133|       |
  134|  9.13k|    if ((rsa = d2i_RSAPrivateKey(NULL, pder, derlen)) == NULL)
  ------------------
  |  Branch (134:9): [True: 8.76k, False: 362]
  ------------------
  135|  8.76k|        return 0;
  136|    362|    EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, rsa);
  137|    362|    return 1;
  138|  9.13k|}
rsa_ameth.c:old_rsa_priv_encode:
  141|    365|{
  142|    365|    return i2d_RSAPrivateKey(pkey->pkey.rsa, pder);
  143|    365|}

rsa_asn1.c:rsa_cb:
   30|   150k|{
   31|   150k|    if (operation == ASN1_OP_NEW_PRE) {
  ------------------
  |  |  742|   150k|# define ASN1_OP_NEW_PRE         0
  ------------------
  |  Branch (31:9): [True: 48.6k, False: 102k]
  ------------------
   32|  48.6k|        *pval = (ASN1_VALUE *)RSA_new();
   33|  48.6k|        if (*pval != NULL)
  ------------------
  |  Branch (33:13): [True: 48.6k, False: 0]
  ------------------
   34|  48.6k|            return 2;
   35|      0|        return 0;
   36|   102k|    } else if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|   102k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (36:16): [True: 47.3k, False: 54.9k]
  ------------------
   37|  47.3k|        RSA_free((RSA *)*pval);
   38|  47.3k|        *pval = NULL;
   39|  47.3k|        return 2;
   40|  54.9k|    } else if (operation == ASN1_OP_D2I_POST) {
  ------------------
  |  |  747|  54.9k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (40:16): [True: 1.85k, False: 53.0k]
  ------------------
   41|  1.85k|        if (((RSA *)*pval)->version != RSA_ASN1_VERSION_MULTI) {
  ------------------
  |  |   60|  1.85k|#  define RSA_ASN1_VERSION_MULTI          1
  ------------------
  |  Branch (41:13): [True: 690, False: 1.16k]
  ------------------
   42|       |            /* not a multi-prime key, skip */
   43|    690|            return 1;
   44|    690|        }
   45|  1.16k|        return (ossl_rsa_multip_calc_product((RSA *)*pval) == 1) ? 2 : 0;
  ------------------
  |  Branch (45:16): [True: 1.16k, False: 7]
  ------------------
   46|  1.85k|    }
   47|  53.0k|    return 1;
   48|   150k|}
rsa_asn1.c:rsa_pss_cb:
   79|  50.7k|{
   80|  50.7k|    if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|  50.7k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (80:9): [True: 10.1k, False: 40.5k]
  ------------------
   81|  10.1k|        RSA_PSS_PARAMS *pss = (RSA_PSS_PARAMS *)*pval;
   82|  10.1k|        X509_ALGOR_free(pss->maskHash);
   83|  10.1k|    }
   84|  50.7k|    return 1;
   85|  50.7k|}
rsa_asn1.c:rsa_oaep_cb:
  100|  50.6k|{
  101|  50.6k|    if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|  50.6k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (101:9): [True: 10.1k, False: 40.5k]
  ------------------
  102|  10.1k|        RSA_OAEP_PARAMS *oaep = (RSA_OAEP_PARAMS *)*pval;
  103|  10.1k|        X509_ALGOR_free(oaep->maskHash);
  104|  10.1k|    }
  105|  50.6k|    return 1;
  106|  50.6k|}

ossl_rsa_todata:
  261|    187|{
  262|    187|    int ret = 0;
  263|    187|    const BIGNUM *rsa_d = NULL, *rsa_n = NULL, *rsa_e = NULL;
  264|    187|    STACK_OF(BIGNUM_const) *factors = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|    187|# define STACK_OF(type) struct stack_st_##type
  ------------------
  265|    187|    STACK_OF(BIGNUM_const) *exps = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|    187|# define STACK_OF(type) struct stack_st_##type
  ------------------
  266|    187|    STACK_OF(BIGNUM_const) *coeffs = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|    187|# define STACK_OF(type) struct stack_st_##type
  ------------------
  267|       |
  268|    187|    if (rsa == NULL || factors == NULL || exps == NULL || coeffs == NULL)
  ------------------
  |  Branch (268:9): [True: 0, False: 187]
  |  Branch (268:24): [True: 0, False: 187]
  |  Branch (268:43): [True: 0, False: 187]
  |  Branch (268:59): [True: 0, False: 187]
  ------------------
  269|      0|        goto err;
  270|       |
  271|    187|    RSA_get0_key(rsa, &rsa_n, &rsa_e, &rsa_d);
  272|    187|    ossl_rsa_get0_all_params(rsa, factors, exps, coeffs);
  273|       |
  274|    187|    if (!ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_N, rsa_n)
  ------------------
  |  |  474|    187|# define OSSL_PKEY_PARAM_RSA_N "n"
  ------------------
  |  Branch (274:9): [True: 0, False: 187]
  ------------------
  275|    187|        || !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_E, rsa_e))
  ------------------
  |  |  449|    187|# define OSSL_PKEY_PARAM_RSA_E "e"
  ------------------
  |  Branch (275:12): [True: 0, False: 187]
  ------------------
  276|      0|        goto err;
  277|       |
  278|       |    /* Check private key data integrity */
  279|    187|    if (include_private && rsa_d != NULL) {
  ------------------
  |  Branch (279:9): [True: 187, False: 0]
  |  Branch (279:28): [True: 140, False: 47]
  ------------------
  280|       |
  281|    140|        if (!ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_D,
  ------------------
  |  |  445|    140|# define OSSL_PKEY_PARAM_RSA_D "d"
  ------------------
  |  Branch (281:13): [True: 0, False: 140]
  ------------------
  282|    140|                                     rsa_d)
  283|    140|            || !ossl_param_build_set_multi_key_bn(bld, params,
  ------------------
  |  Branch (283:16): [True: 0, False: 140]
  ------------------
  284|    140|                                                  ossl_rsa_mp_factor_names,
  285|    140|                                                  factors)
  286|    140|            || !ossl_param_build_set_multi_key_bn(bld, params,
  ------------------
  |  Branch (286:16): [True: 0, False: 140]
  ------------------
  287|    140|                                                  ossl_rsa_mp_exp_names, exps)
  288|    140|            || !ossl_param_build_set_multi_key_bn(bld, params,
  ------------------
  |  Branch (288:16): [True: 0, False: 140]
  ------------------
  289|    140|                                                  ossl_rsa_mp_coeff_names,
  290|    140|                                                  coeffs))
  291|      0|            goto err;
  292|    140|    }
  293|       |
  294|       |#if defined(FIPS_MODULE) && !defined(OPENSSL_NO_ACVP_TESTS)
  295|       |    /* The acvp test results are not meant for export so check for bld == NULL */
  296|       |    if (bld == NULL)
  297|       |        ossl_rsa_acvp_test_get_params(rsa, params);
  298|       |#endif
  299|    187|    ret = 1;
  300|    187| err:
  301|    187|    sk_BIGNUM_const_free(factors);
  302|    187|    sk_BIGNUM_const_free(exps);
  303|    187|    sk_BIGNUM_const_free(coeffs);
  304|    187|    return ret;
  305|    187|}
ossl_rsa_pss_params_30_todata:
  309|      6|{
  310|      6|    if (!ossl_rsa_pss_params_30_is_unrestricted(pss)) {
  ------------------
  |  Branch (310:9): [True: 5, False: 1]
  ------------------
  311|      5|        int hashalg_nid = ossl_rsa_pss_params_30_hashalg(pss);
  312|      5|        int maskgenalg_nid = ossl_rsa_pss_params_30_maskgenalg(pss);
  313|      5|        int maskgenhashalg_nid = ossl_rsa_pss_params_30_maskgenhashalg(pss);
  314|      5|        int saltlen = ossl_rsa_pss_params_30_saltlen(pss);
  315|      5|        int default_hashalg_nid = ossl_rsa_pss_params_30_hashalg(NULL);
  316|      5|        int default_maskgenalg_nid = ossl_rsa_pss_params_30_maskgenalg(NULL);
  317|      5|        int default_maskgenhashalg_nid =
  318|      5|                ossl_rsa_pss_params_30_maskgenhashalg(NULL);
  319|      5|        const char *mdname =
  320|      5|            (hashalg_nid == default_hashalg_nid
  ------------------
  |  Branch (320:14): [True: 5, False: 0]
  ------------------
  321|      5|             ? NULL : ossl_rsa_oaeppss_nid2name(hashalg_nid));
  322|      5|        const char *mgfname =
  323|      5|            (maskgenalg_nid == default_maskgenalg_nid
  ------------------
  |  Branch (323:14): [True: 5, False: 0]
  ------------------
  324|      5|             ? NULL : ossl_rsa_oaeppss_nid2name(maskgenalg_nid));
  325|      5|        const char *mgf1mdname =
  326|      5|            (maskgenhashalg_nid == default_maskgenhashalg_nid
  ------------------
  |  Branch (326:14): [True: 5, False: 0]
  ------------------
  327|      5|             ? NULL : ossl_rsa_oaeppss_nid2name(maskgenhashalg_nid));
  328|      5|        const char *key_md = OSSL_PKEY_PARAM_RSA_DIGEST;
  ------------------
  |  |  447|      5|# define OSSL_PKEY_PARAM_RSA_DIGEST OSSL_PKEY_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  366|      5|# define OSSL_PKEY_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      5|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  329|      5|        const char *key_mgf = OSSL_PKEY_PARAM_RSA_MASKGENFUNC;
  ------------------
  |  |  472|      5|# define OSSL_PKEY_PARAM_RSA_MASKGENFUNC OSSL_PKEY_PARAM_MASKGENFUNC
  |  |  ------------------
  |  |  |  |  415|      5|# define OSSL_PKEY_PARAM_MASKGENFUNC "mgf"
  |  |  ------------------
  ------------------
  330|      5|        const char *key_mgf1_md = OSSL_PKEY_PARAM_RSA_MGF1_DIGEST;
  ------------------
  |  |  473|      5|# define OSSL_PKEY_PARAM_RSA_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST
  |  |  ------------------
  |  |  |  |  417|      5|# define OSSL_PKEY_PARAM_MGF1_DIGEST "mgf1-digest"
  |  |  ------------------
  ------------------
  331|      5|        const char *key_saltlen = OSSL_PKEY_PARAM_RSA_PSS_SALTLEN;
  ------------------
  |  |  476|      5|# define OSSL_PKEY_PARAM_RSA_PSS_SALTLEN "saltlen"
  ------------------
  332|       |
  333|       |        /*
  334|       |         * To ensure that the key isn't seen as unrestricted by the recipient,
  335|       |         * we make sure that at least one PSS-related parameter is passed, even
  336|       |         * if it has a default value; saltlen.
  337|       |         */
  338|      5|        if ((mdname != NULL
  ------------------
  |  Branch (338:14): [True: 0, False: 5]
  ------------------
  339|      5|             && !ossl_param_build_set_utf8_string(bld, params, key_md, mdname))
  ------------------
  |  Branch (339:17): [True: 0, False: 0]
  ------------------
  340|      5|            || (mgfname != NULL
  ------------------
  |  Branch (340:17): [True: 0, False: 5]
  ------------------
  341|      5|                && !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (341:20): [True: 0, False: 0]
  ------------------
  342|      0|                                                     key_mgf, mgfname))
  343|      5|            || (mgf1mdname != NULL
  ------------------
  |  Branch (343:17): [True: 0, False: 5]
  ------------------
  344|      5|                && !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (344:20): [True: 0, False: 0]
  ------------------
  345|      0|                                                     key_mgf1_md, mgf1mdname))
  346|      5|            || (!ossl_param_build_set_int(bld, params, key_saltlen, saltlen)))
  ------------------
  |  Branch (346:16): [True: 0, False: 5]
  ------------------
  347|      0|            return 0;
  348|      5|    }
  349|      6|    return 1;
  350|      6|}
ossl_rsa_is_foreign:
  456|    414|{
  457|    414|#ifndef FIPS_MODULE
  458|    414|    if (rsa->engine != NULL || RSA_get_method(rsa) != RSA_PKCS1_OpenSSL())
  ------------------
  |  Branch (458:9): [True: 0, False: 414]
  |  Branch (458:32): [True: 0, False: 414]
  ------------------
  459|      0|        return 1;
  460|    414|#endif
  461|    414|    return 0;
  462|    414|}
ossl_rsa_pss_decode:
  568|      9|{
  569|      9|    RSA_PSS_PARAMS *pss;
  570|       |
  571|      9|    pss = ASN1_TYPE_unpack_sequence(ASN1_ITEM_rptr(RSA_PSS_PARAMS),
  ------------------
  |  |  427|      9|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  572|      9|                                    alg->parameter);
  573|       |
  574|      9|    if (pss == NULL)
  ------------------
  |  Branch (574:9): [True: 1, False: 8]
  ------------------
  575|      1|        return NULL;
  576|       |
  577|      8|    if (pss->maskGenAlgorithm != NULL) {
  ------------------
  |  Branch (577:9): [True: 0, False: 8]
  ------------------
  578|      0|        pss->maskHash = ossl_x509_algor_mgf1_decode(pss->maskGenAlgorithm);
  579|      0|        if (pss->maskHash == NULL) {
  ------------------
  |  Branch (579:13): [True: 0, False: 0]
  ------------------
  580|      0|            RSA_PSS_PARAMS_free(pss);
  581|      0|            return NULL;
  582|      0|        }
  583|      0|    }
  584|       |
  585|      8|    return pss;
  586|      8|}
ossl_rsa_pss_get_param_unverified:
  630|      8|{
  631|      8|    RSA_PSS_PARAMS_30 pss_params;
  632|       |
  633|       |    /* Get the defaults from the ONE place */
  634|      8|    (void)ossl_rsa_pss_params_30_set_defaults(&pss_params);
  635|       |
  636|      8|    if (pss == NULL)
  ------------------
  |  Branch (636:9): [True: 0, False: 8]
  ------------------
  637|      0|        return 0;
  638|      8|    *pmd = ossl_x509_algor_get_md(pss->hashAlgorithm);
  639|      8|    if (*pmd == NULL)
  ------------------
  |  Branch (639:9): [True: 0, False: 8]
  ------------------
  640|      0|        return 0;
  641|      8|    *pmgf1md = ossl_x509_algor_get_md(pss->maskHash);
  642|      8|    if (*pmgf1md == NULL)
  ------------------
  |  Branch (642:9): [True: 0, False: 8]
  ------------------
  643|      0|        return 0;
  644|      8|    if (pss->saltLength)
  ------------------
  |  Branch (644:9): [True: 0, False: 8]
  ------------------
  645|      0|        *psaltlen = ASN1_INTEGER_get(pss->saltLength);
  646|      8|    else
  647|      8|        *psaltlen = ossl_rsa_pss_params_30_saltlen(&pss_params);
  648|      8|    if (pss->trailerField)
  ------------------
  |  Branch (648:9): [True: 0, False: 8]
  ------------------
  649|      0|        *ptrailerField = ASN1_INTEGER_get(pss->trailerField);
  650|      8|    else
  651|      8|        *ptrailerField = ossl_rsa_pss_params_30_trailerfield(&pss_params);
  652|       |
  653|      8|    return 1;
  654|      8|}
ossl_rsa_param_decode:
  657|     66|{
  658|     66|    RSA_PSS_PARAMS *pss;
  659|     66|    const ASN1_OBJECT *algoid;
  660|     66|    const void *algp;
  661|     66|    int algptype;
  662|       |
  663|     66|    X509_ALGOR_get0(&algoid, &algptype, &algp, alg);
  664|     66|    if (OBJ_obj2nid(algoid) != EVP_PKEY_RSA_PSS)
  ------------------
  |  |   65|     66|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|     66|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (664:9): [True: 50, False: 16]
  ------------------
  665|     50|        return 1;
  666|     16|    if (algptype == V_ASN1_UNDEF)
  ------------------
  |  |   60|     16|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (666:9): [True: 1, False: 15]
  ------------------
  667|      1|        return 1;
  668|     15|    if (algptype != V_ASN1_SEQUENCE) {
  ------------------
  |  |   74|     15|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (668:9): [True: 6, False: 9]
  ------------------
  669|      6|        ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS);
  ------------------
  |  |  401|      6|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      6|    (ERR_new(),                                                 \
  |  |  |  |  404|      6|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      6|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      6|     ERR_set_error)
  |  |  ------------------
  ------------------
  670|      6|        return 0;
  671|      6|    }
  672|      9|    if ((pss = ossl_rsa_pss_decode(alg)) == NULL
  ------------------
  |  Branch (672:9): [True: 1, False: 8]
  ------------------
  673|      9|        || !ossl_rsa_set0_pss_params(rsa, pss)) {
  ------------------
  |  Branch (673:12): [True: 0, False: 8]
  ------------------
  674|      1|        RSA_PSS_PARAMS_free(pss);
  675|      1|        return 0;
  676|      1|    }
  677|      8|    if (!ossl_rsa_sync_to_pss_params_30(rsa))
  ------------------
  |  Branch (677:9): [True: 0, False: 8]
  ------------------
  678|      0|        return 0;
  679|      8|    return 1;
  680|      8|}
ossl_rsa_key_from_pkcs8:
  684|     22|{
  685|     22|    const unsigned char *p;
  686|     22|    RSA *rsa;
  687|     22|    int pklen;
  688|     22|    const X509_ALGOR *alg;
  689|       |
  690|     22|    if (!PKCS8_pkey_get0(NULL, &p, &pklen, &alg, p8inf))
  ------------------
  |  Branch (690:9): [True: 0, False: 22]
  ------------------
  691|      0|        return 0;
  692|     22|    rsa = d2i_RSAPrivateKey(NULL, &p, pklen);
  693|     22|    if (rsa == NULL) {
  ------------------
  |  Branch (693:9): [True: 5, False: 17]
  ------------------
  694|      5|        ERR_raise(ERR_LIB_RSA, ERR_R_RSA_LIB);
  ------------------
  |  |  401|      5|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      5|    (ERR_new(),                                                 \
  |  |  |  |  404|      5|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      5|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      5|     ERR_set_error)
  |  |  ------------------
  ------------------
  695|      5|        return NULL;
  696|      5|    }
  697|     17|    if (!ossl_rsa_param_decode(rsa, alg)) {
  ------------------
  |  Branch (697:9): [True: 5, False: 12]
  ------------------
  698|      5|        RSA_free(rsa);
  699|      5|        return NULL;
  700|      5|    }
  701|       |
  702|     12|    RSA_clear_flags(rsa, RSA_FLAG_TYPE_MASK);
  ------------------
  |  |  117|     12|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  703|     12|    switch (OBJ_obj2nid(alg->algorithm)) {
  704|      7|    case EVP_PKEY_RSA:
  ------------------
  |  |   63|      7|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|      7|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  |  Branch (704:5): [True: 7, False: 5]
  ------------------
  705|      7|        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSA);
  ------------------
  |  |  118|      7|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  706|      7|        break;
  707|      5|    case EVP_PKEY_RSA_PSS:
  ------------------
  |  |   65|      5|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      5|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (707:5): [True: 5, False: 7]
  ------------------
  708|      5|        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSASSAPSS);
  ------------------
  |  |  119|      5|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  709|      5|        break;
  710|      0|    default:
  ------------------
  |  Branch (710:5): [True: 0, False: 12]
  ------------------
  711|       |        /* Leave the type bits zero */
  712|      0|        break;
  713|     12|    }
  714|       |
  715|     12|    return rsa;
  716|     12|}
rsa_backend.c:ossl_rsa_sync_to_pss_params_30:
  589|      8|{
  590|      8|    const RSA_PSS_PARAMS *legacy_pss = NULL;
  591|      8|    RSA_PSS_PARAMS_30 *pss = NULL;
  592|       |
  593|      8|    if (rsa != NULL
  ------------------
  |  Branch (593:9): [True: 8, False: 0]
  ------------------
  594|      8|        && (legacy_pss = RSA_get0_pss_params(rsa)) != NULL
  ------------------
  |  Branch (594:12): [True: 8, False: 0]
  ------------------
  595|      8|        && (pss = ossl_rsa_get0_pss_params_30(rsa)) != NULL) {
  ------------------
  |  Branch (595:12): [True: 8, False: 0]
  ------------------
  596|      8|        const EVP_MD *md = NULL, *mgf1md = NULL;
  597|      8|        int md_nid, mgf1md_nid, saltlen, trailerField;
  598|      8|        RSA_PSS_PARAMS_30 pss_params;
  599|       |
  600|       |        /*
  601|       |         * We don't care about the validity of the fields here, we just
  602|       |         * want to synchronise values.  Verifying here makes it impossible
  603|       |         * to even read a key with invalid values, making it hard to test
  604|       |         * a bad situation.
  605|       |         *
  606|       |         * Other routines use ossl_rsa_pss_get_param(), so the values will
  607|       |         * be checked, eventually.
  608|       |         */
  609|      8|        if (!ossl_rsa_pss_get_param_unverified(legacy_pss, &md, &mgf1md,
  ------------------
  |  Branch (609:13): [True: 0, False: 8]
  ------------------
  610|      8|                                               &saltlen, &trailerField))
  611|      0|            return 0;
  612|      8|        md_nid = EVP_MD_get_type(md);
  613|      8|        mgf1md_nid = EVP_MD_get_type(mgf1md);
  614|      8|        if (!ossl_rsa_pss_params_30_set_defaults(&pss_params)
  ------------------
  |  Branch (614:13): [True: 0, False: 8]
  ------------------
  615|      8|            || !ossl_rsa_pss_params_30_set_hashalg(&pss_params, md_nid)
  ------------------
  |  Branch (615:16): [True: 0, False: 8]
  ------------------
  616|      8|            || !ossl_rsa_pss_params_30_set_maskgenhashalg(&pss_params,
  ------------------
  |  Branch (616:16): [True: 0, False: 8]
  ------------------
  617|      8|                                                          mgf1md_nid)
  618|      8|            || !ossl_rsa_pss_params_30_set_saltlen(&pss_params, saltlen)
  ------------------
  |  Branch (618:16): [True: 0, False: 8]
  ------------------
  619|      8|            || !ossl_rsa_pss_params_30_set_trailerfield(&pss_params,
  ------------------
  |  Branch (619:16): [True: 0, False: 8]
  ------------------
  620|      8|                                                        trailerField))
  621|      0|            return 0;
  622|      8|        *pss = pss_params;
  623|      8|    }
  624|      8|    return 1;
  625|      8|}

RSA_bits:
   24|    187|{
   25|    187|    return BN_num_bits(r->n);
   26|    187|}
RSA_size:
   29|    187|{
   30|    187|    return BN_num_bytes(r->n);
  ------------------
  |  |  189|    187|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
   31|    187|}

ossl_err_load_RSA_strings:
  160|      2|{
  161|      2|#ifndef OPENSSL_NO_ERR
  162|      2|    if (ERR_reason_error_string(RSA_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (162:9): [True: 2, False: 0]
  ------------------
  163|      2|        ERR_load_strings_const(RSA_str_reasons);
  164|      2|#endif
  165|      2|    return 1;
  166|      2|}

RSA_new:
   35|  48.6k|{
   36|  48.6k|    return rsa_new_intern(NULL, NULL);
   37|  48.6k|}
RSA_get_method:
   40|    414|{
   41|    414|    return rsa->meth;
   42|    414|}
RSA_free:
  137|   100k|{
  138|   100k|    int i;
  139|       |
  140|   100k|    if (r == NULL)
  ------------------
  |  Branch (140:9): [True: 51.7k, False: 48.6k]
  ------------------
  141|  51.7k|        return;
  142|       |
  143|  48.6k|    CRYPTO_DOWN_REF(&r->references, &i);
  144|  48.6k|    REF_PRINT_COUNT("RSA", i, r);
  ------------------
  |  |  301|  48.6k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  48.6k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  48.6k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  48.6k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|  48.6k|    if (i > 0)
  ------------------
  |  Branch (145:9): [True: 47, False: 48.6k]
  ------------------
  146|     47|        return;
  147|  48.6k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|  48.6k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 48.6k]
  |  |  ------------------
  ------------------
  148|       |
  149|  48.6k|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (149:9): [True: 48.6k, False: 0]
  |  Branch (149:28): [True: 48.6k, False: 0]
  ------------------
  150|  48.6k|        r->meth->finish(r);
  151|  48.6k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  152|  48.6k|    ENGINE_finish(r->engine);
  153|  48.6k|#endif
  154|       |
  155|  48.6k|#ifndef FIPS_MODULE
  156|  48.6k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, r, &r->ex_data);
  ------------------
  |  |  238|  48.6k|# define CRYPTO_EX_INDEX_RSA              9
  ------------------
  157|  48.6k|#endif
  158|       |
  159|  48.6k|    CRYPTO_THREAD_lock_free(r->lock);
  160|  48.6k|    CRYPTO_FREE_REF(&r->references);
  161|       |
  162|       |#ifdef OPENSSL_PEDANTIC_ZEROIZATION
  163|       |    BN_clear_free(r->n);
  164|       |    BN_clear_free(r->e);
  165|       |#else
  166|  48.6k|    BN_free(r->n);
  167|  48.6k|    BN_free(r->e);
  168|  48.6k|#endif
  169|  48.6k|    BN_clear_free(r->d);
  170|  48.6k|    BN_clear_free(r->p);
  171|  48.6k|    BN_clear_free(r->q);
  172|  48.6k|    BN_clear_free(r->dmp1);
  173|  48.6k|    BN_clear_free(r->dmq1);
  174|  48.6k|    BN_clear_free(r->iqmp);
  175|       |
  176|       |#if defined(FIPS_MODULE) && !defined(OPENSSL_NO_ACVP_TESTS)
  177|       |    ossl_rsa_acvp_test_free(r->acvp_test);
  178|       |#endif
  179|       |
  180|  48.6k|#ifndef FIPS_MODULE
  181|  48.6k|    RSA_PSS_PARAMS_free(r->pss);
  182|  48.6k|    sk_RSA_PRIME_INFO_pop_free(r->prime_infos, ossl_rsa_multip_info_free);
  183|  48.6k|#endif
  184|  48.6k|    BN_BLINDING_free(r->blinding);
  185|  48.6k|    BN_BLINDING_free(r->mt_blinding);
  186|  48.6k|    OPENSSL_free(r);
  ------------------
  |  |  115|  48.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  48.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  48.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  187|  48.6k|}
RSA_up_ref:
  190|     47|{
  191|     47|    int i;
  192|       |
  193|     47|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (193:9): [True: 0, False: 47]
  ------------------
  194|      0|        return 0;
  195|       |
  196|     47|    REF_PRINT_COUNT("RSA", i, r);
  ------------------
  |  |  301|     47|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|     47|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|     47|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|     47|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|     47|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|     47|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 47]
  |  |  ------------------
  ------------------
  198|     47|    return i > 1 ? 1 : 0;
  ------------------
  |  Branch (198:12): [True: 47, False: 0]
  ------------------
  199|     47|}
ossl_rsa_set0_libctx:
  207|    187|{
  208|    187|    r->libctx = libctx;
  209|    187|}
ossl_ifc_ffc_compute_security_bits:
  323|    167|{
  324|    167|    uint64_t x;
  325|    167|    uint32_t lx;
  326|    167|    uint16_t y, cap;
  327|       |
  328|       |    /*
  329|       |     * Look for common values as listed in standards.
  330|       |     * These values are not exactly equal to the results from the formulae in
  331|       |     * the standards but are defined to be canonical.
  332|       |     */
  333|    167|    switch (n) {
  ------------------
  |  Branch (333:13): [True: 153, False: 14]
  ------------------
  334|      1|    case 2048:      /* SP 800-56B rev 2 Appendix D and FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (334:5): [True: 1, False: 166]
  ------------------
  335|      1|        return 112;
  336|      1|    case 3072:      /* SP 800-56B rev 2 Appendix D and FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (336:5): [True: 1, False: 166]
  ------------------
  337|      1|        return 128;
  338|      2|    case 4096:      /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (338:5): [True: 2, False: 165]
  ------------------
  339|      2|        return 152;
  340|      1|    case 6144:      /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (340:5): [True: 1, False: 166]
  ------------------
  341|      1|        return 176;
  342|      3|    case 7680:      /* FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (342:5): [True: 3, False: 164]
  ------------------
  343|      3|        return 192;
  344|      3|    case 8192:      /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (344:5): [True: 3, False: 164]
  ------------------
  345|      3|        return 200;
  346|      3|    case 15360:     /* FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (346:5): [True: 3, False: 164]
  ------------------
  347|      3|        return 256;
  348|    167|    }
  349|       |
  350|       |    /*
  351|       |     * The first incorrect result (i.e. not accurate or off by one low) occurs
  352|       |     * for n = 699668.  The true value here is 1200.  Instead of using this n
  353|       |     * as the check threshold, the smallest n such that the correct result is
  354|       |     * 1200 is used instead.
  355|       |     */
  356|    153|    if (n >= 687737)
  ------------------
  |  Branch (356:9): [True: 0, False: 153]
  ------------------
  357|      0|        return 1200;
  358|    153|    if (n < 8)
  ------------------
  |  Branch (358:9): [True: 20, False: 133]
  ------------------
  359|     20|        return 0;
  360|       |
  361|       |    /*
  362|       |     * To ensure that the output is non-decreasing with respect to n,
  363|       |     * a cap needs to be applied to the two values where the function over
  364|       |     * estimates the strength (according to the above fast path).
  365|       |     */
  366|    133|    if (n <= 7680)
  ------------------
  |  Branch (366:9): [True: 98, False: 35]
  ------------------
  367|     98|        cap = 192;
  368|     35|    else if (n <= 15360)
  ------------------
  |  Branch (368:14): [True: 25, False: 10]
  ------------------
  369|     25|        cap = 256;
  370|     10|    else
  371|     10|        cap = 1200;
  372|       |
  373|    133|    x = n * (uint64_t)log_2;
  374|    133|    lx = ilog_e(x);
  375|    133|    y = (uint16_t)((mul2(c1_923, icbrt64(mul2(mul2(x, lx), lx))) - c4_690)
  376|    133|                   / log_2);
  377|    133|    y = (y + 4) & ~7;
  378|    133|    if (y > cap)
  ------------------
  |  Branch (378:9): [True: 10, False: 123]
  ------------------
  379|     10|        y = cap;
  380|    133|    return y;
  381|    153|}
RSA_security_bits:
  386|    187|{
  387|    187|    int bits = BN_num_bits(rsa->n);
  388|       |
  389|    187|#ifndef FIPS_MODULE
  390|    187|    if (rsa->version == RSA_ASN1_VERSION_MULTI) {
  ------------------
  |  |   60|    187|#  define RSA_ASN1_VERSION_MULTI          1
  ------------------
  |  Branch (390:9): [True: 29, False: 158]
  ------------------
  391|       |        /* This ought to mean that we have private key at hand. */
  392|     29|        int ex_primes = sk_RSA_PRIME_INFO_num(rsa->prime_infos);
  393|       |
  394|     29|        if (ex_primes <= 0 || (ex_primes + 2) > ossl_rsa_multip_cap(bits))
  ------------------
  |  Branch (394:13): [True: 0, False: 29]
  |  Branch (394:31): [True: 20, False: 9]
  ------------------
  395|     20|            return 0;
  396|     29|    }
  397|    167|#endif
  398|    167|    return ossl_ifc_ffc_compute_security_bits(bits);
  399|    187|}
RSA_get0_key:
  556|    327|{
  557|    327|    if (n != NULL)
  ------------------
  |  Branch (557:9): [True: 327, False: 0]
  ------------------
  558|    327|        *n = r->n;
  559|    327|    if (e != NULL)
  ------------------
  |  Branch (559:9): [True: 327, False: 0]
  ------------------
  560|    327|        *e = r->e;
  561|    327|    if (d != NULL)
  ------------------
  |  Branch (561:9): [True: 327, False: 0]
  ------------------
  562|    327|        *d = r->d;
  563|    327|}
RSA_get_multi_prime_extra_count:
  575|  1.09k|{
  576|  1.09k|    int pnum;
  577|       |
  578|  1.09k|    pnum = sk_RSA_PRIME_INFO_num(r->prime_infos);
  579|  1.09k|    if (pnum <= 0)
  ------------------
  |  Branch (579:9): [True: 375, False: 717]
  ------------------
  580|    375|        pnum = 0;
  581|  1.09k|    return pnum;
  582|  1.09k|}
RSA_get0_n:
  646|  2.04k|{
  647|  2.04k|    return r->n;
  648|  2.04k|}
RSA_get0_d:
  656|  1.81k|{
  657|  1.81k|    return r->d;
  658|  1.81k|}
RSA_get0_p:
  661|  2.27k|{
  662|  2.27k|    return r->p;
  663|  2.27k|}
RSA_get0_q:
  666|  1.09k|{
  667|  1.09k|    return r->q;
  668|  1.09k|}
RSA_get0_dmp1:
  671|  1.09k|{
  672|  1.09k|    return r->dmp1;
  673|  1.09k|}
RSA_get0_dmq1:
  676|  1.09k|{
  677|  1.09k|    return r->dmq1;
  678|  1.09k|}
RSA_get0_iqmp:
  681|  1.09k|{
  682|  1.09k|    return r->iqmp;
  683|  1.09k|}
RSA_get0_pss_params:
  686|      8|{
  687|       |#ifdef FIPS_MODULE
  688|       |    return NULL;
  689|       |#else
  690|      8|    return r->pss;
  691|      8|#endif
  692|      8|}
ossl_rsa_set0_pss_params:
  696|      8|{
  697|       |#ifdef FIPS_MODULE
  698|       |    return 0;
  699|       |#else
  700|      8|    RSA_PSS_PARAMS_free(r->pss);
  701|      8|    r->pss = pss;
  702|      8|    return 1;
  703|      8|#endif
  704|      8|}
ossl_rsa_get0_pss_params_30:
  708|    337|{
  709|    337|    return &r->pss_params;
  710|    337|}
RSA_clear_flags:
  713|     59|{
  714|     59|    r->flags &= ~flags;
  715|     59|}
RSA_test_flags:
  718|  1.51k|{
  719|  1.51k|    return r->flags & flags;
  720|  1.51k|}
RSA_set_flags:
  723|     59|{
  724|     59|    r->flags |= flags;
  725|     59|}
ossl_rsa_get0_all_params:
  877|  1.18k|{
  878|  1.18k|#ifndef FIPS_MODULE
  879|  1.18k|    RSA_PRIME_INFO *pinfo;
  880|  1.18k|    int i, pnum;
  881|  1.18k|#endif
  882|       |
  883|  1.18k|    if (r == NULL)
  ------------------
  |  Branch (883:9): [True: 0, False: 1.18k]
  ------------------
  884|      0|        return 0;
  885|       |
  886|       |    /* If |p| is NULL, there are no CRT parameters */
  887|  1.18k|    if (RSA_get0_p(r) == NULL)
  ------------------
  |  Branch (887:9): [True: 94, False: 1.09k]
  ------------------
  888|     94|        return 1;
  889|       |
  890|  1.09k|    sk_BIGNUM_const_push(primes, RSA_get0_p(r));
  891|  1.09k|    sk_BIGNUM_const_push(primes, RSA_get0_q(r));
  892|  1.09k|    sk_BIGNUM_const_push(exps, RSA_get0_dmp1(r));
  893|  1.09k|    sk_BIGNUM_const_push(exps, RSA_get0_dmq1(r));
  894|  1.09k|    sk_BIGNUM_const_push(coeffs, RSA_get0_iqmp(r));
  895|       |
  896|  1.09k|#ifndef FIPS_MODULE
  897|  1.09k|    pnum = RSA_get_multi_prime_extra_count(r);
  898|  21.1k|    for (i = 0; i < pnum; i++) {
  ------------------
  |  Branch (898:17): [True: 20.0k, False: 1.09k]
  ------------------
  899|  20.0k|        pinfo = sk_RSA_PRIME_INFO_value(r->prime_infos, i);
  900|  20.0k|        sk_BIGNUM_const_push(primes, pinfo->r);
  901|  20.0k|        sk_BIGNUM_const_push(exps, pinfo->d);
  902|  20.0k|        sk_BIGNUM_const_push(coeffs, pinfo->t);
  903|  20.0k|    }
  904|  1.09k|#endif
  905|       |
  906|  1.09k|    return 1;
  907|  1.18k|}
ossl_rsa_check_factors:
  911|    859|{
  912|    859|    int valid = 0;
  913|    859|    int n, i, bits;
  914|    859|    STACK_OF(BIGNUM_const) *factors = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|    859|# define STACK_OF(type) struct stack_st_##type
  ------------------
  915|    859|    STACK_OF(BIGNUM_const) *exps = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|    859|# define STACK_OF(type) struct stack_st_##type
  ------------------
  916|    859|    STACK_OF(BIGNUM_const) *coeffs = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|    859|# define STACK_OF(type) struct stack_st_##type
  ------------------
  917|       |
  918|    859|    if (factors == NULL || exps == NULL || coeffs == NULL)
  ------------------
  |  Branch (918:9): [True: 0, False: 859]
  |  Branch (918:28): [True: 0, False: 859]
  |  Branch (918:44): [True: 0, False: 859]
  ------------------
  919|      0|        goto done;
  920|       |
  921|       |    /*
  922|       |     * Simple sanity check for RSA key. All RSA key parameters
  923|       |     * must be less-than/equal-to RSA parameter n.
  924|       |     */
  925|    859|    ossl_rsa_get0_all_params(r, factors, exps, coeffs);
  926|    859|    n = safe_BN_num_bits(RSA_get0_n(r));
  ------------------
  |  |  909|    859|#define safe_BN_num_bits(_k_)  (((_k_) == NULL) ? 0 : BN_num_bits((_k_)))
  |  |  ------------------
  |  |  |  Branch (909:33): [True: 0, False: 859]
  |  |  ------------------
  ------------------
  927|       |
  928|    859|    if (safe_BN_num_bits(RSA_get0_d(r)) > n)
  ------------------
  |  |  909|    859|#define safe_BN_num_bits(_k_)  (((_k_) == NULL) ? 0 : BN_num_bits((_k_)))
  |  |  ------------------
  |  |  |  Branch (909:33): [True: 47, False: 812]
  |  |  ------------------
  ------------------
  |  Branch (928:9): [True: 265, False: 594]
  ------------------
  929|    265|        goto done;
  930|       |
  931|  5.30k|    for (i = 0; i < sk_BIGNUM_const_num(exps); i++) {
  ------------------
  |  Branch (931:17): [True: 4.98k, False: 321]
  ------------------
  932|  4.98k|        bits = safe_BN_num_bits(sk_BIGNUM_const_value(exps, i));
  ------------------
  |  |  909|  4.98k|#define safe_BN_num_bits(_k_)  (((_k_) == NULL) ? 0 : BN_num_bits((_k_)))
  |  |  ------------------
  |  |  |  Branch (909:33): [True: 0, False: 4.98k]
  |  |  ------------------
  ------------------
  933|  4.98k|        if (bits > n)
  ------------------
  |  Branch (933:13): [True: 273, False: 4.71k]
  ------------------
  934|    273|            goto done;
  935|  4.98k|    }
  936|       |
  937|  2.67k|    for (i = 0; i < sk_BIGNUM_const_num(factors); i++) {
  ------------------
  |  Branch (937:17): [True: 2.43k, False: 238]
  ------------------
  938|  2.43k|        bits = safe_BN_num_bits(sk_BIGNUM_const_value(factors, i));
  ------------------
  |  |  909|  2.43k|#define safe_BN_num_bits(_k_)  (((_k_) == NULL) ? 0 : BN_num_bits((_k_)))
  |  |  ------------------
  |  |  |  Branch (909:33): [True: 0, False: 2.43k]
  |  |  ------------------
  ------------------
  939|  2.43k|        if (bits > n)
  ------------------
  |  Branch (939:13): [True: 83, False: 2.35k]
  ------------------
  940|     83|            goto done;
  941|  2.43k|    }
  942|       |
  943|  2.15k|    for (i = 0; i < sk_BIGNUM_const_num(coeffs); i++) {
  ------------------
  |  Branch (943:17): [True: 1.96k, False: 187]
  ------------------
  944|  1.96k|        bits = safe_BN_num_bits(sk_BIGNUM_const_value(coeffs, i));
  ------------------
  |  |  909|  1.96k|#define safe_BN_num_bits(_k_)  (((_k_) == NULL) ? 0 : BN_num_bits((_k_)))
  |  |  ------------------
  |  |  |  Branch (909:33): [True: 0, False: 1.96k]
  |  |  ------------------
  ------------------
  945|  1.96k|        if (bits > n)
  ------------------
  |  Branch (945:13): [True: 51, False: 1.91k]
  ------------------
  946|     51|            goto done;
  947|  1.96k|    }
  948|       |
  949|    187|    valid = 1;
  950|       |
  951|    859|done:
  952|    859|    sk_BIGNUM_const_free(factors);
  953|    859|    sk_BIGNUM_const_free(exps);
  954|    859|    sk_BIGNUM_const_free(coeffs);
  955|       |
  956|    859|    return valid;
  957|    187|}
rsa_lib.c:rsa_new_intern:
   76|  48.6k|{
   77|  48.6k|    RSA *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  48.6k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  48.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  48.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   78|       |
   79|  48.6k|    if (ret == NULL)
  ------------------
  |  Branch (79:9): [True: 0, False: 48.6k]
  ------------------
   80|      0|        return NULL;
   81|       |
   82|  48.6k|    ret->lock = CRYPTO_THREAD_lock_new();
   83|  48.6k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (83:9): [True: 0, False: 48.6k]
  ------------------
   84|      0|        ERR_raise(ERR_LIB_RSA, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   85|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   86|      0|        return NULL;
   87|      0|    }
   88|       |
   89|  48.6k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 48.6k]
  ------------------
   90|      0|        CRYPTO_THREAD_lock_free(ret->lock);
   91|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|      0|        return NULL;
   93|      0|    }
   94|       |
   95|  48.6k|    ret->libctx = libctx;
   96|  48.6k|    ret->meth = RSA_get_default_method();
   97|  48.6k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   98|  48.6k|    ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW;
  ------------------
  |  |  477|  48.6k|#  define RSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
   99|  48.6k|    if (engine) {
  ------------------
  |  Branch (99:9): [True: 0, False: 48.6k]
  ------------------
  100|      0|        if (!ENGINE_init(engine)) {
  ------------------
  |  Branch (100:13): [True: 0, False: 0]
  ------------------
  101|      0|            ERR_raise(ERR_LIB_RSA, ERR_R_ENGINE_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  102|      0|            goto err;
  103|      0|        }
  104|      0|        ret->engine = engine;
  105|  48.6k|    } else {
  106|  48.6k|        ret->engine = ENGINE_get_default_RSA();
  107|  48.6k|    }
  108|  48.6k|    if (ret->engine) {
  ------------------
  |  Branch (108:9): [True: 0, False: 48.6k]
  ------------------
  109|      0|        ret->meth = ENGINE_get_RSA(ret->engine);
  110|      0|        if (ret->meth == NULL) {
  ------------------
  |  Branch (110:13): [True: 0, False: 0]
  ------------------
  111|      0|            ERR_raise(ERR_LIB_RSA, ERR_R_ENGINE_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  112|      0|            goto err;
  113|      0|        }
  114|      0|    }
  115|  48.6k|#endif
  116|       |
  117|  48.6k|    ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW;
  ------------------
  |  |  477|  48.6k|#  define RSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
  118|  48.6k|#ifndef FIPS_MODULE
  119|  48.6k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data)) {
  ------------------
  |  |  238|  48.6k|# define CRYPTO_EX_INDEX_RSA              9
  ------------------
  |  Branch (119:9): [True: 0, False: 48.6k]
  ------------------
  120|      0|        goto err;
  121|      0|    }
  122|  48.6k|#endif
  123|       |
  124|  48.6k|    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
  ------------------
  |  Branch (124:9): [True: 48.6k, False: 0]
  |  Branch (124:38): [True: 0, False: 48.6k]
  ------------------
  125|      0|        ERR_raise(ERR_LIB_RSA, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        goto err;
  127|      0|    }
  128|       |
  129|  48.6k|    return ret;
  130|       |
  131|      0| err:
  132|      0|    RSA_free(ret);
  133|      0|    return NULL;
  134|  48.6k|}
rsa_lib.c:ilog_e:
  280|    133|{
  281|    133|    uint32_t i, r = 0;
  282|       |
  283|       |    /*
  284|       |     * Scale down the value into the range 1 .. 2.
  285|       |     *
  286|       |     * If fractional numbers need to be processed, another loop needs
  287|       |     * to go here that checks v < scale and if so multiplies it by 2 and
  288|       |     * reduces r by scale.  This also means making r signed.
  289|       |     */
  290|  1.15k|    while (v >= 2 * scale) {
  ------------------
  |  Branch (290:12): [True: 1.02k, False: 133]
  ------------------
  291|  1.02k|        v >>= 1;
  292|  1.02k|        r += scale;
  293|  1.02k|    }
  294|  2.52k|    for (i = scale / 2; i != 0; i /= 2) {
  ------------------
  |  Branch (294:25): [True: 2.39k, False: 133]
  ------------------
  295|  2.39k|        v = mul2(v, v);
  296|  2.39k|        if (v >= 2 * scale) {
  ------------------
  |  Branch (296:13): [True: 1.16k, False: 1.23k]
  ------------------
  297|  1.16k|            v >>= 1;
  298|  1.16k|            r += i;
  299|  1.16k|        }
  300|  2.39k|    }
  301|    133|    r = (r * (uint64_t)scale) / log_e;
  302|    133|    return r;
  303|    133|}
rsa_lib.c:mul2:
  244|  2.79k|{
  245|  2.79k|    return a * b / scale;
  246|  2.79k|}
rsa_lib.c:icbrt64:
  256|    133|{
  257|    133|    uint64_t r = 0;
  258|    133|    uint64_t b;
  259|    133|    int s;
  260|       |
  261|  3.05k|    for (s = 63; s >= 0; s -= 3) {
  ------------------
  |  Branch (261:18): [True: 2.92k, False: 133]
  ------------------
  262|  2.92k|        r <<= 1;
  263|  2.92k|        b = 3 * r * (r + 1) + 1;
  264|  2.92k|        if ((x >> s) >= b) {
  ------------------
  |  Branch (264:13): [True: 640, False: 2.28k]
  ------------------
  265|    640|            x -= b << s;
  266|    640|            r++;
  267|    640|        }
  268|  2.92k|    }
  269|    133|    return r * cbrt_scale;
  270|    133|}

ossl_rsa_multip_info_free_ex:
   16|  64.6k|{
   17|       |    /* free pp and pinfo only */
   18|  64.6k|    BN_clear_free(pinfo->pp);
   19|  64.6k|    OPENSSL_free(pinfo);
  ------------------
  |  |  115|  64.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  64.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  64.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   20|  64.6k|}
ossl_rsa_multip_info_free:
   23|  64.6k|{
   24|       |    /* free an RSA_PRIME_INFO structure */
   25|  64.6k|    BN_clear_free(pinfo->r);
   26|  64.6k|    BN_clear_free(pinfo->d);
   27|  64.6k|    BN_clear_free(pinfo->t);
   28|  64.6k|    ossl_rsa_multip_info_free_ex(pinfo);
   29|  64.6k|}
ossl_rsa_multip_calc_product:
   60|  1.16k|{
   61|  1.16k|    RSA_PRIME_INFO *pinfo;
   62|  1.16k|    BIGNUM *p1 = NULL, *p2 = NULL;
   63|  1.16k|    BN_CTX *ctx = NULL;
   64|  1.16k|    int i, rv = 0, ex_primes;
   65|       |
   66|  1.16k|    if ((ex_primes = sk_RSA_PRIME_INFO_num(rsa->prime_infos)) <= 0) {
  ------------------
  |  Branch (66:9): [True: 7, False: 1.16k]
  ------------------
   67|       |        /* invalid */
   68|      7|        goto err;
   69|      7|    }
   70|       |
   71|  1.16k|    if ((ctx = BN_CTX_new()) == NULL)
  ------------------
  |  Branch (71:9): [True: 0, False: 1.16k]
  ------------------
   72|      0|        goto err;
   73|       |
   74|       |    /* calculate pinfo->pp = p * q for first 'extra' prime */
   75|  1.16k|    p1 = rsa->p;
   76|  1.16k|    p2 = rsa->q;
   77|       |
   78|  48.8k|    for (i = 0; i < ex_primes; i++) {
  ------------------
  |  Branch (78:17): [True: 47.6k, False: 1.16k]
  ------------------
   79|  47.6k|        pinfo = sk_RSA_PRIME_INFO_value(rsa->prime_infos, i);
   80|  47.6k|        if (pinfo->pp == NULL) {
  ------------------
  |  Branch (80:13): [True: 47.6k, False: 0]
  ------------------
   81|  47.6k|            pinfo->pp = BN_secure_new();
   82|  47.6k|            if (pinfo->pp == NULL)
  ------------------
  |  Branch (82:17): [True: 0, False: 47.6k]
  ------------------
   83|      0|                goto err;
   84|  47.6k|        }
   85|  47.6k|        if (!BN_mul(pinfo->pp, p1, p2, ctx))
  ------------------
  |  Branch (85:13): [True: 0, False: 47.6k]
  ------------------
   86|      0|            goto err;
   87|       |        /* save previous one */
   88|  47.6k|        p1 = pinfo->pp;
   89|  47.6k|        p2 = pinfo->r;
   90|  47.6k|    }
   91|       |
   92|  1.16k|    rv = 1;
   93|  1.16k| err:
   94|  1.16k|    BN_CTX_free(ctx);
   95|  1.16k|    return rv;
   96|  1.16k|}
ossl_rsa_multip_cap:
   99|     29|{
  100|     29|    int cap = RSA_MAX_PRIME_NUM;
  ------------------
  |  |   16|     29|#define RSA_MAX_PRIME_NUM       5
  ------------------
  101|       |
  102|     29|    if (bits < 1024)
  ------------------
  |  Branch (102:9): [True: 20, False: 9]
  ------------------
  103|     20|        cap = 2;
  104|      9|    else if (bits < 4096)
  ------------------
  |  Branch (104:14): [True: 4, False: 5]
  ------------------
  105|      4|        cap = 3;
  106|      5|    else if (bits < 8192)
  ------------------
  |  Branch (106:14): [True: 4, False: 1]
  ------------------
  107|      4|        cap = 4;
  108|       |
  109|     29|    if (cap > RSA_MAX_PRIME_NUM)
  ------------------
  |  |   16|     29|#define RSA_MAX_PRIME_NUM       5
  ------------------
  |  Branch (109:9): [True: 0, False: 29]
  ------------------
  110|      0|        cap = RSA_MAX_PRIME_NUM;
  ------------------
  |  |   16|      0|#define RSA_MAX_PRIME_NUM       5
  ------------------
  111|       |
  112|     29|    return cap;
  113|     29|}

RSA_get_default_method:
   85|  48.6k|{
   86|  48.6k|    return default_RSA_meth;
   87|  48.6k|}
RSA_PKCS1_OpenSSL:
   90|    414|{
   91|    414|    return &rsa_pkcs1_ossl_meth;
   92|    414|}
rsa_ossl.c:rsa_ossl_init:
 1177|  48.6k|{
 1178|  48.6k|    rsa->flags |= RSA_FLAG_CACHE_PUBLIC | RSA_FLAG_CACHE_PRIVATE;
  ------------------
  |  |   65|  48.6k|#  define RSA_FLAG_CACHE_PUBLIC           0x0002
  ------------------
                  rsa->flags |= RSA_FLAG_CACHE_PUBLIC | RSA_FLAG_CACHE_PRIVATE;
  ------------------
  |  |   66|  48.6k|#  define RSA_FLAG_CACHE_PRIVATE          0x0004
  ------------------
 1179|  48.6k|    return 1;
 1180|  48.6k|}
rsa_ossl.c:rsa_ossl_finish:
 1183|  48.6k|{
 1184|  48.6k|#ifndef FIPS_MODULE
 1185|  48.6k|    int i;
 1186|  48.6k|    RSA_PRIME_INFO *pinfo;
 1187|       |
 1188|   113k|    for (i = 0; i < sk_RSA_PRIME_INFO_num(rsa->prime_infos); i++) {
  ------------------
  |  Branch (1188:17): [True: 64.6k, False: 48.6k]
  ------------------
 1189|  64.6k|        pinfo = sk_RSA_PRIME_INFO_value(rsa->prime_infos, i);
 1190|  64.6k|        BN_MONT_CTX_free(pinfo->m);
 1191|  64.6k|    }
 1192|  48.6k|#endif
 1193|       |
 1194|  48.6k|    BN_MONT_CTX_free(rsa->_method_mod_n);
 1195|  48.6k|    BN_MONT_CTX_free(rsa->_method_mod_p);
 1196|  48.6k|    BN_MONT_CTX_free(rsa->_method_mod_q);
 1197|  48.6k|    return 1;
 1198|  48.6k|}

ossl_rsa_pss_params_30_set_defaults:
  326|     16|{
  327|     16|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (327:9): [True: 0, False: 16]
  ------------------
  328|      0|        return 0;
  329|     16|    *rsa_pss_params = default_RSASSA_PSS_params;
  330|     16|    return 1;
  331|     16|}
ossl_rsa_pss_params_30_is_unrestricted:
  334|    152|{
  335|    152|    static RSA_PSS_PARAMS_30 pss_params_cmp = { 0, };
  336|       |
  337|    152|    return rsa_pss_params == NULL
  ------------------
  |  Branch (337:12): [True: 0, False: 152]
  ------------------
  338|    152|        || memcmp(rsa_pss_params, &pss_params_cmp,
  ------------------
  |  Branch (338:12): [True: 139, False: 13]
  ------------------
  339|    152|                  sizeof(*rsa_pss_params)) == 0;
  340|    152|}
ossl_rsa_pss_params_30_set_hashalg:
  351|      8|{
  352|      8|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (352:9): [True: 0, False: 8]
  ------------------
  353|      0|        return 0;
  354|      8|    rsa_pss_params->hash_algorithm_nid = hashalg_nid;
  355|      8|    return 1;
  356|      8|}
ossl_rsa_pss_params_30_set_maskgenhashalg:
  360|      8|{
  361|      8|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (361:9): [True: 0, False: 8]
  ------------------
  362|      0|        return 0;
  363|      8|    rsa_pss_params->mask_gen.hash_algorithm_nid = maskgenhashalg_nid;
  364|      8|    return 1;
  365|      8|}
ossl_rsa_pss_params_30_set_saltlen:
  369|      8|{
  370|      8|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (370:9): [True: 0, False: 8]
  ------------------
  371|      0|        return 0;
  372|      8|    rsa_pss_params->salt_len = saltlen;
  373|      8|    return 1;
  374|      8|}
ossl_rsa_pss_params_30_set_trailerfield:
  378|      8|{
  379|      8|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (379:9): [True: 0, False: 8]
  ------------------
  380|      0|        return 0;
  381|      8|    rsa_pss_params->trailer_field = trailerfield;
  382|      8|    return 1;
  383|      8|}
ossl_rsa_pss_params_30_hashalg:
  386|     20|{
  387|     20|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (387:9): [True: 9, False: 11]
  ------------------
  388|      9|        return default_RSASSA_PSS_params.hash_algorithm_nid;
  389|     11|    return rsa_pss_params->hash_algorithm_nid;
  390|     20|}
ossl_rsa_pss_params_30_maskgenalg:
  393|     16|{
  394|     16|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (394:9): [True: 5, False: 11]
  ------------------
  395|      5|        return default_RSASSA_PSS_params.mask_gen.algorithm_nid;
  396|     11|    return rsa_pss_params->mask_gen.algorithm_nid;
  397|     16|}
ossl_rsa_pss_params_30_maskgenhashalg:
  400|     16|{
  401|     16|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (401:9): [True: 5, False: 11]
  ------------------
  402|      5|        return default_RSASSA_PSS_params.hash_algorithm_nid;
  403|     11|    return rsa_pss_params->mask_gen.hash_algorithm_nid;
  404|     16|}
ossl_rsa_pss_params_30_saltlen:
  407|     23|{
  408|     23|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (408:9): [True: 4, False: 19]
  ------------------
  409|      4|        return default_RSASSA_PSS_params.salt_len;
  410|     19|    return rsa_pss_params->salt_len;
  411|     23|}
ossl_rsa_pss_params_30_trailerfield:
  414|     18|{
  415|     18|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (415:9): [True: 4, False: 14]
  ------------------
  416|      4|        return default_RSASSA_PSS_params.trailer_field;
  417|     14|    return rsa_pss_params->trailer_field;
  418|     18|}

ossl_rsa_oaeppss_nid2name:
   77|      4|{
   78|      4|    return nid2name(md, oaeppss_name_nid_map, OSSL_NELEM(oaeppss_name_nid_map));
  ------------------
  |  |   14|      4|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   79|      4|}
ossl_rsa_mgf_nid2name:
   82|      2|{
   83|      2|    if (mgf == NID_mgf1)
  ------------------
  |  |  573|      2|#define NID_mgf1                911
  ------------------
  |  Branch (83:9): [True: 2, False: 0]
  ------------------
   84|      2|        return SN_mgf1;
  ------------------
  |  |  571|      2|#define SN_mgf1         "MGF1"
  ------------------
   85|      0|    return NULL;
   86|      2|}
rsa_schemes.c:nid2name:
   31|      4|{
   32|      4|    size_t i;
   33|       |
   34|      4|    for (i = 0; i < items_n; i++)
  ------------------
  |  Branch (34:17): [True: 4, False: 0]
  ------------------
   35|      4|        if (meth == (int)items[i].id)
  ------------------
  |  Branch (35:13): [True: 4, False: 0]
  ------------------
   36|      4|            return items[i].ptr;
   37|      0|    return NULL;
   38|      4|}

ossl_self_test_set_callback_new:
   35|      4|{
   36|      4|    SELF_TEST_CB *stcb;
   37|       |
   38|      4|    stcb = OPENSSL_zalloc(sizeof(*stcb));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|      4|    return stcb;
   40|      4|}
ossl_self_test_set_callback_free:
   43|      2|{
   44|      2|    OPENSSL_free(stcb);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|      2|}

SHA512_Init:
  133|      4|{
  134|      4|    c->h[0] = U64(0x6a09e667f3bcc908);
  ------------------
  |  |   75|      4|# define U64(C)     C##ULL
  ------------------
  135|      4|    c->h[1] = U64(0xbb67ae8584caa73b);
  ------------------
  |  |   75|      4|# define U64(C)     C##ULL
  ------------------
  136|      4|    c->h[2] = U64(0x3c6ef372fe94f82b);
  ------------------
  |  |   75|      4|# define U64(C)     C##ULL
  ------------------
  137|      4|    c->h[3] = U64(0xa54ff53a5f1d36f1);
  ------------------
  |  |   75|      4|# define U64(C)     C##ULL
  ------------------
  138|      4|    c->h[4] = U64(0x510e527fade682d1);
  ------------------
  |  |   75|      4|# define U64(C)     C##ULL
  ------------------
  139|      4|    c->h[5] = U64(0x9b05688c2b3e6c1f);
  ------------------
  |  |   75|      4|# define U64(C)     C##ULL
  ------------------
  140|      4|    c->h[6] = U64(0x1f83d9abfb41bd6b);
  ------------------
  |  |   75|      4|# define U64(C)     C##ULL
  ------------------
  141|      4|    c->h[7] = U64(0x5be0cd19137e2179);
  ------------------
  |  |   75|      4|# define U64(C)     C##ULL
  ------------------
  142|       |
  143|      4|    c->Nl = 0;
  144|      4|    c->Nh = 0;
  145|      4|    c->num = 0;
  146|      4|    c->md_len = SHA512_DIGEST_LENGTH;
  ------------------
  |  |   88|      4|# define SHA512_DIGEST_LENGTH    64
  ------------------
  147|      4|    return 1;
  148|      4|}
SHA512_Final:
  160|      4|{
  161|      4|    unsigned char *p = (unsigned char *)c->u.p;
  162|      4|    size_t n = c->num;
  163|       |
  164|      4|    p[n] = 0x80;                /* There always is a room for one */
  165|      4|    n++;
  166|      4|    if (n > (sizeof(c->u) - 16)) {
  ------------------
  |  Branch (166:9): [True: 0, False: 4]
  ------------------
  167|      0|        memset(p + n, 0, sizeof(c->u) - n);
  168|      0|        n = 0;
  169|      0|        sha512_block_data_order(c, p, 1);
  170|      0|    }
  171|       |
  172|      4|    memset(p + n, 0, sizeof(c->u) - 16 - n);
  173|       |#ifdef  B_ENDIAN
  174|       |    c->u.d[SHA_LBLOCK - 2] = c->Nh;
  175|       |    c->u.d[SHA_LBLOCK - 1] = c->Nl;
  176|       |#else
  177|      4|    p[sizeof(c->u) - 1] = (unsigned char)(c->Nl);
  178|      4|    p[sizeof(c->u) - 2] = (unsigned char)(c->Nl >> 8);
  179|      4|    p[sizeof(c->u) - 3] = (unsigned char)(c->Nl >> 16);
  180|      4|    p[sizeof(c->u) - 4] = (unsigned char)(c->Nl >> 24);
  181|      4|    p[sizeof(c->u) - 5] = (unsigned char)(c->Nl >> 32);
  182|      4|    p[sizeof(c->u) - 6] = (unsigned char)(c->Nl >> 40);
  183|      4|    p[sizeof(c->u) - 7] = (unsigned char)(c->Nl >> 48);
  184|      4|    p[sizeof(c->u) - 8] = (unsigned char)(c->Nl >> 56);
  185|      4|    p[sizeof(c->u) - 9] = (unsigned char)(c->Nh);
  186|      4|    p[sizeof(c->u) - 10] = (unsigned char)(c->Nh >> 8);
  187|      4|    p[sizeof(c->u) - 11] = (unsigned char)(c->Nh >> 16);
  188|      4|    p[sizeof(c->u) - 12] = (unsigned char)(c->Nh >> 24);
  189|      4|    p[sizeof(c->u) - 13] = (unsigned char)(c->Nh >> 32);
  190|      4|    p[sizeof(c->u) - 14] = (unsigned char)(c->Nh >> 40);
  191|      4|    p[sizeof(c->u) - 15] = (unsigned char)(c->Nh >> 48);
  192|      4|    p[sizeof(c->u) - 16] = (unsigned char)(c->Nh >> 56);
  193|      4|#endif
  194|       |
  195|      4|    sha512_block_data_order(c, p, 1);
  196|       |
  197|      4|    if (md == 0)
  ------------------
  |  Branch (197:9): [True: 0, False: 4]
  ------------------
  198|      0|        return 0;
  199|       |
  200|      4|    switch (c->md_len) {
  201|       |    /* Let compiler decide if it's appropriate to unroll... */
  202|      0|    case SHA224_DIGEST_LENGTH:
  ------------------
  |  |   85|      0|# define SHA224_DIGEST_LENGTH    28
  ------------------
  |  Branch (202:5): [True: 0, False: 4]
  ------------------
  203|      0|        for (n = 0; n < SHA224_DIGEST_LENGTH / 8; n++) {
  ------------------
  |  |   85|      0|# define SHA224_DIGEST_LENGTH    28
  ------------------
  |  Branch (203:21): [True: 0, False: 0]
  ------------------
  204|      0|            SHA_LONG64 t = c->h[n];
  ------------------
  |  |  107|      0|#   define SHA_LONG64 unsigned long long
  ------------------
  205|       |
  206|      0|            *(md++) = (unsigned char)(t >> 56);
  207|      0|            *(md++) = (unsigned char)(t >> 48);
  208|      0|            *(md++) = (unsigned char)(t >> 40);
  209|      0|            *(md++) = (unsigned char)(t >> 32);
  210|      0|            *(md++) = (unsigned char)(t >> 24);
  211|      0|            *(md++) = (unsigned char)(t >> 16);
  212|      0|            *(md++) = (unsigned char)(t >> 8);
  213|      0|            *(md++) = (unsigned char)(t);
  214|      0|        }
  215|       |        /*
  216|       |         * For 224 bits, there are four bytes left over that have to be
  217|       |         * processed separately.
  218|       |         */
  219|      0|        {
  220|      0|            SHA_LONG64 t = c->h[SHA224_DIGEST_LENGTH / 8];
  ------------------
  |  |  107|      0|#   define SHA_LONG64 unsigned long long
  ------------------
                          SHA_LONG64 t = c->h[SHA224_DIGEST_LENGTH / 8];
  ------------------
  |  |   85|      0|# define SHA224_DIGEST_LENGTH    28
  ------------------
  221|       |
  222|      0|            *(md++) = (unsigned char)(t >> 56);
  223|      0|            *(md++) = (unsigned char)(t >> 48);
  224|      0|            *(md++) = (unsigned char)(t >> 40);
  225|      0|            *(md++) = (unsigned char)(t >> 32);
  226|      0|        }
  227|      0|        break;
  228|      0|    case SHA256_DIGEST_LENGTH:
  ------------------
  |  |   86|      0|# define SHA256_DIGEST_LENGTH    32
  ------------------
  |  Branch (228:5): [True: 0, False: 4]
  ------------------
  229|      0|        for (n = 0; n < SHA256_DIGEST_LENGTH / 8; n++) {
  ------------------
  |  |   86|      0|# define SHA256_DIGEST_LENGTH    32
  ------------------
  |  Branch (229:21): [True: 0, False: 0]
  ------------------
  230|      0|            SHA_LONG64 t = c->h[n];
  ------------------
  |  |  107|      0|#   define SHA_LONG64 unsigned long long
  ------------------
  231|       |
  232|      0|            *(md++) = (unsigned char)(t >> 56);
  233|      0|            *(md++) = (unsigned char)(t >> 48);
  234|      0|            *(md++) = (unsigned char)(t >> 40);
  235|      0|            *(md++) = (unsigned char)(t >> 32);
  236|      0|            *(md++) = (unsigned char)(t >> 24);
  237|      0|            *(md++) = (unsigned char)(t >> 16);
  238|      0|            *(md++) = (unsigned char)(t >> 8);
  239|      0|            *(md++) = (unsigned char)(t);
  240|      0|        }
  241|      0|        break;
  242|      0|    case SHA384_DIGEST_LENGTH:
  ------------------
  |  |   87|      0|# define SHA384_DIGEST_LENGTH    48
  ------------------
  |  Branch (242:5): [True: 0, False: 4]
  ------------------
  243|      0|        for (n = 0; n < SHA384_DIGEST_LENGTH / 8; n++) {
  ------------------
  |  |   87|      0|# define SHA384_DIGEST_LENGTH    48
  ------------------
  |  Branch (243:21): [True: 0, False: 0]
  ------------------
  244|      0|            SHA_LONG64 t = c->h[n];
  ------------------
  |  |  107|      0|#   define SHA_LONG64 unsigned long long
  ------------------
  245|       |
  246|      0|            *(md++) = (unsigned char)(t >> 56);
  247|      0|            *(md++) = (unsigned char)(t >> 48);
  248|      0|            *(md++) = (unsigned char)(t >> 40);
  249|      0|            *(md++) = (unsigned char)(t >> 32);
  250|      0|            *(md++) = (unsigned char)(t >> 24);
  251|      0|            *(md++) = (unsigned char)(t >> 16);
  252|      0|            *(md++) = (unsigned char)(t >> 8);
  253|      0|            *(md++) = (unsigned char)(t);
  254|      0|        }
  255|      0|        break;
  256|      4|    case SHA512_DIGEST_LENGTH:
  ------------------
  |  |   88|      4|# define SHA512_DIGEST_LENGTH    64
  ------------------
  |  Branch (256:5): [True: 4, False: 0]
  ------------------
  257|     36|        for (n = 0; n < SHA512_DIGEST_LENGTH / 8; n++) {
  ------------------
  |  |   88|     36|# define SHA512_DIGEST_LENGTH    64
  ------------------
  |  Branch (257:21): [True: 32, False: 4]
  ------------------
  258|     32|            SHA_LONG64 t = c->h[n];
  ------------------
  |  |  107|     32|#   define SHA_LONG64 unsigned long long
  ------------------
  259|       |
  260|     32|            *(md++) = (unsigned char)(t >> 56);
  261|     32|            *(md++) = (unsigned char)(t >> 48);
  262|     32|            *(md++) = (unsigned char)(t >> 40);
  263|     32|            *(md++) = (unsigned char)(t >> 32);
  264|     32|            *(md++) = (unsigned char)(t >> 24);
  265|     32|            *(md++) = (unsigned char)(t >> 16);
  266|     32|            *(md++) = (unsigned char)(t >> 8);
  267|     32|            *(md++) = (unsigned char)(t);
  268|     32|        }
  269|      4|        break;
  270|       |    /* ... as well as make sure md_len is not abused. */
  271|      0|    default:
  ------------------
  |  Branch (271:5): [True: 0, False: 4]
  ------------------
  272|      0|        return 0;
  273|      4|    }
  274|       |
  275|      4|    return 1;
  276|      4|}
SHA512_Update:
  284|      4|{
  285|      4|    SHA_LONG64 l;
  ------------------
  |  |  107|      4|#   define SHA_LONG64 unsigned long long
  ------------------
  286|      4|    unsigned char *p = c->u.p;
  287|      4|    const unsigned char *data = (const unsigned char *)_data;
  288|       |
  289|      4|    if (len == 0)
  ------------------
  |  Branch (289:9): [True: 0, False: 4]
  ------------------
  290|      0|        return 1;
  291|       |
  292|      4|    l = (c->Nl + (((SHA_LONG64) len) << 3)) & U64(0xffffffffffffffff);
  ------------------
  |  |   75|      4|# define U64(C)     C##ULL
  ------------------
  293|      4|    if (l < c->Nl)
  ------------------
  |  Branch (293:9): [True: 0, False: 4]
  ------------------
  294|      0|        c->Nh++;
  295|      4|    if (sizeof(len) >= 8)
  ------------------
  |  Branch (295:9): [Folded - Ignored]
  ------------------
  296|      4|        c->Nh += (((SHA_LONG64) len) >> 61);
  297|      4|    c->Nl = l;
  298|       |
  299|      4|    if (c->num != 0) {
  ------------------
  |  Branch (299:9): [True: 0, False: 4]
  ------------------
  300|      0|        size_t n = sizeof(c->u) - c->num;
  301|       |
  302|      0|        if (len < n) {
  ------------------
  |  Branch (302:13): [True: 0, False: 0]
  ------------------
  303|      0|            memcpy(p + c->num, data, len), c->num += (unsigned int)len;
  304|      0|            return 1;
  305|      0|        } else {
  306|      0|            memcpy(p + c->num, data, n), c->num = 0;
  307|      0|            len -= n, data += n;
  308|      0|            sha512_block_data_order(c, p, 1);
  309|      0|        }
  310|      0|    }
  311|       |
  312|      4|    if (len >= sizeof(c->u)) {
  ------------------
  |  Branch (312:9): [True: 0, False: 4]
  ------------------
  313|       |#ifndef SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA
  314|       |        if ((size_t)data % sizeof(c->u.d[0]) != 0)
  315|       |            while (len >= sizeof(c->u))
  316|       |                memcpy(p, data, sizeof(c->u)),
  317|       |                sha512_block_data_order(c, p, 1),
  318|       |                len -= sizeof(c->u), data += sizeof(c->u);
  319|       |        else
  320|       |#endif
  321|      0|            sha512_block_data_order(c, data, len / sizeof(c->u)),
  322|      0|            data += len, len %= sizeof(c->u), data -= len;
  323|      0|    }
  324|       |
  325|      4|    if (len != 0)
  ------------------
  |  Branch (325:9): [True: 4, False: 0]
  ------------------
  326|      4|        memcpy(p, data, len), c->num = (int)len;
  327|       |
  328|      4|    return 1;
  329|      4|}

SHA1_Init:
   55|  6.59k|{
   56|  6.59k|    memset(c, 0, sizeof(*c));
   57|  6.59k|    c->h0 = INIT_DATA_h0;
  ------------------
  |  |   48|  6.59k|#define INIT_DATA_h0 0x67452301UL
  ------------------
   58|  6.59k|    c->h1 = INIT_DATA_h1;
  ------------------
  |  |   49|  6.59k|#define INIT_DATA_h1 0xefcdab89UL
  ------------------
   59|  6.59k|    c->h2 = INIT_DATA_h2;
  ------------------
  |  |   50|  6.59k|#define INIT_DATA_h2 0x98badcfeUL
  ------------------
   60|  6.59k|    c->h3 = INIT_DATA_h3;
  ------------------
  |  |   51|  6.59k|#define INIT_DATA_h3 0x10325476UL
  ------------------
   61|  6.59k|    c->h4 = INIT_DATA_h4;
  ------------------
  |  |   52|  6.59k|#define INIT_DATA_h4 0xc3d2e1f0UL
  ------------------
   62|  6.59k|    return 1;
   63|  6.59k|}

ossl_slh_get_adrs_fn:
  154|     31|{
  155|     31|    static const SLH_ADRS_FUNC methods[] = {
  156|     31|        {
  157|     31|            slh_adrs_set_layer_address,
  158|     31|            slh_adrs_set_tree_address,
  159|     31|            slh_adrs_set_type_and_clear,
  160|     31|            slh_adrs_set_keypair_address,
  161|     31|            slh_adrs_copy_keypair_address,
  162|     31|            slh_adrs_set_chain_address,
  163|     31|            slh_adrs_set_tree_height,
  ------------------
  |  |   38|     31|#define slh_adrs_set_tree_height slh_adrs_set_chain_address
  ------------------
  164|     31|            slh_adrs_set_hash_address,
  165|     31|            slh_adrs_set_tree_index,
  ------------------
  |  |   39|     31|#define slh_adrs_set_tree_index slh_adrs_set_hash_address
  ------------------
  166|     31|            slh_adrs_zero,
  167|     31|            slh_adrs_copy,
  168|     31|        },
  169|     31|        {
  170|     31|            slh_adrsc_set_layer_address,
  171|     31|            slh_adrsc_set_tree_address,
  172|     31|            slh_adrsc_set_type_and_clear,
  173|     31|            slh_adrsc_set_keypair_address,
  174|     31|            slh_adrsc_copy_keypair_address,
  175|     31|            slh_adrsc_set_chain_address,
  176|     31|            slh_adrsc_set_tree_height,
  ------------------
  |  |   41|     31|#define slh_adrsc_set_tree_height slh_adrsc_set_chain_address
  ------------------
  177|     31|            slh_adrsc_set_hash_address,
  178|     31|            slh_adrsc_set_tree_index,
  ------------------
  |  |   42|     31|#define slh_adrsc_set_tree_index slh_adrsc_set_hash_address
  ------------------
  179|     31|            slh_adrsc_zero,
  180|     31|            slh_adrsc_copy,
  181|     31|        }
  182|     31|    };
  183|     31|    return &methods[is_compressed == 0 ? 0 : 1];
  ------------------
  |  Branch (183:21): [True: 14, False: 17]
  ------------------
  184|     31|}

ossl_slh_dsa_key_new:
   89|     31|{
   90|     31|    SLH_DSA_KEY *ret;
   91|     31|    const SLH_DSA_PARAMS *params = ossl_slh_dsa_params_get(alg);
   92|       |
   93|     31|    if (params == NULL)
  ------------------
  |  Branch (93:9): [True: 0, False: 31]
  ------------------
   94|      0|        return NULL;
   95|       |
   96|     31|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|     31|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     31|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     31|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   97|     31|    if (ret != NULL) {
  ------------------
  |  Branch (97:9): [True: 31, False: 0]
  ------------------
   98|     31|        ret->libctx = libctx;
   99|     31|        ret->params = params;
  100|     31|        if (propq != NULL) {
  ------------------
  |  Branch (100:13): [True: 31, False: 0]
  ------------------
  101|     31|            ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  119|     31|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     31|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     31|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  102|     31|            if (ret->propq == NULL)
  ------------------
  |  Branch (102:17): [True: 0, False: 31]
  ------------------
  103|      0|                goto err;
  104|     31|        }
  105|     31|        if (!slh_dsa_key_hash_init(ret))
  ------------------
  |  Branch (105:13): [True: 0, False: 31]
  ------------------
  106|      0|            goto err;
  107|     31|    }
  108|     31|    return ret;
  109|      0| err:
  110|      0|    ossl_slh_dsa_key_free(ret);
  111|      0|    return NULL;
  112|     31|}
ossl_slh_dsa_key_free:
  118|   242k|{
  119|   242k|    if (key == NULL)
  ------------------
  |  Branch (119:9): [True: 242k, False: 31]
  ------------------
  120|   242k|        return;
  121|       |
  122|     31|    slh_dsa_key_hash_cleanup(key);
  123|     31|    OPENSSL_cleanse(&key->priv, sizeof(key->priv) >> 1);
  124|     31|    OPENSSL_free(key);
  ------------------
  |  |  115|     31|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     31|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     31|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  125|     31|}
ossl_slh_dsa_key_get_pub_len:
  403|     31|{
  404|     31|    return 2 * key->params->n;
  405|     31|}
ossl_slh_dsa_key_get_name:
  438|      3|{
  439|      3|    return key->params->alg;
  440|      3|}
slh_dsa_key.c:slh_dsa_key_hash_init:
   35|     31|{
   36|     31|    int is_shake = key->params->is_shake;
   37|     31|    int security_category = key->params->security_category;
   38|     31|    const char *digest_alg = is_shake ? "SHAKE-256" : "SHA2-256";
  ------------------
  |  Branch (38:30): [True: 14, False: 17]
  ------------------
   39|       |
   40|     31|    key->md = EVP_MD_fetch(key->libctx, digest_alg, key->propq);
   41|     31|    if (key->md == NULL)
  ------------------
  |  Branch (41:9): [True: 0, False: 31]
  ------------------
   42|      0|        return 0;
   43|       |    /*
   44|       |     * SHA2 algorithm(s) require SHA256 + HMAC_SHA(X) & MGF1(SHAX)
   45|       |     * SHAKE algorithm(s) use SHAKE for all functions.
   46|       |     */
   47|     31|    if (is_shake == 0) {
  ------------------
  |  Branch (47:9): [True: 17, False: 14]
  ------------------
   48|     17|        if (security_category == 1) {
  ------------------
  |  Branch (48:13): [True: 9, False: 8]
  ------------------
   49|       |            /* For category 1 SHA2-256 is used for all hash operations */
   50|      9|            key->md_big = key->md;
   51|      9|        } else {
   52|       |            /* Security categories 3 & 5 also need SHA-512 */
   53|      8|            key->md_big = EVP_MD_fetch(key->libctx, "SHA2-512", key->propq);
   54|      8|            if (key->md_big == NULL)
  ------------------
  |  Branch (54:17): [True: 0, False: 8]
  ------------------
   55|      0|                goto err;
   56|      8|        }
   57|     17|        key->hmac = EVP_MAC_fetch(key->libctx, "HMAC", key->propq);
   58|     17|        if (key->hmac == NULL)
  ------------------
  |  Branch (58:13): [True: 0, False: 17]
  ------------------
   59|      0|            goto err;
   60|     17|    }
   61|     31|    key->adrs_func = ossl_slh_get_adrs_fn(is_shake == 0);
   62|     31|    key->hash_func = ossl_slh_get_hash_fn(is_shake);
   63|     31|    return 1;
   64|      0| err:
   65|      0|    slh_dsa_key_hash_cleanup(key);
   66|      0|    return 0;
   67|     31|}
slh_dsa_key.c:slh_dsa_key_hash_cleanup:
   24|     31|{
   25|     31|    OPENSSL_free(key->propq);
  ------------------
  |  |  115|     31|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     31|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     31|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|     31|    if (key->md_big != key->md)
  ------------------
  |  Branch (26:9): [True: 22, False: 9]
  ------------------
   27|     22|        EVP_MD_free(key->md_big);
   28|     31|    key->md_big = NULL;
   29|     31|    EVP_MD_free(key->md);
   30|     31|    EVP_MAC_free(key->hmac);
   31|     31|    key->md = NULL;
   32|     31|}

ossl_slh_get_hash_fn:
  267|     31|{
  268|     31|    static const SLH_HASH_FUNC methods[] = {
  269|     31|        {
  270|     31|            slh_hmsg_shake,
  271|     31|            slh_prf_shake,
  272|     31|            slh_prf_msg_shake,
  273|     31|            slh_f_shake,
  274|     31|            slh_h_shake,
  275|     31|            slh_t_shake
  276|     31|        },
  277|     31|        {
  278|     31|            slh_hmsg_sha2,
  279|     31|            slh_prf_sha2,
  280|     31|            slh_prf_msg_sha2,
  281|     31|            slh_f_sha2,
  282|     31|            slh_h_sha2,
  283|     31|            slh_t_sha2
  284|     31|        }
  285|     31|    };
  286|     31|    return &methods[is_shake ? 0 : 1];
  ------------------
  |  Branch (286:21): [True: 14, False: 17]
  ------------------
  287|     31|}

ossl_slh_dsa_params_get:
  117|     31|{
  118|     31|    const SLH_DSA_PARAMS *p;
  119|       |
  120|     31|    if (alg == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 31]
  ------------------
  121|      0|        return NULL;
  122|    179|    for (p = slh_dsa_params; p->alg != NULL; ++p) {
  ------------------
  |  Branch (122:30): [True: 179, False: 0]
  ------------------
  123|    179|        if (strcmp(p->alg, alg) == 0)
  ------------------
  |  Branch (123:13): [True: 31, False: 148]
  ------------------
  124|     31|            return p;
  125|    179|    }
  126|      0|    return NULL;
  127|     31|}

EVP_sm3:
   29|      2|{
   30|      2|    return &sm3_md;
   31|      2|}

ossl_sa_new:
   59|     16|{
   60|     16|    OPENSSL_SA *res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |  104|     16|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|       |
   62|     16|    return res;
   63|     16|}
ossl_sa_free:
  111|      8|{
  112|      8|    if (sa != NULL) {
  ------------------
  |  Branch (112:9): [True: 8, False: 0]
  ------------------
  113|      8|        sa_doall(sa, &sa_free_node, NULL, NULL);
  114|      8|        OPENSSL_free(sa);
  ------------------
  |  |  115|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  115|      8|    }
  116|      8|}
ossl_sa_doall:
  135|      8|{
  136|      8|    struct trampoline_st tramp;
  137|       |
  138|      8|    tramp.func = leaf;
  139|      8|    if (sa != NULL)
  ------------------
  |  Branch (139:9): [True: 8, False: 0]
  ------------------
  140|      8|        sa_doall(sa, NULL, &trampoline, &tramp);
  141|      8|}
ossl_sa_doall_arg:
  146|  6.60k|{
  147|  6.60k|    if (sa != NULL)
  ------------------
  |  Branch (147:9): [True: 6.60k, False: 0]
  ------------------
  148|  6.60k|        sa_doall(sa, NULL, leaf, arg);
  149|  6.60k|}
ossl_sa_num:
  152|  6.59k|{
  153|  6.59k|    return sa == NULL ? 0 : sa->nelem;
  ------------------
  |  Branch (153:12): [True: 0, False: 6.59k]
  ------------------
  154|  6.59k|}
ossl_sa_get:
  157|  7.46k|{
  158|  7.46k|    int level;
  159|  7.46k|    void **p, *r = NULL;
  160|       |
  161|  7.46k|    if (sa == NULL || sa->nelem == 0)
  ------------------
  |  Branch (161:9): [True: 0, False: 7.46k]
  |  Branch (161:23): [True: 6, False: 7.46k]
  ------------------
  162|      6|        return NULL;
  163|       |
  164|  7.46k|    if (n <= sa->top) {
  ------------------
  |  Branch (164:9): [True: 7.27k, False: 186]
  ------------------
  165|  7.27k|        p = sa->nodes;
  166|  27.9k|        for (level = sa->levels - 1; p != NULL && level > 0; level--)
  ------------------
  |  Branch (166:38): [True: 27.9k, False: 48]
  |  Branch (166:51): [True: 20.6k, False: 7.22k]
  ------------------
  167|  20.6k|            p = (void **)p[(n >> (OPENSSL_SA_BLOCK_BITS * level))
  ------------------
  |  |   34|  20.6k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
  168|  20.6k|                           & SA_BLOCK_MASK];
  ------------------
  |  |   46|  20.6k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  20.6k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  20.6k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  7.27k|        r = p == NULL ? NULL : p[n & SA_BLOCK_MASK];
  ------------------
  |  |   46|  7.22k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  7.22k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  7.22k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (169:13): [True: 48, False: 7.22k]
  ------------------
  170|  7.27k|    }
  171|  7.46k|    return r;
  172|  7.46k|}
ossl_sa_set:
  180|    282|{
  181|    282|    int i, level = 1;
  182|    282|    ossl_uintmax_t n = posn;
  183|    282|    void **p;
  184|       |
  185|    282|    if (sa == NULL)
  ------------------
  |  Branch (185:9): [True: 0, False: 282]
  ------------------
  186|      0|        return 0;
  187|       |
  188|    892|    for (level = 1; level < SA_BLOCK_MAX_LEVELS; level++)
  ------------------
  |  |   47|    892|#define SA_BLOCK_MAX_LEVELS     (((int)sizeof(ossl_uintmax_t) * 8 \
  |  |   48|    892|                                  + OPENSSL_SA_BLOCK_BITS - 1) \
  |  |  ------------------
  |  |  |  |   34|    892|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  |  |   49|    892|                                 / OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|    892|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  ------------------
  |  Branch (188:21): [True: 892, False: 0]
  ------------------
  189|    892|        if ((n >>= OPENSSL_SA_BLOCK_BITS) == 0)
  ------------------
  |  |   34|    892|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
  |  Branch (189:13): [True: 282, False: 610]
  ------------------
  190|    282|            break;
  191|       |
  192|    290|    for (;sa->levels < level; sa->levels++) {
  ------------------
  |  Branch (192:11): [True: 8, False: 282]
  ------------------
  193|      8|        p = alloc_node();
  194|      8|        if (p == NULL)
  ------------------
  |  Branch (194:13): [True: 0, False: 8]
  ------------------
  195|      0|            return 0;
  196|      8|        p[0] = sa->nodes;
  197|      8|        sa->nodes = p;
  198|      8|    }
  199|    282|    if (sa->top < posn)
  ------------------
  |  Branch (199:9): [True: 96, False: 186]
  ------------------
  200|     96|        sa->top = posn;
  201|       |
  202|    282|    p = sa->nodes;
  203|    892|    for (level = sa->levels - 1; level > 0; level--) {
  ------------------
  |  Branch (203:34): [True: 610, False: 282]
  ------------------
  204|    610|        i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
  ------------------
  |  |   34|    610|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
                      i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
  ------------------
  |  |   46|    610|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|    610|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    610|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|    610|        if (p[i] == NULL && (p[i] = alloc_node()) == NULL)
  ------------------
  |  Branch (205:13): [True: 170, False: 440]
  |  Branch (205:29): [True: 0, False: 170]
  ------------------
  206|      0|            return 0;
  207|    610|        p = p[i];
  208|    610|    }
  209|    282|    p += posn & SA_BLOCK_MASK;
  ------------------
  |  |   46|    282|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|    282|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    282|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|    282|    if (val == NULL && *p != NULL)
  ------------------
  |  Branch (210:9): [True: 141, False: 141]
  |  Branch (210:24): [True: 141, False: 0]
  ------------------
  211|    141|        sa->nelem--;
  212|    141|    else if (val != NULL && *p == NULL)
  ------------------
  |  Branch (212:14): [True: 141, False: 0]
  |  Branch (212:29): [True: 141, False: 0]
  ------------------
  213|    141|        sa->nelem++;
  214|    282|    *p = val;
  215|    282|    return 1;
  216|    282|}
sparse_array.c:sa_doall:
   67|  6.62k|{
   68|  6.62k|    int i[SA_BLOCK_MAX_LEVELS];
   69|  6.62k|    void *nodes[SA_BLOCK_MAX_LEVELS];
   70|  6.62k|    ossl_uintmax_t idx = 0;
   71|  6.62k|    int l = 0;
   72|       |
   73|  6.62k|    i[0] = 0;
   74|  6.62k|    nodes[0] = sa->nodes;
   75|  1.23M|    while (l >= 0) {
  ------------------
  |  Branch (75:12): [True: 1.23M, False: 6.62k]
  ------------------
   76|  1.23M|        const int n = i[l];
   77|  1.23M|        void ** const p = nodes[l];
   78|       |
   79|  1.23M|        if (n >= SA_BLOCK_MAX) {
  ------------------
  |  |   45|  1.23M|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|  1.23M|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  ------------------
  |  Branch (79:13): [True: 72.4k, False: 1.15M]
  ------------------
   80|  72.4k|            if (p != NULL && node != NULL)
  ------------------
  |  Branch (80:17): [True: 72.3k, False: 18]
  |  Branch (80:30): [True: 178, False: 72.2k]
  ------------------
   81|    178|                (*node)(p);
   82|  72.4k|            l--;
   83|  72.4k|            idx >>= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|  72.4k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   84|  1.15M|        } else {
   85|  1.15M|            i[l] = n + 1;
   86|  1.15M|            if (p != NULL && p[n] != NULL) {
  ------------------
  |  Branch (86:17): [True: 1.15M, False: 288]
  |  Branch (86:30): [True: 267k, False: 890k]
  ------------------
   87|   267k|                idx = (idx & ~SA_BLOCK_MASK) | n;
  ------------------
  |  |   46|   267k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|   267k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   267k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|   267k|                if (l < sa->levels - 1) {
  ------------------
  |  Branch (88:21): [True: 65.7k, False: 201k]
  ------------------
   89|  65.7k|                    i[++l] = 0;
   90|  65.7k|                    nodes[l] = p[n];
   91|  65.7k|                    idx <<= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|  65.7k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   92|   201k|                } else if (leaf != NULL) {
  ------------------
  |  Branch (92:28): [True: 201k, False: 0]
  ------------------
   93|   201k|                    (*leaf)(idx, p[n], arg);
   94|   201k|                }
   95|   267k|            }
   96|  1.15M|        }
   97|  1.23M|    }
   98|  6.62k|}
sparse_array.c:sa_free_node:
  101|    178|{
  102|    178|    OPENSSL_free(p);
  ------------------
  |  |  115|    178|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    178|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    178|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  103|    178|}
sparse_array.c:alloc_node:
  175|    178|{
  176|    178|    return OPENSSL_zalloc(SA_BLOCK_MAX * sizeof(void *));
  ------------------
  |  |  104|    178|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    178|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    178|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  177|    178|}

ossl_err_load_SSL_strings:
  629|      2|{
  630|      2|#ifndef OPENSSL_NO_ERR
  631|      2|    if (ERR_reason_error_string(SSL_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (631:9): [True: 2, False: 0]
  ------------------
  632|      2|        ERR_load_strings_const(SSL_str_reasons);
  633|      2|#endif
  634|      2|    return 1;
  635|      2|}

OPENSSL_sk_set_cmp_func:
   38|  1.83k|{
   39|  1.83k|    OPENSSL_sk_compfunc old = sk->comp;
   40|       |
   41|  1.83k|    if (sk->comp != c)
  ------------------
  |  Branch (41:9): [True: 1.83k, False: 0]
  ------------------
   42|  1.83k|        sk->sorted = 0;
   43|  1.83k|    sk->comp = c;
   44|       |
   45|  1.83k|    return old;
   46|  1.83k|}
OPENSSL_sk_dup:
   49|  18.0k|{
   50|  18.0k|    OPENSSL_STACK *ret;
   51|       |
   52|  18.0k|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|  18.0k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  18.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  18.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (52:9): [True: 0, False: 18.0k]
  ------------------
   53|      0|        goto err;
   54|       |
   55|  18.0k|    if (sk == NULL) {
  ------------------
  |  Branch (55:9): [True: 2, False: 18.0k]
  ------------------
   56|      2|        ret->num = 0;
   57|      2|        ret->sorted = 0;
   58|      2|        ret->comp = NULL;
   59|  18.0k|    } else {
   60|       |        /* direct structure assignment */
   61|  18.0k|        *ret = *sk;
   62|  18.0k|    }
   63|       |
   64|  18.0k|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (64:9): [True: 2, False: 18.0k]
  |  Branch (64:23): [True: 0, False: 18.0k]
  ------------------
   65|       |        /* postpone |ret->data| allocation */
   66|      2|        ret->data = NULL;
   67|      2|        ret->num_alloc = 0;
   68|      2|        return ret;
   69|      2|    }
   70|       |
   71|       |    /* duplicate |sk->data| content */
   72|  18.0k|    ret->data = OPENSSL_malloc(sizeof(*ret->data) * sk->num_alloc);
  ------------------
  |  |  102|  18.0k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  18.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  18.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|  18.0k|    if (ret->data == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 18.0k]
  ------------------
   74|      0|        goto err;
   75|  18.0k|    memcpy(ret->data, sk->data, sizeof(void *) * sk->num);
   76|  18.0k|    return ret;
   77|       |
   78|      0| err:
   79|      0|    OPENSSL_sk_free(ret);
   80|      0|    return NULL;
   81|  18.0k|}
OPENSSL_sk_deep_copy:
   86|  75.2k|{
   87|  75.2k|    OPENSSL_STACK *ret;
   88|  75.2k|    int i;
   89|       |
   90|  75.2k|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|  75.2k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  75.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  75.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (90:9): [True: 0, False: 75.2k]
  ------------------
   91|      0|        goto err;
   92|       |
   93|  75.2k|    if (sk == NULL) {
  ------------------
  |  Branch (93:9): [True: 3, False: 75.2k]
  ------------------
   94|      3|        ret->num = 0;
   95|      3|        ret->sorted = 0;
   96|      3|        ret->comp = NULL;
   97|  75.2k|    } else {
   98|       |        /* direct structure assignment */
   99|  75.2k|        *ret = *sk;
  100|  75.2k|    }
  101|       |
  102|  75.2k|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (102:9): [True: 3, False: 75.2k]
  |  Branch (102:23): [True: 0, False: 75.2k]
  ------------------
  103|       |        /* postpone |ret| data allocation */
  104|      3|        ret->data = NULL;
  105|      3|        ret->num_alloc = 0;
  106|      3|        return ret;
  107|      3|    }
  108|       |
  109|  75.2k|    ret->num_alloc = sk->num > min_nodes ? sk->num : min_nodes;
  ------------------
  |  Branch (109:22): [True: 49.4k, False: 25.7k]
  ------------------
  110|  75.2k|    ret->data = OPENSSL_zalloc(sizeof(*ret->data) * ret->num_alloc);
  ------------------
  |  |  104|  75.2k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  75.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  75.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  111|  75.2k|    if (ret->data == NULL)
  ------------------
  |  Branch (111:9): [True: 0, False: 75.2k]
  ------------------
  112|      0|        goto err;
  113|       |
  114|  1.21M|    for (i = 0; i < ret->num; ++i) {
  ------------------
  |  Branch (114:17): [True: 1.13M, False: 75.2k]
  ------------------
  115|  1.13M|        if (sk->data[i] == NULL)
  ------------------
  |  Branch (115:13): [True: 0, False: 1.13M]
  ------------------
  116|      0|            continue;
  117|  1.13M|        if ((ret->data[i] = copy_func(sk->data[i])) == NULL) {
  ------------------
  |  Branch (117:13): [True: 0, False: 1.13M]
  ------------------
  118|      0|            while (--i >= 0)
  ------------------
  |  Branch (118:20): [True: 0, False: 0]
  ------------------
  119|      0|                if (ret->data[i] != NULL)
  ------------------
  |  Branch (119:21): [True: 0, False: 0]
  ------------------
  120|      0|                    free_func((void *)ret->data[i]);
  121|      0|            goto err;
  122|      0|        }
  123|  1.13M|    }
  124|  75.2k|    return ret;
  125|       |
  126|      0| err:
  127|      0|    OPENSSL_sk_free(ret);
  128|      0|    return NULL;
  129|  75.2k|}
OPENSSL_sk_new_null:
  132|  2.75M|{
  133|  2.75M|    return OPENSSL_sk_new_reserve(NULL, 0);
  134|  2.75M|}
OPENSSL_sk_new:
  137|    389|{
  138|    389|    return OPENSSL_sk_new_reserve(c, 0);
  139|    389|}
OPENSSL_sk_new_reserve:
  228|  2.76M|{
  229|  2.76M|    OPENSSL_STACK *st = OPENSSL_zalloc(sizeof(OPENSSL_STACK));
  ------------------
  |  |  104|  2.76M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.76M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.76M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  230|       |
  231|  2.76M|    if (st == NULL)
  ------------------
  |  Branch (231:9): [True: 0, False: 2.76M]
  ------------------
  232|      0|        return NULL;
  233|       |
  234|  2.76M|    st->comp = c;
  235|       |
  236|  2.76M|    if (n <= 0)
  ------------------
  |  Branch (236:9): [True: 2.76M, False: 6.59k]
  ------------------
  237|  2.76M|        return st;
  238|       |
  239|  6.59k|    if (!sk_reserve(st, n, 1)) {
  ------------------
  |  Branch (239:9): [True: 0, False: 6.59k]
  ------------------
  240|      0|        OPENSSL_sk_free(st);
  241|      0|        return NULL;
  242|      0|    }
  243|       |
  244|  6.59k|    return st;
  245|  6.59k|}
OPENSSL_sk_set_thunks:
  260|   258k|{
  261|   258k|    if (st != NULL)
  ------------------
  |  Branch (261:9): [True: 164k, False: 93.6k]
  ------------------
  262|   164k|        st->free_thunk = f_thunk;
  263|       |
  264|   258k|    return st;
  265|   258k|}
OPENSSL_sk_insert:
  268|  4.95M|{
  269|  4.95M|    if (st == NULL) {
  ------------------
  |  Branch (269:9): [True: 0, False: 4.95M]
  ------------------
  270|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  271|      0|        return 0;
  272|      0|    }
  273|  4.95M|    if (st->num == max_nodes) {
  ------------------
  |  Branch (273:9): [True: 0, False: 4.95M]
  ------------------
  274|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  275|      0|        return 0;
  276|      0|    }
  277|       |
  278|  4.95M|    if (!sk_reserve(st, 1, 0))
  ------------------
  |  Branch (278:9): [True: 0, False: 4.95M]
  ------------------
  279|      0|        return 0;
  280|       |
  281|  4.95M|    if ((loc >= st->num) || (loc < 0)) {
  ------------------
  |  Branch (281:9): [True: 4.95M, False: 0]
  |  Branch (281:29): [True: 0, False: 0]
  ------------------
  282|  4.95M|        st->data[st->num] = data;
  283|  4.95M|    } else {
  284|      0|        memmove(&st->data[loc + 1], &st->data[loc],
  285|      0|                sizeof(st->data[0]) * (st->num - loc));
  286|      0|        st->data[loc] = data;
  287|      0|    }
  288|  4.95M|    st->num++;
  289|  4.95M|    st->sorted = 0;
  290|  4.95M|    return st->num;
  291|  4.95M|}
OPENSSL_sk_delete:
  319|      2|{
  320|      2|    if (st == NULL || loc < 0 || loc >= st->num)
  ------------------
  |  Branch (320:9): [True: 0, False: 2]
  |  Branch (320:23): [True: 0, False: 2]
  |  Branch (320:34): [True: 0, False: 2]
  ------------------
  321|      0|        return NULL;
  322|       |
  323|      2|    return internal_delete(st, loc);
  324|      2|}
OPENSSL_sk_find:
  392|      5|{
  393|      5|    return internal_find(st, data, OSSL_BSEARCH_FIRST_VALUE_ON_MATCH, NULL);
  ------------------
  |  |  153|      5|# define OSSL_BSEARCH_FIRST_VALUE_ON_MATCH        0x02
  ------------------
  394|      5|}
OPENSSL_sk_push:
  407|  4.95M|{
  408|  4.95M|    if (st == NULL)
  ------------------
  |  Branch (408:9): [True: 0, False: 4.95M]
  ------------------
  409|      0|        return 0;
  410|  4.95M|    return OPENSSL_sk_insert(st, data, st->num);
  411|  4.95M|}
OPENSSL_sk_pop_free:
  441|   762k|{
  442|   762k|    int i;
  443|       |
  444|   762k|    if (st == NULL)
  ------------------
  |  Branch (444:9): [True: 279k, False: 482k]
  ------------------
  445|   279k|        return;
  446|       |
  447|  3.46M|    for (i = 0; i < st->num; i++) {
  ------------------
  |  Branch (447:17): [True: 2.98M, False: 482k]
  ------------------
  448|  2.98M|        if (st->data[i] != NULL) {
  ------------------
  |  Branch (448:13): [True: 2.98M, False: 290]
  ------------------
  449|  2.98M|            if (st->free_thunk != NULL)
  ------------------
  |  Branch (449:17): [True: 1.93M, False: 1.05M]
  ------------------
  450|  1.93M|                st->free_thunk(func, (void *)st->data[i]);
  451|  1.05M|            else
  452|  1.05M|                func((void *)st->data[i]);
  453|  2.98M|        }
  454|  2.98M|    }
  455|   482k|    OPENSSL_sk_free(st);
  456|   482k|}
OPENSSL_sk_free:
  459|  6.49M|{
  460|  6.49M|    if (st == NULL)
  ------------------
  |  Branch (460:9): [True: 3.63M, False: 2.85M]
  ------------------
  461|  3.63M|        return;
  462|  2.85M|    OPENSSL_free(st->data);
  ------------------
  |  |  115|  2.85M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.85M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.85M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  463|  2.85M|    OPENSSL_free(st);
  ------------------
  |  |  115|  2.85M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.85M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.85M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  464|  2.85M|}
OPENSSL_sk_num:
  467|  18.6M|{
  468|  18.6M|    return st == NULL ? -1 : st->num;
  ------------------
  |  Branch (468:12): [True: 6.30M, False: 12.3M]
  ------------------
  469|  18.6M|}
OPENSSL_sk_value:
  472|  10.6M|{
  473|  10.6M|    if (st == NULL || i < 0 || i >= st->num)
  ------------------
  |  Branch (473:9): [True: 0, False: 10.6M]
  |  Branch (473:23): [True: 0, False: 10.6M]
  |  Branch (473:32): [True: 0, False: 10.6M]
  ------------------
  474|      0|        return NULL;
  475|  10.6M|    return (void *)st->data[i];
  476|  10.6M|}
OPENSSL_sk_set:
  479|   193k|{
  480|   193k|    if (st == NULL) {
  ------------------
  |  Branch (480:9): [True: 0, False: 193k]
  ------------------
  481|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  482|      0|        return NULL;
  483|      0|    }
  484|   193k|    if (i < 0 || i >= st->num) {
  ------------------
  |  Branch (484:9): [True: 0, False: 193k]
  |  Branch (484:18): [True: 0, False: 193k]
  ------------------
  485|      0|        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  357|      0|# define ERR_R_PASSED_INVALID_ARGUMENT           (262|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  486|      0|                       "i=%d", i);
  487|      0|        return NULL;
  488|      0|    }
  489|   193k|    st->data[i] = data;
  490|   193k|    st->sorted = 0;
  491|   193k|    return (void *)st->data[i];
  492|   193k|}
OPENSSL_sk_sort:
  495|    383|{
  496|    383|    if (st != NULL && !st->sorted && st->comp != NULL) {
  ------------------
  |  Branch (496:9): [True: 383, False: 0]
  |  Branch (496:23): [True: 383, False: 0]
  |  Branch (496:38): [True: 383, False: 0]
  ------------------
  497|    383|        if (st->num > 1)
  ------------------
  |  Branch (497:13): [True: 372, False: 11]
  ------------------
  498|    372|            qsort(st->data, st->num, sizeof(void *), st->comp);
  499|    383|        st->sorted = 1; /* empty or single-element stack is considered sorted */
  500|    383|    }
  501|    383|}
stack.c:sk_reserve:
  179|  4.96M|{
  180|  4.96M|    const void **tmpdata;
  181|  4.96M|    int num_alloc;
  182|       |
  183|       |    /* Check to see the reservation isn't exceeding the hard limit */
  184|  4.96M|    if (n > max_nodes - st->num) {
  ------------------
  |  Branch (184:9): [True: 0, False: 4.96M]
  ------------------
  185|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  186|      0|        return 0;
  187|      0|    }
  188|       |
  189|       |    /* Figure out the new size */
  190|  4.96M|    num_alloc = st->num + n;
  191|  4.96M|    if (num_alloc < min_nodes)
  ------------------
  |  Branch (191:9): [True: 420k, False: 4.54M]
  ------------------
  192|   420k|        num_alloc = min_nodes;
  193|       |
  194|       |    /* If |st->data| allocation was postponed */
  195|  4.96M|    if (st->data == NULL) {
  ------------------
  |  Branch (195:9): [True: 324k, False: 4.64M]
  ------------------
  196|       |        /*
  197|       |         * At this point, |st->num_alloc| and |st->num| are 0;
  198|       |         * so |num_alloc| value is |n| or |min_nodes| if greater than |n|.
  199|       |         */
  200|   324k|        if ((st->data = OPENSSL_zalloc(sizeof(void *) * num_alloc)) == NULL)
  ------------------
  |  |  104|   324k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   324k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   324k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (200:13): [True: 0, False: 324k]
  ------------------
  201|      0|            return 0;
  202|   324k|        st->num_alloc = num_alloc;
  203|   324k|        return 1;
  204|   324k|    }
  205|       |
  206|  4.64M|    if (!exact) {
  ------------------
  |  Branch (206:9): [True: 4.64M, False: 0]
  ------------------
  207|  4.64M|        if (num_alloc <= st->num_alloc)
  ------------------
  |  Branch (207:13): [True: 4.57M, False: 66.4k]
  ------------------
  208|  4.57M|            return 1;
  209|  66.4k|        num_alloc = compute_growth(num_alloc, st->num_alloc);
  210|  66.4k|        if (num_alloc == 0) {
  ------------------
  |  Branch (210:13): [True: 0, False: 66.4k]
  ------------------
  211|      0|            ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  212|      0|            return 0;
  213|      0|        }
  214|  66.4k|    } else if (num_alloc == st->num_alloc) {
  ------------------
  |  Branch (214:16): [True: 0, False: 0]
  ------------------
  215|      0|        return 1;
  216|      0|    }
  217|       |
  218|  66.4k|    tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc);
  ------------------
  |  |  109|  66.4k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  66.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  66.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  219|  66.4k|    if (tmpdata == NULL)
  ------------------
  |  Branch (219:9): [True: 0, False: 66.4k]
  ------------------
  220|      0|        return 0;
  221|       |
  222|  66.4k|    st->data = tmpdata;
  223|  66.4k|    st->num_alloc = num_alloc;
  224|  66.4k|    return 1;
  225|  66.4k|}
stack.c:compute_growth:
  161|  66.4k|{
  162|  66.4k|    int err = 0;
  163|       |
  164|   132k|    while (current < target) {
  ------------------
  |  Branch (164:12): [True: 66.4k, False: 66.4k]
  ------------------
  165|  66.4k|        if (current >= max_nodes)
  ------------------
  |  Branch (165:13): [True: 0, False: 66.4k]
  ------------------
  166|      0|            return 0;
  167|       |
  168|  66.4k|        current = safe_muldiv_int(current, 8, 5, &err);
  169|  66.4k|        if (err != 0)
  ------------------
  |  Branch (169:13): [True: 0, False: 66.4k]
  ------------------
  170|      0|            return 0;
  171|  66.4k|        if (current >= max_nodes)
  ------------------
  |  Branch (171:13): [True: 0, False: 66.4k]
  ------------------
  172|      0|            current = max_nodes;
  173|  66.4k|    }
  174|  66.4k|    return current;
  175|  66.4k|}
stack.c:internal_delete:
  294|      2|{
  295|      2|    const void *ret = st->data[loc];
  296|       |
  297|      2|    if (loc != st->num - 1)
  ------------------
  |  Branch (297:9): [True: 0, False: 2]
  ------------------
  298|      0|        memmove(&st->data[loc], &st->data[loc + 1],
  299|      0|                sizeof(st->data[0]) * (st->num - loc - 1));
  300|      2|    st->num--;
  301|       |
  302|      2|    return (void *)ret;
  303|      2|}
stack.c:internal_find:
  328|      5|{
  329|      5|    const void *r;
  330|      5|    int i, count = 0;
  331|      5|    int *pnum = pnum_matched;
  332|       |
  333|      5|    if (st == NULL || st->num == 0)
  ------------------
  |  Branch (333:9): [True: 0, False: 5]
  |  Branch (333:23): [True: 5, False: 0]
  ------------------
  334|      5|        return -1;
  335|       |
  336|      0|    if (pnum == NULL)
  ------------------
  |  Branch (336:9): [True: 0, False: 0]
  ------------------
  337|      0|        pnum = &count;
  338|       |
  339|      0|    if (st->comp == NULL) {
  ------------------
  |  Branch (339:9): [True: 0, False: 0]
  ------------------
  340|      0|        for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (340:21): [True: 0, False: 0]
  ------------------
  341|      0|            if (st->data[i] == data) {
  ------------------
  |  Branch (341:17): [True: 0, False: 0]
  ------------------
  342|      0|                *pnum = 1;
  343|      0|                return i;
  344|      0|            }
  345|      0|        *pnum = 0;
  346|      0|        return -1;
  347|      0|    }
  348|       |
  349|      0|    if (data == NULL)
  ------------------
  |  Branch (349:9): [True: 0, False: 0]
  ------------------
  350|      0|        return -1;
  351|       |
  352|      0|    if (!st->sorted) {
  ------------------
  |  Branch (352:9): [True: 0, False: 0]
  ------------------
  353|      0|        int res = -1;
  354|       |
  355|      0|        for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (355:21): [True: 0, False: 0]
  ------------------
  356|      0|            if (st->comp(&data, st->data + i) == 0) {
  ------------------
  |  Branch (356:17): [True: 0, False: 0]
  ------------------
  357|      0|                if (res == -1)
  ------------------
  |  Branch (357:21): [True: 0, False: 0]
  ------------------
  358|      0|                    res = i;
  359|      0|                ++*pnum;
  360|       |                /* Check if only one result is wanted and exit if so */
  361|      0|                if (pnum_matched == NULL)
  ------------------
  |  Branch (361:21): [True: 0, False: 0]
  ------------------
  362|      0|                    return i;
  363|      0|            }
  364|      0|        if (res == -1)
  ------------------
  |  Branch (364:13): [True: 0, False: 0]
  ------------------
  365|      0|            *pnum = 0;
  366|      0|        return res;
  367|      0|    }
  368|       |
  369|      0|    if (pnum_matched != NULL)
  ------------------
  |  Branch (369:9): [True: 0, False: 0]
  ------------------
  370|      0|        ret_val_options |= OSSL_BSEARCH_FIRST_VALUE_ON_MATCH;
  ------------------
  |  |  153|      0|# define OSSL_BSEARCH_FIRST_VALUE_ON_MATCH        0x02
  ------------------
  371|      0|    r = ossl_bsearch(&data, st->data, st->num, sizeof(void *), st->comp,
  372|      0|                     ret_val_options);
  373|       |
  374|      0|    if (pnum_matched != NULL) {
  ------------------
  |  Branch (374:9): [True: 0, False: 0]
  ------------------
  375|      0|        *pnum = 0;
  376|      0|        if (r != NULL) {
  ------------------
  |  Branch (376:13): [True: 0, False: 0]
  ------------------
  377|      0|            const void **p = (const void **)r;
  378|       |
  379|      0|            while (p < st->data + st->num) {
  ------------------
  |  Branch (379:20): [True: 0, False: 0]
  ------------------
  380|      0|                if (st->comp(&data, p) != 0)
  ------------------
  |  Branch (380:21): [True: 0, False: 0]
  ------------------
  381|      0|                    break;
  382|      0|                ++*pnum;
  383|      0|                ++p;
  384|      0|            }
  385|      0|        }
  386|      0|    }
  387|       |
  388|      0|    return r == NULL ? -1 : (int)((const void **)r - st->data);
  ------------------
  |  Branch (388:12): [True: 0, False: 0]
  ------------------
  389|      0|}

ossl_err_load_OSSL_STORE_strings:
   69|      2|{
   70|      2|#ifndef OPENSSL_NO_ERR
   71|      2|    if (ERR_reason_error_string(OSSL_STORE_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (71:9): [True: 2, False: 0]
  ------------------
   72|      2|        ERR_load_strings_const(OSSL_STORE_str_reasons);
   73|      2|#endif
   74|      2|    return 1;
   75|      2|}

ossl_store_cleanup_int:
   14|      2|{
   15|      2|    ossl_store_destroy_loaders_int();
   16|      2|}

ossl_store_loader_store_cache_flush:
  389|      2|{
  390|      2|    OSSL_METHOD_STORE *store = get_loader_store(libctx);
  391|       |
  392|      2|    if (store != NULL)
  ------------------
  |  Branch (392:9): [True: 2, False: 0]
  ------------------
  393|      2|        return ossl_method_store_cache_flush_all(store);
  394|      0|    return 1;
  395|      2|}
store_meth.c:get_loader_store:
  109|      2|{
  110|      2|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX);
  ------------------
  |  |  115|      2|# define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX      15
  ------------------
  111|      2|}

ossl_store_destroy_loaders_int:
  281|      2|{
  282|      2|    lh_OSSL_STORE_LOADER_free(loader_register);
  283|      2|    loader_register = NULL;
  284|      2|    CRYPTO_THREAD_lock_free(registry_lock);
  285|      2|    registry_lock = NULL;
  286|      2|}

ossl_crypto_mutex_new:
   97|      4|{
   98|      4|    pthread_mutex_t *mutex;
   99|       |
  100|      4|    if ((mutex = OPENSSL_zalloc(sizeof(*mutex))) == NULL)
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (100:9): [True: 0, False: 4]
  ------------------
  101|      0|        return NULL;
  102|      4|    if (pthread_mutex_init(mutex, NULL) != 0) {
  ------------------
  |  Branch (102:9): [True: 0, False: 4]
  ------------------
  103|      0|        OPENSSL_free(mutex);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|      0|        return NULL;
  105|      0|    }
  106|      4|    return (CRYPTO_MUTEX *)mutex;
  107|      4|}
ossl_crypto_mutex_free:
  142|      2|{
  143|      2|    pthread_mutex_t **mutex_p;
  144|       |
  145|      2|    if (mutex == NULL)
  ------------------
  |  Branch (145:9): [True: 0, False: 2]
  ------------------
  146|      0|        return;
  147|       |
  148|      2|    mutex_p = (pthread_mutex_t **)mutex;
  149|      2|    if (*mutex_p != NULL)
  ------------------
  |  Branch (149:9): [True: 2, False: 0]
  ------------------
  150|      2|        pthread_mutex_destroy(*mutex_p);
  151|      2|    OPENSSL_free(*mutex_p);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  152|      2|    *mutex = NULL;
  153|      2|}
ossl_crypto_condvar_new:
  156|      4|{
  157|      4|    pthread_cond_t *cv_p;
  158|       |
  159|      4|    if ((cv_p = OPENSSL_zalloc(sizeof(*cv_p))) == NULL)
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (159:9): [True: 0, False: 4]
  ------------------
  160|      0|        return NULL;
  161|      4|    if (pthread_cond_init(cv_p, NULL) != 0) {
  ------------------
  |  Branch (161:9): [True: 0, False: 4]
  ------------------
  162|      0|        OPENSSL_free(cv_p);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|      0|        return NULL;
  164|      0|    }
  165|      4|    return (CRYPTO_CONDVAR *) cv_p;
  166|      4|}
ossl_crypto_condvar_free:
  220|      2|{
  221|      2|    pthread_cond_t **cv_p;
  222|       |
  223|      2|    if (cv == NULL)
  ------------------
  |  Branch (223:9): [True: 0, False: 2]
  ------------------
  224|      0|        return;
  225|       |
  226|      2|    cv_p = (pthread_cond_t **)cv;
  227|      2|    if (*cv_p != NULL)
  ------------------
  |  Branch (227:9): [True: 2, False: 0]
  ------------------
  228|      2|        pthread_cond_destroy(*cv_p);
  229|      2|    OPENSSL_free(*cv_p);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  230|      2|    *cv_p = NULL;
  231|      2|}

ossl_threads_ctx_new:
  128|      4|{
  129|      4|    struct openssl_threads_st *t = OPENSSL_zalloc(sizeof(*t));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  130|       |
  131|      4|    if (t == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 4]
  ------------------
  132|      0|        return NULL;
  133|       |
  134|      4|    t->lock = ossl_crypto_mutex_new();
  135|      4|    t->cond_finished = ossl_crypto_condvar_new();
  136|       |
  137|      4|    if (t->lock == NULL || t->cond_finished == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 4]
  |  Branch (137:28): [True: 0, False: 4]
  ------------------
  138|      0|        goto fail;
  139|       |
  140|      4|    return t;
  141|       |
  142|      0|fail:
  143|      0|    ossl_threads_ctx_free((void *)t);
  144|      0|    return NULL;
  145|      4|}
ossl_threads_ctx_free:
  148|      2|{
  149|      2|    OSSL_LIB_CTX_THREADS *t = (OSSL_LIB_CTX_THREADS *) vdata;
  150|       |
  151|      2|    if (t == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 2]
  ------------------
  152|      0|        return;
  153|       |
  154|      2|    ossl_crypto_mutex_free(&t->lock);
  155|      2|    ossl_crypto_condvar_free(&t->cond_finished);
  156|      2|    OPENSSL_free(t);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  157|      2|}

ossl_rcu_write_lock:
  441|      6|{
  442|      6|    pthread_mutex_lock(&lock->write_lock);
  443|      6|    TSAN_FAKE_UNLOCK(&lock->write_lock);
  444|      6|}
ossl_rcu_write_unlock:
  447|      6|{
  448|      6|    TSAN_FAKE_LOCK(&lock->write_lock);
  449|      6|    pthread_mutex_unlock(&lock->write_lock);
  450|      6|}
ossl_synchronize_rcu:
  453|     10|{
  454|     10|    struct rcu_qp *qp;
  455|     10|    uint64_t count;
  456|     10|    uint32_t curr_id;
  457|     10|    struct rcu_cb_item *cb_items, *tmpcb;
  458|       |
  459|     10|    pthread_mutex_lock(&lock->write_lock);
  460|     10|    cb_items = lock->cb_items;
  461|     10|    lock->cb_items = NULL;
  462|     10|    pthread_mutex_unlock(&lock->write_lock);
  463|       |
  464|     10|    qp = update_qp(lock, &curr_id);
  465|       |
  466|       |    /* retire in order */
  467|     10|    pthread_mutex_lock(&lock->prior_lock);
  468|     10|    while (lock->next_to_retire != curr_id)
  ------------------
  |  Branch (468:12): [True: 0, False: 10]
  ------------------
  469|      0|        pthread_cond_wait(&lock->prior_signal, &lock->prior_lock);
  470|       |
  471|       |    /*
  472|       |     * wait for the reader count to reach zero
  473|       |     * Note the use of __ATOMIC_ACQUIRE here to ensure that any
  474|       |     * prior __ATOMIC_RELEASE write operation in ossl_rcu_read_unlock
  475|       |     * is visible prior to our read
  476|       |     * however this is likely just necessary to silence a tsan warning
  477|       |     * because the read side should not do any write operation
  478|       |     * outside the atomic itself
  479|       |     */
  480|     10|    do {
  481|     10|        count = ATOMIC_LOAD_N(uint64_t, &qp->users, __ATOMIC_ACQUIRE);
  ------------------
  |  |   96|     10|#  define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  482|     10|    } while (count != (uint64_t)0);
  ------------------
  |  Branch (482:14): [True: 0, False: 10]
  ------------------
  483|       |
  484|     10|    lock->next_to_retire++;
  485|     10|    pthread_cond_broadcast(&lock->prior_signal);
  486|     10|    pthread_mutex_unlock(&lock->prior_lock);
  487|       |
  488|     10|    retire_qp(lock, qp);
  489|       |
  490|       |    /* handle any callbacks that we have */
  491|     12|    while (cb_items != NULL) {
  ------------------
  |  Branch (491:12): [True: 2, False: 10]
  ------------------
  492|      2|        tmpcb = cb_items;
  493|      2|        cb_items = cb_items->next;
  494|      2|        tmpcb->fn(tmpcb->data);
  495|      2|        OPENSSL_free(tmpcb);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  496|      2|    }
  497|     10|}
ossl_rcu_call:
  504|      2|{
  505|      2|    struct rcu_cb_item *new =
  506|      2|        OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  507|       |
  508|      2|    if (new == NULL)
  ------------------
  |  Branch (508:9): [True: 0, False: 2]
  ------------------
  509|      0|        return 0;
  510|       |
  511|      2|    new->data = data;
  512|      2|    new->fn = cb;
  513|       |
  514|      2|    new->next = lock->cb_items;
  515|      2|    lock->cb_items = new;
  516|       |
  517|      2|    return 1;
  518|      2|}
ossl_rcu_uptr_deref:
  521|   443k|{
  522|   443k|    return ATOMIC_LOAD_N(pvoid, p, __ATOMIC_ACQUIRE);
  ------------------
  |  |   96|   443k|#  define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  523|   443k|}
ossl_rcu_assign_uptr:
  526|    391|{
  527|    391|    ATOMIC_STORE(pvoid, p, v, __ATOMIC_RELEASE);
  ------------------
  |  |   98|    391|#  define ATOMIC_STORE(t, p, v, o) __atomic_store(p, v, o)
  ------------------
  528|    391|}
ossl_rcu_lock_new:
  531|      6|{
  532|      6|    struct rcu_lock_st *new;
  533|       |
  534|       |    /*
  535|       |     * We need a minimum of 2 qp's
  536|       |     */
  537|      6|    if (num_writers < 2)
  ------------------
  |  Branch (537:9): [True: 6, False: 0]
  ------------------
  538|      6|        num_writers = 2;
  539|       |
  540|      6|    ctx = ossl_lib_ctx_get_concrete(ctx);
  541|      6|    if (ctx == NULL)
  ------------------
  |  Branch (541:9): [True: 0, False: 6]
  ------------------
  542|      0|        return 0;
  543|       |
  544|      6|    new = OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  104|      6|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  545|      6|    if (new == NULL)
  ------------------
  |  Branch (545:9): [True: 0, False: 6]
  ------------------
  546|      0|        return NULL;
  547|       |
  548|      6|    new->ctx = ctx;
  549|      6|    pthread_mutex_init(&new->write_lock, NULL);
  550|      6|    pthread_mutex_init(&new->prior_lock, NULL);
  551|      6|    pthread_mutex_init(&new->alloc_lock, NULL);
  552|      6|    pthread_cond_init(&new->prior_signal, NULL);
  553|      6|    pthread_cond_init(&new->alloc_signal, NULL);
  554|       |
  555|      6|    new->qp_group = allocate_new_qp_group(new, num_writers);
  556|      6|    if (new->qp_group == NULL) {
  ------------------
  |  Branch (556:9): [True: 0, False: 6]
  ------------------
  557|      0|        OPENSSL_free(new);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  558|      0|        new = NULL;
  559|      0|    }
  560|       |
  561|      6|    return new;
  562|      6|}
ossl_rcu_lock_free:
  565|      4|{
  566|      4|    struct rcu_lock_st *rlock = (struct rcu_lock_st *)lock;
  567|       |
  568|      4|    if (lock == NULL)
  ------------------
  |  Branch (568:9): [True: 0, False: 4]
  ------------------
  569|      0|        return;
  570|       |
  571|       |    /* make sure we're synchronized */
  572|      4|    ossl_synchronize_rcu(rlock);
  573|       |
  574|      4|    OPENSSL_free(rlock->qp_group);
  ------------------
  |  |  115|      4|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  575|       |    /* There should only be a single qp left now */
  576|      4|    OPENSSL_free(rlock);
  ------------------
  |  |  115|      4|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  577|      4|}
CRYPTO_THREAD_lock_new:
  580|   232k|{
  581|   232k|# ifdef USE_RWLOCK
  582|   232k|    CRYPTO_RWLOCK *lock;
  583|       |
  584|   232k|    if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL)
  ------------------
  |  |  104|   232k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   232k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   232k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (584:9): [True: 0, False: 232k]
  ------------------
  585|       |        /* Don't set error, to avoid recursion blowup. */
  586|      0|        return NULL;
  587|       |
  588|   232k|    if (pthread_rwlock_init(lock, NULL) != 0) {
  ------------------
  |  Branch (588:9): [True: 0, False: 232k]
  ------------------
  589|      0|        OPENSSL_free(lock);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  590|      0|        return NULL;
  591|      0|    }
  592|       |# else
  593|       |    pthread_mutexattr_t attr;
  594|       |    CRYPTO_RWLOCK *lock;
  595|       |
  596|       |    if ((lock = OPENSSL_zalloc(sizeof(pthread_mutex_t))) == NULL)
  597|       |        /* Don't set error, to avoid recursion blowup. */
  598|       |        return NULL;
  599|       |
  600|       |    /*
  601|       |     * We don't use recursive mutexes, but try to catch errors if we do.
  602|       |     */
  603|       |    pthread_mutexattr_init(&attr);
  604|       |#  if !defined (__TANDEM) && !defined (_SPT_MODEL_)
  605|       |#   if !defined(NDEBUG) && !defined(OPENSSL_NO_MUTEX_ERRORCHECK)
  606|       |    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
  607|       |#   endif
  608|       |#  else
  609|       |    /* The SPT Thread Library does not define MUTEX attributes. */
  610|       |#  endif
  611|       |
  612|       |    if (pthread_mutex_init(lock, &attr) != 0) {
  613|       |        pthread_mutexattr_destroy(&attr);
  614|       |        OPENSSL_free(lock);
  615|       |        return NULL;
  616|       |    }
  617|       |
  618|       |    pthread_mutexattr_destroy(&attr);
  619|       |# endif
  620|       |
  621|   232k|    return lock;
  622|   232k|}
CRYPTO_THREAD_read_lock:
  625|  6.16M|{
  626|  6.16M|# ifdef USE_RWLOCK
  627|  6.16M|    if (!ossl_assert(pthread_rwlock_rdlock(lock) == 0))
  ------------------
  |  |   52|  6.16M|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  6.16M|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (627:9): [True: 0, False: 6.16M]
  ------------------
  628|      0|        return 0;
  629|       |# else
  630|       |    if (pthread_mutex_lock(lock) != 0) {
  631|       |        assert(errno != EDEADLK && errno != EBUSY);
  632|       |        return 0;
  633|       |    }
  634|       |# endif
  635|       |
  636|  6.16M|    return 1;
  637|  6.16M|}
CRYPTO_THREAD_write_lock:
  640|  16.6k|{
  641|  16.6k|# ifdef USE_RWLOCK
  642|  16.6k|    if (!ossl_assert(pthread_rwlock_wrlock(lock) == 0))
  ------------------
  |  |   52|  16.6k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  16.6k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (642:9): [True: 0, False: 16.6k]
  ------------------
  643|      0|        return 0;
  644|       |# else
  645|       |    if (pthread_mutex_lock(lock) != 0) {
  646|       |        assert(errno != EDEADLK && errno != EBUSY);
  647|       |        return 0;
  648|       |    }
  649|       |# endif
  650|       |
  651|  16.6k|    return 1;
  652|  16.6k|}
CRYPTO_THREAD_unlock:
  655|  6.18M|{
  656|  6.18M|# ifdef USE_RWLOCK
  657|  6.18M|    if (pthread_rwlock_unlock(lock) != 0)
  ------------------
  |  Branch (657:9): [True: 0, False: 6.18M]
  ------------------
  658|      0|        return 0;
  659|       |# else
  660|       |    if (pthread_mutex_unlock(lock) != 0) {
  661|       |        assert(errno != EPERM);
  662|       |        return 0;
  663|       |    }
  664|       |# endif
  665|       |
  666|  6.18M|    return 1;
  667|  6.18M|}
CRYPTO_THREAD_lock_free:
  670|   232k|{
  671|   232k|    if (lock == NULL)
  ------------------
  |  Branch (671:9): [True: 12, False: 232k]
  ------------------
  672|     12|        return;
  673|       |
  674|   232k|# ifdef USE_RWLOCK
  675|   232k|    pthread_rwlock_destroy(lock);
  676|       |# else
  677|       |    pthread_mutex_destroy(lock);
  678|       |# endif
  679|   232k|    OPENSSL_free(lock);
  ------------------
  |  |  115|   232k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   232k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   232k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  680|       |
  681|   232k|    return;
  682|   232k|}
CRYPTO_THREAD_run_once:
  685|   169M|{
  686|   169M|    if (pthread_once(once, init) != 0)
  ------------------
  |  Branch (686:9): [True: 0, False: 169M]
  ------------------
  687|      0|        return 0;
  688|       |
  689|   169M|    return 1;
  690|   169M|}
CRYPTO_THREAD_init_local:
  693|     20|{
  694|     20|    if (pthread_key_create(key, cleanup) != 0)
  ------------------
  |  Branch (694:9): [True: 0, False: 20]
  ------------------
  695|      0|        return 0;
  696|       |
  697|     20|    return 1;
  698|     20|}
CRYPTO_THREAD_get_local:
  701|  86.9M|{
  702|  86.9M|    return pthread_getspecific(*key);
  703|  86.9M|}
CRYPTO_THREAD_set_local:
  706|     19|{
  707|     19|    if (pthread_setspecific(*key, val) != 0)
  ------------------
  |  Branch (707:9): [True: 0, False: 19]
  ------------------
  708|      0|        return 0;
  709|       |
  710|     19|    return 1;
  711|     19|}
CRYPTO_THREAD_cleanup_local:
  714|     14|{
  715|     14|    if (pthread_key_delete(*key) != 0)
  ------------------
  |  Branch (715:9): [True: 0, False: 14]
  ------------------
  716|      0|        return 0;
  717|       |
  718|     14|    return 1;
  719|     14|}
CRYPTO_atomic_add:
  732|  26.4k|{
  733|  26.4k|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  734|  26.4k|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (734:9): [Folded - Ignored]
  ------------------
  735|  26.4k|        *ret = __atomic_add_fetch(val, amount, __ATOMIC_ACQ_REL);
  736|  26.4k|        return 1;
  737|  26.4k|    }
  738|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  739|       |    /* This will work for all future Solaris versions. */
  740|       |    if (ret != NULL) {
  741|       |        *ret = atomic_add_int_nv((volatile unsigned int *)val, amount);
  742|       |        return 1;
  743|       |    }
  744|       |# endif
  745|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (745:9): [True: 0, False: 0]
  |  Branch (745:25): [True: 0, False: 0]
  ------------------
  746|      0|        return 0;
  747|       |
  748|      0|    *val += amount;
  749|      0|    *ret  = *val;
  750|       |
  751|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (751:9): [True: 0, False: 0]
  ------------------
  752|      0|        return 0;
  753|       |
  754|      0|    return 1;
  755|      0|}
CRYPTO_atomic_or:
  811|      6|{
  812|      6|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  813|      6|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (813:9): [Folded - Ignored]
  ------------------
  814|      6|        *ret = __atomic_or_fetch(val, op, __ATOMIC_ACQ_REL);
  815|      6|        return 1;
  816|      6|    }
  817|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  818|       |    /* This will work for all future Solaris versions. */
  819|       |    if (ret != NULL) {
  820|       |        *ret = atomic_or_64_nv(val, op);
  821|       |        return 1;
  822|       |    }
  823|       |# endif
  824|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (824:9): [True: 0, False: 0]
  |  Branch (824:25): [True: 0, False: 0]
  ------------------
  825|      0|        return 0;
  826|      0|    *val |= op;
  827|      0|    *ret  = *val;
  828|       |
  829|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (829:9): [True: 0, False: 0]
  ------------------
  830|      0|        return 0;
  831|       |
  832|      0|    return 1;
  833|      0|}
CRYPTO_atomic_load:
  836|  82.7M|{
  837|  82.7M|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  838|  82.7M|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (838:9): [Folded - Ignored]
  ------------------
  839|  82.7M|        __atomic_load(val, ret, __ATOMIC_ACQUIRE);
  840|  82.7M|        return 1;
  841|  82.7M|    }
  842|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  843|       |    /* This will work for all future Solaris versions. */
  844|       |    if (ret != NULL) {
  845|       |        *ret = atomic_or_64_nv(val, 0);
  846|       |        return 1;
  847|       |    }
  848|       |# endif
  849|      0|    if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
  ------------------
  |  Branch (849:9): [True: 0, False: 0]
  |  Branch (849:25): [True: 0, False: 0]
  ------------------
  850|      0|        return 0;
  851|      0|    *ret  = *val;
  852|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (852:9): [True: 0, False: 0]
  ------------------
  853|      0|        return 0;
  854|       |
  855|      0|    return 1;
  856|      0|}
CRYPTO_atomic_store:
  859|    385|{
  860|    385|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  861|    385|    if (__atomic_is_lock_free(sizeof(*dst), dst)) {
  ------------------
  |  Branch (861:9): [Folded - Ignored]
  ------------------
  862|    385|        __atomic_store(dst, &val, __ATOMIC_RELEASE);
  863|    385|        return 1;
  864|    385|    }
  865|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  866|       |    /* This will work for all future Solaris versions. */
  867|       |    if (dst != NULL) {
  868|       |        atomic_swap_64(dst, val);
  869|       |        return 1;
  870|       |    }
  871|       |# endif
  872|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (872:9): [True: 0, False: 0]
  |  Branch (872:25): [True: 0, False: 0]
  ------------------
  873|      0|        return 0;
  874|      0|    *dst  = val;
  875|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (875:9): [True: 0, False: 0]
  ------------------
  876|      0|        return 0;
  877|       |
  878|      0|    return 1;
  879|      0|}
threads_pthread.c:update_qp:
  380|     10|{
  381|     10|    uint32_t current_idx;
  382|       |
  383|     10|    pthread_mutex_lock(&lock->alloc_lock);
  384|       |
  385|       |    /*
  386|       |     * we need at least one qp to be available with one
  387|       |     * left over, so that readers can start working on
  388|       |     * one that isn't yet being waited on
  389|       |     */
  390|     10|    while (lock->group_count - lock->writers_alloced < 2)
  ------------------
  |  Branch (390:12): [True: 0, False: 10]
  ------------------
  391|       |        /* we have to wait for one to be free */
  392|      0|        pthread_cond_wait(&lock->alloc_signal, &lock->alloc_lock);
  393|       |
  394|     10|    current_idx = lock->current_alloc_idx;
  395|       |
  396|       |    /* Allocate the qp */
  397|     10|    lock->writers_alloced++;
  398|       |
  399|       |    /* increment the allocation index */
  400|     10|    lock->current_alloc_idx =
  401|     10|        (lock->current_alloc_idx + 1) % lock->group_count;
  402|       |
  403|     10|    *curr_id = lock->id_ctr;
  404|     10|    lock->id_ctr++;
  405|       |
  406|     10|    ATOMIC_STORE_N(uint32_t, &lock->reader_idx, lock->current_alloc_idx,
  ------------------
  |  |   97|     10|#  define ATOMIC_STORE_N(t, p, v, o) __atomic_store_n(p, v, o)
  ------------------
  407|     10|                   __ATOMIC_RELAXED);
  408|       |
  409|       |    /*
  410|       |     * this should make sure that the new value of reader_idx is visible in
  411|       |     * get_hold_current_qp, directly after incrementing the users count
  412|       |     */
  413|     10|    ATOMIC_ADD_FETCH(&lock->qp_group[current_idx].users, (uint64_t)0,
  ------------------
  |  |   99|     10|#  define ATOMIC_ADD_FETCH(p, v, o) __atomic_add_fetch(p, v, o)
  ------------------
  414|     10|                     __ATOMIC_RELEASE);
  415|       |
  416|       |    /* wake up any waiters */
  417|     10|    pthread_cond_signal(&lock->alloc_signal);
  418|     10|    pthread_mutex_unlock(&lock->alloc_lock);
  419|     10|    return &lock->qp_group[current_idx];
  420|     10|}
threads_pthread.c:retire_qp:
  423|     10|{
  424|     10|    pthread_mutex_lock(&lock->alloc_lock);
  425|     10|    lock->writers_alloced--;
  426|     10|    pthread_cond_signal(&lock->alloc_signal);
  427|     10|    pthread_mutex_unlock(&lock->alloc_lock);
  428|     10|}
threads_pthread.c:allocate_new_qp_group:
  432|      6|{
  433|      6|    struct rcu_qp *new =
  434|      6|        OPENSSL_zalloc(sizeof(*new) * count);
  ------------------
  |  |  104|      6|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  435|       |
  436|      6|    lock->group_count = count;
  437|      6|    return new;
  438|      6|}

ossl_time_now:
   16|    795|{
   17|    795|    OSSL_TIME r;
   18|       |
   19|       |#if defined(_WIN32) && !defined(OPENSSL_SYS_UEFI)
   20|       |    SYSTEMTIME st;
   21|       |    union {
   22|       |        unsigned __int64 ul;
   23|       |        FILETIME ft;
   24|       |    } now;
   25|       |
   26|       |    GetSystemTime(&st);
   27|       |    SystemTimeToFileTime(&st, &now.ft);
   28|       |    /* re-bias to 1/1/1970 */
   29|       |# ifdef  __MINGW32__
   30|       |    now.ul -= 116444736000000000ULL;
   31|       |# else
   32|       |    now.ul -= 116444736000000000UI64;
   33|       |# endif
   34|       |    r.t = ((uint64_t)now.ul) * (OSSL_TIME_SECOND / 10000000);
   35|       |#else   /* defined(_WIN32) */
   36|    795|    struct timeval t;
   37|       |
   38|    795|    if (gettimeofday(&t, NULL) < 0) {
  ------------------
  |  Branch (38:9): [True: 0, False: 795]
  ------------------
   39|      0|        ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   72|      0|# define ERR_LIB_SYS             2
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   30|      0|# define get_last_sys_error()    errno
  ------------------
   40|      0|                       "calling gettimeofday()");
   41|      0|        return ossl_time_zero();
   42|      0|    }
   43|    795|    if (t.tv_sec <= 0)
  ------------------
  |  Branch (43:9): [True: 0, False: 795]
  ------------------
   44|      0|        r.t = t.tv_usec <= 0 ? 0 : t.tv_usec * OSSL_TIME_US;
  ------------------
  |  |   37|      0|# define OSSL_TIME_US     (OSSL_TIME_MS     / 1000)
  |  |  ------------------
  |  |  |  |   34|      0|# define OSSL_TIME_MS     (OSSL_TIME_SECOND / 1000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|      0|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (44:15): [True: 0, False: 0]
  ------------------
   45|    795|    else
   46|    795|        r.t = ((uint64_t)t.tv_sec * 1000000 + t.tv_usec) * OSSL_TIME_US;
  ------------------
  |  |   37|    795|# define OSSL_TIME_US     (OSSL_TIME_MS     / 1000)
  |  |  ------------------
  |  |  |  |   34|    795|# define OSSL_TIME_MS     (OSSL_TIME_SECOND / 1000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    795|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   47|    795|#endif  /* defined(_WIN32) */
   48|    795|    return r;
   49|    795|}

ossl_trace_cleanup:
  340|      2|{
  341|       |#ifndef OPENSSL_NO_TRACE
  342|       |    int category;
  343|       |    BIO *channel = NULL;
  344|       |    const char *prefix = NULL;
  345|       |    const char *suffix = NULL;
  346|       |
  347|       |    for (category = 0; category < OSSL_TRACE_CATEGORY_NUM; category++) {
  348|       |        /* We force the TRACE category to be treated last */
  349|       |        if (category == OSSL_TRACE_CATEGORY_TRACE)
  350|       |            continue;
  351|       |        set_trace_data(category, 0, &channel, &prefix, &suffix,
  352|       |                       trace_attach_cb, trace_detach_cb);
  353|       |    }
  354|       |    set_trace_data(OSSL_TRACE_CATEGORY_TRACE, 0, &channel,
  355|       |                   &prefix, &suffix,
  356|       |                   trace_attach_cb, trace_detach_cb);
  357|       |    CRYPTO_THREAD_lock_free(trace_lock);
  358|       |#endif
  359|      2|}
OSSL_trace_set_channel:
  362|      2|{
  363|       |#ifndef OPENSSL_NO_TRACE
  364|       |    if (category >= 0 && category < OSSL_TRACE_CATEGORY_NUM)
  365|       |        return set_trace_data(category, SIMPLE_CHANNEL, &channel, NULL, NULL,
  366|       |                              trace_attach_cb, trace_detach_cb);
  367|       |#endif
  368|      2|    return 0;
  369|      2|}

PKCS7_to_TS_TST_INFO:
  205|      6|{
  206|      6|    PKCS7_SIGNED *pkcs7_signed;
  207|      6|    PKCS7 *enveloped;
  208|      6|    ASN1_TYPE *tst_info_wrapper;
  209|      6|    ASN1_OCTET_STRING *tst_info_der;
  210|      6|    const unsigned char *p;
  211|       |
  212|      6|    if (!PKCS7_type_is_signed(token)) {
  ------------------
  |  |  255|      6|# define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed)
  |  |  ------------------
  |  |  |  |  679|      6|#define NID_pkcs7_signed                22
  |  |  ------------------
  ------------------
  |  Branch (212:9): [True: 3, False: 3]
  ------------------
  213|      3|        ERR_raise(ERR_LIB_TS, TS_R_BAD_PKCS7_TYPE);
  ------------------
  |  |  401|      3|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      3|    (ERR_new(),                                                 \
  |  |  |  |  404|      3|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      3|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      3|     ERR_set_error)
  |  |  ------------------
  ------------------
  214|      3|        return NULL;
  215|      3|    }
  216|      3|    if (PKCS7_get_detached(token)) {
  ------------------
  |  |  266|      3|                PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL)
  |  |  ------------------
  |  |  |  |  250|      3|# define PKCS7_OP_GET_DETACHED_SIGNATURE 2
  |  |  ------------------
  |  |  |  Branch (266:17): [True: 2, False: 1]
  |  |  ------------------
  ------------------
  217|      2|        ERR_raise(ERR_LIB_TS, TS_R_DETACHED_CONTENT);
  ------------------
  |  |  401|      2|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      2|    (ERR_new(),                                                 \
  |  |  |  |  404|      2|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      2|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      2|     ERR_set_error)
  |  |  ------------------
  ------------------
  218|      2|        return NULL;
  219|      2|    }
  220|      1|    pkcs7_signed = token->d.sign;
  221|      1|    enveloped = pkcs7_signed->contents;
  222|      1|    if (OBJ_obj2nid(enveloped->type) != NID_id_smime_ct_TSTInfo) {
  ------------------
  |  |  826|      1|#define NID_id_smime_ct_TSTInfo         207
  ------------------
  |  Branch (222:9): [True: 1, False: 0]
  ------------------
  223|      1|        ERR_raise(ERR_LIB_TS, TS_R_BAD_PKCS7_TYPE);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
  224|      1|        return NULL;
  225|      1|    }
  226|      0|    tst_info_wrapper = enveloped->d.other;
  227|      0|    if (tst_info_wrapper->type != V_ASN1_OCTET_STRING) {
  ------------------
  |  |   66|      0|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (227:9): [True: 0, False: 0]
  ------------------
  228|      0|        ERR_raise(ERR_LIB_TS, TS_R_BAD_TYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  229|      0|        return NULL;
  230|      0|    }
  231|      0|    tst_info_der = tst_info_wrapper->value.octet_string;
  232|      0|    p = tst_info_der->data;
  233|      0|    return d2i_TS_TST_INFO(NULL, &p, tst_info_der->length);
  234|      0|}
ts_asn1.c:ts_resp_cb:
  160|  51.0k|{
  161|  51.0k|    TS_RESP *ts_resp = (TS_RESP *)*pval;
  162|  51.0k|    if (op == ASN1_OP_NEW_POST) {
  ------------------
  |  |  743|  51.0k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (162:9): [True: 10.1k, False: 40.9k]
  ------------------
  163|  10.1k|        ts_resp->tst_info = NULL;
  164|  40.9k|    } else if (op == ASN1_OP_FREE_POST) {
  ------------------
  |  |  745|  40.9k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (164:16): [True: 10.1k, False: 30.8k]
  ------------------
  165|  10.1k|        TS_TST_INFO_free(ts_resp->tst_info);
  166|  30.8k|    } else if (op == ASN1_OP_D2I_POST) {
  ------------------
  |  |  747|  30.8k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (166:16): [True: 172, False: 30.6k]
  ------------------
  167|    172|        if (ts_resp_set_tst_info(ts_resp) == 0)
  ------------------
  |  Branch (167:13): [True: 72, False: 100]
  ------------------
  168|     72|            return 0;
  169|    172|    }
  170|  50.9k|    return 1;
  171|  51.0k|}
ts_asn1.c:ts_resp_set_tst_info:
  134|    172|{
  135|    172|    long status;
  136|       |
  137|    172|    status = ASN1_INTEGER_get(a->status_info->status);
  138|       |
  139|    172|    if (a->token) {
  ------------------
  |  Branch (139:9): [True: 69, False: 103]
  ------------------
  140|     69|        if (status != 0 && status != 1) {
  ------------------
  |  Branch (140:13): [True: 64, False: 5]
  |  Branch (140:28): [True: 63, False: 1]
  ------------------
  141|     63|            ERR_raise(ERR_LIB_TS, TS_R_TOKEN_PRESENT);
  ------------------
  |  |  401|     63|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     63|    (ERR_new(),                                                 \
  |  |  |  |  404|     63|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     63|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     63|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     63|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     63|     ERR_set_error)
  |  |  ------------------
  ------------------
  142|     63|            return 0;
  143|     63|        }
  144|      6|        TS_TST_INFO_free(a->tst_info);
  145|      6|        a->tst_info = PKCS7_to_TS_TST_INFO(a->token);
  146|      6|        if (!a->tst_info) {
  ------------------
  |  Branch (146:13): [True: 6, False: 0]
  ------------------
  147|      6|            ERR_raise(ERR_LIB_TS, TS_R_PKCS7_TO_TS_TST_INFO_FAILED);
  ------------------
  |  |  401|      6|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      6|    (ERR_new(),                                                 \
  |  |  |  |  404|      6|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      6|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      6|     ERR_set_error)
  |  |  ------------------
  ------------------
  148|      6|            return 0;
  149|      6|        }
  150|    103|    } else if (status == 0 || status == 1) {
  ------------------
  |  Branch (150:16): [True: 2, False: 101]
  |  Branch (150:31): [True: 1, False: 100]
  ------------------
  151|      3|        ERR_raise(ERR_LIB_TS, TS_R_TOKEN_NOT_PRESENT);
  ------------------
  |  |  401|      3|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      3|    (ERR_new(),                                                 \
  |  |  |  |  404|      3|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      3|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      3|     ERR_set_error)
  |  |  ------------------
  ------------------
  152|      3|        return 0;
  153|      3|    }
  154|       |
  155|    100|    return 1;
  156|    172|}

ossl_err_load_TS_strings:
   82|      2|{
   83|      2|# ifndef OPENSSL_NO_ERR
   84|      2|    if (ERR_reason_error_string(TS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (84:9): [True: 2, False: 0]
  ------------------
   85|      2|        ERR_load_strings_const(TS_str_reasons);
   86|      2|# endif
   87|      2|    return 1;
   88|      2|}

TS_ASN1_INTEGER_print_bio:
   20|    327|{
   21|    327|    BIGNUM *num_bn;
   22|    327|    int result = 0;
   23|    327|    char *hex;
   24|       |
   25|    327|    num_bn = ASN1_INTEGER_to_BN(num, NULL);
   26|    327|    if (num_bn == NULL)
  ------------------
  |  Branch (26:9): [True: 0, False: 327]
  ------------------
   27|      0|        return -1;
   28|    327|    if ((hex = BN_bn2hex(num_bn))) {
  ------------------
  |  Branch (28:9): [True: 327, False: 0]
  ------------------
   29|    327|        result = BIO_write(bio, "0x", 2) > 0;
   30|    327|        result = result && BIO_write(bio, hex, strlen(hex)) > 0;
  ------------------
  |  Branch (30:18): [True: 327, False: 0]
  |  Branch (30:28): [True: 327, False: 0]
  ------------------
   31|    327|        OPENSSL_free(hex);
  ------------------
  |  |  115|    327|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    327|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    327|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   32|    327|    }
   33|    327|    BN_free(num_bn);
   34|       |
   35|    327|    return result;
   36|    327|}
TS_OBJ_print_bio:
   39|     13|{
   40|     13|    char obj_txt[128];
   41|       |
   42|     13|    OBJ_obj2txt(obj_txt, sizeof(obj_txt), obj, 0);
   43|     13|    BIO_printf(bio, "%s\n", obj_txt);
   44|       |
   45|     13|    return 1;
   46|     13|}
TS_ext_print_bio:
   49|  1.26k|{
   50|  1.26k|    int i, critical, n;
   51|  1.26k|    X509_EXTENSION *ex;
   52|  1.26k|    ASN1_OBJECT *obj;
   53|       |
   54|  1.26k|    BIO_printf(bio, "Extensions:\n");
   55|  1.26k|    n = X509v3_get_ext_count(extensions);
   56|  43.7k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (56:17): [True: 42.4k, False: 1.26k]
  ------------------
   57|  42.4k|        ex = X509v3_get_ext(extensions, i);
   58|  42.4k|        obj = X509_EXTENSION_get_object(ex);
   59|  42.4k|        if (i2a_ASN1_OBJECT(bio, obj) < 0)
  ------------------
  |  Branch (59:13): [True: 0, False: 42.4k]
  ------------------
   60|      0|            return 0;
   61|  42.4k|        critical = X509_EXTENSION_get_critical(ex);
   62|  42.4k|        BIO_printf(bio, ":%s\n", critical ? " critical" : "");
  ------------------
  |  Branch (62:34): [True: 578, False: 41.9k]
  ------------------
   63|  42.4k|        if (!X509V3_EXT_print(bio, ex, 0, 4)) {
  ------------------
  |  Branch (63:13): [True: 27.8k, False: 14.6k]
  ------------------
   64|  27.8k|            BIO_printf(bio, "%4s", "");
   65|  27.8k|            ASN1_STRING_print(bio, X509_EXTENSION_get_data(ex));
   66|  27.8k|        }
   67|  42.4k|        BIO_write(bio, "\n", 1);
   68|  42.4k|    }
   69|       |
   70|  1.26k|    return 1;
   71|  1.26k|}
TS_X509_ALGOR_print_bio:
   74|  1.26k|{
   75|  1.26k|    int i = OBJ_obj2nid(alg->algorithm);
   76|  1.26k|    return BIO_printf(bio, "Hash Algorithm: %s\n",
   77|  1.26k|                      (i == NID_undef) ? "UNKNOWN" : OBJ_nid2ln(i));
  ------------------
  |  |   18|  1.26k|#define NID_undef                       0
  ------------------
  |  Branch (77:23): [True: 1.22k, False: 41]
  ------------------
   78|  1.26k|}
TS_MSG_IMPRINT_print_bio:
   81|  1.26k|{
   82|  1.26k|    ASN1_OCTET_STRING *msg;
   83|       |
   84|  1.26k|    TS_X509_ALGOR_print_bio(bio, a->hash_algo);
   85|       |
   86|  1.26k|    BIO_printf(bio, "Message data:\n");
   87|  1.26k|    msg = a->hashed_msg;
   88|  1.26k|    BIO_dump_indent(bio, (const char *)ASN1_STRING_get0_data(msg),
   89|  1.26k|                    ASN1_STRING_length(msg), 4);
   90|       |
   91|  1.26k|    return 1;
   92|  1.26k|}

TS_REQ_print_bio:
   19|  1.24k|{
   20|  1.24k|    int v;
   21|  1.24k|    ASN1_OBJECT *policy_id;
   22|       |
   23|  1.24k|    if (a == NULL)
  ------------------
  |  Branch (23:9): [True: 0, False: 1.24k]
  ------------------
   24|      0|        return 0;
   25|       |
   26|  1.24k|    v = TS_REQ_get_version(a);
   27|  1.24k|    BIO_printf(bio, "Version: %d\n", v);
   28|       |
   29|  1.24k|    TS_MSG_IMPRINT_print_bio(bio, a->msg_imprint);
   30|       |
   31|  1.24k|    BIO_printf(bio, "Policy OID: ");
   32|  1.24k|    policy_id = TS_REQ_get_policy_id(a);
   33|  1.24k|    if (policy_id == NULL)
  ------------------
  |  Branch (33:9): [True: 1.24k, False: 2]
  ------------------
   34|  1.24k|        BIO_printf(bio, "unspecified\n");
   35|      2|    else
   36|      2|        TS_OBJ_print_bio(bio, policy_id);
   37|       |
   38|  1.24k|    BIO_printf(bio, "Nonce: ");
   39|  1.24k|    if (a->nonce == NULL)
  ------------------
  |  Branch (39:9): [True: 943, False: 306]
  ------------------
   40|    943|        BIO_printf(bio, "unspecified");
   41|    306|    else
   42|    306|        TS_ASN1_INTEGER_print_bio(bio, a->nonce);
   43|  1.24k|    BIO_write(bio, "\n", 1);
   44|       |
   45|  1.24k|    BIO_printf(bio, "Certificate required: %s\n",
   46|  1.24k|               a->cert_req ? "yes" : "no");
  ------------------
  |  Branch (46:16): [True: 1, False: 1.24k]
  ------------------
   47|       |
   48|  1.24k|    TS_ext_print_bio(bio, a->extensions);
   49|       |
   50|  1.24k|    return 1;
   51|  1.24k|}

TS_REQ_get_version:
   23|  1.24k|{
   24|  1.24k|    return ASN1_INTEGER_get(a->version);
   25|  1.24k|}
TS_REQ_get_policy_id:
   96|  1.24k|{
   97|  1.24k|    return a->policy_id;
   98|  1.24k|}

TS_RESP_print_bio:
   29|    100|{
   30|    100|    BIO_printf(bio, "Status info:\n");
   31|    100|    TS_STATUS_INFO_print_bio(bio, a->status_info);
   32|       |
   33|    100|    BIO_printf(bio, "\nTST info:\n");
   34|    100|    if (a->tst_info != NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 100]
  ------------------
   35|      0|        TS_TST_INFO_print_bio(bio, a->tst_info);
   36|    100|    else
   37|    100|        BIO_printf(bio, "Not included.\n");
   38|       |
   39|    100|    return 1;
   40|    100|}
TS_STATUS_INFO_print_bio:
   43|    604|{
   44|    604|    static const char *status_map[] = {
   45|    604|        "Granted.",
   46|    604|        "Granted with modifications.",
   47|    604|        "Rejected.",
   48|    604|        "Waiting.",
   49|    604|        "Revocation warning.",
   50|    604|        "Revoked."
   51|    604|    };
   52|    604|    static const struct status_map_st failure_map[] = {
   53|    604|        {TS_INFO_BAD_ALG,
  ------------------
  |  |   56|    604|# define TS_INFO_BAD_ALG                 0
  ------------------
   54|    604|         "unrecognized or unsupported algorithm identifier"},
   55|    604|        {TS_INFO_BAD_REQUEST,
  ------------------
  |  |   57|    604|# define TS_INFO_BAD_REQUEST             2
  ------------------
   56|    604|         "transaction not permitted or supported"},
   57|    604|        {TS_INFO_BAD_DATA_FORMAT,
  ------------------
  |  |   58|    604|# define TS_INFO_BAD_DATA_FORMAT         5
  ------------------
   58|    604|         "the data submitted has the wrong format"},
   59|    604|        {TS_INFO_TIME_NOT_AVAILABLE,
  ------------------
  |  |   59|    604|# define TS_INFO_TIME_NOT_AVAILABLE      14
  ------------------
   60|    604|         "the TSA's time source is not available"},
   61|    604|        {TS_INFO_UNACCEPTED_POLICY,
  ------------------
  |  |   60|    604|# define TS_INFO_UNACCEPTED_POLICY       15
  ------------------
   62|    604|         "the requested TSA policy is not supported by the TSA"},
   63|    604|        {TS_INFO_UNACCEPTED_EXTENSION,
  ------------------
  |  |   61|    604|# define TS_INFO_UNACCEPTED_EXTENSION    16
  ------------------
   64|    604|         "the requested extension is not supported by the TSA"},
   65|    604|        {TS_INFO_ADD_INFO_NOT_AVAILABLE,
  ------------------
  |  |   62|    604|# define TS_INFO_ADD_INFO_NOT_AVAILABLE  17
  ------------------
   66|    604|         "the additional information requested could not be understood "
   67|    604|         "or is not available"},
   68|    604|        {TS_INFO_SYSTEM_FAILURE,
  ------------------
  |  |   63|    604|# define TS_INFO_SYSTEM_FAILURE          25
  ------------------
   69|    604|         "the request cannot be handled due to system failure"},
   70|    604|        {-1, NULL}
   71|    604|    };
   72|    604|    long status;
   73|    604|    int i, lines = 0;
   74|       |
   75|    604|    BIO_printf(bio, "Status: ");
   76|    604|    status = ASN1_INTEGER_get(a->status);
   77|    604|    if (0 <= status && status < (long)OSSL_NELEM(status_map))
  ------------------
  |  |   14|    212|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (77:9): [True: 212, False: 392]
  |  Branch (77:24): [True: 20, False: 192]
  ------------------
   78|     20|        BIO_printf(bio, "%s\n", status_map[status]);
   79|    584|    else
   80|    584|        BIO_printf(bio, "out of bounds\n");
   81|       |
   82|    604|    BIO_printf(bio, "Status description: ");
   83|  6.54k|    for (i = 0; i < sk_ASN1_UTF8STRING_num(a->text); ++i) {
  ------------------
  |  |  764|  6.54k|#define sk_ASN1_UTF8STRING_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_UTF8STRING_sk_type(sk))
  ------------------
  |  Branch (83:17): [True: 5.93k, False: 604]
  ------------------
   84|  5.93k|        if (i > 0)
  ------------------
  |  Branch (84:13): [True: 5.76k, False: 171]
  ------------------
   85|  5.76k|            BIO_puts(bio, "\t");
   86|  5.93k|        ASN1_STRING_print_ex(bio, sk_ASN1_UTF8STRING_value(a->text, i), 0);
  ------------------
  |  |  765|  5.93k|#define sk_ASN1_UTF8STRING_value(sk, idx) ((ASN1_UTF8STRING *)OPENSSL_sk_value(ossl_check_const_ASN1_UTF8STRING_sk_type(sk), (idx)))
  ------------------
   87|  5.93k|        BIO_puts(bio, "\n");
   88|  5.93k|    }
   89|    604|    if (i == 0)
  ------------------
  |  Branch (89:9): [True: 433, False: 171]
  ------------------
   90|    433|        BIO_printf(bio, "unspecified\n");
   91|       |
   92|    604|    BIO_printf(bio, "Failure info: ");
   93|    604|    if (a->failure_info != NULL)
  ------------------
  |  Branch (93:9): [True: 23, False: 581]
  ------------------
   94|     23|        lines = ts_status_map_print(bio, failure_map, a->failure_info);
   95|    604|    if (lines == 0)
  ------------------
  |  Branch (95:9): [True: 593, False: 11]
  ------------------
   96|    593|        BIO_printf(bio, "unspecified");
   97|    604|    BIO_printf(bio, "\n");
   98|       |
   99|    604|    return 1;
  100|    604|}
TS_TST_INFO_print_bio:
  119|     11|{
  120|     11|    int v;
  121|       |
  122|     11|    if (a == NULL)
  ------------------
  |  Branch (122:9): [True: 0, False: 11]
  ------------------
  123|      0|        return 0;
  124|       |
  125|     11|    v = ASN1_INTEGER_get(a->version);
  126|     11|    BIO_printf(bio, "Version: %d\n", v);
  127|       |
  128|     11|    BIO_printf(bio, "Policy OID: ");
  129|     11|    TS_OBJ_print_bio(bio, a->policy_id);
  130|       |
  131|     11|    TS_MSG_IMPRINT_print_bio(bio, a->msg_imprint);
  132|       |
  133|     11|    BIO_printf(bio, "Serial number: ");
  134|     11|    if (a->serial == NULL)
  ------------------
  |  Branch (134:9): [True: 0, False: 11]
  ------------------
  135|      0|        BIO_printf(bio, "unspecified");
  136|     11|    else
  137|     11|        TS_ASN1_INTEGER_print_bio(bio, a->serial);
  138|     11|    BIO_write(bio, "\n", 1);
  139|       |
  140|     11|    BIO_printf(bio, "Time stamp: ");
  141|     11|    ASN1_GENERALIZEDTIME_print(bio, a->time);
  142|     11|    BIO_write(bio, "\n", 1);
  143|       |
  144|     11|    BIO_printf(bio, "Accuracy: ");
  145|     11|    if (a->accuracy == NULL)
  ------------------
  |  Branch (145:9): [True: 5, False: 6]
  ------------------
  146|      5|        BIO_printf(bio, "unspecified");
  147|      6|    else
  148|      6|        ts_ACCURACY_print_bio(bio, a->accuracy);
  149|     11|    BIO_write(bio, "\n", 1);
  150|       |
  151|     11|    BIO_printf(bio, "Ordering: %s\n", a->ordering ? "yes" : "no");
  ------------------
  |  Branch (151:39): [True: 0, False: 11]
  ------------------
  152|       |
  153|     11|    BIO_printf(bio, "Nonce: ");
  154|     11|    if (a->nonce == NULL)
  ------------------
  |  Branch (154:9): [True: 8, False: 3]
  ------------------
  155|      8|        BIO_printf(bio, "unspecified");
  156|      3|    else
  157|      3|        TS_ASN1_INTEGER_print_bio(bio, a->nonce);
  158|     11|    BIO_write(bio, "\n", 1);
  159|       |
  160|     11|    BIO_printf(bio, "TSA: ");
  161|     11|    if (a->tsa == NULL)
  ------------------
  |  Branch (161:9): [True: 9, False: 2]
  ------------------
  162|      9|        BIO_printf(bio, "unspecified");
  163|      2|    else {
  164|      2|        STACK_OF(CONF_VALUE) *nval;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  165|      2|        if ((nval = i2v_GENERAL_NAME(NULL, a->tsa, NULL)))
  ------------------
  |  Branch (165:13): [True: 1, False: 1]
  ------------------
  166|      1|            X509V3_EXT_val_prn(bio, nval, 0, 0);
  167|      2|        sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);
  ------------------
  |  |   59|      2|#define sk_CONF_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_freefunc_type(freefunc))
  ------------------
  168|      2|    }
  169|     11|    BIO_write(bio, "\n", 1);
  170|       |
  171|     11|    TS_ext_print_bio(bio, a->extensions);
  172|       |
  173|     11|    return 1;
  174|     11|}
ts_rsp_print.c:ts_status_map_print:
  104|     23|{
  105|     23|    int lines = 0;
  106|       |
  107|    207|    for (; a->bit >= 0; ++a) {
  ------------------
  |  Branch (107:12): [True: 184, False: 23]
  ------------------
  108|    184|        if (ASN1_BIT_STRING_get_bit(v, a->bit)) {
  ------------------
  |  Branch (108:13): [True: 38, False: 146]
  ------------------
  109|     38|            if (++lines > 1)
  ------------------
  |  Branch (109:17): [True: 27, False: 11]
  ------------------
  110|     27|                BIO_printf(bio, ", ");
  111|     38|            BIO_printf(bio, "%s", a->text);
  112|     38|        }
  113|    184|    }
  114|       |
  115|     23|    return lines;
  116|     23|}
ts_rsp_print.c:ts_ACCURACY_print_bio:
  177|      6|{
  178|      6|    if (a->seconds != NULL)
  ------------------
  |  Branch (178:9): [True: 1, False: 5]
  ------------------
  179|      1|        TS_ASN1_INTEGER_print_bio(bio, a->seconds);
  180|      5|    else
  181|      5|        BIO_printf(bio, "unspecified");
  182|      6|    BIO_printf(bio, " seconds, ");
  183|      6|    if (a->millis != NULL)
  ------------------
  |  Branch (183:9): [True: 3, False: 3]
  ------------------
  184|      3|        TS_ASN1_INTEGER_print_bio(bio, a->millis);
  185|      3|    else
  186|      3|        BIO_printf(bio, "unspecified");
  187|      6|    BIO_printf(bio, " millis, ");
  188|      6|    if (a->micros != NULL)
  ------------------
  |  Branch (188:9): [True: 3, False: 3]
  ------------------
  189|      3|        TS_ASN1_INTEGER_print_bio(bio, a->micros);
  190|      3|    else
  191|      3|        BIO_printf(bio, "unspecified");
  192|      6|    BIO_printf(bio, " micros");
  193|       |
  194|      6|    return 1;
  195|      6|}

ossl_err_load_UI_strings:
   41|      2|{
   42|      2|#ifndef OPENSSL_NO_ERR
   43|      2|    if (ERR_reason_error_string(UI_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (43:9): [True: 2, False: 0]
  ------------------
   44|      2|        ERR_load_strings_const(UI_str_reasons);
   45|      2|#endif
   46|      2|    return 1;
   47|      2|}

ossl_policy_cache_free:
  179|  74.4k|{
  180|  74.4k|    if (!cache)
  ------------------
  |  Branch (180:9): [True: 74.4k, False: 0]
  ------------------
  181|  74.4k|        return;
  182|      0|    ossl_policy_data_free(cache->anyPolicy);
  183|      0|    sk_X509_POLICY_DATA_pop_free(cache->data, ossl_policy_data_free);
  184|      0|    OPENSSL_free(cache);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  185|      0|}

OSSL_STACK_OF_X509_free:
   21|    479|{
   22|    479|    sk_X509_pop_free(certs, X509_free);
  ------------------
  |  |   93|    479|#define sk_X509_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_sk_type(sk), ossl_check_X509_freefunc_type(freefunc))
  ------------------
   23|    479|}

v3_aaa.c:i2r_ALLOWED_ATTRIBUTES_SYNTAX:
  105|     12|{
  106|     12|    int i;
  107|     12|    OSSL_ALLOWED_ATTRIBUTES_ITEM *aai;
  108|       |
  109|     12|    for (i = 0; i < sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_num(aaa); i++) {
  ------------------
  |  | 1926|     12|#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk))
  ------------------
  |  Branch (109:17): [True: 0, False: 12]
  ------------------
  110|      0|        if (BIO_printf(out, "%*sAllowed Attributes:\n", indent, "") <= 0)
  ------------------
  |  Branch (110:13): [True: 0, False: 0]
  ------------------
  111|      0|            return 0;
  112|      0|        aai = sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_value(aaa, i);
  ------------------
  |  | 1927|      0|#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_value(sk, idx) ((OSSL_ALLOWED_ATTRIBUTES_ITEM *)OPENSSL_sk_value(ossl_check_const_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk), (idx)))
  ------------------
  113|      0|        if (i2r_ALLOWED_ATTRIBUTES_ITEM(method, aai, out, indent + 4) <= 0)
  ------------------
  |  Branch (113:13): [True: 0, False: 0]
  ------------------
  114|      0|            return 0;
  115|      0|    }
  116|     12|    return 1;
  117|     12|}

v3_ac_tgt.c:i2r_TARGETING_INFORMATION:
  222|     46|{
  223|     46|    int i;
  224|     46|    OSSL_TARGETS *targets;
  225|       |
  226|    102|    for (i = 0; i < sk_OSSL_TARGETS_num(tinfo); i++) {
  ------------------
  |  |  232|    102|#define sk_OSSL_TARGETS_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_TARGETS_sk_type(sk))
  ------------------
  |  Branch (226:17): [True: 56, False: 46]
  ------------------
  227|     56|        BIO_printf(out, "%*sTargets:\n", indent, "");
  228|     56|        targets = sk_OSSL_TARGETS_value(tinfo, i);
  ------------------
  |  |  233|     56|#define sk_OSSL_TARGETS_value(sk, idx) ((OSSL_TARGETS *)OPENSSL_sk_value(ossl_check_const_OSSL_TARGETS_sk_type(sk), (idx)))
  ------------------
  229|     56|        i2r_TARGETS(method, targets, out, indent + 2);
  230|     56|    }
  231|     46|    return 1;
  232|     46|}
v3_ac_tgt.c:i2r_TARGETS:
  207|     56|{
  208|     56|    int i;
  209|     56|    OSSL_TARGET *target;
  210|       |
  211|     56|    for (i = 0; i < sk_OSSL_TARGET_num(targets); i++) {
  ------------------
  |  |  204|     56|#define sk_OSSL_TARGET_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_TARGET_sk_type(sk))
  ------------------
  |  Branch (211:17): [True: 0, False: 56]
  ------------------
  212|      0|        BIO_printf(out, "%*sTarget:\n", indent, "");
  213|      0|        target = sk_OSSL_TARGET_value(targets, i);
  ------------------
  |  |  205|      0|#define sk_OSSL_TARGET_value(sk, idx) ((OSSL_TARGET *)OPENSSL_sk_value(ossl_check_const_OSSL_TARGET_sk_type(sk), (idx)))
  ------------------
  214|      0|        i2r_TARGET(method, target, out, indent + 2);
  215|      0|    }
  216|     56|    return 1;
  217|     56|}

v3_admis.c:i2r_ADMISSION_SYNTAX:
  119|     10|{
  120|     10|    ADMISSION_SYNTAX *admission = (ADMISSION_SYNTAX *)in;
  121|     10|    int i, j, k;
  122|       |
  123|     10|    if (admission->admissionAuthority != NULL) {
  ------------------
  |  Branch (123:9): [True: 8, False: 2]
  ------------------
  124|      8|        if (BIO_printf(bp, "%*sadmissionAuthority:\n", ind, "") <= 0
  ------------------
  |  Branch (124:13): [True: 0, False: 8]
  ------------------
  125|      8|            || BIO_printf(bp, "%*s  ", ind, "") <= 0
  ------------------
  |  Branch (125:16): [True: 0, False: 8]
  ------------------
  126|      8|            || GENERAL_NAME_print(bp, admission->admissionAuthority) <= 0
  ------------------
  |  Branch (126:16): [True: 0, False: 8]
  ------------------
  127|      8|            || BIO_printf(bp, "\n") <= 0)
  ------------------
  |  Branch (127:16): [True: 0, False: 8]
  ------------------
  128|      0|            goto err;
  129|      8|    }
  130|       |
  131|     11|    for (i = 0; i < sk_ADMISSIONS_num(admission->contentsOfAdmissions); i++) {
  ------------------
  |  | 1388|     11|#define sk_ADMISSIONS_num(sk) OPENSSL_sk_num(ossl_check_const_ADMISSIONS_sk_type(sk))
  ------------------
  |  Branch (131:17): [True: 1, False: 10]
  ------------------
  132|      1|        ADMISSIONS *entry = sk_ADMISSIONS_value(admission->contentsOfAdmissions, i);
  ------------------
  |  | 1389|      1|#define sk_ADMISSIONS_value(sk, idx) ((ADMISSIONS *)OPENSSL_sk_value(ossl_check_const_ADMISSIONS_sk_type(sk), (idx)))
  ------------------
  133|       |
  134|      1|        if (BIO_printf(bp, "%*sEntry %0d:\n", ind, "", 1 + i) <= 0)
  ------------------
  |  Branch (134:13): [True: 0, False: 1]
  ------------------
  135|      0|            goto err;
  136|       |
  137|      1|        if (entry->admissionAuthority != NULL) {
  ------------------
  |  Branch (137:13): [True: 0, False: 1]
  ------------------
  138|      0|            if (BIO_printf(bp, "%*s  admissionAuthority:\n", ind, "") <= 0
  ------------------
  |  Branch (138:17): [True: 0, False: 0]
  ------------------
  139|      0|                || BIO_printf(bp, "%*s    ", ind, "") <= 0
  ------------------
  |  Branch (139:20): [True: 0, False: 0]
  ------------------
  140|      0|                || GENERAL_NAME_print(bp, entry->admissionAuthority) <= 0
  ------------------
  |  Branch (140:20): [True: 0, False: 0]
  ------------------
  141|      0|                || BIO_printf(bp, "\n") <= 0)
  ------------------
  |  Branch (141:20): [True: 0, False: 0]
  ------------------
  142|      0|                goto err;
  143|      0|        }
  144|       |
  145|      1|        if (entry->namingAuthority != NULL) {
  ------------------
  |  Branch (145:13): [True: 0, False: 1]
  ------------------
  146|      0|            if (i2r_NAMING_AUTHORITY(method, entry->namingAuthority, bp, ind + 2) <= 0)
  ------------------
  |  Branch (146:17): [True: 0, False: 0]
  ------------------
  147|      0|                goto err;
  148|      0|        }
  149|       |
  150|      1|        for (j = 0; j < sk_PROFESSION_INFO_num(entry->professionInfos); j++) {
  ------------------
  |  | 1362|      1|#define sk_PROFESSION_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_PROFESSION_INFO_sk_type(sk))
  ------------------
  |  Branch (150:21): [True: 0, False: 1]
  ------------------
  151|      0|            PROFESSION_INFO *pinfo = sk_PROFESSION_INFO_value(entry->professionInfos, j);
  ------------------
  |  | 1363|      0|#define sk_PROFESSION_INFO_value(sk, idx) ((PROFESSION_INFO *)OPENSSL_sk_value(ossl_check_const_PROFESSION_INFO_sk_type(sk), (idx)))
  ------------------
  152|       |
  153|      0|            if (BIO_printf(bp, "%*s  Profession Info Entry %0d:\n", ind, "", 1 + j) <= 0)
  ------------------
  |  Branch (153:17): [True: 0, False: 0]
  ------------------
  154|      0|                goto err;
  155|       |
  156|      0|            if (pinfo->registrationNumber != NULL) {
  ------------------
  |  Branch (156:17): [True: 0, False: 0]
  ------------------
  157|      0|                if (BIO_printf(bp, "%*s    registrationNumber: ", ind, "") <= 0
  ------------------
  |  Branch (157:21): [True: 0, False: 0]
  ------------------
  158|      0|                    || ASN1_STRING_print(bp, pinfo->registrationNumber) <= 0
  ------------------
  |  Branch (158:24): [True: 0, False: 0]
  ------------------
  159|      0|                    || BIO_printf(bp, "\n") <= 0)
  ------------------
  |  Branch (159:24): [True: 0, False: 0]
  ------------------
  160|      0|                    goto err;
  161|      0|            }
  162|       |
  163|      0|            if (pinfo->namingAuthority != NULL) {
  ------------------
  |  Branch (163:17): [True: 0, False: 0]
  ------------------
  164|      0|                if (i2r_NAMING_AUTHORITY(method, pinfo->namingAuthority, bp, ind + 4) <= 0)
  ------------------
  |  Branch (164:21): [True: 0, False: 0]
  ------------------
  165|      0|                    goto err;
  166|      0|            }
  167|       |
  168|      0|            if (pinfo->professionItems != NULL) {
  ------------------
  |  Branch (168:17): [True: 0, False: 0]
  ------------------
  169|       |
  170|      0|                if (BIO_printf(bp, "%*s    Info Entries:\n", ind, "") <= 0)
  ------------------
  |  Branch (170:21): [True: 0, False: 0]
  ------------------
  171|      0|                    goto err;
  172|      0|                for (k = 0; k < sk_ASN1_STRING_num(pinfo->professionItems); k++) {
  ------------------
  |  | 1323|      0|#define sk_ASN1_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_STRING_sk_type(sk))
  ------------------
  |  Branch (172:29): [True: 0, False: 0]
  ------------------
  173|      0|                    ASN1_STRING *val = sk_ASN1_STRING_value(pinfo->professionItems, k);
  ------------------
  |  | 1324|      0|#define sk_ASN1_STRING_value(sk, idx) ((ASN1_STRING *)OPENSSL_sk_value(ossl_check_const_ASN1_STRING_sk_type(sk), (idx)))
  ------------------
  174|       |
  175|      0|                    if (BIO_printf(bp, "%*s      ", ind, "") <= 0
  ------------------
  |  Branch (175:25): [True: 0, False: 0]
  ------------------
  176|      0|                        || ASN1_STRING_print(bp, val) <= 0
  ------------------
  |  Branch (176:28): [True: 0, False: 0]
  ------------------
  177|      0|                        || BIO_printf(bp, "\n") <= 0)
  ------------------
  |  Branch (177:28): [True: 0, False: 0]
  ------------------
  178|      0|                        goto err;
  179|      0|                }
  180|      0|            }
  181|       |
  182|      0|            if (pinfo->professionOIDs != NULL) {
  ------------------
  |  Branch (182:17): [True: 0, False: 0]
  ------------------
  183|      0|                if (BIO_printf(bp, "%*s    Profession OIDs:\n", ind, "") <= 0)
  ------------------
  |  Branch (183:21): [True: 0, False: 0]
  ------------------
  184|      0|                    goto err;
  185|      0|                for (k = 0; k < sk_ASN1_OBJECT_num(pinfo->professionOIDs); k++) {
  ------------------
  |  |  636|      0|#define sk_ASN1_OBJECT_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_OBJECT_sk_type(sk))
  ------------------
  |  Branch (185:29): [True: 0, False: 0]
  ------------------
  186|      0|                    ASN1_OBJECT *obj = sk_ASN1_OBJECT_value(pinfo->professionOIDs, k);
  ------------------
  |  |  637|      0|#define sk_ASN1_OBJECT_value(sk, idx) ((ASN1_OBJECT *)OPENSSL_sk_value(ossl_check_const_ASN1_OBJECT_sk_type(sk), (idx)))
  ------------------
  187|      0|                    const char *ln = OBJ_nid2ln(OBJ_obj2nid(obj));
  188|      0|                    char objbuf[128];
  189|       |
  190|      0|                    OBJ_obj2txt(objbuf, sizeof(objbuf), obj, 1);
  191|      0|                    if (BIO_printf(bp, "%*s      %s%s%s%s\n", ind, "",
  ------------------
  |  Branch (191:25): [True: 0, False: 0]
  ------------------
  192|      0|                                   ln ? ln : "", ln ? " (" : "",
  ------------------
  |  Branch (192:36): [True: 0, False: 0]
  |  Branch (192:50): [True: 0, False: 0]
  ------------------
  193|      0|                                   objbuf, ln ? ")" : "") <= 0)
  ------------------
  |  Branch (193:44): [True: 0, False: 0]
  ------------------
  194|      0|                        goto err;
  195|      0|                }
  196|      0|            }
  197|      0|        }
  198|      1|    }
  199|     10|    return 1;
  200|       |
  201|      0|err:
  202|      0|    return 0;
  203|     10|}

v3_akid.c:i2v_AUTHORITY_KEYID:
   42|  1.25k|{
   43|  1.25k|    char *tmp = NULL;
   44|  1.25k|    STACK_OF(CONF_VALUE) *origextlist = extlist, *tmpextlist;
  ------------------
  |  |   31|  1.25k|# define STACK_OF(type) struct stack_st_##type
  ------------------
   45|       |
   46|  1.25k|    if (akeyid->keyid) {
  ------------------
  |  Branch (46:9): [True: 284, False: 974]
  ------------------
   47|    284|        tmp = i2s_ASN1_OCTET_STRING(NULL, akeyid->keyid);
   48|    284|        if (tmp == NULL) {
  ------------------
  |  Branch (48:13): [True: 0, False: 284]
  ------------------
   49|      0|            ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   50|      0|            return NULL;
   51|      0|        }
   52|    284|        if (!X509V3_add_value((akeyid->issuer || akeyid->serial) ? "keyid" : NULL,
  ------------------
  |  Branch (52:13): [True: 0, False: 284]
  |  Branch (52:32): [True: 82, False: 202]
  |  Branch (52:50): [True: 1, False: 201]
  ------------------
   53|    284|                              tmp, &extlist)) {
   54|      0|            OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   55|      0|            ERR_raise(ERR_LIB_X509V3, ERR_R_X509_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   56|      0|            goto err;
   57|      0|        }
   58|    284|        OPENSSL_free(tmp);
  ------------------
  |  |  115|    284|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    284|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    284|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   59|    284|    }
   60|  1.25k|    if (akeyid->issuer) {
  ------------------
  |  Branch (60:9): [True: 566, False: 692]
  ------------------
   61|    566|        tmpextlist = i2v_GENERAL_NAMES(NULL, akeyid->issuer, extlist);
   62|    566|        if (tmpextlist == NULL) {
  ------------------
  |  Branch (62:13): [True: 11, False: 555]
  ------------------
   63|     11|            ERR_raise(ERR_LIB_X509V3, ERR_R_X509_LIB);
  ------------------
  |  |  401|     11|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     11|    (ERR_new(),                                                 \
  |  |  |  |  404|     11|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     11|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     11|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     11|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     11|     ERR_set_error)
  |  |  ------------------
  ------------------
   64|     11|            goto err;
   65|     11|        }
   66|    555|        extlist = tmpextlist;
   67|    555|    }
   68|  1.24k|    if (akeyid->serial) {
  ------------------
  |  Branch (68:9): [True: 258, False: 989]
  ------------------
   69|    258|        tmp = i2s_ASN1_OCTET_STRING(NULL, akeyid->serial);
   70|    258|        if (tmp == NULL) {
  ------------------
  |  Branch (70:13): [True: 0, False: 258]
  ------------------
   71|      0|            ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   72|      0|            goto err;
   73|      0|        }
   74|    258|        if (!X509V3_add_value("serial", tmp, &extlist)) {
  ------------------
  |  Branch (74:13): [True: 0, False: 258]
  ------------------
   75|      0|            OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|      0|            goto err;
   77|      0|        }
   78|    258|        OPENSSL_free(tmp);
  ------------------
  |  |  115|    258|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    258|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    258|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|    258|    }
   80|  1.24k|    return extlist;
   81|     11| err:
   82|     11|    if (origextlist == NULL)
  ------------------
  |  Branch (82:9): [True: 11, False: 0]
  ------------------
   83|     11|        sk_CONF_VALUE_pop_free(extlist, X509V3_conf_free);
  ------------------
  |  |   59|     11|#define sk_CONF_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_freefunc_type(freefunc))
  ------------------
   84|     11|    return NULL;
   85|  1.24k|}

v3_attrmap.c:i2r_ATTRIBUTE_MAPPINGS:
   91|     11|{
   92|     11|    int i;
   93|     11|    OSSL_ATTRIBUTE_MAPPING *am;
   94|       |
   95|     11|    for (i = 0; i < sk_OSSL_ATTRIBUTE_MAPPING_num(ams); i++) {
  ------------------
  |  | 1848|     11|#define sk_OSSL_ATTRIBUTE_MAPPING_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_ATTRIBUTE_MAPPING_sk_type(sk))
  ------------------
  |  Branch (95:17): [True: 0, False: 11]
  ------------------
   96|      0|        am = sk_OSSL_ATTRIBUTE_MAPPING_value(ams, i);
  ------------------
  |  | 1849|      0|#define sk_OSSL_ATTRIBUTE_MAPPING_value(sk, idx) ((OSSL_ATTRIBUTE_MAPPING *)OPENSSL_sk_value(ossl_check_const_OSSL_ATTRIBUTE_MAPPING_sk_type(sk), (idx)))
  ------------------
   97|      0|        if (BIO_printf(out, "%*s", indent, "") <= 0)
  ------------------
  |  Branch (97:13): [True: 0, False: 0]
  ------------------
   98|      0|            return 0;
   99|      0|        if (i2r_ATTRIBUTE_MAPPING(method, am, out, indent + 4) <= 0)
  ------------------
  |  Branch (99:13): [True: 0, False: 0]
  ------------------
  100|      0|            return 0;
  101|      0|        if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (101:13): [True: 0, False: 0]
  ------------------
  102|      0|            return 0;
  103|      0|    }
  104|     11|    return 1;
  105|     11|}

v3_authattid.c:i2r_auth_attr_id:
   54|     11|{
   55|     11|    int i;
   56|     11|    OSSL_ISSUER_SERIAL *aid;
   57|       |
   58|     11|    for (i = 0; i < sk_OSSL_ISSUER_SERIAL_num(aids); i++) {
  ------------------
  |  |  267|     11|#define sk_OSSL_ISSUER_SERIAL_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_ISSUER_SERIAL_sk_type(sk))
  ------------------
  |  Branch (58:17): [True: 0, False: 11]
  ------------------
   59|      0|        if (BIO_printf(out, "%*sIssuer-Serials:\n", indent, "") <= 0)
  ------------------
  |  Branch (59:13): [True: 0, False: 0]
  ------------------
   60|      0|            return 0;
   61|      0|        aid = sk_OSSL_ISSUER_SERIAL_value(aids, i);
  ------------------
  |  |  268|      0|#define sk_OSSL_ISSUER_SERIAL_value(sk, idx) ((OSSL_ISSUER_SERIAL *)OPENSSL_sk_value(ossl_check_const_OSSL_ISSUER_SERIAL_sk_type(sk), (idx)))
  ------------------
   62|      0|        if (i2r_ISSUER_SERIAL(method, aid, out, indent + 4) <= 0)
  ------------------
  |  Branch (62:13): [True: 0, False: 0]
  ------------------
   63|      0|            return 0;
   64|      0|        if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (64:13): [True: 0, False: 0]
  ------------------
   65|      0|            return 0;
   66|      0|    }
   67|     11|    return 1;
   68|     11|}

v3_battcons.c:i2v_OSSL_BASIC_ATTR_CONSTRAINTS:
   49|     20|{
   50|     20|    X509V3_add_value_bool("authority", battcons->authority, &extlist);
   51|     20|    X509V3_add_value_int("pathlen", battcons->pathlen, &extlist);
   52|     20|    return extlist;
   53|     20|}

v3_bcons.c:i2v_BASIC_CONSTRAINTS:
   49|    260|{
   50|    260|    X509V3_add_value_bool("CA", bcons->ca, &extlist);
   51|    260|    X509V3_add_value_int("pathlen", bcons->pathlen, &extlist);
   52|    260|    return extlist;
   53|    260|}

i2v_ASN1_BIT_STRING:
   49|    117|{
   50|    117|    BIT_STRING_BITNAME *bnam;
   51|  1.17k|    for (bnam = method->usr_data; bnam->lname; bnam++) {
  ------------------
  |  Branch (51:35): [True: 1.05k, False: 117]
  ------------------
   52|  1.05k|        if (ASN1_BIT_STRING_get_bit(bits, bnam->bitnum))
  ------------------
  |  Branch (52:13): [True: 685, False: 368]
  ------------------
   53|    685|            X509V3_add_value(bnam->lname, NULL, &ret);
   54|  1.05k|    }
   55|    117|    return ret;
   56|    117|}

v3_cpols.c:i2r_certpol:
  418|    261|{
  419|    261|    int i;
  420|    261|    POLICYINFO *pinfo;
  421|       |    /* First print out the policy OIDs */
  422|    261|    for (i = 0; i < sk_POLICYINFO_num(pol); i++) {
  ------------------
  |  |  468|    261|#define sk_POLICYINFO_num(sk) OPENSSL_sk_num(ossl_check_const_POLICYINFO_sk_type(sk))
  ------------------
  |  Branch (422:17): [True: 0, False: 261]
  ------------------
  423|      0|        if (i > 0)
  ------------------
  |  Branch (423:13): [True: 0, False: 0]
  ------------------
  424|      0|            BIO_puts(out, "\n");
  425|      0|        pinfo = sk_POLICYINFO_value(pol, i);
  ------------------
  |  |  469|      0|#define sk_POLICYINFO_value(sk, idx) ((POLICYINFO *)OPENSSL_sk_value(ossl_check_const_POLICYINFO_sk_type(sk), (idx)))
  ------------------
  426|      0|        BIO_printf(out, "%*sPolicy: ", indent, "");
  427|      0|        i2a_ASN1_OBJECT(out, pinfo->policyid);
  428|      0|        if (pinfo->qualifiers) {
  ------------------
  |  Branch (428:13): [True: 0, False: 0]
  ------------------
  429|      0|            BIO_puts(out, "\n");
  430|      0|            print_qualifiers(out, pinfo->qualifiers, indent + 2);
  431|      0|        }
  432|      0|    }
  433|    261|    return 1;
  434|    261|}

DIST_POINT_set_dpname:
  486|    327|{
  487|    327|    int i;
  488|    327|    STACK_OF(X509_NAME_ENTRY) *frag;
  ------------------
  |  |   31|    327|# define STACK_OF(type) struct stack_st_##type
  ------------------
  489|    327|    X509_NAME_ENTRY *ne;
  490|       |
  491|    327|    if (dpn == NULL || dpn->type != 1)
  ------------------
  |  Branch (491:9): [True: 77, False: 250]
  |  Branch (491:24): [True: 11, False: 239]
  ------------------
  492|     88|        return 1;
  493|    239|    frag = dpn->name.relativename;
  494|    239|    X509_NAME_free(dpn->dpname); /* just in case it was already set */
  495|    239|    dpn->dpname = X509_NAME_dup(iname);
  496|    239|    if (dpn->dpname == NULL)
  ------------------
  |  Branch (496:9): [True: 3, False: 236]
  ------------------
  497|      3|        return 0;
  498|  1.61k|    for (i = 0; i < sk_X509_NAME_ENTRY_num(frag); i++) {
  ------------------
  |  |  204|  1.61k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (498:17): [True: 1.37k, False: 235]
  ------------------
  499|  1.37k|        ne = sk_X509_NAME_ENTRY_value(frag, i);
  ------------------
  |  |  205|  1.37k|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
  500|  1.37k|        if (!X509_NAME_add_entry(dpn->dpname, ne, -1, i ? 0 : 1))
  ------------------
  |  Branch (500:13): [True: 1, False: 1.37k]
  |  Branch (500:55): [True: 1.14k, False: 233]
  ------------------
  501|      1|            goto err;
  502|  1.37k|    }
  503|       |    /* generate cached encoding of name */
  504|    235|    if (i2d_X509_NAME(dpn->dpname, NULL) >= 0)
  ------------------
  |  Branch (504:9): [True: 212, False: 23]
  ------------------
  505|    212|        return 1;
  506|       |
  507|     24| err:
  508|     24|    X509_NAME_free(dpn->dpname);
  509|     24|    dpn->dpname = NULL;
  510|     24|    return 0;
  511|    235|}
v3_crld.c:dpn_cb:
  307|   110k|{
  308|   110k|    DIST_POINT_NAME *dpn = (DIST_POINT_NAME *)*pval;
  309|       |
  310|   110k|    switch (operation) {
  ------------------
  |  Branch (310:13): [True: 70.2k, False: 40.5k]
  ------------------
  311|  20.2k|    case ASN1_OP_NEW_POST:
  ------------------
  |  |  743|  20.2k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (311:5): [True: 20.2k, False: 90.5k]
  ------------------
  312|  20.2k|        dpn->dpname = NULL;
  313|  20.2k|        break;
  314|       |
  315|  20.2k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|  20.2k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (315:5): [True: 20.2k, False: 90.5k]
  ------------------
  316|  20.2k|        X509_NAME_free(dpn->dpname);
  317|  20.2k|        break;
  318|   110k|    }
  319|   110k|    return 1;
  320|   110k|}
v3_crld.c:i2r_idp:
  440|  6.58k|{
  441|  6.58k|    ISSUING_DIST_POINT *idp = pidp;
  442|  6.58k|    if (idp->distpoint)
  ------------------
  |  Branch (442:9): [True: 3.70k, False: 2.88k]
  ------------------
  443|  3.70k|        print_distpoint(out, idp->distpoint, indent);
  444|  6.58k|    if (idp->onlyuser > 0)
  ------------------
  |  Branch (444:9): [True: 728, False: 5.85k]
  ------------------
  445|    728|        BIO_printf(out, "%*sOnly User Certificates\n", indent, "");
  446|  6.58k|    if (idp->onlyCA > 0)
  ------------------
  |  Branch (446:9): [True: 147, False: 6.43k]
  ------------------
  447|    147|        BIO_printf(out, "%*sOnly CA Certificates\n", indent, "");
  448|  6.58k|    if (idp->indirectCRL > 0)
  ------------------
  |  Branch (448:9): [True: 388, False: 6.19k]
  ------------------
  449|    388|        BIO_printf(out, "%*sIndirect CRL\n", indent, "");
  450|  6.58k|    if (idp->onlysomereasons)
  ------------------
  |  Branch (450:9): [True: 1.45k, False: 5.13k]
  ------------------
  451|  1.45k|        print_reasons(out, "Only Some Reasons", idp->onlysomereasons, indent);
  452|  6.58k|    if (idp->onlyattr > 0)
  ------------------
  |  Branch (452:9): [True: 73, False: 6.51k]
  ------------------
  453|     73|        BIO_printf(out, "%*sOnly Attribute Certificates\n", indent, "");
  454|  6.58k|    if (!idp->distpoint && (idp->onlyuser <= 0) && (idp->onlyCA <= 0)
  ------------------
  |  Branch (454:9): [True: 2.88k, False: 3.70k]
  |  Branch (454:28): [True: 2.15k, False: 728]
  |  Branch (454:52): [True: 2.00k, False: 147]
  ------------------
  455|  6.58k|        && (idp->indirectCRL <= 0) && !idp->onlysomereasons
  ------------------
  |  Branch (455:12): [True: 1.61k, False: 388]
  |  Branch (455:39): [True: 162, False: 1.45k]
  ------------------
  456|  6.58k|        && (idp->onlyattr <= 0))
  ------------------
  |  Branch (456:12): [True: 89, False: 73]
  ------------------
  457|     89|        BIO_printf(out, "%*s<EMPTY>\n", indent, "");
  458|       |
  459|  6.58k|    return 1;
  460|  6.58k|}
v3_crld.c:print_distpoint:
  423|  3.80k|{
  424|  3.80k|    if (dpn->type == 0) {
  ------------------
  |  Branch (424:9): [True: 899, False: 2.90k]
  ------------------
  425|    899|        BIO_printf(out, "%*sFull Name:\n", indent, "");
  426|    899|        OSSL_GENERAL_NAMES_print(out, dpn->name.fullname, indent);
  427|    899|        BIO_puts(out, "\n");
  428|  2.90k|    } else {
  429|  2.90k|        X509_NAME ntmp;
  430|  2.90k|        ntmp.entries = dpn->name.relativename;
  431|  2.90k|        BIO_printf(out, "%*sRelative Name:\n%*s", indent, "", indent + 2, "");
  432|  2.90k|        X509_NAME_print_ex(out, &ntmp, 0, XN_FLAG_ONELINE);
  ------------------
  |  |  358|  2.90k|# define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
  |  |  ------------------
  |  |  |  |  516|  2.90k|# define ASN1_STRFLGS_RFC2253    (ASN1_STRFLGS_ESC_2253 | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  441|  2.90k|# define ASN1_STRFLGS_ESC_2253           1
  |  |  |  |  ------------------
  |  |  |  |  517|  2.90k|                                ASN1_STRFLGS_ESC_CTRL | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|  2.90k|# define ASN1_STRFLGS_ESC_CTRL           2
  |  |  |  |  ------------------
  |  |  |  |  518|  2.90k|                                ASN1_STRFLGS_ESC_MSB | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  443|  2.90k|# define ASN1_STRFLGS_ESC_MSB            4
  |  |  |  |  ------------------
  |  |  |  |  519|  2.90k|                                ASN1_STRFLGS_UTF8_CONVERT | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  475|  2.90k|# define ASN1_STRFLGS_UTF8_CONVERT       0x10
  |  |  |  |  ------------------
  |  |  |  |  520|  2.90k|                                ASN1_STRFLGS_DUMP_UNKNOWN | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  497|  2.90k|# define ASN1_STRFLGS_DUMP_UNKNOWN       0x100
  |  |  |  |  ------------------
  |  |  |  |  521|  2.90k|                                ASN1_STRFLGS_DUMP_DER)
  |  |  |  |  ------------------
  |  |  |  |  |  |  504|  2.90k|# define ASN1_STRFLGS_DUMP_DER           0x200
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  359|  2.90k|                        ASN1_STRFLGS_ESC_QUOTE | \
  |  |  ------------------
  |  |  |  |  455|  2.90k|# define ASN1_STRFLGS_ESC_QUOTE          8
  |  |  ------------------
  |  |  360|  2.90k|                        XN_FLAG_SEP_CPLUS_SPC | \
  |  |  ------------------
  |  |  |  |  321|  2.90k|# define XN_FLAG_SEP_CPLUS_SPC   (2 << 16)/* ,+ spaced: more readable */
  |  |  ------------------
  |  |  361|  2.90k|                        XN_FLAG_SPC_EQ | \
  |  |  ------------------
  |  |  |  |  336|  2.90k|# define XN_FLAG_SPC_EQ          (1 << 23)/* Put spaces round '=' */
  |  |  ------------------
  |  |  362|  2.90k|                        XN_FLAG_FN_SN)
  |  |  ------------------
  |  |  |  |  331|  2.90k|# define XN_FLAG_FN_SN           0/* Object short name */
  |  |  ------------------
  ------------------
  433|  2.90k|        BIO_puts(out, "\n");
  434|  2.90k|    }
  435|  3.80k|    return 1;
  436|  3.80k|}
v3_crld.c:print_reasons:
  187|  1.48k|{
  188|  1.48k|    int first = 1;
  189|  1.48k|    const BIT_STRING_BITNAME *pbn;
  190|  1.48k|    BIO_printf(out, "%*s%s:\n%*s", indent, "", rname, indent + 2, "");
  191|  14.8k|    for (pbn = reason_flags; pbn->lname; pbn++) {
  ------------------
  |  Branch (191:30): [True: 13.3k, False: 1.48k]
  ------------------
  192|  13.3k|        if (ASN1_BIT_STRING_get_bit(rflags, pbn->bitnum)) {
  ------------------
  |  Branch (192:13): [True: 2.12k, False: 11.2k]
  ------------------
  193|  2.12k|            if (first)
  ------------------
  |  Branch (193:17): [True: 810, False: 1.31k]
  ------------------
  194|    810|                first = 0;
  195|  1.31k|            else
  196|  1.31k|                BIO_puts(out, ", ");
  197|  2.12k|            BIO_puts(out, pbn->lname);
  198|  2.12k|        }
  199|  13.3k|    }
  200|  1.48k|    if (first)
  ------------------
  |  Branch (200:9): [True: 677, False: 810]
  ------------------
  201|    677|        BIO_puts(out, "<EMPTY>\n");
  202|    810|    else
  203|    810|        BIO_puts(out, "\n");
  204|  1.48k|    return 1;
  205|  1.48k|}
v3_crld.c:i2r_crldp:
  464|    622|{
  465|    622|    STACK_OF(DIST_POINT) *crld = pcrldp;
  ------------------
  |  |   31|    622|# define STACK_OF(type) struct stack_st_##type
  ------------------
  466|    622|    DIST_POINT *point;
  467|    622|    int i;
  468|  1.55k|    for (i = 0; i < sk_DIST_POINT_num(crld); i++) {
  ------------------
  |  |  331|  1.55k|#define sk_DIST_POINT_num(sk) OPENSSL_sk_num(ossl_check_const_DIST_POINT_sk_type(sk))
  ------------------
  |  Branch (468:17): [True: 933, False: 622]
  ------------------
  469|    933|        if (i > 0)
  ------------------
  |  Branch (469:13): [True: 405, False: 528]
  ------------------
  470|    405|            BIO_puts(out, "\n");
  471|    933|        point = sk_DIST_POINT_value(crld, i);
  ------------------
  |  |  332|    933|#define sk_DIST_POINT_value(sk, idx) ((DIST_POINT *)OPENSSL_sk_value(ossl_check_const_DIST_POINT_sk_type(sk), (idx)))
  ------------------
  472|    933|        if (point->distpoint)
  ------------------
  |  Branch (472:13): [True: 66, False: 867]
  ------------------
  473|     66|            print_distpoint(out, point->distpoint, indent);
  474|    933|        if (point->reasons)
  ------------------
  |  Branch (474:13): [True: 21, False: 912]
  ------------------
  475|     21|            print_reasons(out, "Reasons", point->reasons, indent);
  476|    933|        if (point->CRLissuer) {
  ------------------
  |  Branch (476:13): [True: 202, False: 731]
  ------------------
  477|    202|            BIO_printf(out, "%*sCRL Issuer:\n", indent, "");
  478|    202|            OSSL_GENERAL_NAMES_print(out, point->CRLissuer, indent);
  479|    202|        }
  480|    933|    }
  481|    622|    return 1;
  482|    622|}
v3_crld.c:i2r_aaidp:
  625|     75|{
  626|     75|    OSSL_AA_DIST_POINT *pdp = dp;
  627|       |
  628|     75|    if (pdp->distpoint)
  ------------------
  |  Branch (628:9): [True: 34, False: 41]
  ------------------
  629|     34|        if (print_distpoint(out, pdp->distpoint, indent) <= 0)
  ------------------
  |  Branch (629:13): [True: 0, False: 34]
  ------------------
  630|      0|            return 0;
  631|     75|    if (pdp->reasons)
  ------------------
  |  Branch (631:9): [True: 10, False: 65]
  ------------------
  632|     10|        if (print_reasons(out, "Reasons", pdp->reasons, indent) <= 0)
  ------------------
  |  Branch (632:13): [True: 0, False: 10]
  ------------------
  633|      0|            return 0;
  634|     75|    if (pdp->indirectCRL) {
  ------------------
  |  Branch (634:9): [True: 1, False: 74]
  ------------------
  635|      1|        if (BIO_printf(out, "%*sIndirect CRL: ", indent, "") <= 0)
  ------------------
  |  Branch (635:13): [True: 0, False: 1]
  ------------------
  636|      0|            return 0;
  637|      1|        if (print_boolean(out, pdp->indirectCRL) <= 0)
  ------------------
  |  Branch (637:13): [True: 0, False: 1]
  ------------------
  638|      0|            return 0;
  639|      1|        if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (639:13): [True: 0, False: 1]
  ------------------
  640|      0|            return 0;
  641|      1|    }
  642|     75|    if (pdp->containsUserAttributeCerts) {
  ------------------
  |  Branch (642:9): [True: 57, False: 18]
  ------------------
  643|     57|        if (BIO_printf(out, "%*sContains User Attribute Certificates: ", indent, "") <= 0)
  ------------------
  |  Branch (643:13): [True: 0, False: 57]
  ------------------
  644|      0|            return 0;
  645|     57|        if (print_boolean(out, pdp->containsUserAttributeCerts) <= 0)
  ------------------
  |  Branch (645:13): [True: 0, False: 57]
  ------------------
  646|      0|            return 0;
  647|     57|        if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (647:13): [True: 0, False: 57]
  ------------------
  648|      0|            return 0;
  649|     57|    }
  650|     75|    if (pdp->containsAACerts) {
  ------------------
  |  Branch (650:9): [True: 74, False: 1]
  ------------------
  651|     74|        if (BIO_printf(out, "%*sContains Attribute Authority (AA) Certificates: ",
  ------------------
  |  Branch (651:13): [True: 0, False: 74]
  ------------------
  652|     74|                       indent, "") <= 0)
  653|      0|            return 0;
  654|     74|        if (print_boolean(out, pdp->containsAACerts) <= 0)
  ------------------
  |  Branch (654:13): [True: 0, False: 74]
  ------------------
  655|      0|            return 0;
  656|     74|        if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (656:13): [True: 0, False: 74]
  ------------------
  657|      0|            return 0;
  658|     74|    }
  659|     75|    if (pdp->containsSOAPublicKeyCerts) {
  ------------------
  |  Branch (659:9): [True: 74, False: 1]
  ------------------
  660|     74|        if (BIO_printf(out,
  ------------------
  |  Branch (660:13): [True: 0, False: 74]
  ------------------
  661|     74|                       "%*sContains Source Of Authority (SOA) Public Key Certificates: ",
  662|     74|                       indent, "") <= 0)
  663|      0|            return 0;
  664|     74|        if (print_boolean(out, pdp->containsSOAPublicKeyCerts) <= 0)
  ------------------
  |  Branch (664:13): [True: 0, False: 74]
  ------------------
  665|      0|            return 0;
  666|     74|        if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (666:13): [True: 0, False: 74]
  ------------------
  667|      0|            return 0;
  668|     74|    }
  669|     75|    return 1;
  670|     75|}
v3_crld.c:print_boolean:
  525|    206|{
  526|    206|    return BIO_puts(out, b ? "TRUE" : "FALSE");
  ------------------
  |  Branch (526:26): [True: 206, False: 0]
  ------------------
  527|    206|}

i2s_ASN1_ENUMERATED_TABLE:
   43|    933|{
   44|    933|    ENUMERATED_NAMES *enam;
   45|    933|    long strval;
   46|       |
   47|    933|    strval = ASN1_ENUMERATED_get(e);
   48|  5.01k|    for (enam = method->usr_data; enam->lname; enam++) {
  ------------------
  |  Branch (48:35): [True: 4.63k, False: 376]
  ------------------
   49|  4.63k|        if (strval == enam->bitnum)
  ------------------
  |  Branch (49:13): [True: 557, False: 4.07k]
  ------------------
   50|    557|            return OPENSSL_strdup(enam->lname);
  ------------------
  |  |  119|    557|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    557|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    557|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   51|  4.63k|    }
   52|    376|    return i2s_ASN1_ENUMERATED(method, e);
   53|    933|}

v3_extku.c:i2v_EXTENDED_KEY_USAGE:
   80|    491|{
   81|    491|    EXTENDED_KEY_USAGE *eku = a;
   82|    491|    int i;
   83|    491|    ASN1_OBJECT *obj;
   84|    491|    char obj_tmp[80];
   85|    740|    for (i = 0; i < sk_ASN1_OBJECT_num(eku); i++) {
  ------------------
  |  |  636|    740|#define sk_ASN1_OBJECT_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_OBJECT_sk_type(sk))
  ------------------
  |  Branch (85:17): [True: 249, False: 491]
  ------------------
   86|    249|        obj = sk_ASN1_OBJECT_value(eku, i);
  ------------------
  |  |  637|    249|#define sk_ASN1_OBJECT_value(sk, idx) ((ASN1_OBJECT *)OPENSSL_sk_value(ossl_check_const_ASN1_OBJECT_sk_type(sk), (idx)))
  ------------------
   87|    249|        i2t_ASN1_OBJECT(obj_tmp, 80, obj);
   88|    249|        X509V3_add_value(NULL, obj_tmp, &ext_list);
   89|    249|    }
   90|    491|    return ext_list;
   91|    491|}

v3_group_ac.c:i2s_GROUP_AC:
   31|      1|{
   32|      1|    return OPENSSL_strdup("NULL");
  ------------------
  |  |  119|      1|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|      1|}

v3_ind_iss.c:i2s_INDIRECT_ISSUER:
   31|     10|{
   32|     10|    return OPENSSL_strdup("NULL");
  ------------------
  |  |  119|     10|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|     10|}

v3_iobo.c:i2r_ISSUED_ON_BEHALF_OF:
   16|      1|{
   17|      1|    if (BIO_printf(out, "%*s", indent, "") <= 0)
  ------------------
  |  Branch (17:9): [True: 0, False: 1]
  ------------------
   18|      0|        return 0;
   19|      1|    if (GENERAL_NAME_print(out, gn) <= 0)
  ------------------
  |  Branch (19:9): [True: 0, False: 1]
  ------------------
   20|      0|        return 0;
   21|      1|    return BIO_puts(out, "\n") > 0;
   22|      1|}

X509V3_EXT_get_nid:
   53|  61.3k|{
   54|  61.3k|    X509V3_EXT_METHOD tmp;
   55|  61.3k|    const X509V3_EXT_METHOD *t = &tmp, *const *ret;
   56|  61.3k|    int idx;
   57|       |
   58|  61.3k|    if (nid < 0)
  ------------------
  |  Branch (58:9): [True: 0, False: 61.3k]
  ------------------
   59|      0|        return NULL;
   60|  61.3k|    tmp.ext_nid = nid;
   61|  61.3k|    ret = OBJ_bsearch_ext(&t, standard_exts, STANDARD_EXTENSION_COUNT);
  ------------------
  |  |  103|  61.3k|#define STANDARD_EXTENSION_COUNT OSSL_NELEM(standard_exts)
  |  |  ------------------
  |  |  |  |   14|  61.3k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
   62|  61.3k|    if (ret)
  ------------------
  |  Branch (62:9): [True: 60.0k, False: 1.36k]
  ------------------
   63|  60.0k|        return *ret;
   64|  1.36k|    if (!ext_list)
  ------------------
  |  Branch (64:9): [True: 1.36k, False: 0]
  ------------------
   65|  1.36k|        return NULL;
   66|       |    /* Ideally, this would be done under a lock */
   67|      0|    sk_X509V3_EXT_METHOD_sort(ext_list);
  ------------------
  |  |  133|      0|#define sk_X509V3_EXT_METHOD_sort(sk) OPENSSL_sk_sort(ossl_check_X509V3_EXT_METHOD_sk_type(sk))
  ------------------
   68|      0|    idx = sk_X509V3_EXT_METHOD_find(ext_list, &tmp);
  ------------------
  |  |  130|      0|#define sk_X509V3_EXT_METHOD_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509V3_EXT_METHOD_sk_type(sk), ossl_check_X509V3_EXT_METHOD_type(ptr))
  ------------------
   69|       |    /* A failure to locate the item is handled by the value method */
   70|      0|    return sk_X509V3_EXT_METHOD_value(ext_list, idx);
  ------------------
  |  |  114|      0|#define sk_X509V3_EXT_METHOD_value(sk, idx) ((X509V3_EXT_METHOD *)OPENSSL_sk_value(ossl_check_const_X509V3_EXT_METHOD_sk_type(sk), (idx)))
  ------------------
   71|  1.36k|}
X509V3_EXT_get:
   74|  62.5k|{
   75|  62.5k|    int nid;
   76|  62.5k|    if ((nid = OBJ_obj2nid(X509_EXTENSION_get_object(ext))) == NID_undef)
  ------------------
  |  |   18|  62.5k|#define NID_undef                       0
  ------------------
  |  Branch (76:9): [True: 1.14k, False: 61.3k]
  ------------------
   77|  1.14k|        return NULL;
   78|  61.3k|    return X509V3_EXT_get_nid(nid);
   79|  62.5k|}
X509V3_EXT_d2i:
  135|  20.0k|{
  136|  20.0k|    const X509V3_EXT_METHOD *method;
  137|  20.0k|    const unsigned char *p;
  138|  20.0k|    ASN1_STRING *extvalue;
  139|  20.0k|    int extlen;
  140|       |
  141|  20.0k|    if ((method = X509V3_EXT_get(ext)) == NULL)
  ------------------
  |  Branch (141:9): [True: 0, False: 20.0k]
  ------------------
  142|      0|        return NULL;
  143|  20.0k|    extvalue = X509_EXTENSION_get_data(ext);
  144|  20.0k|    p = ASN1_STRING_get0_data(extvalue);
  145|  20.0k|    extlen = ASN1_STRING_length(extvalue);
  146|  20.0k|    if (method->it)
  ------------------
  |  Branch (146:9): [True: 20.0k, False: 0]
  ------------------
  147|  20.0k|        return ASN1_item_d2i(NULL, &p, extlen, ASN1_ITEM_ptr(method->it));
  ------------------
  |  |  422|  20.0k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  148|      0|    return method->d2i(NULL, &p, extlen);
  149|  20.0k|}
X509V3_get_d2i:
  169|  66.6k|{
  170|  66.6k|    int lastpos, i;
  171|  66.6k|    X509_EXTENSION *ex, *found_ex = NULL;
  172|       |
  173|  66.6k|    if (!x) {
  ------------------
  |  Branch (173:9): [True: 16.8k, False: 49.8k]
  ------------------
  174|  16.8k|        if (idx)
  ------------------
  |  Branch (174:13): [True: 0, False: 16.8k]
  ------------------
  175|      0|            *idx = -1;
  176|  16.8k|        if (crit)
  ------------------
  |  Branch (176:13): [True: 16.8k, False: 0]
  ------------------
  177|  16.8k|            *crit = -1;
  178|  16.8k|        return NULL;
  179|  16.8k|    }
  180|  49.8k|    if (idx)
  ------------------
  |  Branch (180:9): [True: 0, False: 49.8k]
  ------------------
  181|      0|        lastpos = *idx + 1;
  182|  49.8k|    else
  183|  49.8k|        lastpos = 0;
  184|  49.8k|    if (lastpos < 0)
  ------------------
  |  Branch (184:9): [True: 0, False: 49.8k]
  ------------------
  185|      0|        lastpos = 0;
  186|   130k|    for (i = lastpos; i < sk_X509_EXTENSION_num(x); i++) {
  ------------------
  |  |  235|   130k|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (186:23): [True: 80.9k, False: 49.7k]
  ------------------
  187|  80.9k|        ex = sk_X509_EXTENSION_value(x, i);
  ------------------
  |  |  236|  80.9k|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
  188|  80.9k|        if (OBJ_obj2nid(X509_EXTENSION_get_object(ex)) == nid) {
  ------------------
  |  Branch (188:13): [True: 20.2k, False: 60.7k]
  ------------------
  189|  20.2k|            if (idx) {
  ------------------
  |  Branch (189:17): [True: 0, False: 20.2k]
  ------------------
  190|      0|                *idx = i;
  191|      0|                found_ex = ex;
  192|      0|                break;
  193|  20.2k|            } else if (found_ex) {
  ------------------
  |  Branch (193:24): [True: 113, False: 20.1k]
  ------------------
  194|       |                /* Found more than one */
  195|    113|                if (crit)
  ------------------
  |  Branch (195:21): [True: 113, False: 0]
  ------------------
  196|    113|                    *crit = -2;
  197|    113|                return NULL;
  198|    113|            }
  199|  20.1k|            found_ex = ex;
  200|  20.1k|        }
  201|  80.9k|    }
  202|  49.7k|    if (found_ex) {
  ------------------
  |  Branch (202:9): [True: 20.0k, False: 29.7k]
  ------------------
  203|       |        /* Found it */
  204|  20.0k|        if (crit)
  ------------------
  |  Branch (204:13): [True: 20.0k, False: 0]
  ------------------
  205|  20.0k|            *crit = X509_EXTENSION_get_critical(found_ex);
  206|  20.0k|        return X509V3_EXT_d2i(found_ex);
  207|  20.0k|    }
  208|       |
  209|       |    /* Extension not found */
  210|  29.7k|    if (idx)
  ------------------
  |  Branch (210:9): [True: 0, False: 29.7k]
  ------------------
  211|      0|        *idx = -1;
  212|  29.7k|    if (crit)
  ------------------
  |  Branch (212:9): [True: 29.7k, False: 0]
  ------------------
  213|  29.7k|        *crit = -1;
  214|  29.7k|    return NULL;
  215|  49.7k|}
v3_lib.c:ext_cmp:
   41|   336k|{
   42|   336k|    return ((*a)->ext_nid - (*b)->ext_nid);
   43|   336k|}

v3_ncons.c:i2r_NAME_CONSTRAINTS:
  205|    962|{
  206|    962|    NAME_CONSTRAINTS *ncons = a;
  207|    962|    do_i2r_name_constraints(method, ncons->permittedSubtrees,
  208|    962|                            bp, ind, "Permitted");
  209|    962|    if (ncons->permittedSubtrees && ncons->excludedSubtrees)
  ------------------
  |  Branch (209:9): [True: 821, False: 141]
  |  Branch (209:37): [True: 265, False: 556]
  ------------------
  210|    265|        BIO_puts(bp, "\n");
  211|    962|    do_i2r_name_constraints(method, ncons->excludedSubtrees,
  212|    962|                            bp, ind, "Excluded");
  213|    962|    return 1;
  214|    962|}
v3_ncons.c:do_i2r_name_constraints:
  219|  1.92k|{
  220|  1.92k|    GENERAL_SUBTREE *tree;
  221|  1.92k|    int i;
  222|  1.92k|    if (sk_GENERAL_SUBTREE_num(trees) > 0)
  ------------------
  |  |  539|  1.92k|#define sk_GENERAL_SUBTREE_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_SUBTREE_sk_type(sk))
  ------------------
  |  Branch (222:9): [True: 540, False: 1.38k]
  ------------------
  223|    540|        BIO_printf(bp, "%*s%s:\n", ind, "", name);
  224|  3.23k|    for (i = 0; i < sk_GENERAL_SUBTREE_num(trees); i++) {
  ------------------
  |  |  539|  3.23k|#define sk_GENERAL_SUBTREE_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_SUBTREE_sk_type(sk))
  ------------------
  |  Branch (224:17): [True: 1.31k, False: 1.92k]
  ------------------
  225|  1.31k|        if (i > 0)
  ------------------
  |  Branch (225:13): [True: 772, False: 540]
  ------------------
  226|    772|            BIO_puts(bp, "\n");
  227|  1.31k|        tree = sk_GENERAL_SUBTREE_value(trees, i);
  ------------------
  |  |  540|  1.31k|#define sk_GENERAL_SUBTREE_value(sk, idx) ((GENERAL_SUBTREE *)OPENSSL_sk_value(ossl_check_const_GENERAL_SUBTREE_sk_type(sk), (idx)))
  ------------------
  228|  1.31k|        BIO_printf(bp, "%*s", ind + 2, "");
  229|  1.31k|        if (tree->base->type == GEN_IPADD)
  ------------------
  |  |  180|  1.31k|# define GEN_IPADD       7
  ------------------
  |  Branch (229:13): [True: 619, False: 693]
  ------------------
  230|    619|            print_nc_ipadd(bp, tree->base->d.ip);
  231|    693|        else
  232|    693|            GENERAL_NAME_print(bp, tree->base);
  233|  1.31k|    }
  234|  1.92k|    return 1;
  235|  1.92k|}
v3_ncons.c:print_nc_ipadd:
  238|    619|{
  239|       |    /* ip->length should be 8 or 32 and len1 == len2 == 4 or len1 == len2 == 16 */
  240|    619|    int len1 = ip->length >= 16 ? 16 : ip->length >= 4 ? 4 : ip->length;
  ------------------
  |  Branch (240:16): [True: 66, False: 553]
  |  Branch (240:40): [True: 72, False: 481]
  ------------------
  241|    619|    int len2 = ip->length - len1;
  242|    619|    char *ip1 = ossl_ipaddr_to_asc(ip->data, len1);
  243|    619|    char *ip2 = ossl_ipaddr_to_asc(ip->data + len1, len2);
  244|    619|    int ret = ip1 != NULL && ip2 != NULL
  ------------------
  |  Branch (244:15): [True: 619, False: 0]
  |  Branch (244:30): [True: 619, False: 0]
  ------------------
  245|    619|        && BIO_printf(bp, "IP:%s/%s", ip1, ip2) > 0;
  ------------------
  |  Branch (245:12): [True: 619, False: 0]
  ------------------
  246|       |
  247|    619|    OPENSSL_free(ip1);
  ------------------
  |  |  115|    619|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    619|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    619|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  248|    619|    OPENSSL_free(ip2);
  ------------------
  |  |  115|    619|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    619|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    619|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  249|    619|    return ret;
  250|    619|}

v3_no_ass.c:i2s_NO_ASSERTION:
   31|      1|{
   32|      1|    return OPENSSL_strdup("NULL");
  ------------------
  |  |  119|      1|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|      1|}

v3_no_rev_avail.c:i2s_NO_REV_AVAIL:
   31|     48|{
   32|     48|    return OPENSSL_strdup("NULL");
  ------------------
  |  |  119|     48|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     48|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     48|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|     48|}

v3_pcons.c:i2v_POLICY_CONSTRAINTS:
   46|    440|{
   47|    440|    POLICY_CONSTRAINTS *pcons = a;
   48|    440|    X509V3_add_value_int("Require Explicit Policy",
   49|    440|                         pcons->requireExplicitPolicy, &extlist);
   50|    440|    X509V3_add_value_int("Inhibit Policy Mapping",
   51|    440|                         pcons->inhibitPolicyMapping, &extlist);
   52|    440|    return extlist;
   53|    440|}

v3_pku.c:i2r_PKEY_USAGE_PERIOD:
   39|    116|{
   40|    116|    BIO_printf(out, "%*s", indent, "");
   41|    116|    if (usage->notBefore) {
  ------------------
  |  Branch (41:9): [True: 34, False: 82]
  ------------------
   42|     34|        BIO_write(out, "Not Before: ", 12);
   43|     34|        ASN1_GENERALIZEDTIME_print(out, usage->notBefore);
   44|     34|        if (usage->notAfter)
  ------------------
  |  Branch (44:13): [True: 0, False: 34]
  ------------------
   45|      0|            BIO_write(out, ", ", 2);
   46|     34|    }
   47|    116|    if (usage->notAfter) {
  ------------------
  |  Branch (47:9): [True: 34, False: 82]
  ------------------
   48|     34|        BIO_write(out, "Not After: ", 11);
   49|     34|        ASN1_GENERALIZEDTIME_print(out, usage->notAfter);
   50|     34|    }
   51|    116|    return 1;
   52|    116|}

v3_pmaps.c:i2v_POLICY_MAPPINGS:
   49|    282|{
   50|    282|    POLICY_MAPPINGS *pmaps = a;
   51|    282|    POLICY_MAPPING *pmap;
   52|    282|    int i;
   53|    282|    char obj_tmp1[80];
   54|    282|    char obj_tmp2[80];
   55|       |
   56|    282|    for (i = 0; i < sk_POLICY_MAPPING_num(pmaps); i++) {
  ------------------
  |  |  503|    282|#define sk_POLICY_MAPPING_num(sk) OPENSSL_sk_num(ossl_check_const_POLICY_MAPPING_sk_type(sk))
  ------------------
  |  Branch (56:17): [True: 0, False: 282]
  ------------------
   57|      0|        pmap = sk_POLICY_MAPPING_value(pmaps, i);
  ------------------
  |  |  504|      0|#define sk_POLICY_MAPPING_value(sk, idx) ((POLICY_MAPPING *)OPENSSL_sk_value(ossl_check_const_POLICY_MAPPING_sk_type(sk), (idx)))
  ------------------
   58|      0|        i2t_ASN1_OBJECT(obj_tmp1, 80, pmap->issuerDomainPolicy);
   59|      0|        i2t_ASN1_OBJECT(obj_tmp2, 80, pmap->subjectDomainPolicy);
   60|      0|        X509V3_add_value(obj_tmp1, obj_tmp2, &ext_list);
   61|      0|    }
   62|    282|    return ext_list;
   63|    282|}

X509V3_EXT_val_prn:
   26|  3.01k|{
   27|  3.01k|    int i;
   28|  3.01k|    CONF_VALUE *nval;
   29|  3.01k|    if (!val)
  ------------------
  |  Branch (29:9): [True: 0, False: 3.01k]
  ------------------
   30|      0|        return;
   31|  3.01k|    if (!ml || !sk_CONF_VALUE_num(val)) {
  ------------------
  |  |   45|  1.01k|#define sk_CONF_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_CONF_VALUE_sk_type(sk))
  ------------------
  |  Branch (31:9): [True: 2.00k, False: 1.01k]
  |  Branch (31:16): [True: 194, False: 820]
  ------------------
   32|  2.19k|        BIO_printf(out, "%*s", indent, "");
   33|  2.19k|        if (!sk_CONF_VALUE_num(val))
  ------------------
  |  |   45|  2.19k|#define sk_CONF_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_CONF_VALUE_sk_type(sk))
  ------------------
  |  Branch (33:13): [True: 215, False: 1.97k]
  ------------------
   34|    215|            BIO_puts(out, "<EMPTY>\n");
   35|  2.19k|    }
   36|  7.98k|    for (i = 0; i < sk_CONF_VALUE_num(val); i++) {
  ------------------
  |  |   45|  7.98k|#define sk_CONF_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_CONF_VALUE_sk_type(sk))
  ------------------
  |  Branch (36:17): [True: 4.96k, False: 3.01k]
  ------------------
   37|  4.96k|        if (ml) {
  ------------------
  |  Branch (37:13): [True: 854, False: 4.11k]
  ------------------
   38|    854|            if (i > 0)
  ------------------
  |  Branch (38:17): [True: 34, False: 820]
  ------------------
   39|     34|                BIO_printf(out, "\n");
   40|    854|            BIO_printf(out, "%*s", indent, "");
   41|    854|        }
   42|  4.11k|        else if (i > 0)
  ------------------
  |  Branch (42:18): [True: 2.13k, False: 1.97k]
  ------------------
   43|  2.13k|            BIO_printf(out, ", ");
   44|  4.96k|        nval = sk_CONF_VALUE_value(val, i);
  ------------------
  |  |   46|  4.96k|#define sk_CONF_VALUE_value(sk, idx) ((CONF_VALUE *)OPENSSL_sk_value(ossl_check_const_CONF_VALUE_sk_type(sk), (idx)))
  ------------------
   45|  4.96k|        if (!nval->name)
  ------------------
  |  Branch (45:13): [True: 450, False: 4.51k]
  ------------------
   46|    450|            BIO_puts(out, nval->value);
   47|  4.51k|        else if (!nval->value)
  ------------------
  |  Branch (47:18): [True: 685, False: 3.83k]
  ------------------
   48|    685|            BIO_puts(out, nval->name);
   49|  3.83k|#ifndef CHARSET_EBCDIC
   50|  3.83k|        else
   51|  3.83k|            BIO_printf(out, "%s:%s", nval->name, nval->value);
   52|       |#else
   53|       |        else {
   54|       |            int len;
   55|       |            char *tmp;
   56|       |            len = strlen(nval->value) + 1;
   57|       |            tmp = OPENSSL_malloc(len);
   58|       |            if (tmp != NULL) {
   59|       |                ascii2ebcdic(tmp, nval->value, len);
   60|       |                BIO_printf(out, "%s:%s", nval->name, tmp);
   61|       |                OPENSSL_free(tmp);
   62|       |            }
   63|       |        }
   64|       |#endif
   65|  4.96k|    }
   66|  3.01k|}
X509V3_EXT_print:
   72|  42.4k|{
   73|  42.4k|    void *ext_str = NULL;
   74|  42.4k|    char *value = NULL;
   75|  42.4k|    ASN1_OCTET_STRING *extoct;
   76|  42.4k|    const unsigned char *p;
   77|  42.4k|    int extlen;
   78|  42.4k|    const X509V3_EXT_METHOD *method;
   79|  42.4k|    STACK_OF(CONF_VALUE) *nval = NULL;
  ------------------
  |  |   31|  42.4k|# define STACK_OF(type) struct stack_st_##type
  ------------------
   80|  42.4k|    int ok = 1;
   81|       |
   82|  42.4k|    extoct = X509_EXTENSION_get_data(ext);
   83|  42.4k|    p = ASN1_STRING_get0_data(extoct);
   84|  42.4k|    extlen = ASN1_STRING_length(extoct);
   85|       |
   86|  42.4k|    if ((method = X509V3_EXT_get(ext)) == NULL)
  ------------------
  |  Branch (86:9): [True: 2.51k, False: 39.9k]
  ------------------
   87|  2.51k|        return unknown_ext_print(out, p, extlen, flag, indent, 0);
   88|  39.9k|    if (method->it)
  ------------------
  |  Branch (88:9): [True: 39.5k, False: 461]
  ------------------
   89|  39.5k|        ext_str = ASN1_item_d2i(NULL, &p, extlen, ASN1_ITEM_ptr(method->it));
  ------------------
  |  |  422|  39.5k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
   90|    461|    else
   91|    461|        ext_str = method->d2i(NULL, &p, extlen);
   92|       |
   93|  39.9k|    if (!ext_str)
  ------------------
  |  Branch (93:9): [True: 8.21k, False: 31.7k]
  ------------------
   94|  8.21k|        return unknown_ext_print(out, p, extlen, flag, indent, 1);
   95|       |
   96|  31.7k|    if (method->i2s) {
  ------------------
  |  Branch (96:9): [True: 1.00k, False: 30.7k]
  ------------------
   97|  1.00k|        if ((value = method->i2s(method, ext_str)) == NULL) {
  ------------------
  |  Branch (97:13): [True: 0, False: 1.00k]
  ------------------
   98|      0|            ok = 0;
   99|      0|            goto err;
  100|      0|        }
  101|  1.00k|#ifndef CHARSET_EBCDIC
  102|  1.00k|        BIO_printf(out, "%*s%s", indent, "", value);
  103|       |#else
  104|       |        {
  105|       |            int len;
  106|       |            char *tmp;
  107|       |            len = strlen(value) + 1;
  108|       |            tmp = OPENSSL_malloc(len);
  109|       |            if (tmp != NULL) {
  110|       |                ascii2ebcdic(tmp, value, len);
  111|       |                BIO_printf(out, "%*s%s", indent, "", tmp);
  112|       |                OPENSSL_free(tmp);
  113|       |            }
  114|       |        }
  115|       |#endif
  116|  30.7k|    } else if (method->i2v) {
  ------------------
  |  Branch (116:16): [True: 4.22k, False: 26.5k]
  ------------------
  117|  4.22k|        if ((nval = method->i2v(method, ext_str, NULL)) == NULL) {
  ------------------
  |  Branch (117:13): [True: 1.20k, False: 3.01k]
  ------------------
  118|  1.20k|            ok = 0;
  119|  1.20k|            goto err;
  120|  1.20k|        }
  121|  3.01k|        X509V3_EXT_val_prn(out, nval, indent,
  122|  3.01k|                           method->ext_flags & X509V3_EXT_MULTILINE);
  ------------------
  |  |  143|  3.01k|# define X509V3_EXT_MULTILINE    0x4
  ------------------
  123|  26.5k|    } else if (method->i2r) {
  ------------------
  |  Branch (123:16): [True: 26.5k, False: 0]
  ------------------
  124|  26.5k|        if (!method->i2r(method, ext_str, out, indent))
  ------------------
  |  Branch (124:13): [True: 15.8k, False: 10.6k]
  ------------------
  125|  15.8k|            ok = 0;
  126|  26.5k|    } else
  127|      0|        ok = 0;
  128|       |
  129|  31.7k| err:
  130|  31.7k|    sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);
  ------------------
  |  |   59|  31.7k|#define sk_CONF_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_freefunc_type(freefunc))
  ------------------
  131|  31.7k|    OPENSSL_free(value);
  ------------------
  |  |  115|  31.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  31.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  31.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  132|  31.7k|    if (method->it)
  ------------------
  |  Branch (132:9): [True: 31.6k, False: 157]
  ------------------
  133|  31.6k|        ASN1_item_free(ext_str, ASN1_ITEM_ptr(method->it));
  ------------------
  |  |  422|  31.6k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  134|    157|    else
  135|    157|        method->ext_free(ext_str);
  136|  31.7k|    return ok;
  137|  31.7k|}
v3_prn.c:unknown_ext_print:
  181|  10.7k|{
  182|  10.7k|    switch (flag & X509V3_EXT_UNKNOWN_MASK) {
  ------------------
  |  |  761|  10.7k|# define X509V3_EXT_UNKNOWN_MASK         (0xfL << 16)
  ------------------
  183|       |
  184|  10.7k|    case X509V3_EXT_DEFAULT:
  ------------------
  |  |  763|  10.7k|# define X509V3_EXT_DEFAULT              0
  ------------------
  |  Branch (184:5): [True: 10.7k, False: 0]
  ------------------
  185|  10.7k|        return 0;
  186|       |
  187|      0|    case X509V3_EXT_ERROR_UNKNOWN:
  ------------------
  |  |  765|      0|# define X509V3_EXT_ERROR_UNKNOWN        (1L << 16)
  ------------------
  |  Branch (187:5): [True: 0, False: 10.7k]
  ------------------
  188|      0|        if (supported)
  ------------------
  |  Branch (188:13): [True: 0, False: 0]
  ------------------
  189|      0|            BIO_printf(out, "%*s<Parse Error>", indent, "");
  190|      0|        else
  191|      0|            BIO_printf(out, "%*s<Not Supported>", indent, "");
  192|      0|        return 1;
  193|       |
  194|      0|    case X509V3_EXT_PARSE_UNKNOWN:
  ------------------
  |  |  767|      0|# define X509V3_EXT_PARSE_UNKNOWN        (2L << 16)
  ------------------
  |  Branch (194:5): [True: 0, False: 10.7k]
  ------------------
  195|      0|        return ASN1_parse_dump(out, ext, extlen, indent, -1);
  196|      0|    case X509V3_EXT_DUMP_UNKNOWN:
  ------------------
  |  |  769|      0|# define X509V3_EXT_DUMP_UNKNOWN         (3L << 16)
  ------------------
  |  Branch (196:5): [True: 0, False: 10.7k]
  ------------------
  197|      0|        return BIO_dump_indent(out, (const char *)ext, extlen, indent);
  198|       |
  199|      0|    default:
  ------------------
  |  Branch (199:5): [True: 0, False: 10.7k]
  ------------------
  200|      0|        return 1;
  201|  10.7k|    }
  202|  10.7k|}

v3_rolespec.c:i2r_OSSL_ROLE_SPEC_CERT_ID_SYNTAX:
   67|     40|{
   68|     40|    OSSL_ROLE_SPEC_CERT_ID *rscid;
   69|     40|    int i;
   70|       |
   71|     40|    for (i = 0; i < sk_OSSL_ROLE_SPEC_CERT_ID_num(rscids); i++) {
  ------------------
  |  | 1510|     40|#define sk_OSSL_ROLE_SPEC_CERT_ID_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk))
  ------------------
  |  Branch (71:17): [True: 0, False: 40]
  ------------------
   72|      0|        if (i > 0 && BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (72:13): [True: 0, False: 0]
  |  Branch (72:22): [True: 0, False: 0]
  ------------------
   73|      0|            return 0;
   74|      0|        if (BIO_printf(out,
  ------------------
  |  Branch (74:13): [True: 0, False: 0]
  ------------------
   75|      0|                       "%*sRole Specification Certificate Identifier #%d:\n",
   76|      0|                       indent, "", i + 1) <= 0)
   77|      0|            return 0;
   78|      0|        rscid = sk_OSSL_ROLE_SPEC_CERT_ID_value(rscids, i);
  ------------------
  |  | 1511|      0|#define sk_OSSL_ROLE_SPEC_CERT_ID_value(sk, idx) ((OSSL_ROLE_SPEC_CERT_ID *)OPENSSL_sk_value(ossl_check_const_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk), (idx)))
  ------------------
   79|      0|        if (i2r_OSSL_ROLE_SPEC_CERT_ID(method, rscid, out, indent + 4) != 1)
  ------------------
  |  Branch (79:13): [True: 0, False: 0]
  ------------------
   80|      0|            return 0;
   81|      0|    }
   82|     40|    return 1;
   83|     40|}

i2v_GENERAL_NAMES:
   54|  1.92k|{
   55|  1.92k|    int i;
   56|  1.92k|    GENERAL_NAME *gen;
   57|  1.92k|    STACK_OF(CONF_VALUE) *tmpret = NULL, *origret = ret;
  ------------------
  |  |   31|  1.92k|# define STACK_OF(type) struct stack_st_##type
  ------------------
   58|       |
   59|  5.11k|    for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) {
  ------------------
  |  |  238|  5.11k|#define sk_GENERAL_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_NAME_sk_type(sk))
  ------------------
  |  Branch (59:17): [True: 3.32k, False: 1.78k]
  ------------------
   60|  3.32k|        gen = sk_GENERAL_NAME_value(gens, i);
  ------------------
  |  |  239|  3.32k|#define sk_GENERAL_NAME_value(sk, idx) ((GENERAL_NAME *)OPENSSL_sk_value(ossl_check_const_GENERAL_NAME_sk_type(sk), (idx)))
  ------------------
   61|       |        /*
   62|       |         * i2v_GENERAL_NAME allocates ret if it is NULL. If something goes
   63|       |         * wrong we need to free the stack - but only if it was empty when we
   64|       |         * originally entered this function.
   65|       |         */
   66|  3.32k|        tmpret = i2v_GENERAL_NAME(method, gen, ret);
   67|  3.32k|        if (tmpret == NULL) {
  ------------------
  |  Branch (67:13): [True: 131, False: 3.19k]
  ------------------
   68|    131|            if (origret == NULL)
  ------------------
  |  Branch (68:17): [True: 128, False: 3]
  ------------------
   69|    128|                sk_CONF_VALUE_pop_free(ret, X509V3_conf_free);
  ------------------
  |  |   59|    128|#define sk_CONF_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_freefunc_type(freefunc))
  ------------------
   70|    131|            return NULL;
   71|    131|        }
   72|  3.19k|        ret = tmpret;
   73|  3.19k|    }
   74|  1.78k|    if (ret == NULL)
  ------------------
  |  Branch (74:9): [True: 215, False: 1.57k]
  ------------------
   75|    215|        return sk_CONF_VALUE_new_null();
  ------------------
  |  |   48|    215|#define sk_CONF_VALUE_new_null() ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_null())
  ------------------
   76|  1.57k|    return ret;
   77|  1.78k|}
i2v_GENERAL_NAME:
   82|  3.32k|{
   83|  3.32k|    char othername[300];
   84|  3.32k|    char oline[256], *tmp;
   85|       |
   86|  3.32k|    switch (gen->type) {
  ------------------
  |  Branch (86:13): [True: 0, False: 3.32k]
  ------------------
   87|     51|    case GEN_OTHERNAME:
  ------------------
  |  |  173|     51|# define GEN_OTHERNAME   0
  ------------------
  |  Branch (87:5): [True: 51, False: 3.27k]
  ------------------
   88|     51|        switch (OBJ_obj2nid(gen->d.otherName->type_id)) {
   89|      0|        case NID_id_on_SmtpUTF8Mailbox:
  ------------------
  |  | 2051|      0|#define NID_id_on_SmtpUTF8Mailbox               1208
  ------------------
  |  Branch (89:9): [True: 0, False: 51]
  ------------------
   90|      0|            if (gen->d.otherName->value->type != V_ASN1_UTF8STRING
  ------------------
  |  |   73|      0|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (90:17): [True: 0, False: 0]
  ------------------
   91|      0|                    || !x509v3_add_len_value_uchar("othername: SmtpUTF8Mailbox",
  ------------------
  |  Branch (91:24): [True: 0, False: 0]
  ------------------
   92|      0|                            gen->d.otherName->value->value.utf8string->data,
   93|      0|                            gen->d.otherName->value->value.utf8string->length,
   94|      0|                            &ret))
   95|      0|                return NULL;
   96|      0|            break;
   97|      0|        case NID_XmppAddr:
  ------------------
  |  | 2036|      0|#define NID_XmppAddr            1209
  ------------------
  |  Branch (97:9): [True: 0, False: 51]
  ------------------
   98|      0|            if (gen->d.otherName->value->type != V_ASN1_UTF8STRING
  ------------------
  |  |   73|      0|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (98:17): [True: 0, False: 0]
  ------------------
   99|      0|                    || !x509v3_add_len_value_uchar("othername: XmppAddr",
  ------------------
  |  Branch (99:24): [True: 0, False: 0]
  ------------------
  100|      0|                            gen->d.otherName->value->value.utf8string->data,
  101|      0|                            gen->d.otherName->value->value.utf8string->length,
  102|      0|                            &ret))
  103|      0|                return NULL;
  104|      0|            break;
  105|      0|        case NID_SRVName:
  ------------------
  |  | 2041|      0|#define NID_SRVName             1210
  ------------------
  |  Branch (105:9): [True: 0, False: 51]
  ------------------
  106|      0|            if (gen->d.otherName->value->type != V_ASN1_IA5STRING
  ------------------
  |  |   81|      0|# define V_ASN1_IA5STRING                22
  ------------------
  |  Branch (106:17): [True: 0, False: 0]
  ------------------
  107|      0|                    || !x509v3_add_len_value_uchar("othername: SRVName",
  ------------------
  |  Branch (107:24): [True: 0, False: 0]
  ------------------
  108|      0|                            gen->d.otherName->value->value.ia5string->data,
  109|      0|                            gen->d.otherName->value->value.ia5string->length,
  110|      0|                            &ret))
  111|      0|                return NULL;
  112|      0|            break;
  113|      0|        case NID_ms_upn:
  ------------------
  |  | 1371|      0|#define NID_ms_upn              649
  ------------------
  |  Branch (113:9): [True: 0, False: 51]
  ------------------
  114|      0|            if (gen->d.otherName->value->type != V_ASN1_UTF8STRING
  ------------------
  |  |   73|      0|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (114:17): [True: 0, False: 0]
  ------------------
  115|      0|                    || !x509v3_add_len_value_uchar("othername: UPN",
  ------------------
  |  Branch (115:24): [True: 0, False: 0]
  ------------------
  116|      0|                            gen->d.otherName->value->value.utf8string->data,
  117|      0|                            gen->d.otherName->value->value.utf8string->length,
  118|      0|                            &ret))
  119|      0|                return NULL;
  120|      0|            break;
  121|      0|        case NID_NAIRealm:
  ------------------
  |  | 2046|      0|#define NID_NAIRealm            1211
  ------------------
  |  Branch (121:9): [True: 0, False: 51]
  ------------------
  122|      0|            if (gen->d.otherName->value->type != V_ASN1_UTF8STRING
  ------------------
  |  |   73|      0|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (122:17): [True: 0, False: 0]
  ------------------
  123|      0|                    || !x509v3_add_len_value_uchar("othername: NAIRealm",
  ------------------
  |  Branch (123:24): [True: 0, False: 0]
  ------------------
  124|      0|                            gen->d.otherName->value->value.utf8string->data,
  125|      0|                            gen->d.otherName->value->value.utf8string->length,
  126|      0|                            &ret))
  127|      0|                return NULL;
  128|      0|            break;
  129|     51|        default:
  ------------------
  |  Branch (129:9): [True: 51, False: 0]
  ------------------
  130|     51|            if (OBJ_obj2txt(oline, sizeof(oline), gen->d.otherName->type_id, 0) > 0)
  ------------------
  |  Branch (130:17): [True: 51, False: 0]
  ------------------
  131|     51|                BIO_snprintf(othername, sizeof(othername), "othername: %s",
  132|     51|                             oline);
  133|      0|            else
  134|      0|                OPENSSL_strlcpy(othername, "othername", sizeof(othername));
  135|       |
  136|       |            /* check if the value is something printable */
  137|     51|            if (gen->d.otherName->value->type == V_ASN1_IA5STRING) {
  ------------------
  |  |   81|     51|# define V_ASN1_IA5STRING                22
  ------------------
  |  Branch (137:17): [True: 11, False: 40]
  ------------------
  138|     11|                if (x509v3_add_len_value_uchar(othername,
  ------------------
  |  Branch (138:21): [True: 10, False: 1]
  ------------------
  139|     11|                             gen->d.otherName->value->value.ia5string->data,
  140|     11|                             gen->d.otherName->value->value.ia5string->length,
  141|     11|                             &ret))
  142|     10|                    return ret;
  143|     11|            }
  144|     41|            if (gen->d.otherName->value->type == V_ASN1_UTF8STRING) {
  ------------------
  |  |   73|     41|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (144:17): [True: 12, False: 29]
  ------------------
  145|     12|                if (x509v3_add_len_value_uchar(othername,
  ------------------
  |  Branch (145:21): [True: 11, False: 1]
  ------------------
  146|     12|                             gen->d.otherName->value->value.utf8string->data,
  147|     12|                             gen->d.otherName->value->value.utf8string->length,
  148|     12|                             &ret))
  149|     11|                    return ret;
  150|     12|            }
  151|     30|            if (!X509V3_add_value(othername, "<unsupported>", &ret))
  ------------------
  |  Branch (151:17): [True: 0, False: 30]
  ------------------
  152|      0|                return NULL;
  153|     30|            break;
  154|     51|        }
  155|     30|        break;
  156|       |
  157|    216|    case GEN_X400:
  ------------------
  |  |  176|    216|# define GEN_X400        3
  ------------------
  |  Branch (157:5): [True: 216, False: 3.11k]
  ------------------
  158|    216|        if (!X509V3_add_value("X400Name", "<unsupported>", &ret))
  ------------------
  |  Branch (158:13): [True: 0, False: 216]
  ------------------
  159|      0|            return NULL;
  160|    216|        break;
  161|       |
  162|    216|    case GEN_EDIPARTY:
  ------------------
  |  |  178|    139|# define GEN_EDIPARTY    5
  ------------------
  |  Branch (162:5): [True: 139, False: 3.18k]
  ------------------
  163|    139|        if (!X509V3_add_value("EdiPartyName", "<unsupported>", &ret))
  ------------------
  |  Branch (163:13): [True: 0, False: 139]
  ------------------
  164|      0|            return NULL;
  165|    139|        break;
  166|       |
  167|  1.62k|    case GEN_EMAIL:
  ------------------
  |  |  174|  1.62k|# define GEN_EMAIL       1
  ------------------
  |  Branch (167:5): [True: 1.62k, False: 1.70k]
  ------------------
  168|  1.62k|        if (!x509v3_add_len_value_uchar("email", gen->d.ia5->data,
  ------------------
  |  Branch (168:13): [True: 76, False: 1.54k]
  ------------------
  169|  1.62k|                                        gen->d.ia5->length, &ret))
  170|     76|            return NULL;
  171|  1.54k|        break;
  172|       |
  173|  1.54k|    case GEN_DNS:
  ------------------
  |  |  175|    241|# define GEN_DNS         2
  ------------------
  |  Branch (173:5): [True: 241, False: 3.08k]
  ------------------
  174|    241|        if (!x509v3_add_len_value_uchar("DNS", gen->d.ia5->data,
  ------------------
  |  Branch (174:13): [True: 19, False: 222]
  ------------------
  175|    241|                                        gen->d.ia5->length, &ret))
  176|     19|            return NULL;
  177|    222|        break;
  178|       |
  179|    323|    case GEN_URI:
  ------------------
  |  |  179|    323|# define GEN_URI         6
  ------------------
  |  Branch (179:5): [True: 323, False: 3.00k]
  ------------------
  180|    323|        if (!x509v3_add_len_value_uchar("URI", gen->d.ia5->data,
  ------------------
  |  Branch (180:13): [True: 37, False: 286]
  ------------------
  181|    323|                                        gen->d.ia5->length, &ret))
  182|     37|            return NULL;
  183|    286|        break;
  184|       |
  185|    286|    case GEN_DIRNAME:
  ------------------
  |  |  177|     64|# define GEN_DIRNAME     4
  ------------------
  |  Branch (185:5): [True: 64, False: 3.26k]
  ------------------
  186|     64|        if (X509_NAME_oneline(gen->d.dirn, oline, sizeof(oline)) == NULL
  ------------------
  |  Branch (186:13): [True: 0, False: 64]
  ------------------
  187|     64|                || !X509V3_add_value("DirName", oline, &ret))
  ------------------
  |  Branch (187:20): [True: 0, False: 64]
  ------------------
  188|      0|            return NULL;
  189|     64|        break;
  190|       |
  191|    413|    case GEN_IPADD:
  ------------------
  |  |  180|    413|# define GEN_IPADD       7
  ------------------
  |  Branch (191:5): [True: 413, False: 2.91k]
  ------------------
  192|    413|        tmp = ossl_ipaddr_to_asc(gen->d.ip->data, gen->d.ip->length);
  193|    413|        if (tmp == NULL || !X509V3_add_value("IP Address", tmp, &ret))
  ------------------
  |  Branch (193:13): [True: 0, False: 413]
  |  Branch (193:28): [True: 0, False: 413]
  ------------------
  194|      0|            ret = NULL;
  195|    413|        OPENSSL_free(tmp);
  ------------------
  |  |  115|    413|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    413|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    413|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  196|    413|        break;
  197|       |
  198|    254|    case GEN_RID:
  ------------------
  |  |  181|    254|# define GEN_RID         8
  ------------------
  |  Branch (198:5): [True: 254, False: 3.07k]
  ------------------
  199|    254|        i2t_ASN1_OBJECT(oline, 256, gen->d.rid);
  200|    254|        if (!X509V3_add_value("Registered ID", oline, &ret))
  ------------------
  |  Branch (200:13): [True: 0, False: 254]
  ------------------
  201|      0|            return NULL;
  202|    254|        break;
  203|  3.32k|    }
  204|  3.17k|    return ret;
  205|  3.32k|}
GENERAL_NAME_print:
  208|  1.86k|{
  209|  1.86k|    char *tmp;
  210|  1.86k|    int nid;
  211|       |
  212|  1.86k|    switch (gen->type) {
  ------------------
  |  Branch (212:13): [True: 0, False: 1.86k]
  ------------------
  213|      0|    case GEN_OTHERNAME:
  ------------------
  |  |  173|      0|# define GEN_OTHERNAME   0
  ------------------
  |  Branch (213:5): [True: 0, False: 1.86k]
  ------------------
  214|      0|        nid = OBJ_obj2nid(gen->d.otherName->type_id);
  215|       |        /* Validate the types are as we expect before we use them */
  216|      0|        if ((nid == NID_SRVName
  ------------------
  |  | 2041|      0|#define NID_SRVName             1210
  ------------------
  |  Branch (216:14): [True: 0, False: 0]
  ------------------
  217|      0|             && gen->d.otherName->value->type != V_ASN1_IA5STRING)
  ------------------
  |  |   81|      0|# define V_ASN1_IA5STRING                22
  ------------------
  |  Branch (217:17): [True: 0, False: 0]
  ------------------
  218|      0|                || (nid != NID_SRVName
  ------------------
  |  | 2041|      0|#define NID_SRVName             1210
  ------------------
  |  Branch (218:21): [True: 0, False: 0]
  ------------------
  219|      0|                    && gen->d.otherName->value->type != V_ASN1_UTF8STRING)) {
  ------------------
  |  |   73|      0|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (219:24): [True: 0, False: 0]
  ------------------
  220|      0|            BIO_printf(out, "othername:<unsupported>");
  221|      0|            break;
  222|      0|        }
  223|       |
  224|      0|        switch (nid) {
  225|      0|        case NID_id_on_SmtpUTF8Mailbox:
  ------------------
  |  | 2051|      0|#define NID_id_on_SmtpUTF8Mailbox               1208
  ------------------
  |  Branch (225:9): [True: 0, False: 0]
  ------------------
  226|      0|            BIO_printf(out, "othername:SmtpUTF8Mailbox:%.*s",
  227|      0|                       gen->d.otherName->value->value.utf8string->length,
  228|      0|                       gen->d.otherName->value->value.utf8string->data);
  229|      0|            break;
  230|      0|        case NID_XmppAddr:
  ------------------
  |  | 2036|      0|#define NID_XmppAddr            1209
  ------------------
  |  Branch (230:9): [True: 0, False: 0]
  ------------------
  231|      0|            BIO_printf(out, "othername:XmppAddr:%.*s",
  232|      0|                       gen->d.otherName->value->value.utf8string->length,
  233|      0|                       gen->d.otherName->value->value.utf8string->data);
  234|      0|            break;
  235|      0|        case NID_SRVName:
  ------------------
  |  | 2041|      0|#define NID_SRVName             1210
  ------------------
  |  Branch (235:9): [True: 0, False: 0]
  ------------------
  236|      0|            BIO_printf(out, "othername:SRVName:%.*s",
  237|      0|                       gen->d.otherName->value->value.ia5string->length,
  238|      0|                       gen->d.otherName->value->value.ia5string->data);
  239|      0|            break;
  240|      0|        case NID_ms_upn:
  ------------------
  |  | 1371|      0|#define NID_ms_upn              649
  ------------------
  |  Branch (240:9): [True: 0, False: 0]
  ------------------
  241|      0|            BIO_printf(out, "othername:UPN:%.*s",
  242|      0|                       gen->d.otherName->value->value.utf8string->length,
  243|      0|                       gen->d.otherName->value->value.utf8string->data);
  244|      0|            break;
  245|      0|        case NID_NAIRealm:
  ------------------
  |  | 2046|      0|#define NID_NAIRealm            1211
  ------------------
  |  Branch (245:9): [True: 0, False: 0]
  ------------------
  246|      0|            BIO_printf(out, "othername:NAIRealm:%.*s",
  247|      0|                       gen->d.otherName->value->value.utf8string->length,
  248|      0|                       gen->d.otherName->value->value.utf8string->data);
  249|      0|            break;
  250|      0|        default:
  ------------------
  |  Branch (250:9): [True: 0, False: 0]
  ------------------
  251|      0|            BIO_printf(out, "othername:<unsupported>");
  252|      0|            break;
  253|      0|        }
  254|      0|        break;
  255|       |
  256|     67|    case GEN_X400:
  ------------------
  |  |  176|     67|# define GEN_X400        3
  ------------------
  |  Branch (256:5): [True: 67, False: 1.80k]
  ------------------
  257|     67|        BIO_printf(out, "X400Name:<unsupported>");
  258|     67|        break;
  259|       |
  260|      3|    case GEN_EDIPARTY:
  ------------------
  |  |  178|      3|# define GEN_EDIPARTY    5
  ------------------
  |  Branch (260:5): [True: 3, False: 1.86k]
  ------------------
  261|       |        /* Maybe fix this: it is supported now */
  262|      3|        BIO_printf(out, "EdiPartyName:<unsupported>");
  263|      3|        break;
  264|       |
  265|    414|    case GEN_EMAIL:
  ------------------
  |  |  174|    414|# define GEN_EMAIL       1
  ------------------
  |  Branch (265:5): [True: 414, False: 1.45k]
  ------------------
  266|    414|        BIO_printf(out, "email:");
  267|    414|        ASN1_STRING_print(out, gen->d.ia5);
  268|    414|        break;
  269|       |
  270|     69|    case GEN_DNS:
  ------------------
  |  |  175|     69|# define GEN_DNS         2
  ------------------
  |  Branch (270:5): [True: 69, False: 1.79k]
  ------------------
  271|     69|        BIO_printf(out, "DNS:");
  272|     69|        ASN1_STRING_print(out, gen->d.ia5);
  273|     69|        break;
  274|       |
  275|    305|    case GEN_URI:
  ------------------
  |  |  179|    305|# define GEN_URI         6
  ------------------
  |  Branch (275:5): [True: 305, False: 1.56k]
  ------------------
  276|    305|        BIO_printf(out, "URI:");
  277|    305|        ASN1_STRING_print(out, gen->d.ia5);
  278|    305|        break;
  279|       |
  280|    647|    case GEN_DIRNAME:
  ------------------
  |  |  177|    647|# define GEN_DIRNAME     4
  ------------------
  |  Branch (280:5): [True: 647, False: 1.22k]
  ------------------
  281|    647|        BIO_printf(out, "DirName:");
  282|    647|        X509_NAME_print_ex(out, gen->d.dirn, 0, XN_FLAG_ONELINE);
  ------------------
  |  |  358|    647|# define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
  |  |  ------------------
  |  |  |  |  516|    647|# define ASN1_STRFLGS_RFC2253    (ASN1_STRFLGS_ESC_2253 | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  441|    647|# define ASN1_STRFLGS_ESC_2253           1
  |  |  |  |  ------------------
  |  |  |  |  517|    647|                                ASN1_STRFLGS_ESC_CTRL | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|    647|# define ASN1_STRFLGS_ESC_CTRL           2
  |  |  |  |  ------------------
  |  |  |  |  518|    647|                                ASN1_STRFLGS_ESC_MSB | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  443|    647|# define ASN1_STRFLGS_ESC_MSB            4
  |  |  |  |  ------------------
  |  |  |  |  519|    647|                                ASN1_STRFLGS_UTF8_CONVERT | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  475|    647|# define ASN1_STRFLGS_UTF8_CONVERT       0x10
  |  |  |  |  ------------------
  |  |  |  |  520|    647|                                ASN1_STRFLGS_DUMP_UNKNOWN | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  497|    647|# define ASN1_STRFLGS_DUMP_UNKNOWN       0x100
  |  |  |  |  ------------------
  |  |  |  |  521|    647|                                ASN1_STRFLGS_DUMP_DER)
  |  |  |  |  ------------------
  |  |  |  |  |  |  504|    647|# define ASN1_STRFLGS_DUMP_DER           0x200
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  359|    647|                        ASN1_STRFLGS_ESC_QUOTE | \
  |  |  ------------------
  |  |  |  |  455|    647|# define ASN1_STRFLGS_ESC_QUOTE          8
  |  |  ------------------
  |  |  360|    647|                        XN_FLAG_SEP_CPLUS_SPC | \
  |  |  ------------------
  |  |  |  |  321|    647|# define XN_FLAG_SEP_CPLUS_SPC   (2 << 16)/* ,+ spaced: more readable */
  |  |  ------------------
  |  |  361|    647|                        XN_FLAG_SPC_EQ | \
  |  |  ------------------
  |  |  |  |  336|    647|# define XN_FLAG_SPC_EQ          (1 << 23)/* Put spaces round '=' */
  |  |  ------------------
  |  |  362|    647|                        XN_FLAG_FN_SN)
  |  |  ------------------
  |  |  |  |  331|    647|# define XN_FLAG_FN_SN           0/* Object short name */
  |  |  ------------------
  ------------------
  283|    647|        break;
  284|       |
  285|     71|    case GEN_IPADD:
  ------------------
  |  |  180|     71|# define GEN_IPADD       7
  ------------------
  |  Branch (285:5): [True: 71, False: 1.79k]
  ------------------
  286|     71|        tmp = ossl_ipaddr_to_asc(gen->d.ip->data, gen->d.ip->length);
  287|     71|        if (tmp == NULL)
  ------------------
  |  Branch (287:13): [True: 0, False: 71]
  ------------------
  288|      0|            return 0;
  289|     71|        BIO_printf(out, "IP Address:%s", tmp);
  290|     71|        OPENSSL_free(tmp);
  ------------------
  |  |  115|     71|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     71|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     71|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  291|     71|        break;
  292|       |
  293|    292|    case GEN_RID:
  ------------------
  |  |  181|    292|# define GEN_RID         8
  ------------------
  |  Branch (293:5): [True: 292, False: 1.57k]
  ------------------
  294|    292|        BIO_printf(out, "Registered ID:");
  295|    292|        i2a_ASN1_OBJECT(out, gen->d.rid);
  296|    292|        break;
  297|  1.86k|    }
  298|  1.86k|    return 1;
  299|  1.86k|}

v3_sda.c:i2r_ATTRIBUTES_SYNTAX:
   24|     11|{
   25|     11|    X509_ATTRIBUTE *attr;
   26|     11|    ASN1_TYPE *av;
   27|     11|    int i, j, attr_nid;
   28|       |
   29|     11|    if (!attrlst) {
  ------------------
  |  Branch (29:9): [True: 0, False: 11]
  ------------------
   30|      0|        if (BIO_printf(out, "<No Attributes>\n") <= 0)
  ------------------
  |  Branch (30:13): [True: 0, False: 0]
  ------------------
   31|      0|            return 0;
   32|      0|        return 1;
   33|      0|    }
   34|     11|    if (!sk_X509_ATTRIBUTE_num(attrlst)) {
  ------------------
  |  |  264|     11|#define sk_X509_ATTRIBUTE_num(sk) OPENSSL_sk_num(ossl_check_const_X509_ATTRIBUTE_sk_type(sk))
  ------------------
  |  Branch (34:9): [True: 11, False: 0]
  ------------------
   35|     11|        if (BIO_printf(out, "<Empty Attributes>\n") <= 0)
  ------------------
  |  Branch (35:13): [True: 0, False: 11]
  ------------------
   36|      0|            return 0;
   37|     11|        return 1;
   38|     11|    }
   39|       |
   40|      0|    for (i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {
  ------------------
  |  |  264|      0|#define sk_X509_ATTRIBUTE_num(sk) OPENSSL_sk_num(ossl_check_const_X509_ATTRIBUTE_sk_type(sk))
  ------------------
  |  Branch (40:17): [True: 0, False: 0]
  ------------------
   41|      0|        ASN1_OBJECT *attr_obj;
   42|      0|        attr = sk_X509_ATTRIBUTE_value(attrlst, i);
  ------------------
  |  |  265|      0|#define sk_X509_ATTRIBUTE_value(sk, idx) ((X509_ATTRIBUTE *)OPENSSL_sk_value(ossl_check_const_X509_ATTRIBUTE_sk_type(sk), (idx)))
  ------------------
   43|      0|        attr_obj = X509_ATTRIBUTE_get0_object(attr);
   44|      0|        attr_nid = OBJ_obj2nid(attr_obj);
   45|      0|        if (indent && BIO_printf(out, "%*s", indent, "") <= 0)
  ------------------
  |  Branch (45:13): [True: 0, False: 0]
  |  Branch (45:23): [True: 0, False: 0]
  ------------------
   46|      0|            return 0;
   47|      0|        if (attr_nid == NID_undef) {
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (47:13): [True: 0, False: 0]
  ------------------
   48|      0|            if (i2a_ASN1_OBJECT(out, attr_obj) <= 0)
  ------------------
  |  Branch (48:17): [True: 0, False: 0]
  ------------------
   49|      0|                return 0;
   50|      0|            if (BIO_puts(out, ":\n") <= 0)
  ------------------
  |  Branch (50:17): [True: 0, False: 0]
  ------------------
   51|      0|                return 0;
   52|      0|        } else if (BIO_printf(out, "%s:\n", OBJ_nid2ln(attr_nid)) <= 0) {
  ------------------
  |  Branch (52:20): [True: 0, False: 0]
  ------------------
   53|      0|            return 0;
   54|      0|        }
   55|       |
   56|      0|        if (X509_ATTRIBUTE_count(attr)) {
  ------------------
  |  Branch (56:13): [True: 0, False: 0]
  ------------------
   57|      0|            for (j = 0; j < X509_ATTRIBUTE_count(attr); j++)
  ------------------
  |  Branch (57:25): [True: 0, False: 0]
  ------------------
   58|      0|            {
   59|      0|                av = X509_ATTRIBUTE_get0_type(attr, j);
   60|      0|                if (ossl_print_attribute_value(out, attr_nid, av, indent + 4) <= 0)
  ------------------
  |  Branch (60:21): [True: 0, False: 0]
  ------------------
   61|      0|                    return 0;
   62|      0|                if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (62:21): [True: 0, False: 0]
  ------------------
   63|      0|                    return 0;
   64|      0|            }
   65|      0|        } else if (BIO_printf(out, "%*s<No Values>\n", indent + 4, "") <= 0) {
  ------------------
  |  Branch (65:20): [True: 0, False: 0]
  ------------------
   66|      0|            return 0;
   67|      0|        }
   68|      0|    }
   69|      0|    return 1;
   70|      0|}

v3_single_use.c:i2s_SINGLE_USE:
   31|      1|{
   32|      1|    return OPENSSL_strdup("NULL");
  ------------------
  |  |  119|      1|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|      1|}

i2s_ASN1_OCTET_STRING:
   29|    543|{
   30|    543|    return OPENSSL_buf2hexstr(oct->data, oct->length);
   31|    543|}

v3_soa_id.c:i2s_SOA_IDENTIFIER:
   31|      1|{
   32|      1|    return OPENSSL_strdup("NULL");
  ------------------
  |  |  119|      1|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|      1|}

v3_timespec.c:i2r_OSSL_TIME_SPEC:
  570|    507|{
  571|    507|    int64_t tz;
  572|       |
  573|    507|    if (time->timeZone) {
  ------------------
  |  Branch (573:9): [True: 2, False: 505]
  ------------------
  574|      2|        if (ASN1_INTEGER_get_int64(&tz, time->timeZone) != 1)
  ------------------
  |  Branch (574:13): [True: 1, False: 1]
  ------------------
  575|      1|            return 0;
  576|      1|        if (BIO_printf(out, "%*sTimezone: UTC%+03lld:00\n", indent, "", (long long int)tz) <= 0)
  ------------------
  |  Branch (576:13): [True: 0, False: 1]
  ------------------
  577|      0|            return 0;
  578|      1|    }
  579|    506|    if (time->notThisTime > 0) {
  ------------------
  |  Branch (579:9): [True: 1, False: 505]
  ------------------
  580|      1|        if (BIO_printf(out, "%*sNOT this time:\n", indent, "") <= 0)
  ------------------
  |  Branch (580:13): [True: 0, False: 1]
  ------------------
  581|      0|            return 0;
  582|    505|    } else if (BIO_printf(out, "%*sTime:\n", indent, "") <= 0) {
  ------------------
  |  Branch (582:16): [True: 0, False: 505]
  ------------------
  583|      0|        return 0;
  584|      0|    }
  585|    506|    return i2r_OSSL_TIME_SPEC_TIME(method, time->time, out, indent + 4);
  586|    506|}
v3_timespec.c:i2r_OSSL_TIME_SPEC_TIME:
  539|    506|{
  540|    506|    OSSL_TIME_PERIOD *tp;
  541|    506|    int i;
  542|       |
  543|    506|    switch (time->type) {
  544|     10|    case (OSSL_TIME_SPEC_TIME_TYPE_ABSOLUTE):
  ------------------
  |  | 1728|     10|# define OSSL_TIME_SPEC_TIME_TYPE_ABSOLUTE 0
  ------------------
  |  Branch (544:5): [True: 10, False: 496]
  ------------------
  545|     10|        if (BIO_printf(out, "%*sAbsolute: ", indent, "") <= 0)
  ------------------
  |  Branch (545:13): [True: 0, False: 10]
  ------------------
  546|      0|            return 0;
  547|     10|        if (i2r_OSSL_TIME_SPEC_ABSOLUTE(method, time->choice.absolute, out, indent + 4) <= 0)
  ------------------
  |  Branch (547:13): [True: 0, False: 10]
  ------------------
  548|      0|            return 0;
  549|     10|        return BIO_puts(out, "\n");
  550|    496|    case (OSSL_TIME_SPEC_TIME_TYPE_PERIODIC):
  ------------------
  |  | 1729|    496|# define OSSL_TIME_SPEC_TIME_TYPE_PERIODIC 1
  ------------------
  |  Branch (550:5): [True: 496, False: 10]
  ------------------
  551|    496|        if (BIO_printf(out, "%*sPeriodic:\n", indent, "") <= 0)
  ------------------
  |  Branch (551:13): [True: 0, False: 496]
  ------------------
  552|      0|            return 0;
  553|  1.00k|        for (i = 0; i < sk_OSSL_TIME_PERIOD_num(time->choice.periodic); i++) {
  ------------------
  |  | 1758|  1.00k|#define sk_OSSL_TIME_PERIOD_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_TIME_PERIOD_sk_type(sk))
  ------------------
  |  Branch (553:21): [True: 505, False: 496]
  ------------------
  554|    505|            if (i > 0 && !BIO_puts(out, "\n"))
  ------------------
  |  Branch (554:17): [True: 20, False: 485]
  |  Branch (554:26): [True: 0, False: 20]
  ------------------
  555|      0|                return 0;
  556|    505|            tp = sk_OSSL_TIME_PERIOD_value(time->choice.periodic, i);
  ------------------
  |  | 1759|    505|#define sk_OSSL_TIME_PERIOD_value(sk, idx) ((OSSL_TIME_PERIOD *)OPENSSL_sk_value(ossl_check_const_OSSL_TIME_PERIOD_sk_type(sk), (idx)))
  ------------------
  557|    505|            if (!i2r_OSSL_PERIOD(method, tp, out, indent + 4))
  ------------------
  |  Branch (557:17): [True: 0, False: 505]
  ------------------
  558|      0|                return 0;
  559|    505|        }
  560|    496|        return BIO_puts(out, "\n");
  561|      0|    default:
  ------------------
  |  Branch (561:5): [True: 0, False: 506]
  ------------------
  562|      0|        return 0;
  563|    506|    }
  564|      0|    return 0;
  565|    506|}
v3_timespec.c:i2r_OSSL_TIME_SPEC_ABSOLUTE:
  130|     10|{
  131|     10|    if (time->startTime != NULL && time->endTime != NULL) {
  ------------------
  |  Branch (131:9): [True: 0, False: 10]
  |  Branch (131:36): [True: 0, False: 0]
  ------------------
  132|      0|        if (!BIO_puts(out, "Any time between "))
  ------------------
  |  Branch (132:13): [True: 0, False: 0]
  ------------------
  133|      0|            return 0;
  134|      0|        if (!ossl_asn1_time_print_ex(out, time->startTime, 0))
  ------------------
  |  Branch (134:13): [True: 0, False: 0]
  ------------------
  135|      0|            return 0;
  136|      0|        if (!BIO_puts(out, " and "))
  ------------------
  |  Branch (136:13): [True: 0, False: 0]
  ------------------
  137|      0|            return 0;
  138|      0|        if (!ossl_asn1_time_print_ex(out, time->endTime, 0))
  ------------------
  |  Branch (138:13): [True: 0, False: 0]
  ------------------
  139|      0|            return 0;
  140|     10|    } else if (time->startTime != NULL) {
  ------------------
  |  Branch (140:16): [True: 0, False: 10]
  ------------------
  141|      0|        if (!BIO_puts(out, "Any time after "))
  ------------------
  |  Branch (141:13): [True: 0, False: 0]
  ------------------
  142|      0|            return 0;
  143|      0|        if (!ossl_asn1_time_print_ex(out, time->startTime, 0))
  ------------------
  |  Branch (143:13): [True: 0, False: 0]
  ------------------
  144|      0|            return 0;
  145|      0|        if (BIO_printf(out, "%.*s", time->startTime->length, time->startTime->data) <= 0)
  ------------------
  |  Branch (145:13): [True: 0, False: 0]
  ------------------
  146|      0|            return 0;
  147|     10|    } else if (time->endTime != NULL) {
  ------------------
  |  Branch (147:16): [True: 0, False: 10]
  ------------------
  148|      0|        if (!BIO_puts(out, "Any time until "))
  ------------------
  |  Branch (148:13): [True: 0, False: 0]
  ------------------
  149|      0|            return 0;
  150|      0|        if (!ossl_asn1_time_print_ex(out, time->endTime, 0))
  ------------------
  |  Branch (150:13): [True: 0, False: 0]
  ------------------
  151|      0|            return 0;
  152|     10|    } else { /* Invalid: there must be SOME time specified. */
  153|     10|        return BIO_puts(out, "INVALID (EMPTY)");
  154|     10|    }
  155|      0|    return 1;
  156|     10|}
v3_timespec.c:i2r_OSSL_PERIOD:
  340|    505|{
  341|    505|    int i;
  342|    505|    OSSL_DAY_TIME_BAND *band;
  343|    505|    ASN1_INTEGER *big_val;
  344|    505|    int64_t small_val;
  345|    505|    OSSL_NAMED_DAY *nd;
  346|       |
  347|    505|    if (BIO_printf(out, "%*sPeriod:\n", indent, "") <= 0)
  ------------------
  |  Branch (347:9): [True: 0, False: 505]
  ------------------
  348|      0|        return 0;
  349|    505|    if (p->timesOfDay) {
  ------------------
  |  Branch (349:9): [True: 0, False: 505]
  ------------------
  350|      0|        if (BIO_printf(out, "%*sDaytime bands:\n", indent + 4, "") <= 0)
  ------------------
  |  Branch (350:13): [True: 0, False: 0]
  ------------------
  351|      0|            return 0;
  352|      0|        for (i = 0; i < sk_OSSL_DAY_TIME_BAND_num(p->timesOfDay); i++) {
  ------------------
  |  | 1786|      0|#define sk_OSSL_DAY_TIME_BAND_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_DAY_TIME_BAND_sk_type(sk))
  ------------------
  |  Branch (352:21): [True: 0, False: 0]
  ------------------
  353|      0|            band = sk_OSSL_DAY_TIME_BAND_value(p->timesOfDay, i);
  ------------------
  |  | 1787|      0|#define sk_OSSL_DAY_TIME_BAND_value(sk, idx) ((OSSL_DAY_TIME_BAND *)OPENSSL_sk_value(ossl_check_const_OSSL_DAY_TIME_BAND_sk_type(sk), (idx)))
  ------------------
  354|      0|            if (BIO_printf(out, "%*s", indent + 8, "") <= 0)
  ------------------
  |  Branch (354:17): [True: 0, False: 0]
  ------------------
  355|      0|                return 0;
  356|      0|            if (!i2r_OSSL_DAY_TIME_BAND(method, band, out, indent + 8))
  ------------------
  |  Branch (356:17): [True: 0, False: 0]
  ------------------
  357|      0|                return 0;
  358|      0|            if (!BIO_puts(out, "\n"))
  ------------------
  |  Branch (358:17): [True: 0, False: 0]
  ------------------
  359|      0|                return 0;
  360|      0|        }
  361|      0|    }
  362|    505|    if (p->days) {
  ------------------
  |  Branch (362:9): [True: 0, False: 505]
  ------------------
  363|      0|        if (p->days->type == OSSL_TIME_SPEC_DAY_TYPE_INT) {
  ------------------
  |  | 1638|      0|# define OSSL_TIME_SPEC_DAY_TYPE_INT 0
  ------------------
  |  Branch (363:13): [True: 0, False: 0]
  ------------------
  364|      0|            if (p->weeks != NULL) {
  ------------------
  |  Branch (364:17): [True: 0, False: 0]
  ------------------
  365|      0|                if (BIO_printf(out, "%*sDays of the week: ", indent + 4, "") <= 0)
  ------------------
  |  Branch (365:21): [True: 0, False: 0]
  ------------------
  366|      0|                    return 0;
  367|      0|            } else if (p->months != NULL) {
  ------------------
  |  Branch (367:24): [True: 0, False: 0]
  ------------------
  368|      0|                if (BIO_printf(out, "%*sDays of the month: ", indent + 4, "") <= 0)
  ------------------
  |  Branch (368:21): [True: 0, False: 0]
  ------------------
  369|      0|                    return 0;
  370|      0|            } else if (p->years != NULL) {
  ------------------
  |  Branch (370:24): [True: 0, False: 0]
  ------------------
  371|      0|                if (BIO_printf(out, "%*sDays of the year: ", indent + 4, "") <= 0)
  ------------------
  |  Branch (371:21): [True: 0, False: 0]
  ------------------
  372|      0|                    return 0;
  373|      0|            }
  374|      0|        } else {
  375|      0|            if (BIO_printf(out, "%*sDays: ", indent + 4, "") <= 0)
  ------------------
  |  Branch (375:17): [True: 0, False: 0]
  ------------------
  376|      0|                return 0;
  377|      0|        }
  378|       |
  379|      0|        switch (p->days->type) {
  380|      0|        case (OSSL_TIME_SPEC_DAY_TYPE_INT):
  ------------------
  |  | 1638|      0|# define OSSL_TIME_SPEC_DAY_TYPE_INT 0
  ------------------
  |  Branch (380:9): [True: 0, False: 0]
  ------------------
  381|      0|            for (i = 0; i < sk_ASN1_INTEGER_num(p->days->choice.intDay); i++) {
  ------------------
  |  |  702|      0|#define sk_ASN1_INTEGER_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_INTEGER_sk_type(sk))
  ------------------
  |  Branch (381:25): [True: 0, False: 0]
  ------------------
  382|      0|                big_val = sk_ASN1_INTEGER_value(p->days->choice.intDay, i);
  ------------------
  |  |  703|      0|#define sk_ASN1_INTEGER_value(sk, idx) ((ASN1_INTEGER *)OPENSSL_sk_value(ossl_check_const_ASN1_INTEGER_sk_type(sk), (idx)))
  ------------------
  383|      0|                if (!ASN1_INTEGER_get_int64(&small_val, big_val))
  ------------------
  |  Branch (383:21): [True: 0, False: 0]
  ------------------
  384|      0|                    return 0;
  385|      0|                if (i > 0 && !BIO_puts(out, ", "))
  ------------------
  |  Branch (385:21): [True: 0, False: 0]
  |  Branch (385:30): [True: 0, False: 0]
  ------------------
  386|      0|                    return 0;
  387|       |                /* If weeks is defined, then print day of week by name. */
  388|      0|                if (p->weeks != NULL) {
  ------------------
  |  Branch (388:21): [True: 0, False: 0]
  ------------------
  389|      0|                    if (!print_int_day_of_week(out, small_val))
  ------------------
  |  Branch (389:25): [True: 0, False: 0]
  ------------------
  390|      0|                        return 0;
  391|      0|                } else if (BIO_printf(out, "%lld", (long long int)small_val) <= 0) {
  ------------------
  |  Branch (391:28): [True: 0, False: 0]
  ------------------
  392|      0|                    return 0;
  393|      0|                }
  394|      0|            }
  395|      0|            break;
  396|      0|        case (OSSL_TIME_SPEC_DAY_TYPE_BIT):
  ------------------
  |  | 1639|      0|# define OSSL_TIME_SPEC_DAY_TYPE_BIT 1
  ------------------
  |  Branch (396:9): [True: 0, False: 0]
  ------------------
  397|      0|            if (!print_day_of_week(out, p->days->choice.bitDay))
  ------------------
  |  Branch (397:17): [True: 0, False: 0]
  ------------------
  398|      0|                return 0;
  399|      0|            break;
  400|      0|        case (OSSL_TIME_SPEC_DAY_TYPE_DAY_OF):
  ------------------
  |  | 1640|      0|# define OSSL_TIME_SPEC_DAY_TYPE_DAY_OF 2
  ------------------
  |  Branch (400:9): [True: 0, False: 0]
  ------------------
  401|      0|            switch (p->days->choice.dayOf->type) {
  402|      0|            case (OSSL_TIME_SPEC_X_DAY_OF_FIRST):
  ------------------
  |  | 1621|      0|# define OSSL_TIME_SPEC_X_DAY_OF_FIRST 0
  ------------------
  |  Branch (402:13): [True: 0, False: 0]
  ------------------
  403|      0|                if (!BIO_puts(out, "FIRST "))
  ------------------
  |  Branch (403:21): [True: 0, False: 0]
  ------------------
  404|      0|                    return 0;
  405|      0|                nd = p->days->choice.dayOf->choice.first;
  406|      0|                break;
  407|      0|            case (OSSL_TIME_SPEC_X_DAY_OF_SECOND):
  ------------------
  |  | 1622|      0|# define OSSL_TIME_SPEC_X_DAY_OF_SECOND 1
  ------------------
  |  Branch (407:13): [True: 0, False: 0]
  ------------------
  408|      0|                if (!BIO_puts(out, "SECOND "))
  ------------------
  |  Branch (408:21): [True: 0, False: 0]
  ------------------
  409|      0|                    return 0;
  410|      0|                nd = p->days->choice.dayOf->choice.second;
  411|      0|                break;
  412|      0|            case (OSSL_TIME_SPEC_X_DAY_OF_THIRD):
  ------------------
  |  | 1623|      0|# define OSSL_TIME_SPEC_X_DAY_OF_THIRD 2
  ------------------
  |  Branch (412:13): [True: 0, False: 0]
  ------------------
  413|      0|                if (!BIO_puts(out, "THIRD "))
  ------------------
  |  Branch (413:21): [True: 0, False: 0]
  ------------------
  414|      0|                    return 0;
  415|      0|                nd = p->days->choice.dayOf->choice.third;
  416|      0|                break;
  417|      0|            case (OSSL_TIME_SPEC_X_DAY_OF_FOURTH):
  ------------------
  |  | 1624|      0|# define OSSL_TIME_SPEC_X_DAY_OF_FOURTH 3
  ------------------
  |  Branch (417:13): [True: 0, False: 0]
  ------------------
  418|      0|                if (!BIO_puts(out, "FOURTH "))
  ------------------
  |  Branch (418:21): [True: 0, False: 0]
  ------------------
  419|      0|                    return 0;
  420|      0|                nd = p->days->choice.dayOf->choice.fourth;
  421|      0|                break;
  422|      0|            case (OSSL_TIME_SPEC_X_DAY_OF_FIFTH):
  ------------------
  |  | 1625|      0|# define OSSL_TIME_SPEC_X_DAY_OF_FIFTH 4
  ------------------
  |  Branch (422:13): [True: 0, False: 0]
  ------------------
  423|      0|                if (!BIO_puts(out, "FIFTH "))
  ------------------
  |  Branch (423:21): [True: 0, False: 0]
  ------------------
  424|      0|                    return 0;
  425|      0|                nd = p->days->choice.dayOf->choice.fifth;
  426|      0|                break;
  427|      0|            default:
  ------------------
  |  Branch (427:13): [True: 0, False: 0]
  ------------------
  428|      0|                return 0;
  429|      0|            }
  430|      0|            switch (nd->type) {
  431|      0|            case (OSSL_NAMED_DAY_TYPE_INT):
  ------------------
  |  | 1596|      0|# define OSSL_NAMED_DAY_TYPE_INT 0
  ------------------
  |  Branch (431:13): [True: 0, False: 0]
  ------------------
  432|      0|                if (!ASN1_INTEGER_get_int64(&small_val, nd->choice.intNamedDays))
  ------------------
  |  Branch (432:21): [True: 0, False: 0]
  ------------------
  433|      0|                    return 0;
  434|      0|                if (!print_int_named_day(out, small_val))
  ------------------
  |  Branch (434:21): [True: 0, False: 0]
  ------------------
  435|      0|                    return 0;
  436|      0|                break;
  437|      0|            case (OSSL_NAMED_DAY_TYPE_BIT):
  ------------------
  |  | 1597|      0|# define OSSL_NAMED_DAY_TYPE_BIT 1
  ------------------
  |  Branch (437:13): [True: 0, False: 0]
  ------------------
  438|      0|                if (!print_bit_named_day(out, nd->choice.bitNamedDays))
  ------------------
  |  Branch (438:21): [True: 0, False: 0]
  ------------------
  439|      0|                    return 0;
  440|      0|                break;
  441|      0|            default:
  ------------------
  |  Branch (441:13): [True: 0, False: 0]
  ------------------
  442|      0|                return 0;
  443|      0|            }
  444|      0|            break;
  445|      0|        default:
  ------------------
  |  Branch (445:9): [True: 0, False: 0]
  ------------------
  446|      0|            return 0;
  447|      0|        }
  448|      0|        if (!BIO_puts(out, "\n"))
  ------------------
  |  Branch (448:13): [True: 0, False: 0]
  ------------------
  449|      0|            return 0;
  450|      0|    }
  451|    505|    if (p->weeks) {
  ------------------
  |  Branch (451:9): [True: 0, False: 505]
  ------------------
  452|      0|        if (p->weeks->type == OSSL_TIME_SPEC_WEEKS_TYPE_INT) {
  ------------------
  |  | 1666|      0|# define OSSL_TIME_SPEC_WEEKS_TYPE_INT 1
  ------------------
  |  Branch (452:13): [True: 0, False: 0]
  ------------------
  453|      0|            if (p->months != NULL) {
  ------------------
  |  Branch (453:17): [True: 0, False: 0]
  ------------------
  454|      0|                if (BIO_printf(out, "%*sWeeks of the month: ", indent + 4, "") <= 0)
  ------------------
  |  Branch (454:21): [True: 0, False: 0]
  ------------------
  455|      0|                    return 0;
  456|      0|            } else if (p->years != NULL) {
  ------------------
  |  Branch (456:24): [True: 0, False: 0]
  ------------------
  457|      0|                if (BIO_printf(out, "%*sWeeks of the year: ", indent + 4, "") <= 0)
  ------------------
  |  Branch (457:21): [True: 0, False: 0]
  ------------------
  458|      0|                    return 0;
  459|      0|            }
  460|      0|        } else {
  461|      0|            if (BIO_printf(out, "%*sWeeks: ", indent + 4, "") <= 0)
  ------------------
  |  Branch (461:17): [True: 0, False: 0]
  ------------------
  462|      0|                return 0;
  463|      0|        }
  464|       |
  465|      0|        switch (p->weeks->type) {
  466|      0|        case (OSSL_TIME_SPEC_WEEKS_TYPE_ALL):
  ------------------
  |  | 1665|      0|# define OSSL_TIME_SPEC_WEEKS_TYPE_ALL 0
  ------------------
  |  Branch (466:9): [True: 0, False: 0]
  ------------------
  467|      0|            if (!BIO_puts(out, "ALL"))
  ------------------
  |  Branch (467:17): [True: 0, False: 0]
  ------------------
  468|      0|                return 0;
  469|      0|            break;
  470|      0|        case (OSSL_TIME_SPEC_WEEKS_TYPE_INT):
  ------------------
  |  | 1666|      0|# define OSSL_TIME_SPEC_WEEKS_TYPE_INT 1
  ------------------
  |  Branch (470:9): [True: 0, False: 0]
  ------------------
  471|      0|            for (i = 0; i < sk_ASN1_INTEGER_num(p->weeks->choice.intWeek); i++) {
  ------------------
  |  |  702|      0|#define sk_ASN1_INTEGER_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_INTEGER_sk_type(sk))
  ------------------
  |  Branch (471:25): [True: 0, False: 0]
  ------------------
  472|      0|                big_val = sk_ASN1_INTEGER_value(p->weeks->choice.intWeek, i);
  ------------------
  |  |  703|      0|#define sk_ASN1_INTEGER_value(sk, idx) ((ASN1_INTEGER *)OPENSSL_sk_value(ossl_check_const_ASN1_INTEGER_sk_type(sk), (idx)))
  ------------------
  473|      0|                if (!ASN1_INTEGER_get_int64(&small_val, big_val))
  ------------------
  |  Branch (473:21): [True: 0, False: 0]
  ------------------
  474|      0|                    return 0;
  475|      0|                if (i > 0 && !BIO_puts(out, ", "))
  ------------------
  |  Branch (475:21): [True: 0, False: 0]
  |  Branch (475:30): [True: 0, False: 0]
  ------------------
  476|      0|                    return 0;
  477|      0|                if (!BIO_printf(out, "%lld", (long long int)small_val))
  ------------------
  |  Branch (477:21): [True: 0, False: 0]
  ------------------
  478|      0|                    return 0;
  479|      0|            }
  480|      0|            break;
  481|      0|        case (OSSL_TIME_SPEC_WEEKS_TYPE_BIT):
  ------------------
  |  | 1667|      0|# define OSSL_TIME_SPEC_WEEKS_TYPE_BIT 2
  ------------------
  |  Branch (481:9): [True: 0, False: 0]
  ------------------
  482|      0|            if (!print_bit_week(out, p->weeks->choice.bitWeek))
  ------------------
  |  Branch (482:17): [True: 0, False: 0]
  ------------------
  483|      0|                return 0;
  484|      0|            break;
  485|      0|        default:
  ------------------
  |  Branch (485:9): [True: 0, False: 0]
  ------------------
  486|      0|            return 0;
  487|      0|        }
  488|      0|        if (!BIO_puts(out, "\n"))
  ------------------
  |  Branch (488:13): [True: 0, False: 0]
  ------------------
  489|      0|            return 0;
  490|      0|    }
  491|    505|    if (p->months) {
  ------------------
  |  Branch (491:9): [True: 0, False: 505]
  ------------------
  492|      0|        if (BIO_printf(out, "%*sMonths: ", indent + 4, "") <= 0)
  ------------------
  |  Branch (492:13): [True: 0, False: 0]
  ------------------
  493|      0|            return 0;
  494|      0|        switch (p->months->type) {
  495|      0|        case (OSSL_TIME_SPEC_MONTH_TYPE_ALL):
  ------------------
  |  | 1683|      0|# define OSSL_TIME_SPEC_MONTH_TYPE_ALL 0
  ------------------
  |  Branch (495:9): [True: 0, False: 0]
  ------------------
  496|      0|            if (!BIO_puts(out, "ALL"))
  ------------------
  |  Branch (496:17): [True: 0, False: 0]
  ------------------
  497|      0|                return 0;
  498|      0|            break;
  499|      0|        case (OSSL_TIME_SPEC_MONTH_TYPE_INT):
  ------------------
  |  | 1684|      0|# define OSSL_TIME_SPEC_MONTH_TYPE_INT 1
  ------------------
  |  Branch (499:9): [True: 0, False: 0]
  ------------------
  500|      0|            for (i = 0; i < sk_ASN1_INTEGER_num(p->months->choice.intMonth); i++) {
  ------------------
  |  |  702|      0|#define sk_ASN1_INTEGER_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_INTEGER_sk_type(sk))
  ------------------
  |  Branch (500:25): [True: 0, False: 0]
  ------------------
  501|      0|                big_val = sk_ASN1_INTEGER_value(p->months->choice.intMonth, i);
  ------------------
  |  |  703|      0|#define sk_ASN1_INTEGER_value(sk, idx) ((ASN1_INTEGER *)OPENSSL_sk_value(ossl_check_const_ASN1_INTEGER_sk_type(sk), (idx)))
  ------------------
  502|      0|                if (!ASN1_INTEGER_get_int64(&small_val, big_val))
  ------------------
  |  Branch (502:21): [True: 0, False: 0]
  ------------------
  503|      0|                    return 0;
  504|      0|                if (i > 0 && !BIO_puts(out, ", "))
  ------------------
  |  Branch (504:21): [True: 0, False: 0]
  |  Branch (504:30): [True: 0, False: 0]
  ------------------
  505|      0|                    return 0;
  506|      0|                if (!print_int_month(out, small_val))
  ------------------
  |  Branch (506:21): [True: 0, False: 0]
  ------------------
  507|      0|                    return 0;
  508|      0|            }
  509|      0|            break;
  510|      0|        case (OSSL_TIME_SPEC_MONTH_TYPE_BIT):
  ------------------
  |  | 1685|      0|# define OSSL_TIME_SPEC_MONTH_TYPE_BIT 2
  ------------------
  |  Branch (510:9): [True: 0, False: 0]
  ------------------
  511|      0|            if (!print_bit_month(out, p->months->choice.bitMonth))
  ------------------
  |  Branch (511:17): [True: 0, False: 0]
  ------------------
  512|      0|                return 0;
  513|      0|            break;
  514|      0|        default:
  ------------------
  |  Branch (514:9): [True: 0, False: 0]
  ------------------
  515|      0|            return 0;
  516|      0|        }
  517|      0|        if (!BIO_puts(out, "\n"))
  ------------------
  |  Branch (517:13): [True: 0, False: 0]
  ------------------
  518|      0|            return 0;
  519|      0|    }
  520|    505|    if (p->years) {
  ------------------
  |  Branch (520:9): [True: 0, False: 505]
  ------------------
  521|      0|        if (BIO_printf(out, "%*sYears: ", indent + 4, "") <= 0)
  ------------------
  |  Branch (521:13): [True: 0, False: 0]
  ------------------
  522|      0|            return 0;
  523|      0|        for (i = 0; i < sk_ASN1_INTEGER_num(p->years); i++) {
  ------------------
  |  |  702|      0|#define sk_ASN1_INTEGER_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_INTEGER_sk_type(sk))
  ------------------
  |  Branch (523:21): [True: 0, False: 0]
  ------------------
  524|      0|            big_val = sk_ASN1_INTEGER_value(p->years, i);
  ------------------
  |  |  703|      0|#define sk_ASN1_INTEGER_value(sk, idx) ((ASN1_INTEGER *)OPENSSL_sk_value(ossl_check_const_ASN1_INTEGER_sk_type(sk), (idx)))
  ------------------
  525|      0|            if (!ASN1_INTEGER_get_int64(&small_val, big_val))
  ------------------
  |  Branch (525:17): [True: 0, False: 0]
  ------------------
  526|      0|                return 0;
  527|      0|            if (i > 0 && !BIO_puts(out, ", "))
  ------------------
  |  Branch (527:17): [True: 0, False: 0]
  |  Branch (527:26): [True: 0, False: 0]
  ------------------
  528|      0|                return 0;
  529|      0|            if (BIO_printf(out, "%04lld", (long long int)small_val) <= 0)
  ------------------
  |  Branch (529:17): [True: 0, False: 0]
  ------------------
  530|      0|                return 0;
  531|      0|        }
  532|      0|    }
  533|    505|    return 1;
  534|    505|}

v3_usernotice.c:i2r_USER_NOTICE_SYNTAX:
   67|     14|{
   68|     14|    int i;
   69|     14|    USERNOTICE *unotice;
   70|       |
   71|     14|    if (BIO_printf(out, "%*sUser Notices:\n", indent, "") <= 0)
  ------------------
  |  Branch (71:9): [True: 0, False: 14]
  ------------------
   72|      0|        return 0;
   73|       |
   74|     20|    for (i = 0; i < sk_USERNOTICE_num(uns); i++) {
  ------------------
  |  | 1473|     20|#define sk_USERNOTICE_num(sk) OPENSSL_sk_num(ossl_check_const_USERNOTICE_sk_type(sk))
  ------------------
  |  Branch (74:17): [True: 6, False: 14]
  ------------------
   75|      6|        unotice = sk_USERNOTICE_value(uns, i);
  ------------------
  |  | 1474|      6|#define sk_USERNOTICE_value(sk, idx) ((USERNOTICE *)OPENSSL_sk_value(ossl_check_const_USERNOTICE_sk_type(sk), (idx)))
  ------------------
   76|      6|        if (!print_notice(out, unotice, indent + 4))
  ------------------
  |  Branch (76:13): [True: 0, False: 6]
  ------------------
   77|      0|            return 0;
   78|      6|        if (BIO_puts(out, "\n\n") <= 0)
  ------------------
  |  Branch (78:13): [True: 0, False: 6]
  ------------------
   79|      0|            return 0;
   80|      6|    }
   81|     14|    return 1;
   82|     14|}
v3_usernotice.c:print_notice:
   21|      6|{
   22|      6|    int i;
   23|      6|    ASN1_INTEGER *num;
   24|      6|    char *tmp;
   25|       |
   26|      6|    if (notice->noticeref) {
  ------------------
  |  Branch (26:9): [True: 0, False: 6]
  ------------------
   27|      0|        NOTICEREF *ref;
   28|      0|        ref = notice->noticeref;
   29|      0|        if (BIO_printf(out, "%*sOrganization: %.*s\n", indent, "",
  ------------------
  |  Branch (29:13): [True: 0, False: 0]
  ------------------
   30|      0|                   ref->organization->length,
   31|      0|                   ref->organization->data) <= 0)
   32|      0|            return 0;
   33|      0|        if (BIO_printf(out, "%*sNumber%s: ", indent, "",
  ------------------
  |  Branch (33:13): [True: 0, False: 0]
  ------------------
   34|      0|                   sk_ASN1_INTEGER_num(ref->noticenos) > 1 ? "s" : "") <= 0)
  ------------------
  |  |  702|      0|#define sk_ASN1_INTEGER_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_INTEGER_sk_type(sk))
  ------------------
  |  Branch (34:20): [True: 0, False: 0]
  ------------------
   35|      0|            return 0;
   36|      0|        for (i = 0; i < sk_ASN1_INTEGER_num(ref->noticenos); i++) {
  ------------------
  |  |  702|      0|#define sk_ASN1_INTEGER_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_INTEGER_sk_type(sk))
  ------------------
  |  Branch (36:21): [True: 0, False: 0]
  ------------------
   37|      0|            num = sk_ASN1_INTEGER_value(ref->noticenos, i);
  ------------------
  |  |  703|      0|#define sk_ASN1_INTEGER_value(sk, idx) ((ASN1_INTEGER *)OPENSSL_sk_value(ossl_check_const_ASN1_INTEGER_sk_type(sk), (idx)))
  ------------------
   38|      0|            if (i && BIO_puts(out, ", ") <= 0)
  ------------------
  |  Branch (38:17): [True: 0, False: 0]
  |  Branch (38:22): [True: 0, False: 0]
  ------------------
   39|      0|                return 0;
   40|      0|            if (num == NULL && BIO_puts(out, "(null)") <= 0)
  ------------------
  |  Branch (40:17): [True: 0, False: 0]
  |  Branch (40:32): [True: 0, False: 0]
  ------------------
   41|      0|                return 0;
   42|      0|            else {
   43|      0|                tmp = i2s_ASN1_INTEGER(NULL, num);
   44|      0|                if (tmp == NULL)
  ------------------
  |  Branch (44:21): [True: 0, False: 0]
  ------------------
   45|      0|                    return 0;
   46|      0|                if (BIO_puts(out, tmp) <= 0) {
  ------------------
  |  Branch (46:21): [True: 0, False: 0]
  ------------------
   47|      0|                    OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|      0|                    return 0;
   49|      0|                }
   50|      0|                OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   51|      0|            }
   52|      0|        }
   53|      0|        if (notice->exptext && BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (53:13): [True: 0, False: 0]
  |  Branch (53:32): [True: 0, False: 0]
  ------------------
   54|      0|            return 0;
   55|      0|    }
   56|      6|    if (notice->exptext == NULL)
  ------------------
  |  Branch (56:9): [True: 6, False: 0]
  ------------------
   57|      6|        return 1;
   58|       |
   59|      0|    return BIO_printf(out, "%*sExplicit Text: %.*s", indent, "",
   60|      0|                notice->exptext->length,
   61|      0|                notice->exptext->data) >= 0;
   62|      6|}

X509V3_add_value:
   82|  3.00k|{
   83|  3.00k|    return x509v3_add_len_value(name, value,
   84|  3.00k|                                value != NULL ? strlen((const char *)value) : 0,
  ------------------
  |  Branch (84:33): [True: 2.31k, False: 685]
  ------------------
   85|  3.00k|                                extlist);
   86|  3.00k|}
x509v3_add_len_value_uchar:
   98|  2.21k|{
   99|  2.21k|    return x509v3_add_len_value(name, (const char *)value, vallen, extlist);
  100|  2.21k|}
X509V3_conf_free:
  105|  5.07k|{
  106|  5.07k|    if (!conf)
  ------------------
  |  Branch (106:9): [True: 0, False: 5.07k]
  ------------------
  107|      0|        return;
  108|  5.07k|    OPENSSL_free(conf->name);
  ------------------
  |  |  115|  5.07k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  5.07k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  5.07k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  109|  5.07k|    OPENSSL_free(conf->value);
  ------------------
  |  |  115|  5.07k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  5.07k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  5.07k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  110|  5.07k|    OPENSSL_free(conf->section);
  ------------------
  |  |  115|  5.07k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  5.07k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  5.07k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  111|  5.07k|    OPENSSL_free(conf);
  ------------------
  |  |  115|  5.07k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  5.07k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  5.07k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|  5.07k|}
X509V3_add_value_bool:
  116|    280|{
  117|    280|    if (asn1_bool)
  ------------------
  |  Branch (117:9): [True: 10, False: 270]
  ------------------
  118|     10|        return X509V3_add_value(name, "TRUE", extlist);
  119|    270|    return X509V3_add_value(name, "FALSE", extlist);
  120|    280|}
i2s_ASN1_ENUMERATED:
  167|    376|{
  168|    376|    BIGNUM *bntmp = NULL;
  169|    376|    char *strtmp = NULL;
  170|       |
  171|    376|    if (!a)
  ------------------
  |  Branch (171:9): [True: 0, False: 376]
  ------------------
  172|      0|        return NULL;
  173|    376|    if ((bntmp = ASN1_ENUMERATED_to_BN(a, NULL)) == NULL)
  ------------------
  |  Branch (173:9): [True: 0, False: 376]
  ------------------
  174|    376|        ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  175|    376|    else if ((strtmp = bignum_to_string(bntmp)) == NULL)
  ------------------
  |  Branch (175:14): [True: 0, False: 376]
  ------------------
  176|    376|        ERR_raise(ERR_LIB_X509V3, ERR_R_X509V3_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  177|    376|    BN_free(bntmp);
  178|    376|    return strtmp;
  179|    376|}
i2s_ASN1_INTEGER:
  182|  16.3k|{
  183|  16.3k|    BIGNUM *bntmp = NULL;
  184|  16.3k|    char *strtmp = NULL;
  185|       |
  186|  16.3k|    if (!a)
  ------------------
  |  Branch (186:9): [True: 0, False: 16.3k]
  ------------------
  187|      0|        return NULL;
  188|  16.3k|    if ((bntmp = ASN1_INTEGER_to_BN(a, NULL)) == NULL)
  ------------------
  |  Branch (188:9): [True: 60, False: 16.2k]
  ------------------
  189|  16.3k|        ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|     60|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     60|    (ERR_new(),                                                 \
  |  |  |  |  404|     60|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     60|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     60|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     60|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     60|     ERR_set_error)
  |  |  ------------------
  ------------------
  190|  16.2k|    else if ((strtmp = bignum_to_string(bntmp)) == NULL)
  ------------------
  |  Branch (190:14): [True: 0, False: 16.2k]
  ------------------
  191|  16.2k|        ERR_raise(ERR_LIB_X509V3, ERR_R_X509V3_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  192|  16.3k|    BN_free(bntmp);
  193|  16.3k|    return strtmp;
  194|  16.3k|}
X509V3_add_value_int:
  253|  1.16k|{
  254|  1.16k|    char *strtmp;
  255|  1.16k|    int ret;
  256|       |
  257|  1.16k|    if (!aint)
  ------------------
  |  Branch (257:9): [True: 1.03k, False: 129]
  ------------------
  258|  1.03k|        return 1;
  259|    129|    if ((strtmp = i2s_ASN1_INTEGER(NULL, aint)) == NULL)
  ------------------
  |  Branch (259:9): [True: 0, False: 129]
  ------------------
  260|      0|        return 0;
  261|    129|    ret = X509V3_add_value(name, strtmp, extlist);
  262|    129|    OPENSSL_free(strtmp);
  ------------------
  |  |  115|    129|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    129|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    129|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  263|    129|    return ret;
  264|    129|}
ossl_ipaddr_to_asc:
 1067|  1.72k|{
 1068|       |    /*
 1069|       |     * 40 is enough space for the longest IPv6 address + nul terminator byte
 1070|       |     * XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX\0
 1071|       |     */
 1072|  1.72k|    char buf[40], *out;
 1073|  1.72k|    int i = 0, remain = 0, bytes = 0;
 1074|       |
 1075|  1.72k|    switch (len) {
 1076|    297|    case 4: /* IPv4 */
  ------------------
  |  Branch (1076:5): [True: 297, False: 1.42k]
  ------------------
 1077|    297|        BIO_snprintf(buf, sizeof(buf), "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
 1078|    297|        break;
 1079|    143|    case 16: /* IPv6 */
  ------------------
  |  Branch (1079:5): [True: 143, False: 1.57k]
  ------------------
 1080|    143|        for (out = buf, i = 8, remain = sizeof(buf);
 1081|  1.28k|             i-- > 0 && bytes >= 0;
  ------------------
  |  Branch (1081:14): [True: 1.14k, False: 143]
  |  Branch (1081:25): [True: 1.14k, False: 0]
  ------------------
 1082|  1.14k|             remain -= bytes, out += bytes) {
 1083|  1.14k|            const char *template = (i > 0 ? "%X:" : "%X");
  ------------------
  |  Branch (1083:37): [True: 1.00k, False: 143]
  ------------------
 1084|       |
 1085|  1.14k|            bytes = BIO_snprintf(out, remain, template, p[0] << 8 | p[1]);
 1086|  1.14k|            p += 2;
 1087|  1.14k|        }
 1088|    143|        break;
 1089|  1.28k|    default:
  ------------------
  |  Branch (1089:5): [True: 1.28k, False: 440]
  ------------------
 1090|  1.28k|        BIO_snprintf(buf, sizeof(buf), "<invalid length=%d>", len);
 1091|  1.28k|        break;
 1092|  1.72k|    }
 1093|  1.72k|    return OPENSSL_strdup(buf);
  ------------------
  |  |  119|  1.72k|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.72k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.72k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1094|  1.72k|}
OSSL_GENERAL_NAMES_print:
 1426|  1.10k|{
 1427|  1.10k|    int i;
 1428|       |
 1429|  2.26k|    for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) {
  ------------------
  |  |  238|  2.26k|#define sk_GENERAL_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_NAME_sk_type(sk))
  ------------------
  |  Branch (1429:17): [True: 1.16k, False: 1.10k]
  ------------------
 1430|  1.16k|        if (i > 0)
  ------------------
  |  Branch (1430:13): [True: 334, False: 832]
  ------------------
 1431|    334|            BIO_puts(out, "\n");
 1432|  1.16k|        BIO_printf(out, "%*s", indent + 2, "");
 1433|  1.16k|        GENERAL_NAME_print(out, sk_GENERAL_NAME_value(gens, i));
  ------------------
  |  |  239|  1.16k|#define sk_GENERAL_NAME_value(sk, idx) ((GENERAL_NAME *)OPENSSL_sk_value(ossl_check_const_GENERAL_NAME_sk_type(sk), (idx)))
  ------------------
 1434|  1.16k|    }
 1435|  1.10k|    return 1;
 1436|  1.10k|}
v3_utl.c:x509v3_add_len_value:
   42|  5.21k|{
   43|  5.21k|    CONF_VALUE *vtmp = NULL;
   44|  5.21k|    char *tname = NULL, *tvalue = NULL;
   45|  5.21k|    int sk_allocated = (*extlist == NULL);
   46|       |
   47|  5.21k|    if (name != NULL && (tname = OPENSSL_strdup(name)) == NULL)
  ------------------
  |  |  119|  4.76k|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.76k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.76k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (47:9): [True: 4.76k, False: 450]
  |  Branch (47:25): [True: 0, False: 4.76k]
  ------------------
   48|      0|        goto err;
   49|  5.21k|    if (value != NULL) {
  ------------------
  |  Branch (49:9): [True: 4.52k, False: 685]
  ------------------
   50|       |        /* We don't allow embedded NUL characters */
   51|  4.52k|        if (memchr(value, 0, vallen) != NULL)
  ------------------
  |  Branch (51:13): [True: 134, False: 4.39k]
  ------------------
   52|    134|            goto err;
   53|  4.39k|        tvalue = OPENSSL_strndup(value, vallen);
  ------------------
  |  |  121|  4.39k|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.39k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.39k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   54|  4.39k|        if (tvalue == NULL)
  ------------------
  |  Branch (54:13): [True: 0, False: 4.39k]
  ------------------
   55|      0|            goto err;
   56|  4.39k|    }
   57|  5.07k|    if ((vtmp = OPENSSL_malloc(sizeof(*vtmp))) == NULL)
  ------------------
  |  |  102|  5.07k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  5.07k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  5.07k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:9): [True: 0, False: 5.07k]
  ------------------
   58|      0|        goto err;
   59|  5.07k|    if (sk_allocated && (*extlist = sk_CONF_VALUE_new_null()) == NULL) {
  ------------------
  |  |   48|  2.87k|#define sk_CONF_VALUE_new_null() ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (59:9): [True: 2.87k, False: 2.20k]
  |  Branch (59:25): [True: 0, False: 2.87k]
  ------------------
   60|      0|        ERR_raise(ERR_LIB_X509V3, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   61|      0|        goto err;
   62|      0|    }
   63|  5.07k|    vtmp->section = NULL;
   64|  5.07k|    vtmp->name = tname;
   65|  5.07k|    vtmp->value = tvalue;
   66|  5.07k|    if (!sk_CONF_VALUE_push(*extlist, vtmp))
  ------------------
  |  |   55|  5.07k|#define sk_CONF_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
  ------------------
  |  Branch (66:9): [True: 0, False: 5.07k]
  ------------------
   67|      0|        goto err;
   68|  5.07k|    return 1;
   69|    134| err:
   70|    134|    if (sk_allocated) {
  ------------------
  |  Branch (70:9): [True: 54, False: 80]
  ------------------
   71|     54|        sk_CONF_VALUE_free(*extlist);
  ------------------
  |  |   51|     54|#define sk_CONF_VALUE_free(sk) OPENSSL_sk_free(ossl_check_CONF_VALUE_sk_type(sk))
  ------------------
   72|     54|        *extlist = NULL;
   73|     54|    }
   74|    134|    OPENSSL_free(vtmp);
  ------------------
  |  |  115|    134|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    134|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    134|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   75|    134|    OPENSSL_free(tname);
  ------------------
  |  |  115|    134|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    134|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    134|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|    134|    OPENSSL_free(tvalue);
  ------------------
  |  |  115|    134|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    134|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    134|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|    134|    return 0;
   78|  5.07k|}
v3_utl.c:bignum_to_string:
  131|  16.6k|{
  132|  16.6k|    char *tmp, *ret;
  133|  16.6k|    size_t len;
  134|       |
  135|       |    /*
  136|       |     * Display large numbers in hex and small numbers in decimal. Converting to
  137|       |     * decimal takes quadratic time and is no more useful than hex for large
  138|       |     * numbers.
  139|       |     */
  140|  16.6k|    if (BN_num_bits(bn) < 128)
  ------------------
  |  Branch (140:9): [True: 15.2k, False: 1.35k]
  ------------------
  141|  15.2k|        return BN_bn2dec(bn);
  142|       |
  143|  1.35k|    tmp = BN_bn2hex(bn);
  144|  1.35k|    if (tmp == NULL)
  ------------------
  |  Branch (144:9): [True: 0, False: 1.35k]
  ------------------
  145|      0|        return NULL;
  146|       |
  147|  1.35k|    len = strlen(tmp) + 3;
  148|  1.35k|    ret = OPENSSL_malloc(len);
  ------------------
  |  |  102|  1.35k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.35k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.35k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  149|  1.35k|    if (ret == NULL) {
  ------------------
  |  Branch (149:9): [True: 0, False: 1.35k]
  ------------------
  150|      0|        OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  151|      0|        return NULL;
  152|      0|    }
  153|       |
  154|       |    /* Prepend "0x", but place it after the "-" if negative. */
  155|  1.35k|    if (tmp[0] == '-') {
  ------------------
  |  Branch (155:9): [True: 475, False: 879]
  ------------------
  156|    475|        OPENSSL_strlcpy(ret, "-0x", len);
  157|    475|        OPENSSL_strlcat(ret, tmp + 1, len);
  158|    879|    } else {
  159|    879|        OPENSSL_strlcpy(ret, "0x", len);
  160|    879|        OPENSSL_strlcat(ret, tmp, len);
  161|    879|    }
  162|  1.35k|    OPENSSL_free(tmp);
  ------------------
  |  |  115|  1.35k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.35k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.35k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|  1.35k|    return ret;
  164|  1.35k|}

ossl_err_load_X509V3_strings:
  146|      2|{
  147|      2|#ifndef OPENSSL_NO_ERR
  148|      2|    if (ERR_reason_error_string(X509V3_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (148:9): [True: 2, False: 0]
  ------------------
  149|      2|        ERR_load_strings_const(X509V3_str_reasons);
  150|      2|#endif
  151|      2|    return 1;
  152|      2|}

X509_get_default_cert_area:
   79|      2|{
   80|       |#if defined (_WIN32)
   81|       |    RUN_ONCE(&openssldir_setup_init, do_openssldir_setup);
   82|       |    return x509_cert_areaptr;
   83|       |#else
   84|      2|    return X509_CERT_AREA;
  ------------------
  |  |   84|      2|#  define X509_CERT_AREA          OPENSSLDIR
  ------------------
   85|      2|#endif
   86|      2|}

ossl_err_load_X509_strings:
   92|      2|{
   93|      2|#ifndef OPENSSL_NO_ERR
   94|      2|    if (ERR_reason_error_string(X509_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (94:9): [True: 2, False: 0]
  ------------------
   95|      2|        ERR_load_strings_const(X509_str_reasons);
   96|      2|#endif
   97|      2|    return 1;
   98|      2|}

X509_CRL_get_ext_d2i:
   51|  26.3k|{
   52|  26.3k|    return X509V3_get_d2i(x->crl.extensions, nid, crit, idx);
   53|  26.3k|}
X509_REVOKED_get_ext_d2i:
  151|  40.3k|{
  152|  40.3k|    return X509V3_get_d2i(x->extensions, nid, crit, idx);
  153|  40.3k|}

X509_NAME_oneline:
   26|  2.86k|{
   27|  2.86k|    const X509_NAME_ENTRY *ne;
   28|  2.86k|    int i;
   29|  2.86k|    int n, lold, l, l1, l2, num, j, type;
   30|  2.86k|    int prev_set = -1;
   31|  2.86k|    const char *s;
   32|  2.86k|    char *p;
   33|  2.86k|    unsigned char *q;
   34|  2.86k|    BUF_MEM *b = NULL;
   35|  2.86k|    int gs_doit[4];
   36|  2.86k|    char tmp_buf[80];
   37|       |#ifdef CHARSET_EBCDIC
   38|       |    unsigned char ebcdic_buf[1024];
   39|       |#endif
   40|       |
   41|  2.86k|    if (buf == NULL) {
  ------------------
  |  Branch (41:9): [True: 2.79k, False: 64]
  ------------------
   42|  2.79k|        if ((b = BUF_MEM_new()) == NULL)
  ------------------
  |  Branch (42:13): [True: 0, False: 2.79k]
  ------------------
   43|      0|            goto buferr;
   44|  2.79k|        if (!BUF_MEM_grow(b, 200))
  ------------------
  |  Branch (44:13): [True: 0, False: 2.79k]
  ------------------
   45|      0|            goto buferr;
   46|  2.79k|        b->data[0] = '\0';
   47|  2.79k|        len = 200;
   48|  2.79k|    } else if (len == 0) {
  ------------------
  |  Branch (48:16): [True: 0, False: 64]
  ------------------
   49|      0|        return NULL;
   50|      0|    }
   51|  2.86k|    if (a == NULL) {
  ------------------
  |  Branch (51:9): [True: 0, False: 2.86k]
  ------------------
   52|      0|        if (b) {
  ------------------
  |  Branch (52:13): [True: 0, False: 0]
  ------------------
   53|      0|            buf = b->data;
   54|      0|            OPENSSL_free(b);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   55|      0|        }
   56|      0|        strncpy(buf, "NO X509_NAME", len);
   57|      0|        buf[len - 1] = '\0';
   58|      0|        return buf;
   59|      0|    }
   60|       |
   61|  2.86k|    len--;                      /* space for '\0' */
   62|  2.86k|    l = 0;
   63|  10.4k|    for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
  ------------------
  |  |  204|  10.4k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (63:17): [True: 7.56k, False: 2.84k]
  ------------------
   64|  7.56k|        ne = sk_X509_NAME_ENTRY_value(a->entries, i);
  ------------------
  |  |  205|  7.56k|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
   65|  7.56k|        n = OBJ_obj2nid(ne->object);
   66|  7.56k|        if ((n == NID_undef) || ((s = OBJ_nid2sn(n)) == NULL)) {
  ------------------
  |  |   18|  7.56k|#define NID_undef                       0
  ------------------
  |  Branch (66:13): [True: 4.95k, False: 2.60k]
  |  Branch (66:33): [True: 0, False: 2.60k]
  ------------------
   67|  4.95k|            i2t_ASN1_OBJECT(tmp_buf, sizeof(tmp_buf), ne->object);
   68|  4.95k|            s = tmp_buf;
   69|  4.95k|        }
   70|  7.56k|        l1 = strlen(s);
   71|       |
   72|  7.56k|        type = ne->value->type;
   73|  7.56k|        num = ne->value->length;
   74|  7.56k|        if (num > NAME_ONELINE_MAX) {
  ------------------
  |  |   23|  7.56k|#define NAME_ONELINE_MAX    (1024 * 1024)
  ------------------
  |  Branch (74:13): [True: 0, False: 7.56k]
  ------------------
   75|      0|            ERR_raise(ERR_LIB_X509, X509_R_NAME_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   76|      0|            goto end;
   77|      0|        }
   78|  7.56k|        q = ne->value->data;
   79|       |#ifdef CHARSET_EBCDIC
   80|       |        if (type == V_ASN1_GENERALSTRING ||
   81|       |            type == V_ASN1_VISIBLESTRING ||
   82|       |            type == V_ASN1_PRINTABLESTRING ||
   83|       |            type == V_ASN1_TELETEXSTRING ||
   84|       |            type == V_ASN1_IA5STRING) {
   85|       |            if (num > (int)sizeof(ebcdic_buf))
   86|       |                num = sizeof(ebcdic_buf);
   87|       |            ascii2ebcdic(ebcdic_buf, q, num);
   88|       |            q = ebcdic_buf;
   89|       |        }
   90|       |#endif
   91|       |
   92|  7.56k|        if ((type == V_ASN1_GENERALSTRING) && ((num % 4) == 0)) {
  ------------------
  |  |   87|  7.56k|# define V_ASN1_GENERALSTRING            27
  ------------------
  |  Branch (92:13): [True: 0, False: 7.56k]
  |  Branch (92:47): [True: 0, False: 0]
  ------------------
   93|      0|            gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 0;
   94|      0|            for (j = 0; j < num; j++)
  ------------------
  |  Branch (94:25): [True: 0, False: 0]
  ------------------
   95|      0|                if (q[j] != 0)
  ------------------
  |  Branch (95:21): [True: 0, False: 0]
  ------------------
   96|      0|                    gs_doit[j & 3] = 1;
   97|       |
   98|      0|            if (gs_doit[0] | gs_doit[1] | gs_doit[2])
  ------------------
  |  Branch (98:17): [True: 0, False: 0]
  ------------------
   99|      0|                gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1;
  100|      0|            else {
  101|      0|                gs_doit[0] = gs_doit[1] = gs_doit[2] = 0;
  102|      0|                gs_doit[3] = 1;
  103|      0|            }
  104|      0|        } else
  105|  7.56k|            gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1;
  106|       |
  107|   230k|        for (l2 = j = 0; j < num; j++) {
  ------------------
  |  Branch (107:26): [True: 222k, False: 7.56k]
  ------------------
  108|   222k|            if (!gs_doit[j & 3])
  ------------------
  |  Branch (108:17): [True: 0, False: 222k]
  ------------------
  109|      0|                continue;
  110|   222k|            l2++;
  111|   222k|            if (q[j] == '/' || q[j] == '+')
  ------------------
  |  Branch (111:17): [True: 1.12k, False: 221k]
  |  Branch (111:32): [True: 642, False: 220k]
  ------------------
  112|  1.76k|                l2++; /* char needs to be escaped */
  113|   220k|            else if ((ossl_toascii(q[j]) < ossl_toascii(' ')) ||
  ------------------
  |  |   56|   220k|#  define ossl_toascii(c)       (c)
  ------------------
                          else if ((ossl_toascii(q[j]) < ossl_toascii(' ')) ||
  ------------------
  |  |   56|   220k|#  define ossl_toascii(c)       (c)
  ------------------
  |  Branch (113:22): [True: 39.0k, False: 181k]
  ------------------
  114|   220k|                     (ossl_toascii(q[j]) > ossl_toascii('~')))
  ------------------
  |  |   56|   181k|#  define ossl_toascii(c)       (c)
  ------------------
                                   (ossl_toascii(q[j]) > ossl_toascii('~')))
  ------------------
  |  |   56|   181k|#  define ossl_toascii(c)       (c)
  ------------------
  |  Branch (114:22): [True: 164k, False: 16.8k]
  ------------------
  115|   203k|                l2 += 3;
  116|   222k|        }
  117|       |
  118|  7.56k|        lold = l;
  119|  7.56k|        l += 1 + l1 + 1 + l2;
  120|  7.56k|        if (l > NAME_ONELINE_MAX) {
  ------------------
  |  |   23|  7.56k|#define NAME_ONELINE_MAX    (1024 * 1024)
  ------------------
  |  Branch (120:13): [True: 0, False: 7.56k]
  ------------------
  121|      0|            ERR_raise(ERR_LIB_X509, X509_R_NAME_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  122|      0|            goto end;
  123|      0|        }
  124|  7.56k|        if (b != NULL) {
  ------------------
  |  Branch (124:13): [True: 7.52k, False: 39]
  ------------------
  125|  7.52k|            if (!BUF_MEM_grow(b, l + 1))
  ------------------
  |  Branch (125:17): [True: 0, False: 7.52k]
  ------------------
  126|      0|                goto buferr;
  127|  7.52k|            p = &(b->data[lold]);
  128|  7.52k|        } else if (l > len) {
  ------------------
  |  Branch (128:20): [True: 18, False: 21]
  ------------------
  129|     18|            break;
  130|     18|        } else
  131|     21|            p = &(buf[lold]);
  132|  7.54k|        *(p++) = prev_set == ne->set ? '+' : '/';
  ------------------
  |  Branch (132:18): [True: 5.51k, False: 2.02k]
  ------------------
  133|  7.54k|        memcpy(p, s, (unsigned int)l1);
  134|  7.54k|        p += l1;
  135|  7.54k|        *(p++) = '=';
  136|       |
  137|  7.54k|#ifndef CHARSET_EBCDIC          /* q was assigned above already. */
  138|  7.54k|        q = ne->value->data;
  139|  7.54k|#endif
  140|       |
  141|   229k|        for (j = 0; j < num; j++) {
  ------------------
  |  Branch (141:21): [True: 221k, False: 7.54k]
  ------------------
  142|   221k|            if (!gs_doit[j & 3])
  ------------------
  |  Branch (142:17): [True: 0, False: 221k]
  ------------------
  143|      0|                continue;
  144|   221k|#ifndef CHARSET_EBCDIC
  145|   221k|            n = q[j];
  146|   221k|            if ((n < ' ') || (n > '~')) {
  ------------------
  |  Branch (146:17): [True: 38.4k, False: 183k]
  |  Branch (146:30): [True: 164k, False: 18.4k]
  ------------------
  147|   203k|                *(p++) = '\\';
  148|   203k|                *(p++) = 'x';
  149|   203k|                p += ossl_to_hex(p, n);
  150|   203k|            } else {
  151|  18.4k|                if (n == '/' || n == '+')
  ------------------
  |  Branch (151:21): [True: 1.12k, False: 17.3k]
  |  Branch (151:33): [True: 637, False: 16.6k]
  ------------------
  152|  1.76k|                    *(p++) = '\\';
  153|  18.4k|                *(p++) = n;
  154|  18.4k|            }
  155|       |#else
  156|       |            n = os_toascii[q[j]];
  157|       |            if ((n < os_toascii[' ']) || (n > os_toascii['~'])) {
  158|       |                *(p++) = '\\';
  159|       |                *(p++) = 'x';
  160|       |                p += ossl_to_hex(p, n);
  161|       |            } else {
  162|       |                if (n == os_toascii['/'] || n == os_toascii['+'])
  163|       |                    *(p++) = '\\';
  164|       |                *(p++) = q[j];
  165|       |            }
  166|       |#endif
  167|   221k|        }
  168|  7.54k|        *p = '\0';
  169|  7.54k|        prev_set = ne->set;
  170|  7.54k|    }
  171|  2.86k|    if (b != NULL) {
  ------------------
  |  Branch (171:9): [True: 2.79k, False: 64]
  ------------------
  172|  2.79k|        p = b->data;
  173|  2.79k|        OPENSSL_free(b);
  ------------------
  |  |  115|  2.79k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.79k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.79k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  174|  2.79k|    } else
  175|     64|        p = buf;
  176|  2.86k|    if (i == 0)
  ------------------
  |  Branch (176:9): [True: 1.94k, False: 918]
  ------------------
  177|  1.94k|        *p = '\0';
  178|  2.86k|    return p;
  179|      0| buferr:
  180|      0|    ERR_raise(ERR_LIB_X509, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  181|      0| end:
  182|      0|    BUF_MEM_free(b);
  183|      0|    return NULL;
  184|      0|}

X509_verify_cert_error_string:
   22|    409|{
   23|    409|    switch ((int)n) {
   24|    316|    case X509_V_OK:
  ------------------
  |  |  303|    316|# define X509_V_OK                                       0
  ------------------
  |  Branch (24:5): [True: 316, False: 93]
  ------------------
   25|    316|        return "ok";
   26|      0|    case X509_V_ERR_UNSPECIFIED:
  ------------------
  |  |  304|      0|# define X509_V_ERR_UNSPECIFIED                          1
  ------------------
  |  Branch (26:5): [True: 0, False: 409]
  ------------------
   27|      0|        return "unspecified certificate verification error";
   28|      0|    case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT:
  ------------------
  |  |  305|      0|# define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT            2
  ------------------
  |  Branch (28:5): [True: 0, False: 409]
  ------------------
   29|      0|        return "unable to get issuer certificate";
   30|      0|    case X509_V_ERR_UNABLE_TO_GET_CRL:
  ------------------
  |  |  306|      0|# define X509_V_ERR_UNABLE_TO_GET_CRL                    3
  ------------------
  |  Branch (30:5): [True: 0, False: 409]
  ------------------
   31|      0|        return "unable to get certificate CRL";
   32|      1|    case X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE:
  ------------------
  |  |  307|      1|# define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE     4
  ------------------
  |  Branch (32:5): [True: 1, False: 408]
  ------------------
   33|      1|        return "unable to decrypt certificate's signature";
   34|      0|    case X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE:
  ------------------
  |  |  308|      0|# define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE      5
  ------------------
  |  Branch (34:5): [True: 0, False: 409]
  ------------------
   35|      0|        return "unable to decrypt CRL's signature";
   36|      0|    case X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY:
  ------------------
  |  |  309|      0|# define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY   6
  ------------------
  |  Branch (36:5): [True: 0, False: 409]
  ------------------
   37|      0|        return "unable to decode issuer public key";
   38|      2|    case X509_V_ERR_CERT_SIGNATURE_FAILURE:
  ------------------
  |  |  310|      2|# define X509_V_ERR_CERT_SIGNATURE_FAILURE               7
  ------------------
  |  Branch (38:5): [True: 2, False: 407]
  ------------------
   39|      2|        return "certificate signature failure";
   40|      1|    case X509_V_ERR_CRL_SIGNATURE_FAILURE:
  ------------------
  |  |  311|      1|# define X509_V_ERR_CRL_SIGNATURE_FAILURE                8
  ------------------
  |  Branch (40:5): [True: 1, False: 408]
  ------------------
   41|      1|        return "CRL signature failure";
   42|      1|    case X509_V_ERR_CERT_NOT_YET_VALID:
  ------------------
  |  |  312|      1|# define X509_V_ERR_CERT_NOT_YET_VALID                   9
  ------------------
  |  Branch (42:5): [True: 1, False: 408]
  ------------------
   43|      1|        return "certificate is not yet valid or the system clock is incorrect";
   44|      1|    case X509_V_ERR_CERT_HAS_EXPIRED:
  ------------------
  |  |  313|      1|# define X509_V_ERR_CERT_HAS_EXPIRED                     10
  ------------------
  |  Branch (44:5): [True: 1, False: 408]
  ------------------
   45|      1|        return "certificate has expired";
   46|      1|    case X509_V_ERR_CRL_NOT_YET_VALID:
  ------------------
  |  |  314|      1|# define X509_V_ERR_CRL_NOT_YET_VALID                    11
  ------------------
  |  Branch (46:5): [True: 1, False: 408]
  ------------------
   47|      1|        return "CRL is not yet valid";
   48|      1|    case X509_V_ERR_CRL_HAS_EXPIRED:
  ------------------
  |  |  315|      1|# define X509_V_ERR_CRL_HAS_EXPIRED                      12
  ------------------
  |  Branch (48:5): [True: 1, False: 408]
  ------------------
   49|      1|        return "CRL has expired";
   50|      1|    case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:
  ------------------
  |  |  316|      1|# define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD       13
  ------------------
  |  Branch (50:5): [True: 1, False: 408]
  ------------------
   51|      1|        return "format error in certificate's notBefore field";
   52|      0|    case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD:
  ------------------
  |  |  317|      0|# define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD        14
  ------------------
  |  Branch (52:5): [True: 0, False: 409]
  ------------------
   53|      0|        return "format error in certificate's notAfter field";
   54|      0|    case X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD:
  ------------------
  |  |  318|      0|# define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD       15
  ------------------
  |  Branch (54:5): [True: 0, False: 409]
  ------------------
   55|      0|        return "format error in CRL's lastUpdate field";
   56|      1|    case X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD:
  ------------------
  |  |  319|      1|# define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD       16
  ------------------
  |  Branch (56:5): [True: 1, False: 408]
  ------------------
   57|      1|        return "format error in CRL's nextUpdate field";
   58|      1|    case X509_V_ERR_OUT_OF_MEM:
  ------------------
  |  |  320|      1|# define X509_V_ERR_OUT_OF_MEM                           17
  ------------------
  |  Branch (58:5): [True: 1, False: 408]
  ------------------
   59|      1|        return "out of memory";
   60|      0|    case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
  ------------------
  |  |  321|      0|# define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT          18
  ------------------
  |  Branch (60:5): [True: 0, False: 409]
  ------------------
   61|      0|        return "self-signed certificate";
   62|      1|    case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN:
  ------------------
  |  |  322|      1|# define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN            19
  ------------------
  |  Branch (62:5): [True: 1, False: 408]
  ------------------
   63|      1|        return "self-signed certificate in certificate chain";
   64|      1|    case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
  ------------------
  |  |  323|      1|# define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY    20
  ------------------
  |  Branch (64:5): [True: 1, False: 408]
  ------------------
   65|      1|        return "unable to get local issuer certificate";
   66|      1|    case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE:
  ------------------
  |  |  324|      1|# define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE      21
  ------------------
  |  Branch (66:5): [True: 1, False: 408]
  ------------------
   67|      1|        return "unable to verify the first certificate";
   68|      1|    case X509_V_ERR_CERT_CHAIN_TOO_LONG:
  ------------------
  |  |  325|      1|# define X509_V_ERR_CERT_CHAIN_TOO_LONG                  22
  ------------------
  |  Branch (68:5): [True: 1, False: 408]
  ------------------
   69|      1|        return "certificate chain too long";
   70|      0|    case X509_V_ERR_CERT_REVOKED:
  ------------------
  |  |  326|      0|# define X509_V_ERR_CERT_REVOKED                         23
  ------------------
  |  Branch (70:5): [True: 0, False: 409]
  ------------------
   71|      0|        return "certificate revoked";
   72|      2|    case X509_V_ERR_NO_ISSUER_PUBLIC_KEY:
  ------------------
  |  |  327|      2|# define X509_V_ERR_NO_ISSUER_PUBLIC_KEY                 24
  ------------------
  |  Branch (72:5): [True: 2, False: 407]
  ------------------
   73|      2|        return "issuer certificate doesn't have a public key";
   74|      1|    case X509_V_ERR_PATH_LENGTH_EXCEEDED:
  ------------------
  |  |  328|      1|# define X509_V_ERR_PATH_LENGTH_EXCEEDED                 25
  ------------------
  |  Branch (74:5): [True: 1, False: 408]
  ------------------
   75|      1|        return "path length constraint exceeded";
   76|      0|    case X509_V_ERR_INVALID_PURPOSE:
  ------------------
  |  |  329|      0|# define X509_V_ERR_INVALID_PURPOSE                      26
  ------------------
  |  Branch (76:5): [True: 0, False: 409]
  ------------------
   77|      0|        return "unsuitable certificate purpose";
   78|      1|    case X509_V_ERR_CERT_UNTRUSTED:
  ------------------
  |  |  330|      1|# define X509_V_ERR_CERT_UNTRUSTED                       27
  ------------------
  |  Branch (78:5): [True: 1, False: 408]
  ------------------
   79|      1|        return "certificate not trusted";
   80|      1|    case X509_V_ERR_CERT_REJECTED:
  ------------------
  |  |  331|      1|# define X509_V_ERR_CERT_REJECTED                        28
  ------------------
  |  Branch (80:5): [True: 1, False: 408]
  ------------------
   81|      1|        return "certificate rejected";
   82|      0|    case X509_V_ERR_SUBJECT_ISSUER_MISMATCH:
  ------------------
  |  |  334|      0|# define X509_V_ERR_SUBJECT_ISSUER_MISMATCH              29
  ------------------
  |  Branch (82:5): [True: 0, False: 409]
  ------------------
   83|      0|        return "subject issuer mismatch";
   84|      0|    case X509_V_ERR_AKID_SKID_MISMATCH:
  ------------------
  |  |  335|      0|# define X509_V_ERR_AKID_SKID_MISMATCH                   30
  ------------------
  |  Branch (84:5): [True: 0, False: 409]
  ------------------
   85|      0|        return "authority and subject key identifier mismatch";
   86|      1|    case X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH:
  ------------------
  |  |  336|      1|# define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH          31
  ------------------
  |  Branch (86:5): [True: 1, False: 408]
  ------------------
   87|      1|        return "authority and issuer serial number mismatch";
   88|      1|    case X509_V_ERR_KEYUSAGE_NO_CERTSIGN:
  ------------------
  |  |  337|      1|# define X509_V_ERR_KEYUSAGE_NO_CERTSIGN                 32
  ------------------
  |  Branch (88:5): [True: 1, False: 408]
  ------------------
   89|      1|        return "key usage does not include certificate signing";
   90|      1|    case X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER:
  ------------------
  |  |  338|      1|# define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER             33
  ------------------
  |  Branch (90:5): [True: 1, False: 408]
  ------------------
   91|      1|        return "unable to get CRL issuer certificate";
   92|      0|    case X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION:
  ------------------
  |  |  339|      0|# define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION         34
  ------------------
  |  Branch (92:5): [True: 0, False: 409]
  ------------------
   93|      0|        return "unhandled critical extension";
   94|      0|    case X509_V_ERR_KEYUSAGE_NO_CRL_SIGN:
  ------------------
  |  |  340|      0|# define X509_V_ERR_KEYUSAGE_NO_CRL_SIGN                 35
  ------------------
  |  Branch (94:5): [True: 0, False: 409]
  ------------------
   95|      0|        return "key usage does not include CRL signing";
   96|      1|    case X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION:
  ------------------
  |  |  341|      1|# define X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION     36
  ------------------
  |  Branch (96:5): [True: 1, False: 408]
  ------------------
   97|      1|        return "unhandled critical CRL extension";
   98|      1|    case X509_V_ERR_INVALID_NON_CA:
  ------------------
  |  |  342|      1|# define X509_V_ERR_INVALID_NON_CA                       37
  ------------------
  |  Branch (98:5): [True: 1, False: 408]
  ------------------
   99|      1|        return "invalid non-CA certificate (has CA markings)";
  100|      0|    case X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED:
  ------------------
  |  |  343|      0|# define X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED           38
  ------------------
  |  Branch (100:5): [True: 0, False: 409]
  ------------------
  101|      0|        return "proxy path length constraint exceeded";
  102|      1|    case X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE:
  ------------------
  |  |  344|      1|# define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE        39
  ------------------
  |  Branch (102:5): [True: 1, False: 408]
  ------------------
  103|      1|        return "key usage does not include digital signature";
  104|      0|    case X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED:
  ------------------
  |  |  345|      0|# define X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED       40
  ------------------
  |  Branch (104:5): [True: 0, False: 409]
  ------------------
  105|      0|        return
  106|      0|            "proxy certificates not allowed, please set the appropriate flag";
  107|      1|    case X509_V_ERR_INVALID_EXTENSION:
  ------------------
  |  |  346|      1|# define X509_V_ERR_INVALID_EXTENSION                    41
  ------------------
  |  Branch (107:5): [True: 1, False: 408]
  ------------------
  108|      1|        return "invalid or inconsistent certificate extension";
  109|      0|    case X509_V_ERR_INVALID_POLICY_EXTENSION:
  ------------------
  |  |  347|      0|# define X509_V_ERR_INVALID_POLICY_EXTENSION             42
  ------------------
  |  Branch (109:5): [True: 0, False: 409]
  ------------------
  110|      0|        return "invalid or inconsistent certificate policy extension";
  111|      1|    case X509_V_ERR_NO_EXPLICIT_POLICY:
  ------------------
  |  |  348|      1|# define X509_V_ERR_NO_EXPLICIT_POLICY                   43
  ------------------
  |  Branch (111:5): [True: 1, False: 408]
  ------------------
  112|      1|        return "no explicit policy";
  113|      1|    case X509_V_ERR_DIFFERENT_CRL_SCOPE:
  ------------------
  |  |  349|      1|# define X509_V_ERR_DIFFERENT_CRL_SCOPE                  44
  ------------------
  |  Branch (113:5): [True: 1, False: 408]
  ------------------
  114|      1|        return "different CRL scope";
  115|      0|    case X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE:
  ------------------
  |  |  350|      0|# define X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE        45
  ------------------
  |  Branch (115:5): [True: 0, False: 409]
  ------------------
  116|      0|        return "unsupported extension feature";
  117|      1|    case X509_V_ERR_UNNESTED_RESOURCE:
  ------------------
  |  |  351|      1|# define X509_V_ERR_UNNESTED_RESOURCE                    46
  ------------------
  |  Branch (117:5): [True: 1, False: 408]
  ------------------
  118|      1|        return "RFC 3779 resource not subset of parent's resources";
  119|      0|    case X509_V_ERR_PERMITTED_VIOLATION:
  ------------------
  |  |  352|      0|# define X509_V_ERR_PERMITTED_VIOLATION                  47
  ------------------
  |  Branch (119:5): [True: 0, False: 409]
  ------------------
  120|      0|        return "permitted subtree violation";
  121|      0|    case X509_V_ERR_EXCLUDED_VIOLATION:
  ------------------
  |  |  353|      0|# define X509_V_ERR_EXCLUDED_VIOLATION                   48
  ------------------
  |  Branch (121:5): [True: 0, False: 409]
  ------------------
  122|      0|        return "excluded subtree violation";
  123|      3|    case X509_V_ERR_SUBTREE_MINMAX:
  ------------------
  |  |  354|      3|# define X509_V_ERR_SUBTREE_MINMAX                       49
  ------------------
  |  Branch (123:5): [True: 3, False: 406]
  ------------------
  124|      3|        return "name constraints minimum and maximum not supported";
  125|      1|    case X509_V_ERR_APPLICATION_VERIFICATION:
  ------------------
  |  |  356|      1|# define X509_V_ERR_APPLICATION_VERIFICATION             50
  ------------------
  |  Branch (125:5): [True: 1, False: 408]
  ------------------
  126|      1|        return "application verification failure";
  127|      0|    case X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE:
  ------------------
  |  |  357|      0|# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE          51
  ------------------
  |  Branch (127:5): [True: 0, False: 409]
  ------------------
  128|      0|        return "unsupported name constraint type";
  129|      0|    case X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX:
  ------------------
  |  |  358|      0|# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX        52
  ------------------
  |  Branch (129:5): [True: 0, False: 409]
  ------------------
  130|      0|        return "unsupported or invalid name constraint syntax";
  131|      2|    case X509_V_ERR_UNSUPPORTED_NAME_SYNTAX:
  ------------------
  |  |  359|      2|# define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX              53
  ------------------
  |  Branch (131:5): [True: 2, False: 407]
  ------------------
  132|      2|        return "unsupported or invalid name syntax";
  133|      0|    case X509_V_ERR_CRL_PATH_VALIDATION_ERROR:
  ------------------
  |  |  360|      0|# define X509_V_ERR_CRL_PATH_VALIDATION_ERROR            54
  ------------------
  |  Branch (133:5): [True: 0, False: 409]
  ------------------
  134|      0|        return "CRL path validation error";
  135|      0|    case X509_V_ERR_PATH_LOOP:
  ------------------
  |  |  362|      0|# define X509_V_ERR_PATH_LOOP                            55
  ------------------
  |  Branch (135:5): [True: 0, False: 409]
  ------------------
  136|      0|        return "path loop";
  137|      0|    case X509_V_ERR_SUITE_B_INVALID_VERSION:
  ------------------
  |  |  364|      0|# define X509_V_ERR_SUITE_B_INVALID_VERSION              56
  ------------------
  |  Branch (137:5): [True: 0, False: 409]
  ------------------
  138|      0|        return "Suite B: certificate version invalid";
  139|      0|    case X509_V_ERR_SUITE_B_INVALID_ALGORITHM:
  ------------------
  |  |  365|      0|# define X509_V_ERR_SUITE_B_INVALID_ALGORITHM            57
  ------------------
  |  Branch (139:5): [True: 0, False: 409]
  ------------------
  140|      0|        return "Suite B: invalid public key algorithm";
  141|      0|    case X509_V_ERR_SUITE_B_INVALID_CURVE:
  ------------------
  |  |  366|      0|# define X509_V_ERR_SUITE_B_INVALID_CURVE                58
  ------------------
  |  Branch (141:5): [True: 0, False: 409]
  ------------------
  142|      0|        return "Suite B: invalid ECC curve";
  143|      0|    case X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM:
  ------------------
  |  |  367|      0|# define X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM  59
  ------------------
  |  Branch (143:5): [True: 0, False: 409]
  ------------------
  144|      0|        return "Suite B: invalid signature algorithm";
  145|      0|    case X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED:
  ------------------
  |  |  368|      0|# define X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED              60
  ------------------
  |  Branch (145:5): [True: 0, False: 409]
  ------------------
  146|      0|        return "Suite B: curve not allowed for this LOS";
  147|      0|    case X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256:
  ------------------
  |  |  369|      0|# define X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 61
  ------------------
  |  Branch (147:5): [True: 0, False: 409]
  ------------------
  148|      0|        return "Suite B: cannot sign P-384 with P-256";
  149|      0|    case X509_V_ERR_HOSTNAME_MISMATCH:
  ------------------
  |  |  371|      0|# define X509_V_ERR_HOSTNAME_MISMATCH                    62
  ------------------
  |  Branch (149:5): [True: 0, False: 409]
  ------------------
  150|      0|        return "hostname mismatch";
  151|      0|    case X509_V_ERR_EMAIL_MISMATCH:
  ------------------
  |  |  372|      0|# define X509_V_ERR_EMAIL_MISMATCH                       63
  ------------------
  |  Branch (151:5): [True: 0, False: 409]
  ------------------
  152|      0|        return "email address mismatch";
  153|      1|    case X509_V_ERR_IP_ADDRESS_MISMATCH:
  ------------------
  |  |  373|      1|# define X509_V_ERR_IP_ADDRESS_MISMATCH                  64
  ------------------
  |  Branch (153:5): [True: 1, False: 408]
  ------------------
  154|      1|        return "IP address mismatch";
  155|      1|    case X509_V_ERR_DANE_NO_MATCH:
  ------------------
  |  |  375|      1|# define X509_V_ERR_DANE_NO_MATCH                        65
  ------------------
  |  Branch (155:5): [True: 1, False: 408]
  ------------------
  156|      1|        return "no matching DANE TLSA records";
  157|      1|    case X509_V_ERR_EE_KEY_TOO_SMALL:
  ------------------
  |  |  377|      1|# define X509_V_ERR_EE_KEY_TOO_SMALL                     66
  ------------------
  |  Branch (157:5): [True: 1, False: 408]
  ------------------
  158|      1|        return "EE certificate key too weak";
  159|      1|    case X509_V_ERR_CA_KEY_TOO_SMALL:
  ------------------
  |  |  378|      1|# define X509_V_ERR_CA_KEY_TOO_SMALL                     67
  ------------------
  |  Branch (159:5): [True: 1, False: 408]
  ------------------
  160|      1|        return "CA certificate key too weak";
  161|      0|    case X509_V_ERR_CA_MD_TOO_WEAK:
  ------------------
  |  |  379|      0|# define X509_V_ERR_CA_MD_TOO_WEAK                       68
  ------------------
  |  Branch (161:5): [True: 0, False: 409]
  ------------------
  162|      0|        return "CA signature digest algorithm too weak";
  163|      2|    case X509_V_ERR_INVALID_CALL:
  ------------------
  |  |  381|      2|# define X509_V_ERR_INVALID_CALL                         69
  ------------------
  |  Branch (163:5): [True: 2, False: 407]
  ------------------
  164|      2|        return "invalid certificate verification context";
  165|      1|    case X509_V_ERR_STORE_LOOKUP:
  ------------------
  |  |  383|      1|# define X509_V_ERR_STORE_LOOKUP                         70
  ------------------
  |  Branch (165:5): [True: 1, False: 408]
  ------------------
  166|      1|        return "issuer certificate lookup error";
  167|      1|    case X509_V_ERR_NO_VALID_SCTS:
  ------------------
  |  |  385|      1|# define X509_V_ERR_NO_VALID_SCTS                        71
  ------------------
  |  Branch (167:5): [True: 1, False: 408]
  ------------------
  168|      1|        return "Certificate Transparency required, but no valid SCTs found";
  169|      1|    case X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION:
  ------------------
  |  |  387|      1|# define X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION         72
  ------------------
  |  Branch (169:5): [True: 1, False: 408]
  ------------------
  170|      1|        return "proxy subject name violation";
  171|      1|    case X509_V_ERR_OCSP_VERIFY_NEEDED:
  ------------------
  |  |  389|      1|# define X509_V_ERR_OCSP_VERIFY_NEEDED                   73  /* Need OCSP verification */
  ------------------
  |  Branch (171:5): [True: 1, False: 408]
  ------------------
  172|      1|        return "OCSP verification needed";
  173|      0|    case X509_V_ERR_OCSP_VERIFY_FAILED:
  ------------------
  |  |  390|      0|# define X509_V_ERR_OCSP_VERIFY_FAILED                   74  /* Couldn't verify cert through OCSP */
  ------------------
  |  Branch (173:5): [True: 0, False: 409]
  ------------------
  174|      0|        return "OCSP verification failed";
  175|      0|    case X509_V_ERR_OCSP_CERT_UNKNOWN:
  ------------------
  |  |  391|      0|# define X509_V_ERR_OCSP_CERT_UNKNOWN                    75  /* Certificate wasn't recognized by the OCSP responder */
  ------------------
  |  Branch (175:5): [True: 0, False: 409]
  ------------------
  176|      0|        return "OCSP unknown cert";
  177|      1|    case X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHM:
  ------------------
  |  |  393|      1|# define X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHM      76
  ------------------
  |  Branch (177:5): [True: 1, False: 408]
  ------------------
  178|      1|        return "Cannot find certificate signature algorithm";
  179|      0|    case X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH:
  ------------------
  |  |  394|      0|# define X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH         77
  ------------------
  |  Branch (179:5): [True: 0, False: 409]
  ------------------
  180|      0|        return "subject signature algorithm and issuer public key algorithm mismatch";
  181|      0|    case X509_V_ERR_SIGNATURE_ALGORITHM_INCONSISTENCY:
  ------------------
  |  |  397|      0|# define X509_V_ERR_SIGNATURE_ALGORITHM_INCONSISTENCY    78
  ------------------
  |  Branch (181:5): [True: 0, False: 409]
  ------------------
  182|      0|        return "cert info signature and signature algorithm mismatch";
  183|      0|    case X509_V_ERR_INVALID_CA:
  ------------------
  |  |  398|      0|# define X509_V_ERR_INVALID_CA                           79
  ------------------
  |  Branch (183:5): [True: 0, False: 409]
  ------------------
  184|      0|        return "invalid CA certificate";
  185|      0|    case X509_V_ERR_PATHLEN_INVALID_FOR_NON_CA:
  ------------------
  |  |  399|      0|# define X509_V_ERR_PATHLEN_INVALID_FOR_NON_CA           80
  ------------------
  |  Branch (185:5): [True: 0, False: 409]
  ------------------
  186|      0|        return "Path length invalid for non-CA cert";
  187|      0|    case X509_V_ERR_PATHLEN_WITHOUT_KU_KEY_CERT_SIGN:
  ------------------
  |  |  400|      0|# define X509_V_ERR_PATHLEN_WITHOUT_KU_KEY_CERT_SIGN     81
  ------------------
  |  Branch (187:5): [True: 0, False: 409]
  ------------------
  188|      0|        return "Path length given without key usage keyCertSign";
  189|      0|    case X509_V_ERR_KU_KEY_CERT_SIGN_INVALID_FOR_NON_CA:
  ------------------
  |  |  401|      0|# define X509_V_ERR_KU_KEY_CERT_SIGN_INVALID_FOR_NON_CA  82
  ------------------
  |  Branch (189:5): [True: 0, False: 409]
  ------------------
  190|      0|        return "Key usage keyCertSign invalid for non-CA cert";
  191|      2|    case X509_V_ERR_ISSUER_NAME_EMPTY:
  ------------------
  |  |  402|      2|# define X509_V_ERR_ISSUER_NAME_EMPTY                    83
  ------------------
  |  Branch (191:5): [True: 2, False: 407]
  ------------------
  192|      2|        return "Issuer name empty";
  193|      1|    case X509_V_ERR_SUBJECT_NAME_EMPTY:
  ------------------
  |  |  403|      1|# define X509_V_ERR_SUBJECT_NAME_EMPTY                   84
  ------------------
  |  Branch (193:5): [True: 1, False: 408]
  ------------------
  194|      1|        return "Subject name empty";
  195|      1|    case X509_V_ERR_MISSING_AUTHORITY_KEY_IDENTIFIER:
  ------------------
  |  |  404|      1|# define X509_V_ERR_MISSING_AUTHORITY_KEY_IDENTIFIER     85
  ------------------
  |  Branch (195:5): [True: 1, False: 408]
  ------------------
  196|      1|        return "Missing Authority Key Identifier";
  197|      0|    case X509_V_ERR_MISSING_SUBJECT_KEY_IDENTIFIER:
  ------------------
  |  |  405|      0|# define X509_V_ERR_MISSING_SUBJECT_KEY_IDENTIFIER       86
  ------------------
  |  Branch (197:5): [True: 0, False: 409]
  ------------------
  198|      0|        return "Missing Subject Key Identifier";
  199|      0|    case X509_V_ERR_EMPTY_SUBJECT_ALT_NAME:
  ------------------
  |  |  406|      0|# define X509_V_ERR_EMPTY_SUBJECT_ALT_NAME               87
  ------------------
  |  Branch (199:5): [True: 0, False: 409]
  ------------------
  200|      0|        return "Empty Subject Alternative Name extension";
  201|      1|    case X509_V_ERR_CA_BCONS_NOT_CRITICAL:
  ------------------
  |  |  408|      1|# define X509_V_ERR_CA_BCONS_NOT_CRITICAL                89
  ------------------
  |  Branch (201:5): [True: 1, False: 408]
  ------------------
  202|      1|        return "Basic Constraints of CA cert not marked critical";
  203|      0|    case X509_V_ERR_EMPTY_SUBJECT_SAN_NOT_CRITICAL:
  ------------------
  |  |  407|      0|# define X509_V_ERR_EMPTY_SUBJECT_SAN_NOT_CRITICAL       88
  ------------------
  |  Branch (203:5): [True: 0, False: 409]
  ------------------
  204|      0|        return "Subject empty and Subject Alt Name extension not critical";
  205|      1|    case X509_V_ERR_AUTHORITY_KEY_IDENTIFIER_CRITICAL:
  ------------------
  |  |  409|      1|# define X509_V_ERR_AUTHORITY_KEY_IDENTIFIER_CRITICAL    90
  ------------------
  |  Branch (205:5): [True: 1, False: 408]
  ------------------
  206|      1|        return "Authority Key Identifier marked critical";
  207|      1|    case X509_V_ERR_SUBJECT_KEY_IDENTIFIER_CRITICAL:
  ------------------
  |  |  410|      1|# define X509_V_ERR_SUBJECT_KEY_IDENTIFIER_CRITICAL      91
  ------------------
  |  Branch (207:5): [True: 1, False: 408]
  ------------------
  208|      1|        return "Subject Key Identifier marked critical";
  209|      1|    case X509_V_ERR_CA_CERT_MISSING_KEY_USAGE:
  ------------------
  |  |  411|      1|# define X509_V_ERR_CA_CERT_MISSING_KEY_USAGE            92
  ------------------
  |  Branch (209:5): [True: 1, False: 408]
  ------------------
  210|      1|        return "CA cert does not include key usage extension";
  211|      1|    case X509_V_ERR_EXTENSIONS_REQUIRE_VERSION_3:
  ------------------
  |  |  412|      1|# define X509_V_ERR_EXTENSIONS_REQUIRE_VERSION_3         93
  ------------------
  |  Branch (211:5): [True: 1, False: 408]
  ------------------
  212|      1|        return "Using cert extension requires at least X509v3";
  213|      1|    case X509_V_ERR_EC_KEY_EXPLICIT_PARAMS:
  ------------------
  |  |  413|      1|# define X509_V_ERR_EC_KEY_EXPLICIT_PARAMS               94
  ------------------
  |  Branch (213:5): [True: 1, False: 408]
  ------------------
  214|      1|        return "Certificate public key has explicit ECC parameters";
  215|      1|    case X509_V_ERR_RPK_UNTRUSTED:
  ------------------
  |  |  414|      1|# define X509_V_ERR_RPK_UNTRUSTED                        95
  ------------------
  |  Branch (215:5): [True: 1, False: 408]
  ------------------
  216|      1|        return "Raw public key untrusted, no trusted keys configured";
  217|       |
  218|       |        /*
  219|       |         * Entries must be kept consistent with include/openssl/x509_vfy.h.in
  220|       |         * and with doc/man3/X509_STORE_CTX_get_error.pod
  221|       |         */
  222|       |
  223|     35|    default:
  ------------------
  |  Branch (223:5): [True: 35, False: 374]
  ------------------
  224|       |        /* Printing an error number into a static buffer is not thread-safe */
  225|     35|        return "unknown certificate verification error";
  226|    409|    }
  227|    409|}

X509v3_get_ext_count:
   21|  1.26k|{
   22|  1.26k|    int ret;
   23|       |
   24|  1.26k|    if (x == NULL)
  ------------------
  |  Branch (24:9): [True: 18, False: 1.24k]
  ------------------
   25|     18|        return 0;
   26|  1.24k|    ret = sk_X509_EXTENSION_num(x);
  ------------------
  |  |  235|  1.24k|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
   27|  1.24k|    return ret > 0 ? ret : 0;
  ------------------
  |  Branch (27:12): [True: 1.24k, False: 1]
  ------------------
   28|  1.26k|}
X509v3_get_ext:
   84|  42.4k|{
   85|  42.4k|    if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
  ------------------
  |  |  235|  42.4k|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (85:9): [True: 0, False: 42.4k]
  |  Branch (85:22): [True: 0, False: 42.4k]
  |  Branch (85:57): [True: 0, False: 42.4k]
  ------------------
   86|      0|        return NULL;
   87|  42.4k|    else
   88|  42.4k|        return sk_X509_EXTENSION_value(x, loc);
  ------------------
  |  |  236|  42.4k|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
   89|  42.4k|}
X509_EXTENSION_get_object:
  253|   198k|{
  254|   198k|    if (ex == NULL)
  ------------------
  |  Branch (254:9): [True: 0, False: 198k]
  ------------------
  255|      0|        return NULL;
  256|   198k|    return ex->object;
  257|   198k|}
X509_EXTENSION_get_data:
  260|  90.3k|{
  261|  90.3k|    if (ex == NULL)
  ------------------
  |  Branch (261:9): [True: 0, False: 90.3k]
  ------------------
  262|      0|        return NULL;
  263|  90.3k|    return &ex->value;
  264|  90.3k|}
X509_EXTENSION_get_critical:
  267|  91.1k|{
  268|  91.1k|    if (ex == NULL)
  ------------------
  |  Branch (268:9): [True: 0, False: 91.1k]
  ------------------
  269|      0|        return 0;
  270|  91.1k|    if (ex->critical > 0)
  ------------------
  |  Branch (270:9): [True: 5.53k, False: 85.5k]
  ------------------
  271|  5.53k|        return 1;
  272|  85.5k|    return 0;
  273|  91.1k|}

X509_CRL_get_issuer:
  114|    327|{
  115|    327|    return crl->crl.issuer;
  116|    327|}
X509_CRL_get_REVOKED:
  124|  6.59k|{
  125|  6.59k|    return crl->crl.revoked;
  126|  6.59k|}

X509_NAME_entry_count:
   51|  3.56k|{
   52|  3.56k|    int ret;
   53|       |
   54|  3.56k|    if (name == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 3.56k]
  ------------------
   55|      0|        return 0;
   56|  3.56k|    ret = sk_X509_NAME_ENTRY_num(name->entries);
  ------------------
  |  |  204|  3.56k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
   57|  3.56k|    return ret > 0 ? ret : 0;
  ------------------
  |  Branch (57:12): [True: 2.90k, False: 657]
  ------------------
   58|  3.56k|}
X509_NAME_get_entry:
   93|  7.11k|{
   94|  7.11k|    if (name == NULL || sk_X509_NAME_ENTRY_num(name->entries) <= loc
  ------------------
  |  |  204|  7.11k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (94:9): [True: 0, False: 7.11k]
  |  Branch (94:25): [True: 0, False: 7.11k]
  ------------------
   95|  7.11k|        || loc < 0)
  ------------------
  |  Branch (95:12): [True: 0, False: 7.11k]
  ------------------
   96|      0|        return NULL;
   97|       |
   98|  7.11k|    return sk_X509_NAME_ENTRY_value(name->entries, loc);
  ------------------
  |  |  205|  7.11k|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
   99|  7.11k|}
X509_NAME_add_entry:
  190|  1.37k|{
  191|  1.37k|    X509_NAME_ENTRY *new_name = NULL;
  192|  1.37k|    int n, i, inc;
  193|  1.37k|    STACK_OF(X509_NAME_ENTRY) *sk;
  ------------------
  |  |   31|  1.37k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  194|       |
  195|  1.37k|    if (name == NULL)
  ------------------
  |  Branch (195:9): [True: 0, False: 1.37k]
  ------------------
  196|      0|        return 0;
  197|  1.37k|    sk = name->entries;
  198|  1.37k|    n = sk_X509_NAME_ENTRY_num(sk);
  ------------------
  |  |  204|  1.37k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  199|  1.37k|    if (loc > n)
  ------------------
  |  Branch (199:9): [True: 0, False: 1.37k]
  ------------------
  200|      0|        loc = n;
  201|  1.37k|    else if (loc < 0)
  ------------------
  |  Branch (201:14): [True: 1.37k, False: 0]
  ------------------
  202|  1.37k|        loc = n;
  203|  1.37k|    inc = (set == 0);
  204|  1.37k|    name->modified = 1;
  205|       |
  206|  1.37k|    if (set == -1) {
  ------------------
  |  Branch (206:9): [True: 0, False: 1.37k]
  ------------------
  207|      0|        if (loc == 0) {
  ------------------
  |  Branch (207:13): [True: 0, False: 0]
  ------------------
  208|      0|            set = 0;
  209|      0|            inc = 1;
  210|      0|        } else {
  211|      0|            set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set;
  ------------------
  |  |  205|      0|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
  212|      0|        }
  213|  1.37k|    } else {                    /* if (set >= 0) */
  214|       |
  215|  1.37k|        if (loc >= n) {
  ------------------
  |  Branch (215:13): [True: 1.37k, False: 0]
  ------------------
  216|  1.37k|            if (loc != 0)
  ------------------
  |  Branch (216:17): [True: 1.23k, False: 142]
  ------------------
  217|  1.23k|                set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set + 1;
  ------------------
  |  |  205|  1.23k|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
  218|    142|            else
  219|    142|                set = 0;
  220|  1.37k|        } else
  221|      0|            set = sk_X509_NAME_ENTRY_value(sk, loc)->set;
  ------------------
  |  |  205|      0|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
  222|  1.37k|    }
  223|       |
  224|  1.37k|    if ((new_name = X509_NAME_ENTRY_dup(ne)) == NULL)
  ------------------
  |  Branch (224:9): [True: 1, False: 1.37k]
  ------------------
  225|      1|        goto err;
  226|  1.37k|    new_name->set = set;
  227|  1.37k|    if (!sk_X509_NAME_ENTRY_insert(sk, new_name, loc)) {
  ------------------
  |  |  219|  1.37k|#define sk_X509_NAME_ENTRY_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr), (idx))
  ------------------
  |  Branch (227:9): [True: 0, False: 1.37k]
  ------------------
  228|      0|        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  229|      0|        goto err;
  230|      0|    }
  231|  1.37k|    if (inc) {
  ------------------
  |  Branch (231:9): [True: 1.14k, False: 232]
  ------------------
  232|  1.14k|        n = sk_X509_NAME_ENTRY_num(sk);
  ------------------
  |  |  204|  1.14k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  233|  1.14k|        for (i = loc + 1; i < n; i++)
  ------------------
  |  Branch (233:27): [True: 0, False: 1.14k]
  ------------------
  234|      0|            sk_X509_NAME_ENTRY_value(sk, i)->set += 1;
  ------------------
  |  |  205|      0|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
  235|  1.14k|    }
  236|  1.37k|    return 1;
  237|      1| err:
  238|      1|    X509_NAME_ENTRY_free(new_name);
  239|      1|    return 0;
  240|  1.37k|}
X509_NAME_ENTRY_get_object:
  343|  7.11k|{
  344|  7.11k|    if (ne == NULL)
  ------------------
  |  Branch (344:9): [True: 0, False: 7.11k]
  ------------------
  345|      0|        return NULL;
  346|  7.11k|    return ne->object;
  347|  7.11k|}
X509_NAME_ENTRY_get_data:
  350|  7.11k|{
  351|  7.11k|    if (ne == NULL)
  ------------------
  |  Branch (351:9): [True: 0, False: 7.11k]
  ------------------
  352|      0|        return NULL;
  353|  7.11k|    return ne->value;
  354|  7.11k|}
X509_NAME_ENTRY_set:
  357|  11.3k|{
  358|  11.3k|    return ne->set;
  359|  11.3k|}

X509_CRL_digest:
  609|  6.59k|{
  610|  6.59k|    if (type == NULL) {
  ------------------
  |  Branch (610:9): [True: 0, False: 6.59k]
  ------------------
  611|      0|        ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  612|      0|        return 0;
  613|      0|    }
  614|  6.59k|    if (EVP_MD_is_a(type, SN_sha1)
  ------------------
  |  | 2319|  6.59k|#define SN_sha1         "SHA1"
  ------------------
  |  Branch (614:9): [True: 6.59k, False: 0]
  ------------------
  615|  6.59k|            && (data->flags & EXFLAG_SET) != 0
  ------------------
  |  |  659|  6.59k|# define EXFLAG_SET              0x100
  ------------------
  |  Branch (615:16): [True: 0, False: 6.59k]
  ------------------
  616|  6.59k|            && (data->flags & EXFLAG_NO_FINGERPRINT) == 0) {
  ------------------
  |  |  671|      0|# define EXFLAG_NO_FINGERPRINT   0x100000
  ------------------
  |  Branch (616:16): [True: 0, False: 0]
  ------------------
  617|       |        /* Asking for SHA1; always computed in CRL d2i. */
  618|      0|        if (len != NULL)
  ------------------
  |  Branch (618:13): [True: 0, False: 0]
  ------------------
  619|      0|            *len = sizeof(data->sha1_hash);
  620|      0|        memcpy(md, data->sha1_hash, sizeof(data->sha1_hash));
  621|      0|        return 1;
  622|      0|    }
  623|  6.59k|    return
  624|  6.59k|        ossl_asn1_item_digest_ex(ASN1_ITEM_rptr(X509_CRL), type, (char *)data,
  ------------------
  |  |  427|  6.59k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  625|  6.59k|                                 md, len, data->libctx, data->propq);
  626|  6.59k|}
i2d_PKCS8_PRIV_KEY_INFO_bio:
  786|     23|{
  787|     23|    return ASN1_i2d_bio_of(PKCS8_PRIV_KEY_INFO, i2d_PKCS8_PRIV_KEY_INFO, bp,
  ------------------
  |  |  971|     23|    (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \
  |  |  ------------------
  |  |  |  |  360|     23|    ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:22): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  972|     23|                  out, \
  |  |  973|     23|                  CHECKED_PTR_OF(const type, x)))
  |  |  ------------------
  |  |  |  |  364|     23|    ((void*) (1 ? p : (type*)0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:15): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  788|     23|                           p8inf);
  789|     23|}

x_crl.c:crl_inf_cb:
   49|   132k|{
   50|   132k|    X509_CRL_INFO *a = (X509_CRL_INFO *)*pval;
   51|       |
   52|   132k|    if (!a || !a->revoked)
  ------------------
  |  Branch (52:9): [True: 10.1k, False: 122k]
  |  Branch (52:15): [True: 118k, False: 3.75k]
  ------------------
   53|   129k|        return 1;
   54|  3.75k|    switch (operation) {
  ------------------
  |  Branch (54:13): [True: 1.92k, False: 1.83k]
  ------------------
   55|       |        /*
   56|       |         * Just set cmp function here. We don't sort because that would
   57|       |         * affect the output of X509_CRL_print().
   58|       |         */
   59|  1.83k|    case ASN1_OP_D2I_POST:
  ------------------
  |  |  747|  1.83k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (59:5): [True: 1.83k, False: 1.92k]
  ------------------
   60|  1.83k|        (void)sk_X509_REVOKED_set_cmp_func(a->revoked, X509_REVOKED_cmp);
  ------------------
  |  |  129|  1.83k|#define sk_X509_REVOKED_set_cmp_func(sk, cmp) ((sk_X509_REVOKED_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_compfunc_type(cmp)))
  ------------------
   61|  1.83k|        break;
   62|  3.75k|    }
   63|  3.75k|    return 1;
   64|  3.75k|}
x_crl.c:crl_cb:
  160|   110k|{
  161|   110k|    X509_CRL *crl = (X509_CRL *)*pval;
  162|   110k|    STACK_OF(X509_EXTENSION) *exts;
  ------------------
  |  |   31|   110k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  163|   110k|    X509_EXTENSION *ext;
  164|   110k|    int idx, i;
  165|       |
  166|   110k|    switch (operation) {
  ------------------
  |  Branch (166:13): [True: 54.1k, False: 56.6k]
  ------------------
  167|  16.6k|    case ASN1_OP_D2I_PRE:
  ------------------
  |  |  746|  16.6k|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (167:5): [True: 16.6k, False: 94.1k]
  ------------------
  168|  16.6k|        if (crl->meth->crl_free) {
  ------------------
  |  Branch (168:13): [True: 0, False: 16.6k]
  ------------------
  169|      0|            if (!crl->meth->crl_free(crl))
  ------------------
  |  Branch (169:17): [True: 0, False: 0]
  ------------------
  170|      0|                return 0;
  171|      0|        }
  172|  16.6k|        AUTHORITY_KEYID_free(crl->akid);
  173|  16.6k|        ISSUING_DIST_POINT_free(crl->idp);
  174|  16.6k|        ASN1_INTEGER_free(crl->crl_number);
  175|  16.6k|        ASN1_INTEGER_free(crl->base_crl_number);
  176|  16.6k|        sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free);
  ------------------
  |  |  285|  16.6k|#define sk_GENERAL_NAMES_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_GENERAL_NAMES_sk_type(sk), ossl_check_GENERAL_NAMES_freefunc_type(freefunc))
  ------------------
  177|       |        /* fall through */
  178|       |
  179|  33.3k|    case ASN1_OP_NEW_POST:
  ------------------
  |  |  743|  33.3k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (179:5): [True: 16.6k, False: 94.1k]
  ------------------
  180|  33.3k|        crl->idp = NULL;
  181|  33.3k|        crl->akid = NULL;
  182|  33.3k|        crl->flags = 0;
  183|  33.3k|        crl->idp_flags = 0;
  184|  33.3k|        crl->idp_reasons = CRLDP_ALL_REASONS;
  ------------------
  |  |  309|  33.3k|# define CRLDP_ALL_REASONS       0x807f
  ------------------
  185|  33.3k|        crl->meth = default_crl_method;
  186|  33.3k|        crl->meth_data = NULL;
  187|  33.3k|        crl->issuers = NULL;
  188|  33.3k|        crl->crl_number = NULL;
  189|  33.3k|        crl->base_crl_number = NULL;
  190|  33.3k|        break;
  191|       |
  192|  6.59k|    case ASN1_OP_D2I_POST:
  ------------------
  |  |  747|  6.59k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (192:5): [True: 6.59k, False: 104k]
  ------------------
  193|  6.59k|        if (!X509_CRL_digest(crl, EVP_sha1(), crl->sha1_hash, NULL))
  ------------------
  |  Branch (193:13): [True: 0, False: 6.59k]
  ------------------
  194|      0|            crl->flags |= EXFLAG_NO_FINGERPRINT;
  ------------------
  |  |  671|      0|# define EXFLAG_NO_FINGERPRINT   0x100000
  ------------------
  195|  6.59k|        crl->idp = X509_CRL_get_ext_d2i(crl,
  196|  6.59k|                                        NID_issuing_distribution_point, &i,
  ------------------
  |  | 2707|  6.59k|#define NID_issuing_distribution_point          770
  ------------------
  197|  6.59k|                                        NULL);
  198|  6.59k|        if (crl->idp != NULL) {
  ------------------
  |  Branch (198:13): [True: 327, False: 6.26k]
  ------------------
  199|    327|            if (!setup_idp(crl, crl->idp))
  ------------------
  |  Branch (199:17): [True: 27, False: 300]
  ------------------
  200|     27|                crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|     27|# define EXFLAG_INVALID          0x80
  ------------------
  201|    327|        }
  202|  6.26k|        else if (i != -1) {
  ------------------
  |  Branch (202:18): [True: 2.81k, False: 3.45k]
  ------------------
  203|  2.81k|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|  2.81k|# define EXFLAG_INVALID          0x80
  ------------------
  204|  2.81k|        }
  205|       |
  206|  6.59k|        crl->akid = X509_CRL_get_ext_d2i(crl,
  207|  6.59k|                                         NID_authority_key_identifier, &i,
  ------------------
  |  | 2742|  6.59k|#define NID_authority_key_identifier            90
  ------------------
  208|  6.59k|                                         NULL);
  209|  6.59k|        if (crl->akid == NULL && i != -1)
  ------------------
  |  Branch (209:13): [True: 6.56k, False: 31]
  |  Branch (209:34): [True: 1.43k, False: 5.12k]
  ------------------
  210|  1.43k|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|  1.43k|# define EXFLAG_INVALID          0x80
  ------------------
  211|       |
  212|  6.59k|        crl->crl_number = X509_CRL_get_ext_d2i(crl,
  213|  6.59k|                                               NID_crl_number, &i, NULL);
  ------------------
  |  | 2687|  6.59k|#define NID_crl_number          88
  ------------------
  214|  6.59k|        if (crl->crl_number == NULL && i != -1)
  ------------------
  |  Branch (214:13): [True: 5.52k, False: 1.07k]
  |  Branch (214:40): [True: 288, False: 5.23k]
  ------------------
  215|    288|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|    288|# define EXFLAG_INVALID          0x80
  ------------------
  216|       |
  217|  6.59k|        crl->base_crl_number = X509_CRL_get_ext_d2i(crl,
  218|  6.59k|                                                    NID_delta_crl, &i,
  ------------------
  |  | 2702|  6.59k|#define NID_delta_crl           140
  ------------------
  219|  6.59k|                                                    NULL);
  220|  6.59k|        if (crl->base_crl_number == NULL && i != -1)
  ------------------
  |  Branch (220:13): [True: 6.48k, False: 112]
  |  Branch (220:45): [True: 22, False: 6.46k]
  ------------------
  221|     22|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|     22|# define EXFLAG_INVALID          0x80
  ------------------
  222|       |        /* Delta CRLs must have CRL number */
  223|  6.59k|        if (crl->base_crl_number && !crl->crl_number)
  ------------------
  |  Branch (223:13): [True: 112, False: 6.48k]
  |  Branch (223:37): [True: 105, False: 7]
  ------------------
  224|    105|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|    105|# define EXFLAG_INVALID          0x80
  ------------------
  225|       |
  226|       |        /*
  227|       |         * See if we have any unhandled critical CRL extensions and indicate
  228|       |         * this in a flag. We only currently handle IDP so anything else
  229|       |         * critical sets the flag. This code accesses the X509_CRL structure
  230|       |         * directly: applications shouldn't do this.
  231|       |         */
  232|       |
  233|  6.59k|        exts = crl->crl.extensions;
  234|       |
  235|  18.2k|        for (idx = 0; idx < sk_X509_EXTENSION_num(exts); idx++) {
  ------------------
  |  |  235|  18.2k|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (235:23): [True: 11.7k, False: 6.55k]
  ------------------
  236|  11.7k|            int nid;
  237|  11.7k|            ext = sk_X509_EXTENSION_value(exts, idx);
  ------------------
  |  |  236|  11.7k|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
  238|  11.7k|            nid = OBJ_obj2nid(X509_EXTENSION_get_object(ext));
  239|  11.7k|            if (nid == NID_freshest_crl)
  ------------------
  |  | 2782|  11.7k|#define NID_freshest_crl                857
  ------------------
  |  Branch (239:17): [True: 276, False: 11.4k]
  ------------------
  240|    276|                crl->flags |= EXFLAG_FRESHEST;
  ------------------
  |  |  664|    276|# define EXFLAG_FRESHEST         0x1000
  ------------------
  241|  11.7k|            if (X509_EXTENSION_get_critical(ext)) {
  ------------------
  |  Branch (241:17): [True: 2.80k, False: 8.91k]
  ------------------
  242|       |                /* We handle IDP and deltas */
  243|  2.80k|                if ((nid == NID_issuing_distribution_point)
  ------------------
  |  | 2707|  2.80k|#define NID_issuing_distribution_point          770
  ------------------
  |  Branch (243:21): [True: 1.62k, False: 1.17k]
  ------------------
  244|  2.80k|                    || (nid == NID_authority_key_identifier)
  ------------------
  |  | 2742|  1.17k|#define NID_authority_key_identifier            90
  ------------------
  |  Branch (244:24): [True: 1.10k, False: 66]
  ------------------
  245|  2.80k|                    || (nid == NID_delta_crl))
  ------------------
  |  | 2702|     66|#define NID_delta_crl           140
  ------------------
  |  Branch (245:24): [True: 29, False: 37]
  ------------------
  246|  2.76k|                    continue;
  247|     37|                crl->flags |= EXFLAG_CRITICAL;
  ------------------
  |  |  660|     37|# define EXFLAG_CRITICAL         0x200
  ------------------
  248|     37|                break;
  249|  2.80k|            }
  250|  11.7k|        }
  251|       |
  252|  6.59k|        if (!crl_set_issuers(crl))
  ------------------
  |  Branch (252:13): [True: 0, False: 6.59k]
  ------------------
  253|      0|            return 0;
  254|       |
  255|  6.59k|        if (crl->meth->crl_init) {
  ------------------
  |  Branch (255:13): [True: 0, False: 6.59k]
  ------------------
  256|      0|            if (crl->meth->crl_init(crl) == 0)
  ------------------
  |  Branch (256:17): [True: 0, False: 0]
  ------------------
  257|      0|                return 0;
  258|      0|        }
  259|       |
  260|  6.59k|        crl->flags |= EXFLAG_SET;
  ------------------
  |  |  659|  6.59k|# define EXFLAG_SET              0x100
  ------------------
  261|  6.59k|        break;
  262|       |
  263|  16.6k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|  16.6k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (263:5): [True: 16.6k, False: 94.1k]
  ------------------
  264|  16.6k|        if (crl->meth != NULL && crl->meth->crl_free != NULL) {
  ------------------
  |  Branch (264:13): [True: 16.6k, False: 0]
  |  Branch (264:34): [True: 0, False: 16.6k]
  ------------------
  265|      0|            if (!crl->meth->crl_free(crl))
  ------------------
  |  Branch (265:17): [True: 0, False: 0]
  ------------------
  266|      0|                return 0;
  267|      0|        }
  268|  16.6k|        AUTHORITY_KEYID_free(crl->akid);
  269|  16.6k|        ISSUING_DIST_POINT_free(crl->idp);
  270|  16.6k|        ASN1_INTEGER_free(crl->crl_number);
  271|  16.6k|        ASN1_INTEGER_free(crl->base_crl_number);
  272|  16.6k|        sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free);
  ------------------
  |  |  285|  16.6k|#define sk_GENERAL_NAMES_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_GENERAL_NAMES_sk_type(sk), ossl_check_GENERAL_NAMES_freefunc_type(freefunc))
  ------------------
  273|  16.6k|        OPENSSL_free(crl->propq);
  ------------------
  |  |  115|  16.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  16.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  16.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  274|  16.6k|        break;
  275|      0|    case ASN1_OP_DUP_POST:
  ------------------
  |  |  757|      0|# define ASN1_OP_DUP_POST        15
  ------------------
  |  Branch (275:5): [True: 0, False: 110k]
  ------------------
  276|      0|        {
  277|      0|            X509_CRL *old = exarg;
  278|       |
  279|      0|            if (!ossl_x509_crl_set0_libctx(crl, old->libctx, old->propq))
  ------------------
  |  Branch (279:17): [True: 0, False: 0]
  ------------------
  280|      0|                return 0;
  281|      0|        }
  282|      0|        break;
  283|   110k|    }
  284|   110k|    return 1;
  285|   110k|}
x_crl.c:setup_idp:
  290|    327|{
  291|    327|    int idp_only = 0;
  292|       |
  293|       |    /* Set various flags according to IDP */
  294|    327|    crl->idp_flags |= IDP_PRESENT;
  ------------------
  |  |  601|    327|# define IDP_PRESENT     0x1
  ------------------
  295|    327|    if (idp->onlyuser > 0) {
  ------------------
  |  Branch (295:9): [True: 3, False: 324]
  ------------------
  296|      3|        idp_only++;
  297|      3|        crl->idp_flags |= IDP_ONLYUSER;
  ------------------
  |  |  605|      3|# define IDP_ONLYUSER    0x4
  ------------------
  298|      3|    }
  299|    327|    if (idp->onlyCA > 0) {
  ------------------
  |  Branch (299:9): [True: 49, False: 278]
  ------------------
  300|     49|        idp_only++;
  301|     49|        crl->idp_flags |= IDP_ONLYCA;
  ------------------
  |  |  607|     49|# define IDP_ONLYCA      0x8
  ------------------
  302|     49|    }
  303|    327|    if (idp->onlyattr > 0) {
  ------------------
  |  Branch (303:9): [True: 22, False: 305]
  ------------------
  304|     22|        idp_only++;
  305|     22|        crl->idp_flags |= IDP_ONLYATTR;
  ------------------
  |  |  609|     22|# define IDP_ONLYATTR    0x10
  ------------------
  306|     22|    }
  307|       |
  308|    327|    if (idp_only > 1)
  ------------------
  |  Branch (308:9): [True: 3, False: 324]
  ------------------
  309|      3|        crl->idp_flags |= IDP_INVALID;
  ------------------
  |  |  603|      3|# define IDP_INVALID     0x2
  ------------------
  310|       |
  311|    327|    if (idp->indirectCRL > 0)
  ------------------
  |  Branch (311:9): [True: 3, False: 324]
  ------------------
  312|      3|        crl->idp_flags |= IDP_INDIRECT;
  ------------------
  |  |  611|      3|# define IDP_INDIRECT    0x20
  ------------------
  313|       |
  314|    327|    if (idp->onlysomereasons) {
  ------------------
  |  Branch (314:9): [True: 6, False: 321]
  ------------------
  315|      6|        crl->idp_flags |= IDP_REASONS;
  ------------------
  |  |  613|      6|# define IDP_REASONS     0x40
  ------------------
  316|      6|        if (idp->onlysomereasons->length > 0)
  ------------------
  |  Branch (316:13): [True: 3, False: 3]
  ------------------
  317|      3|            crl->idp_reasons = idp->onlysomereasons->data[0];
  318|      6|        if (idp->onlysomereasons->length > 1)
  ------------------
  |  Branch (318:13): [True: 3, False: 3]
  ------------------
  319|      3|            crl->idp_reasons |= (idp->onlysomereasons->data[1] << 8);
  320|      6|        crl->idp_reasons &= CRLDP_ALL_REASONS;
  ------------------
  |  |  309|      6|# define CRLDP_ALL_REASONS       0x807f
  ------------------
  321|      6|    }
  322|       |
  323|    327|    return DIST_POINT_set_dpname(idp->distpoint, X509_CRL_get_issuer(crl));
  324|    327|}
x_crl.c:crl_set_issuers:
   83|  6.59k|{
   84|       |
   85|  6.59k|    int i, j;
   86|  6.59k|    GENERAL_NAMES *gens, *gtmp;
   87|  6.59k|    STACK_OF(X509_REVOKED) *revoked;
  ------------------
  |  |   31|  6.59k|# define STACK_OF(type) struct stack_st_##type
  ------------------
   88|       |
   89|  6.59k|    revoked = X509_CRL_get_REVOKED(crl);
   90|       |
   91|  6.59k|    gens = NULL;
   92|  25.5k|    for (i = 0; i < sk_X509_REVOKED_num(revoked); i++) {
  ------------------
  |  |  105|  25.5k|#define sk_X509_REVOKED_num(sk) OPENSSL_sk_num(ossl_check_const_X509_REVOKED_sk_type(sk))
  ------------------
  |  Branch (92:17): [True: 20.1k, False: 5.36k]
  ------------------
   93|  20.1k|        X509_REVOKED *rev = sk_X509_REVOKED_value(revoked, i);
  ------------------
  |  |  106|  20.1k|#define sk_X509_REVOKED_value(sk, idx) ((X509_REVOKED *)OPENSSL_sk_value(ossl_check_const_X509_REVOKED_sk_type(sk), (idx)))
  ------------------
   94|  20.1k|        STACK_OF(X509_EXTENSION) *exts;
  ------------------
  |  |   31|  20.1k|# define STACK_OF(type) struct stack_st_##type
  ------------------
   95|  20.1k|        ASN1_ENUMERATED *reason;
   96|  20.1k|        X509_EXTENSION *ext;
   97|       |
   98|  20.1k|        gtmp = X509_REVOKED_get_ext_d2i(rev,
   99|  20.1k|                                        NID_certificate_issuer, &j, NULL);
  ------------------
  |  | 2712|  20.1k|#define NID_certificate_issuer          771
  ------------------
  100|  20.1k|        if (gtmp == NULL && j != -1) {
  ------------------
  |  Branch (100:13): [True: 19.6k, False: 504]
  |  Branch (100:29): [True: 54, False: 19.6k]
  ------------------
  101|     54|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|     54|# define EXFLAG_INVALID          0x80
  ------------------
  102|     54|            return 1;
  103|     54|        }
  104|       |
  105|  20.1k|        if (gtmp != NULL) {
  ------------------
  |  Branch (105:13): [True: 504, False: 19.6k]
  ------------------
  106|    504|            if (crl->issuers == NULL) {
  ------------------
  |  Branch (106:17): [True: 75, False: 429]
  ------------------
  107|     75|                crl->issuers = sk_GENERAL_NAMES_new_null();
  ------------------
  |  |  274|     75|#define sk_GENERAL_NAMES_new_null() ((STACK_OF(GENERAL_NAMES) *)OPENSSL_sk_new_null())
  ------------------
  108|     75|                if (crl->issuers == NULL) {
  ------------------
  |  Branch (108:21): [True: 0, False: 75]
  ------------------
  109|      0|                    GENERAL_NAMES_free(gtmp);
  110|      0|                    return 0;
  111|      0|                }
  112|     75|            }
  113|    504|            if (!sk_GENERAL_NAMES_push(crl->issuers, gtmp)) {
  ------------------
  |  |  281|    504|#define sk_GENERAL_NAMES_push(sk, ptr) OPENSSL_sk_push(ossl_check_GENERAL_NAMES_sk_type(sk), ossl_check_GENERAL_NAMES_type(ptr))
  ------------------
  |  Branch (113:17): [True: 0, False: 504]
  ------------------
  114|      0|                GENERAL_NAMES_free(gtmp);
  115|      0|                return 0;
  116|      0|            }
  117|    504|            gens = gtmp;
  118|    504|        }
  119|  20.1k|        rev->issuer = gens;
  120|       |
  121|  20.1k|        reason = X509_REVOKED_get_ext_d2i(rev, NID_crl_reason, &j, NULL);
  ------------------
  |  | 2692|  20.1k|#define NID_crl_reason          141
  ------------------
  122|  20.1k|        if (reason == NULL && j != -1) {
  ------------------
  |  Branch (122:13): [True: 7.81k, False: 12.3k]
  |  Branch (122:31): [True: 1.17k, False: 6.64k]
  ------------------
  123|  1.17k|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|  1.17k|# define EXFLAG_INVALID          0x80
  ------------------
  124|  1.17k|            return 1;
  125|  1.17k|        }
  126|       |
  127|  18.9k|        if (reason != NULL) {
  ------------------
  |  Branch (127:13): [True: 12.3k, False: 6.64k]
  ------------------
  128|  12.3k|            rev->reason = ASN1_ENUMERATED_get(reason);
  129|  12.3k|            ASN1_ENUMERATED_free(reason);
  130|  12.3k|        } else
  131|  6.64k|            rev->reason = CRL_REASON_NONE;
  ------------------
  |  |  311|  6.64k|# define CRL_REASON_NONE                         -1
  ------------------
  132|       |
  133|       |        /* Check for critical CRL entry extensions */
  134|       |
  135|  18.9k|        exts = rev->extensions;
  136|       |
  137|  35.4k|        for (j = 0; j < sk_X509_EXTENSION_num(exts); j++) {
  ------------------
  |  |  235|  35.4k|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (137:21): [True: 16.8k, False: 18.6k]
  ------------------
  138|  16.8k|            ext = sk_X509_EXTENSION_value(exts, j);
  ------------------
  |  |  236|  16.8k|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
  139|  16.8k|            if (X509_EXTENSION_get_critical(ext)) {
  ------------------
  |  Branch (139:17): [True: 357, False: 16.5k]
  ------------------
  140|    357|                if (OBJ_obj2nid(X509_EXTENSION_get_object(ext))
  ------------------
  |  Branch (140:21): [True: 20, False: 337]
  ------------------
  141|    357|                    == NID_certificate_issuer)
  ------------------
  |  | 2712|    357|#define NID_certificate_issuer          771
  ------------------
  142|     20|                    continue;
  143|    337|                crl->flags |= EXFLAG_CRITICAL;
  ------------------
  |  |  660|    337|# define EXFLAG_CRITICAL         0x200
  ------------------
  144|    337|                break;
  145|    357|            }
  146|  16.8k|        }
  147|       |
  148|  18.9k|    }
  149|       |
  150|  5.36k|    return 1;
  151|       |
  152|  6.59k|}

X509_NAME_print:
  504|  2.79k|{
  505|  2.79k|    char *s, *c, *b;
  506|  2.79k|    int i;
  507|       |
  508|  2.79k|    b = X509_NAME_oneline(name, NULL, 0);
  509|  2.79k|    if (b == NULL)
  ------------------
  |  Branch (509:9): [True: 0, False: 2.79k]
  ------------------
  510|      0|        return 0;
  511|  2.79k|    if (*b == '\0') {
  ------------------
  |  Branch (511:9): [True: 1.88k, False: 912]
  ------------------
  512|  1.88k|        OPENSSL_free(b);
  ------------------
  |  |  115|  1.88k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.88k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.88k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  513|  1.88k|        return 1;
  514|  1.88k|    }
  515|    912|    s = b + 1;                  /* skip the first slash */
  516|       |
  517|    912|    c = s;
  518|   905k|    for (;;) {
  519|   905k|        if (((*s == '/') &&
  ------------------
  |  Branch (519:14): [True: 2.23k, False: 903k]
  ------------------
  520|   905k|             (ossl_isupper(s[1]) && ((s[2] == '=') ||
  ------------------
  |  Branch (520:15): [True: 929, False: 1.30k]
  |  Branch (520:38): [True: 228, False: 701]
  ------------------
  521|    929|                                (ossl_isupper(s[2]) && (s[3] == '='))
  ------------------
  |  Branch (521:34): [True: 437, False: 264]
  |  Branch (521:56): [True: 238, False: 199]
  ------------------
  522|   905k|              ))) || (*s == '\0'))
  ------------------
  |  Branch (522:22): [True: 912, False: 904k]
  ------------------
  523|  1.37k|        {
  524|  1.37k|            i = s - c;
  525|  1.37k|            if (BIO_write(bp, c, i) != i)
  ------------------
  |  Branch (525:17): [True: 0, False: 1.37k]
  ------------------
  526|      0|                goto err;
  527|  1.37k|            c = s + 1;          /* skip following slash */
  528|  1.37k|            if (*s != '\0') {
  ------------------
  |  Branch (528:17): [True: 466, False: 912]
  ------------------
  529|    466|                if (BIO_write(bp, ", ", 2) != 2)
  ------------------
  |  Branch (529:21): [True: 0, False: 466]
  ------------------
  530|      0|                    goto err;
  531|    466|            }
  532|  1.37k|        }
  533|   905k|        if (*s == '\0')
  ------------------
  |  Branch (533:13): [True: 912, False: 904k]
  ------------------
  534|    912|            break;
  535|   904k|        s++;
  536|   904k|    }
  537|       |
  538|    912|    OPENSSL_free(b);
  ------------------
  |  |  115|    912|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    912|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    912|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  539|    912|    return 1;
  540|      0| err:
  541|      0|    ERR_raise(ERR_LIB_X509, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  542|      0|    OPENSSL_free(b);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  543|      0|    return 0;
  544|    912|}
x_name.c:x509_name_ex_new:
   91|   256k|{
   92|   256k|    X509_NAME *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|   256k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   256k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   256k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|       |
   94|   256k|    if (ret == NULL)
  ------------------
  |  Branch (94:9): [True: 0, False: 256k]
  ------------------
   95|      0|        return 0;
   96|   256k|    if ((ret->entries = sk_X509_NAME_ENTRY_new_null()) == NULL) {
  ------------------
  |  |  207|   256k|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (96:9): [True: 0, False: 256k]
  ------------------
   97|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   98|      0|        goto err;
   99|      0|    }
  100|   256k|    if ((ret->bytes = BUF_MEM_new()) == NULL) {
  ------------------
  |  Branch (100:9): [True: 0, False: 256k]
  ------------------
  101|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  102|      0|        goto err;
  103|      0|    }
  104|   256k|    ret->modified = 1;
  105|   256k|    *val = (ASN1_VALUE *)ret;
  106|   256k|    return 1;
  107|       |
  108|      0| err:
  109|      0|    if (ret) {
  ------------------
  |  Branch (109:9): [True: 0, False: 0]
  ------------------
  110|      0|        sk_X509_NAME_ENTRY_free(ret->entries);
  ------------------
  |  |  210|      0|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  111|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|      0|    }
  113|      0|    return 0;
  114|   256k|}
x_name.c:x509_name_ex_free:
  117|   256k|{
  118|   256k|    X509_NAME *a;
  119|       |
  120|   256k|    if (pval == NULL || *pval == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 256k]
  |  Branch (120:25): [True: 0, False: 256k]
  ------------------
  121|      0|        return;
  122|   256k|    a = (X509_NAME *)*pval;
  123|       |
  124|   256k|    BUF_MEM_free(a->bytes);
  125|   256k|    sk_X509_NAME_ENTRY_pop_free(a->entries, X509_NAME_ENTRY_free);
  ------------------
  |  |  218|   256k|#define sk_X509_NAME_ENTRY_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_freefunc_type(freefunc))
  ------------------
  126|   256k|    OPENSSL_free(a->canon_enc);
  ------------------
  |  |  115|   256k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   256k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   256k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  127|   256k|    OPENSSL_free(a);
  ------------------
  |  |  115|   256k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   256k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   256k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  128|   256k|    *pval = NULL;
  129|   256k|}
x_name.c:x509_name_ex_d2i:
  145|   116k|{
  146|   116k|    const unsigned char *p = *in, *q;
  147|   116k|    union {
  148|   116k|        STACK_OF(STACK_OF_X509_NAME_ENTRY) *s;
  149|   116k|        ASN1_VALUE *a;
  150|   116k|    } intname = {
  151|   116k|        NULL
  152|   116k|    };
  153|   116k|    union {
  154|   116k|        X509_NAME *x;
  155|   116k|        ASN1_VALUE *a;
  156|   116k|    } nm = {
  157|   116k|        NULL
  158|   116k|    };
  159|   116k|    int i, j, ret;
  160|   116k|    STACK_OF(X509_NAME_ENTRY) *entries;
  ------------------
  |  |   31|   116k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  161|   116k|    X509_NAME_ENTRY *entry;
  162|       |
  163|   116k|    if (len > X509_NAME_MAX)
  ------------------
  |  |   24|   116k|#define X509_NAME_MAX (1024 * 1024)
  ------------------
  |  Branch (163:9): [True: 0, False: 116k]
  ------------------
  164|      0|        len = X509_NAME_MAX;
  ------------------
  |  |   24|      0|#define X509_NAME_MAX (1024 * 1024)
  ------------------
  165|   116k|    q = p;
  166|       |
  167|       |    /* Get internal representation of Name */
  168|   116k|    ret = ASN1_item_ex_d2i(&intname.a,
  169|   116k|                           &p, len, ASN1_ITEM_rptr(X509_NAME_INTERNAL),
  ------------------
  |  |  427|   116k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  170|   116k|                           tag, aclass, opt, ctx);
  171|       |
  172|   116k|    if (ret <= 0)
  ------------------
  |  Branch (172:9): [True: 45.4k, False: 70.6k]
  ------------------
  173|  45.4k|        return ret;
  174|       |
  175|  70.6k|    if (*val)
  ------------------
  |  Branch (175:9): [True: 65.4k, False: 5.17k]
  ------------------
  176|  65.4k|        x509_name_ex_free(val, NULL);
  177|  70.6k|    if (!x509_name_ex_new(&nm.a, NULL))
  ------------------
  |  Branch (177:9): [True: 0, False: 70.6k]
  ------------------
  178|      0|        goto err;
  179|       |    /* We've decoded it: now cache encoding */
  180|  70.6k|    if (!BUF_MEM_grow(nm.x->bytes, p - q))
  ------------------
  |  Branch (180:9): [True: 0, False: 70.6k]
  ------------------
  181|      0|        goto err;
  182|  70.6k|    memcpy(nm.x->bytes->data, q, p - q);
  183|       |
  184|       |    /* Convert internal representation to X509_NAME structure */
  185|   690k|    for (i = 0; i < sk_STACK_OF_X509_NAME_ENTRY_num(intname.s); i++) {
  ------------------
  |  Branch (185:17): [True: 620k, False: 70.6k]
  ------------------
  186|   620k|        entries = sk_STACK_OF_X509_NAME_ENTRY_value(intname.s, i);
  187|   813k|        for (j = 0; j < sk_X509_NAME_ENTRY_num(entries); j++) {
  ------------------
  |  |  204|   813k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (187:21): [True: 193k, False: 620k]
  ------------------
  188|   193k|            entry = sk_X509_NAME_ENTRY_value(entries, j);
  ------------------
  |  |  205|   193k|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
  189|   193k|            entry->set = i;
  190|   193k|            if (!sk_X509_NAME_ENTRY_push(nm.x->entries, entry))
  ------------------
  |  |  214|   193k|#define sk_X509_NAME_ENTRY_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
  ------------------
  |  Branch (190:17): [True: 0, False: 193k]
  ------------------
  191|      0|                goto err;
  192|   193k|            (void)sk_X509_NAME_ENTRY_set(entries, j, NULL);
  ------------------
  |  |  220|   193k|#define sk_X509_NAME_ENTRY_set(sk, idx, ptr) ((X509_NAME_ENTRY *)OPENSSL_sk_set(ossl_check_X509_NAME_ENTRY_sk_type(sk), (idx), ossl_check_X509_NAME_ENTRY_type(ptr)))
  ------------------
  193|   193k|        }
  194|   620k|    }
  195|  70.6k|    ret = x509_name_canon(nm.x);
  196|  70.6k|    if (!ret)
  ------------------
  |  Branch (196:9): [True: 109, False: 70.5k]
  ------------------
  197|    109|        goto err;
  198|  70.5k|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  199|  70.5k|                                         local_sk_X509_NAME_ENTRY_free);
  200|  70.5k|    nm.x->modified = 0;
  201|  70.5k|    *val = nm.a;
  202|  70.5k|    *in = p;
  203|  70.5k|    return ret;
  204|       |
  205|    109| err:
  206|    109|    if (nm.x != NULL)
  ------------------
  |  Branch (206:9): [True: 109, False: 0]
  ------------------
  207|    109|        X509_NAME_free(nm.x);
  208|    109|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  209|    109|                                         local_sk_X509_NAME_ENTRY_pop_free);
  210|    109|    ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|    109|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    109|    (ERR_new(),                                                 \
  |  |  |  |  404|    109|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    109|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    109|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    109|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    109|     ERR_set_error)
  |  |  ------------------
  ------------------
  211|    109|    return 0;
  212|  70.6k|}
x_name.c:x509_name_canon:
  311|  70.8k|{
  312|  70.8k|    unsigned char *p;
  313|  70.8k|    STACK_OF(STACK_OF_X509_NAME_ENTRY) *intname;
  ------------------
  |  |   31|  70.8k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  314|  70.8k|    STACK_OF(X509_NAME_ENTRY) *entries = NULL;
  ------------------
  |  |   31|  70.8k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  315|  70.8k|    X509_NAME_ENTRY *entry, *tmpentry = NULL;
  316|  70.8k|    int i, set = -1, ret = 0, len;
  317|       |
  318|  70.8k|    OPENSSL_free(a->canon_enc);
  ------------------
  |  |  115|  70.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  70.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  70.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  319|  70.8k|    a->canon_enc = NULL;
  320|       |    /* Special case: empty X509_NAME => null encoding */
  321|  70.8k|    if (sk_X509_NAME_ENTRY_num(a->entries) == 0) {
  ------------------
  |  |  204|  70.8k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (321:9): [True: 64.7k, False: 6.06k]
  ------------------
  322|  64.7k|        a->canon_enclen = 0;
  323|  64.7k|        return 1;
  324|  64.7k|    }
  325|  6.06k|    intname = sk_STACK_OF_X509_NAME_ENTRY_new_null();
  326|  6.06k|    if (intname == NULL) {
  ------------------
  |  Branch (326:9): [True: 0, False: 6.06k]
  ------------------
  327|      0|        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  328|      0|        goto err;
  329|      0|    }
  330|   232k|    for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
  ------------------
  |  |  204|   232k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (330:17): [True: 226k, False: 5.93k]
  ------------------
  331|   226k|        entry = sk_X509_NAME_ENTRY_value(a->entries, i);
  ------------------
  |  |  205|   226k|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
  332|   226k|        if (entry->set != set) {
  ------------------
  |  Branch (332:13): [True: 58.8k, False: 167k]
  ------------------
  333|  58.8k|            entries = sk_X509_NAME_ENTRY_new_null();
  ------------------
  |  |  207|  58.8k|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  334|  58.8k|            if (entries == NULL)
  ------------------
  |  Branch (334:17): [True: 0, False: 58.8k]
  ------------------
  335|      0|                goto err;
  336|  58.8k|            if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname, entries)) {
  ------------------
  |  Branch (336:17): [True: 0, False: 58.8k]
  ------------------
  337|      0|                sk_X509_NAME_ENTRY_free(entries);
  ------------------
  |  |  210|      0|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  338|      0|                ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  339|      0|                goto err;
  340|      0|            }
  341|  58.8k|            set = entry->set;
  342|  58.8k|        }
  343|   226k|        tmpentry = X509_NAME_ENTRY_new();
  344|   226k|        if (tmpentry == NULL) {
  ------------------
  |  Branch (344:13): [True: 0, False: 226k]
  ------------------
  345|      0|            ERR_raise(ERR_LIB_X509, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  346|      0|            goto err;
  347|      0|        }
  348|   226k|        tmpentry->object = OBJ_dup(entry->object);
  349|   226k|        if (tmpentry->object == NULL) {
  ------------------
  |  Branch (349:13): [True: 0, False: 226k]
  ------------------
  350|      0|            ERR_raise(ERR_LIB_X509, ERR_R_OBJ_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  351|      0|            goto err;
  352|      0|        }
  353|   226k|        if (!asn1_string_canon(tmpentry->value, entry->value))
  ------------------
  |  Branch (353:13): [True: 132, False: 226k]
  ------------------
  354|    132|            goto err;
  355|   226k|        if (!sk_X509_NAME_ENTRY_push(entries, tmpentry)) {
  ------------------
  |  |  214|   226k|#define sk_X509_NAME_ENTRY_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
  ------------------
  |  Branch (355:13): [True: 0, False: 226k]
  ------------------
  356|      0|            ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  357|      0|            goto err;
  358|      0|        }
  359|   226k|        tmpentry = NULL;
  360|   226k|    }
  361|       |
  362|       |    /* Finally generate encoding */
  363|  5.93k|    len = i2d_name_canon(intname, NULL);
  364|  5.93k|    if (len < 0)
  ------------------
  |  Branch (364:9): [True: 0, False: 5.93k]
  ------------------
  365|      0|        goto err;
  366|  5.93k|    a->canon_enclen = len;
  367|       |
  368|  5.93k|    p = OPENSSL_malloc(a->canon_enclen);
  ------------------
  |  |  102|  5.93k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  5.93k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  5.93k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  369|  5.93k|    if (p == NULL)
  ------------------
  |  Branch (369:9): [True: 0, False: 5.93k]
  ------------------
  370|      0|        goto err;
  371|       |
  372|  5.93k|    a->canon_enc = p;
  373|       |
  374|  5.93k|    i2d_name_canon(intname, &p);
  375|       |
  376|  5.93k|    ret = 1;
  377|       |
  378|  6.06k| err:
  379|  6.06k|    X509_NAME_ENTRY_free(tmpentry);
  380|  6.06k|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname,
  381|  6.06k|                                         local_sk_X509_NAME_ENTRY_pop_free);
  382|  6.06k|    return ret;
  383|  5.93k|}
x_name.c:asn1_string_canon:
  393|   226k|{
  394|   226k|    unsigned char *to, *from;
  395|   226k|    int len, i;
  396|       |
  397|       |    /* If type not in bitmask just copy string across */
  398|   226k|    if (!(ASN1_tag2bit(in->type) & ASN1_MASK_CANON)) {
  ------------------
  |  |  388|   226k|        (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \
  |  |  ------------------
  |  |  |  |  117|   226k|# define B_ASN1_UTF8STRING       0x2000
  |  |  ------------------
  |  |                       (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \
  |  |  ------------------
  |  |  |  |  115|   226k|# define B_ASN1_BMPSTRING        0x0800
  |  |  ------------------
  |  |                       (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \
  |  |  ------------------
  |  |  |  |  112|   226k|# define B_ASN1_UNIVERSALSTRING  0x0100
  |  |  ------------------
  |  |  389|   226k|        | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  103|   226k|# define B_ASN1_PRINTABLESTRING  0x0002
  |  |  ------------------
  |  |                       | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  104|   226k|# define B_ASN1_T61STRING        0x0004
  |  |  ------------------
  |  |                       | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  107|   226k|# define B_ASN1_IA5STRING        0x0010
  |  |  ------------------
  |  |  390|   226k|        | B_ASN1_VISIBLESTRING)
  |  |  ------------------
  |  |  |  |  110|   226k|# define B_ASN1_VISIBLESTRING    0x0040
  |  |  ------------------
  ------------------
  |  Branch (398:9): [True: 109k, False: 117k]
  ------------------
  399|   109k|        if (!ASN1_STRING_copy(out, in))
  ------------------
  |  Branch (399:13): [True: 0, False: 109k]
  ------------------
  400|      0|            return 0;
  401|   109k|        return 1;
  402|   109k|    }
  403|       |
  404|   117k|    out->type = V_ASN1_UTF8STRING;
  ------------------
  |  |   73|   117k|# define V_ASN1_UTF8STRING               12
  ------------------
  405|   117k|    out->length = ASN1_STRING_to_UTF8(&out->data, in);
  406|   117k|    if (out->length == -1)
  ------------------
  |  Branch (406:9): [True: 132, False: 117k]
  ------------------
  407|    132|        return 0;
  408|       |
  409|   117k|    to = out->data;
  410|   117k|    from = to;
  411|       |
  412|   117k|    len = out->length;
  413|       |
  414|       |    /*
  415|       |     * Convert string in place to canonical form. Ultimately we may need to
  416|       |     * handle a wider range of characters but for now ignore anything with
  417|       |     * MSB set and rely on the ossl_isspace() to fail on bad characters without
  418|       |     * needing isascii or range checks as well.
  419|       |     */
  420|       |
  421|       |    /* Ignore leading spaces */
  422|   118k|    while (len > 0 && ossl_isspace(*from)) {
  ------------------
  |  |   82|  15.9k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  15.9k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 628, False: 15.3k]
  |  |  ------------------
  ------------------
  |  Branch (422:12): [True: 15.9k, False: 102k]
  ------------------
  423|    628|        from++;
  424|    628|        len--;
  425|    628|    }
  426|       |
  427|   117k|    to = from + len;
  428|       |
  429|       |    /* Ignore trailing spaces */
  430|   117k|    while (len > 0 && ossl_isspace(to[-1])) {
  ------------------
  |  |   82|  15.6k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  15.6k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 293, False: 15.3k]
  |  |  ------------------
  ------------------
  |  Branch (430:12): [True: 15.6k, False: 102k]
  ------------------
  431|    293|        to--;
  432|    293|        len--;
  433|    293|    }
  434|       |
  435|   117k|    to = out->data;
  436|       |
  437|   117k|    i = 0;
  438|  24.4M|    while (i < len) {
  ------------------
  |  Branch (438:12): [True: 24.3M, False: 117k]
  ------------------
  439|       |        /* If not ASCII set just copy across */
  440|  24.3M|        if (!ossl_isascii(*from)) {
  ------------------
  |  |   75|  24.3M|# define ossl_isascii(c)        (((c) & ~127) == 0)
  ------------------
  |  Branch (440:13): [True: 23.9M, False: 444k]
  ------------------
  441|  23.9M|            *to++ = *from++;
  442|  23.9M|            i++;
  443|  23.9M|        }
  444|       |        /* Collapse multiple spaces */
  445|   444k|        else if (ossl_isspace(*from)) {
  ------------------
  |  |   82|   444k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|   444k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 15.6k, False: 429k]
  |  |  ------------------
  ------------------
  446|       |            /* Copy one space across */
  447|  15.6k|            *to++ = ' ';
  448|       |            /*
  449|       |             * Ignore subsequent spaces. Note: don't need to check len here
  450|       |             * because we know the last character is a non-space so we can't
  451|       |             * overflow.
  452|       |             */
  453|   122k|            do {
  454|   122k|                from++;
  455|   122k|                i++;
  456|   122k|            }
  457|   122k|            while (ossl_isspace(*from));
  ------------------
  |  |   82|   122k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|   122k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 106k, False: 15.6k]
  |  |  ------------------
  ------------------
  458|   429k|        } else {
  459|   429k|            *to++ = ossl_tolower(*from);
  460|   429k|            from++;
  461|   429k|            i++;
  462|   429k|        }
  463|  24.3M|    }
  464|       |
  465|   117k|    out->length = to - out->data;
  466|       |
  467|   117k|    return 1;
  468|       |
  469|   117k|}
x_name.c:i2d_name_canon:
  473|  11.8k|{
  474|  11.8k|    int i, len, ltmp;
  475|  11.8k|    const ASN1_VALUE *v;
  476|  11.8k|    STACK_OF(ASN1_VALUE) *intname = (STACK_OF(ASN1_VALUE) *)_intname;
  ------------------
  |  |   31|  11.8k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  477|       |
  478|  11.8k|    len = 0;
  479|   129k|    for (i = 0; i < sk_ASN1_VALUE_num(intname); i++) {
  ------------------
  |  |  898|   129k|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (479:17): [True: 117k, False: 11.8k]
  ------------------
  480|   117k|        v = sk_ASN1_VALUE_value(intname, i);
  ------------------
  |  |  899|   117k|#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx)))
  ------------------
  481|   117k|        ltmp = ASN1_item_ex_i2d(&v, in,
  482|   117k|                                ASN1_ITEM_rptr(X509_NAME_ENTRIES), -1, -1);
  ------------------
  |  |  427|   117k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  483|   117k|        if (ltmp < 0 || len > INT_MAX - ltmp)
  ------------------
  |  Branch (483:13): [True: 0, False: 117k]
  |  Branch (483:25): [True: 0, False: 117k]
  ------------------
  484|      0|            return -1;
  485|   117k|        len += ltmp;
  486|   117k|    }
  487|  11.8k|    return len;
  488|  11.8k|}
x_name.c:local_sk_X509_NAME_ENTRY_free:
  132|   632k|{
  133|   632k|    sk_X509_NAME_ENTRY_free(ne);
  ------------------
  |  |  210|   632k|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  134|   632k|}
x_name.c:local_sk_X509_NAME_ENTRY_pop_free:
  137|  59.1k|{
  138|  59.1k|    sk_X509_NAME_ENTRY_pop_free(ne, X509_NAME_ENTRY_free);
  ------------------
  |  |  218|  59.1k|#define sk_X509_NAME_ENTRY_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_freefunc_type(freefunc))
  ------------------
  139|  59.1k|}
x_name.c:x509_name_ex_i2d:
  216|  14.0k|{
  217|  14.0k|    int ret;
  218|  14.0k|    X509_NAME *a = (X509_NAME *)*val;
  219|       |
  220|  14.0k|    if (a->modified) {
  ------------------
  |  Branch (220:9): [True: 232, False: 13.7k]
  ------------------
  221|    232|        ret = x509_name_encode(a);
  222|    232|        if (ret < 0)
  ------------------
  |  Branch (222:13): [True: 0, False: 232]
  ------------------
  223|      0|            return ret;
  224|    232|        ret = x509_name_canon(a);
  225|    232|        if (!ret)
  ------------------
  |  Branch (225:13): [True: 23, False: 209]
  ------------------
  226|     23|            return -1;
  227|    232|    }
  228|  13.9k|    ret = a->bytes->length;
  229|  13.9k|    if (out != NULL) {
  ------------------
  |  Branch (229:9): [True: 2.49k, False: 11.4k]
  ------------------
  230|  2.49k|        memcpy(*out, a->bytes->data, ret);
  231|  2.49k|        *out += ret;
  232|  2.49k|    }
  233|  13.9k|    return ret;
  234|  14.0k|}
x_name.c:x509_name_encode:
  237|    232|{
  238|    232|    union {
  239|    232|        STACK_OF(STACK_OF_X509_NAME_ENTRY) *s;
  240|    232|        const ASN1_VALUE *a;
  241|    232|    } intname = {
  242|    232|        NULL
  243|    232|    };
  244|    232|    int len;
  245|    232|    unsigned char *p;
  246|    232|    STACK_OF(X509_NAME_ENTRY) *entries = NULL;
  ------------------
  |  |   31|    232|# define STACK_OF(type) struct stack_st_##type
  ------------------
  247|    232|    X509_NAME_ENTRY *entry;
  248|    232|    int i, set = -1;
  249|       |
  250|    232|    intname.s = sk_STACK_OF_X509_NAME_ENTRY_new_null();
  251|    232|    if (!intname.s)
  ------------------
  |  Branch (251:9): [True: 0, False: 232]
  ------------------
  252|      0|        goto cerr;
  253|  33.3k|    for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
  ------------------
  |  |  204|  33.3k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (253:17): [True: 33.1k, False: 232]
  ------------------
  254|  33.1k|        entry = sk_X509_NAME_ENTRY_value(a->entries, i);
  ------------------
  |  |  205|  33.1k|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
  255|  33.1k|        if (entry->set != set) {
  ------------------
  |  Branch (255:13): [True: 12.2k, False: 20.8k]
  ------------------
  256|  12.2k|            entries = sk_X509_NAME_ENTRY_new_null();
  ------------------
  |  |  207|  12.2k|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  257|  12.2k|            if (!entries)
  ------------------
  |  Branch (257:17): [True: 0, False: 12.2k]
  ------------------
  258|      0|                goto cerr;
  259|  12.2k|            if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname.s, entries)) {
  ------------------
  |  Branch (259:17): [True: 0, False: 12.2k]
  ------------------
  260|      0|                sk_X509_NAME_ENTRY_free(entries);
  ------------------
  |  |  210|      0|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  261|      0|                goto cerr;
  262|      0|            }
  263|  12.2k|            set = entry->set;
  264|  12.2k|        }
  265|  33.1k|        if (!sk_X509_NAME_ENTRY_push(entries, entry))
  ------------------
  |  |  214|  33.1k|#define sk_X509_NAME_ENTRY_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
  ------------------
  |  Branch (265:13): [True: 0, False: 33.1k]
  ------------------
  266|      0|            goto cerr;
  267|  33.1k|    }
  268|    232|    len = ASN1_item_ex_i2d(&intname.a, NULL,
  269|    232|                           ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1);
  ------------------
  |  |  427|    232|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  270|    232|    if (!BUF_MEM_grow(a->bytes, len)) {
  ------------------
  |  Branch (270:9): [True: 0, False: 232]
  ------------------
  271|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        goto err;
  273|      0|    }
  274|    232|    p = (unsigned char *)a->bytes->data;
  275|    232|    ASN1_item_ex_i2d(&intname.a,
  276|    232|                     &p, ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1);
  ------------------
  |  |  427|    232|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  277|    232|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  278|    232|                                         local_sk_X509_NAME_ENTRY_free);
  279|    232|    a->modified = 0;
  280|    232|    return len;
  281|      0| cerr:
  282|      0|    ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  283|      0| err:
  284|      0|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  285|      0|                                         local_sk_X509_NAME_ENTRY_free);
  286|      0|    return -1;
  287|      0|}
x_name.c:x509_name_ex_print:
  292|  2.79k|{
  293|  2.79k|    if (X509_NAME_print_ex(out, (const X509_NAME *)*pval,
  ------------------
  |  Branch (293:9): [True: 0, False: 2.79k]
  ------------------
  294|  2.79k|                           indent, pctx->nm_flags) <= 0)
  295|      0|        return 0;
  296|  2.79k|    return 2;
  297|  2.79k|}

ossl_d2i_X509_PUBKEY_INTERNAL:
   71|  35.1k|{
   72|  35.1k|    X509_PUBKEY *xpub = OPENSSL_zalloc(sizeof(*xpub));
  ------------------
  |  |  104|  35.1k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  35.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  35.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|       |
   74|  35.1k|    if (xpub == NULL)
  ------------------
  |  Branch (74:9): [True: 0, False: 35.1k]
  ------------------
   75|      0|        return NULL;
   76|  35.1k|    return (X509_PUBKEY *)ASN1_item_d2i_ex((ASN1_VALUE **)&xpub, pp, len,
   77|  35.1k|                                           ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL),
  ------------------
  |  |  427|  35.1k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
   78|  35.1k|                                           libctx, propq);
   79|  35.1k|}
ossl_X509_PUBKEY_INTERNAL_free:
   82|  60.7k|{
   83|  60.7k|    ASN1_item_free((ASN1_VALUE *)xpub, ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL));
  ------------------
  |  |  427|  60.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
   84|  60.7k|}
X509_PUBKEY_get0:
  456|  24.8k|{
  457|  24.8k|    if (key == NULL) {
  ------------------
  |  Branch (457:9): [True: 0, False: 24.8k]
  ------------------
  458|      0|        ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  459|      0|        return NULL;
  460|      0|    }
  461|       |
  462|  24.8k|    if (key->pkey == NULL) {
  ------------------
  |  Branch (462:9): [True: 17.9k, False: 6.89k]
  ------------------
  463|       |        /* We failed to decode the key when we loaded it, or it was never set */
  464|  17.9k|        ERR_raise(ERR_LIB_EVP, EVP_R_DECODE_ERROR);
  ------------------
  |  |  401|  17.9k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  17.9k|    (ERR_new(),                                                 \
  |  |  |  |  404|  17.9k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  17.9k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  17.9k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  17.9k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  17.9k|     ERR_set_error)
  |  |  ------------------
  ------------------
  465|  17.9k|        return NULL;
  466|  17.9k|    }
  467|       |
  468|  6.89k|    return key->pkey;
  469|  24.8k|}
X509_PUBKEY_get:
  472|  24.8k|{
  473|  24.8k|    EVP_PKEY *ret = X509_PUBKEY_get0(key);
  474|       |
  475|  24.8k|    if (ret != NULL && !EVP_PKEY_up_ref(ret)) {
  ------------------
  |  Branch (475:9): [True: 6.89k, False: 17.9k]
  |  Branch (475:24): [True: 0, False: 6.89k]
  ------------------
  476|      0|        ERR_raise(ERR_LIB_X509, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  477|      0|        ret = NULL;
  478|      0|    }
  479|  24.8k|    return ret;
  480|  24.8k|}
ossl_d2i_PUBKEY_legacy:
  536|  24.8k|{
  537|  24.8k|    return d2i_PUBKEY_int(a, pp, length, NULL, NULL, 1, d2i_X509_PUBKEY);
  538|  24.8k|}
d2i_PUBKEY_ex:
  542|      2|{
  543|      2|    return d2i_PUBKEY_int(a, pp, length, libctx, propq, 0, d2i_X509_PUBKEY);
  544|      2|}
d2i_RSA_PUBKEY:
  606|     59|{
  607|     59|    EVP_PKEY *pkey;
  608|     59|    RSA *key = NULL;
  609|     59|    const unsigned char *q;
  610|       |
  611|     59|    q = *pp;
  612|     59|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  613|     59|    if (pkey == NULL)
  ------------------
  |  Branch (613:9): [True: 12, False: 47]
  ------------------
  614|     12|        return NULL;
  615|     47|    key = EVP_PKEY_get1_RSA(pkey);
  616|     47|    EVP_PKEY_free(pkey);
  617|     47|    if (key == NULL)
  ------------------
  |  Branch (617:9): [True: 0, False: 47]
  ------------------
  618|      0|        return NULL;
  619|     47|    *pp = q;
  620|     47|    if (a != NULL) {
  ------------------
  |  Branch (620:9): [True: 0, False: 47]
  ------------------
  621|      0|        RSA_free(*a);
  622|      0|        *a = key;
  623|      0|    }
  624|     47|    return key;
  625|     47|}
ossl_d2i_DH_PUBKEY:
  647|     75|{
  648|     75|    EVP_PKEY *pkey;
  649|     75|    DH *key = NULL;
  650|     75|    const unsigned char *q;
  651|       |
  652|     75|    q = *pp;
  653|     75|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  654|     75|    if (pkey == NULL)
  ------------------
  |  Branch (654:9): [True: 11, False: 64]
  ------------------
  655|     11|        return NULL;
  656|     64|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_DH)
  ------------------
  |  |   71|     64|# define EVP_PKEY_DH     NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|     64|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
  |  Branch (656:9): [True: 64, False: 0]
  ------------------
  657|     64|        key = EVP_PKEY_get1_DH(pkey);
  658|     64|    EVP_PKEY_free(pkey);
  659|     64|    if (key == NULL)
  ------------------
  |  Branch (659:9): [True: 0, False: 64]
  ------------------
  660|      0|        return NULL;
  661|     64|    *pp = q;
  662|     64|    if (a != NULL) {
  ------------------
  |  Branch (662:9): [True: 0, False: 64]
  ------------------
  663|      0|        DH_free(*a);
  664|      0|        *a = key;
  665|      0|    }
  666|     64|    return key;
  667|     64|}
ossl_d2i_DHx_PUBKEY:
  688|     39|{
  689|     39|    EVP_PKEY *pkey;
  690|     39|    DH *key = NULL;
  691|     39|    const unsigned char *q;
  692|       |
  693|     39|    q = *pp;
  694|     39|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  695|     39|    if (pkey == NULL)
  ------------------
  |  Branch (695:9): [True: 38, False: 1]
  ------------------
  696|     38|        return NULL;
  697|      1|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_DHX)
  ------------------
  |  |   72|      1|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5499|      1|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
  |  Branch (697:9): [True: 1, False: 0]
  ------------------
  698|      1|        key = EVP_PKEY_get1_DH(pkey);
  699|      1|    EVP_PKEY_free(pkey);
  700|      1|    if (key == NULL)
  ------------------
  |  Branch (700:9): [True: 0, False: 1]
  ------------------
  701|      0|        return NULL;
  702|      1|    *pp = q;
  703|      1|    if (a != NULL) {
  ------------------
  |  Branch (703:9): [True: 0, False: 1]
  ------------------
  704|      0|        DH_free(*a);
  705|      0|        *a = key;
  706|      0|    }
  707|      1|    return key;
  708|      1|}
d2i_DSA_PUBKEY:
  731|  1.08k|{
  732|  1.08k|    EVP_PKEY *pkey;
  733|  1.08k|    DSA *key = NULL;
  734|  1.08k|    const unsigned char *q;
  735|       |
  736|  1.08k|    q = *pp;
  737|  1.08k|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  738|  1.08k|    if (pkey == NULL)
  ------------------
  |  Branch (738:9): [True: 1.07k, False: 5]
  ------------------
  739|  1.07k|        return NULL;
  740|      5|    key = EVP_PKEY_get1_DSA(pkey);
  741|      5|    EVP_PKEY_free(pkey);
  742|      5|    if (key == NULL)
  ------------------
  |  Branch (742:9): [True: 0, False: 5]
  ------------------
  743|      0|        return NULL;
  744|      5|    *pp = q;
  745|      5|    if (a != NULL) {
  ------------------
  |  Branch (745:9): [True: 0, False: 5]
  ------------------
  746|      0|        DSA_free(*a);
  747|      0|        *a = key;
  748|      0|    }
  749|      5|    return key;
  750|      5|}
ossl_d2i_DSA_PUBKEY:
  754|  1.08k|{
  755|  1.08k|    DSA *key = NULL;
  756|  1.08k|    const unsigned char *data;
  757|  1.08k|    const BIGNUM *p, *q, *g;
  758|       |
  759|  1.08k|    data = *pp;
  760|  1.08k|    key = d2i_DSA_PUBKEY(NULL, &data, length);
  761|  1.08k|    if (key == NULL)
  ------------------
  |  Branch (761:9): [True: 1.07k, False: 5]
  ------------------
  762|  1.07k|        return NULL;
  763|      5|    DSA_get0_pqg(key, &p, &q, &g);
  764|      5|    if (p == NULL || q == NULL || g == NULL) {
  ------------------
  |  Branch (764:9): [True: 3, False: 2]
  |  Branch (764:22): [True: 0, False: 2]
  |  Branch (764:35): [True: 0, False: 2]
  ------------------
  765|      3|        DSA_free(key);
  766|      3|        return NULL;
  767|      3|    }
  768|      2|    *pp = data;
  769|      2|    if (a != NULL) {
  ------------------
  |  Branch (769:9): [True: 0, False: 2]
  ------------------
  770|      0|        DSA_free(*a);
  771|      0|        *a = key;
  772|      0|    }
  773|      2|    return key;
  774|      5|}
d2i_EC_PUBKEY:
  797|  23.5k|{
  798|  23.5k|    EVP_PKEY *pkey;
  799|  23.5k|    EC_KEY *key = NULL;
  800|  23.5k|    const unsigned char *q;
  801|  23.5k|    int type;
  802|       |
  803|  23.5k|    q = *pp;
  804|  23.5k|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  805|  23.5k|    if (pkey == NULL)
  ------------------
  |  Branch (805:9): [True: 16.8k, False: 6.77k]
  ------------------
  806|  16.8k|        return NULL;
  807|  6.77k|    type = EVP_PKEY_get_id(pkey);
  808|  6.77k|    if (type == EVP_PKEY_EC || type == EVP_PKEY_SM2)
  ------------------
  |  |   73|  6.77k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|  13.5k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
                  if (type == EVP_PKEY_EC || type == EVP_PKEY_SM2)
  ------------------
  |  |   74|      1|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|      1|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (808:9): [True: 6.77k, False: 1]
  |  Branch (808:32): [True: 1, False: 0]
  ------------------
  809|  6.77k|        key = EVP_PKEY_get1_EC_KEY(pkey);
  810|  6.77k|    EVP_PKEY_free(pkey);
  811|  6.77k|    if (key == NULL)
  ------------------
  |  Branch (811:9): [True: 0, False: 6.77k]
  ------------------
  812|      0|        return NULL;
  813|  6.77k|    *pp = q;
  814|  6.77k|    if (a != NULL) {
  ------------------
  |  Branch (814:9): [True: 0, False: 6.77k]
  ------------------
  815|      0|        EC_KEY_free(*a);
  816|      0|        *a = key;
  817|      0|    }
  818|  6.77k|    return key;
  819|  6.77k|}
ossl_d2i_ED25519_PUBKEY:
  842|      9|{
  843|      9|    EVP_PKEY *pkey;
  844|      9|    ECX_KEY *key = NULL;
  845|      9|    const unsigned char *q;
  846|       |
  847|      9|    q = *pp;
  848|      9|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  849|      9|    if (pkey == NULL)
  ------------------
  |  Branch (849:9): [True: 8, False: 1]
  ------------------
  850|      8|        return NULL;
  851|      1|    key = ossl_evp_pkey_get1_ED25519(pkey);
  852|      1|    EVP_PKEY_free(pkey);
  853|      1|    if (key == NULL)
  ------------------
  |  Branch (853:9): [True: 0, False: 1]
  ------------------
  854|      0|        return NULL;
  855|      1|    *pp = q;
  856|      1|    if (a != NULL) {
  ------------------
  |  Branch (856:9): [True: 0, False: 1]
  ------------------
  857|      0|        ossl_ecx_key_free(*a);
  858|      0|        *a = key;
  859|      0|    }
  860|      1|    return key;
  861|      1|}
ossl_d2i_ED448_PUBKEY:
  883|      7|{
  884|      7|    EVP_PKEY *pkey;
  885|      7|    ECX_KEY *key = NULL;
  886|      7|    const unsigned char *q;
  887|       |
  888|      7|    q = *pp;
  889|      7|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  890|      7|    if (pkey == NULL)
  ------------------
  |  Branch (890:9): [True: 6, False: 1]
  ------------------
  891|      6|        return NULL;
  892|      1|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_ED448)
  ------------------
  |  |   85|      1|# define EVP_PKEY_ED448 NID_ED448
  |  |  ------------------
  |  |  |  | 5708|      1|#define NID_ED448               1088
  |  |  ------------------
  ------------------
  |  Branch (892:9): [True: 1, False: 0]
  ------------------
  893|      1|        key = ossl_evp_pkey_get1_ED448(pkey);
  894|      1|    EVP_PKEY_free(pkey);
  895|      1|    if (key == NULL)
  ------------------
  |  Branch (895:9): [True: 0, False: 1]
  ------------------
  896|      0|        return NULL;
  897|      1|    *pp = q;
  898|      1|    if (a != NULL) {
  ------------------
  |  Branch (898:9): [True: 0, False: 1]
  ------------------
  899|      0|        ossl_ecx_key_free(*a);
  900|      0|        *a = key;
  901|      0|    }
  902|      1|    return key;
  903|      1|}
ossl_d2i_X25519_PUBKEY:
  925|      5|{
  926|      5|    EVP_PKEY *pkey;
  927|      5|    ECX_KEY *key = NULL;
  928|      5|    const unsigned char *q;
  929|       |
  930|      5|    q = *pp;
  931|      5|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  932|      5|    if (pkey == NULL)
  ------------------
  |  Branch (932:9): [True: 4, False: 1]
  ------------------
  933|      4|        return NULL;
  934|      1|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_X25519)
  ------------------
  |  |   82|      1|# define EVP_PKEY_X25519 NID_X25519
  |  |  ------------------
  |  |  |  | 5696|      1|#define NID_X25519              1034
  |  |  ------------------
  ------------------
  |  Branch (934:9): [True: 1, False: 0]
  ------------------
  935|      1|        key = ossl_evp_pkey_get1_X25519(pkey);
  936|      1|    EVP_PKEY_free(pkey);
  937|      1|    if (key == NULL)
  ------------------
  |  Branch (937:9): [True: 0, False: 1]
  ------------------
  938|      0|        return NULL;
  939|      1|    *pp = q;
  940|      1|    if (a != NULL) {
  ------------------
  |  Branch (940:9): [True: 0, False: 1]
  ------------------
  941|      0|        ossl_ecx_key_free(*a);
  942|      0|        *a = key;
  943|      0|    }
  944|      1|    return key;
  945|      1|}
ossl_d2i_X448_PUBKEY:
  967|      7|{
  968|      7|    EVP_PKEY *pkey;
  969|      7|    ECX_KEY *key = NULL;
  970|      7|    const unsigned char *q;
  971|       |
  972|      7|    q = *pp;
  973|      7|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  974|      7|    if (pkey == NULL)
  ------------------
  |  Branch (974:9): [True: 6, False: 1]
  ------------------
  975|      6|        return NULL;
  976|      1|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_X448)
  ------------------
  |  |   84|      1|# define EVP_PKEY_X448 NID_X448
  |  |  ------------------
  |  |  |  | 5700|      1|#define NID_X448                1035
  |  |  ------------------
  ------------------
  |  Branch (976:9): [True: 1, False: 0]
  ------------------
  977|      1|        key = ossl_evp_pkey_get1_X448(pkey);
  978|      1|    EVP_PKEY_free(pkey);
  979|      1|    if (key == NULL)
  ------------------
  |  Branch (979:9): [True: 0, False: 1]
  ------------------
  980|      0|        return NULL;
  981|      1|    *pp = q;
  982|      1|    if (a != NULL) {
  ------------------
  |  Branch (982:9): [True: 0, False: 1]
  ------------------
  983|      0|        ossl_ecx_key_free(*a);
  984|      0|        *a = key;
  985|      0|    }
  986|      1|    return key;
  987|      1|}
X509_PUBKEY_get0_param:
 1031|  50.5k|{
 1032|  50.5k|    if (ppkalg)
  ------------------
  |  Branch (1032:9): [True: 0, False: 50.5k]
  ------------------
 1033|      0|        *ppkalg = pub->algor->algorithm;
 1034|  50.5k|    if (pk) {
  ------------------
  |  Branch (1034:9): [True: 24.8k, False: 25.6k]
  ------------------
 1035|  24.8k|        *pk = pub->public_key->data;
 1036|  24.8k|        *ppklen = pub->public_key->length;
 1037|  24.8k|    }
 1038|  50.5k|    if (pa)
  ------------------
  |  Branch (1038:9): [True: 50.5k, False: 0]
  ------------------
 1039|  50.5k|        *pa = pub->algor;
 1040|  50.5k|    return 1;
 1041|  50.5k|}
ossl_x509_PUBKEY_get0_libctx:
 1073|  23.5k|{
 1074|  23.5k|    if (plibctx)
  ------------------
  |  Branch (1074:9): [True: 23.5k, False: 0]
  ------------------
 1075|  23.5k|        *plibctx = key->libctx;
 1076|  23.5k|    if (ppropq)
  ------------------
  |  Branch (1076:9): [True: 23.5k, False: 0]
  ------------------
 1077|  23.5k|        *ppropq = key->propq;
 1078|  23.5k|    return 1;
 1079|  23.5k|}
x_pubkey.c:x509_pubkey_ex_i2d:
  240|  1.53k|{
  241|  1.53k|    return ASN1_item_ex_i2d(pval, out, ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL),
  ------------------
  |  |  427|  1.53k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  242|  1.53k|                            tag, aclass);
  243|  1.53k|}
x_pubkey.c:x509_pubkey_ex_print:
  247|    967|{
  248|    967|    return ASN1_item_print(out, *pval, indent,
  249|    967|                           ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL), pctx);
  ------------------
  |  |  427|    967|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  250|    967|}
x_pubkey.c:x509_pubkey_ex_new_ex:
  113|   100k|{
  114|   100k|    X509_PUBKEY *ret;
  115|       |
  116|   100k|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  104|   100k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   100k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   100k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (116:9): [True: 0, False: 100k]
  ------------------
  117|      0|        return 0;
  118|   100k|    if (!x509_pubkey_ex_populate((ASN1_VALUE **)&ret, NULL)
  ------------------
  |  Branch (118:9): [True: 0, False: 100k]
  ------------------
  119|   100k|        || !x509_pubkey_set0_libctx(ret, libctx, propq)) {
  ------------------
  |  Branch (119:12): [True: 0, False: 100k]
  ------------------
  120|      0|        x509_pubkey_ex_free((ASN1_VALUE **)&ret, NULL);
  121|      0|        ret = NULL;
  122|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_X509_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  123|   100k|    } else {
  124|   100k|        *pval = (ASN1_VALUE *)ret;
  125|   100k|    }
  126|       |
  127|   100k|    return ret != NULL;
  128|   100k|}
x_pubkey.c:x509_pubkey_ex_populate:
  101|   177k|{
  102|   177k|    X509_PUBKEY *pubkey = (X509_PUBKEY *)*pval;
  103|       |
  104|   177k|    return (pubkey->algor != NULL
  ------------------
  |  Branch (104:13): [True: 51.7k, False: 125k]
  ------------------
  105|   177k|            || (pubkey->algor = X509_ALGOR_new()) != NULL)
  ------------------
  |  Branch (105:16): [True: 125k, False: 0]
  ------------------
  106|   177k|        && (pubkey->public_key != NULL
  ------------------
  |  Branch (106:13): [True: 51.7k, False: 125k]
  ------------------
  107|   177k|            || (pubkey->public_key = ASN1_BIT_STRING_new()) != NULL);
  ------------------
  |  Branch (107:16): [True: 125k, False: 0]
  ------------------
  108|   177k|}
x_pubkey.c:x509_pubkey_ex_d2i_ex:
  135|  76.5k|{
  136|  76.5k|    const unsigned char *in_saved = *in;
  137|  76.5k|    size_t publen;
  138|  76.5k|    X509_PUBKEY *pubkey;
  139|  76.5k|    int ret;
  140|  76.5k|    OSSL_DECODER_CTX *dctx = NULL;
  141|  76.5k|    unsigned char *tmpbuf = NULL;
  142|       |
  143|  76.5k|    if (*pval == NULL && !x509_pubkey_ex_new_ex(pval, it, libctx, propq))
  ------------------
  |  Branch (143:9): [True: 12.7k, False: 63.8k]
  |  Branch (143:26): [True: 0, False: 12.7k]
  ------------------
  144|      0|        return 0;
  145|  76.5k|    if (!x509_pubkey_ex_populate(pval, NULL)) {
  ------------------
  |  Branch (145:9): [True: 0, False: 76.5k]
  ------------------
  146|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_X509_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  147|      0|        return 0;
  148|      0|    }
  149|       |
  150|       |    /* This ensures that |*in| advances properly no matter what */
  151|  76.5k|    if ((ret = ASN1_item_ex_d2i(pval, in, len,
  ------------------
  |  Branch (151:9): [True: 24.0k, False: 52.5k]
  ------------------
  152|  76.5k|                                ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL),
  ------------------
  |  |  427|  76.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  153|  76.5k|                                tag, aclass, opt, ctx)) <= 0)
  154|  24.0k|        return ret;
  155|       |
  156|  52.5k|    publen = *in - in_saved;
  157|  52.5k|    if (!ossl_assert(publen > 0)) {
  ------------------
  |  |   52|  52.5k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  52.5k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (157:9): [True: 0, False: 52.5k]
  ------------------
  158|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  159|      0|        return 0;
  160|      0|    }
  161|       |
  162|  52.5k|    pubkey = (X509_PUBKEY *)*pval;
  163|  52.5k|    EVP_PKEY_free(pubkey->pkey);
  164|  52.5k|    pubkey->pkey = NULL;
  165|       |
  166|       |    /*
  167|       |     * Opportunistically decode the key but remove any non fatal errors
  168|       |     * from the queue. Subsequent explicit attempts to decode/use the key
  169|       |     * will return an appropriate error.
  170|       |     */
  171|  52.5k|    ERR_set_mark();
  172|       |
  173|       |    /*
  174|       |     * Try to decode with legacy method first.  This ensures that engines
  175|       |     * aren't overridden by providers.
  176|       |     */
  177|  52.5k|    if ((ret = x509_pubkey_decode(&pubkey->pkey, pubkey)) == -1) {
  ------------------
  |  Branch (177:9): [True: 0, False: 52.5k]
  ------------------
  178|       |        /* -1 indicates a fatal error, like malloc failure */
  179|      0|        ERR_clear_last_mark();
  180|      0|        goto end;
  181|      0|    }
  182|       |
  183|       |    /* Try to decode it into an EVP_PKEY with OSSL_DECODER */
  184|  52.5k|    if (ret <= 0 && !pubkey->flag_force_legacy) {
  ------------------
  |  Branch (184:9): [True: 45.6k, False: 6.89k]
  |  Branch (184:21): [True: 27.6k, False: 17.9k]
  ------------------
  185|  27.6k|        const unsigned char *p;
  186|  27.6k|        char txtoidname[OSSL_MAX_NAME_SIZE];
  187|  27.6k|        size_t slen = publen;
  188|       |
  189|       |        /*
  190|       |        * The decoders don't know how to handle anything other than Universal
  191|       |        * class so we modify the data accordingly.
  192|       |        */
  193|  27.6k|        if (aclass != V_ASN1_UNIVERSAL) {
  ------------------
  |  |   47|  27.6k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (193:13): [True: 0, False: 27.6k]
  ------------------
  194|      0|            tmpbuf = OPENSSL_memdup(in_saved, publen);
  ------------------
  |  |  117|      0|        CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  195|      0|            if (tmpbuf == NULL)
  ------------------
  |  Branch (195:17): [True: 0, False: 0]
  ------------------
  196|      0|                return 0;
  197|      0|            in_saved = tmpbuf;
  198|      0|            *tmpbuf = V_ASN1_CONSTRUCTED | V_ASN1_SEQUENCE;
  ------------------
  |  |   52|      0|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
                          *tmpbuf = V_ASN1_CONSTRUCTED | V_ASN1_SEQUENCE;
  ------------------
  |  |   74|      0|# define V_ASN1_SEQUENCE                 16
  ------------------
  199|      0|        }
  200|  27.6k|        p = in_saved;
  201|       |
  202|  27.6k|        if (OBJ_obj2txt(txtoidname, sizeof(txtoidname),
  ------------------
  |  Branch (202:13): [True: 0, False: 27.6k]
  ------------------
  203|  27.6k|                        pubkey->algor->algorithm, 0) <= 0) {
  204|      0|            ERR_clear_last_mark();
  205|      0|            goto end;
  206|      0|        }
  207|  27.6k|        if ((dctx =
  ------------------
  |  Branch (207:13): [True: 27.6k, False: 0]
  ------------------
  208|  27.6k|             OSSL_DECODER_CTX_new_for_pkey(&pubkey->pkey,
  209|  27.6k|                                           "DER", "SubjectPublicKeyInfo",
  210|  27.6k|                                           txtoidname, EVP_PKEY_PUBLIC_KEY,
  ------------------
  |  |  111|  27.6k|    ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  107|  27.6k|    ( OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  |  |  ------------------
  |  |  |  |  |  |  647|  27.6k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  642|  27.6k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  648|  27.6k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  643|  27.6k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|  27.6k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  211|  27.6k|                                           pubkey->libctx,
  212|  27.6k|                                           pubkey->propq)) != NULL)
  213|       |            /*
  214|       |             * As said higher up, we're being opportunistic.  In other words,
  215|       |             * we don't care if we fail.
  216|       |             */
  217|  27.6k|            if (OSSL_DECODER_from_data(dctx, &p, &slen)) {
  ------------------
  |  Branch (217:17): [True: 6.89k, False: 20.7k]
  ------------------
  218|  6.89k|                if (slen != 0) {
  ------------------
  |  Branch (218:21): [True: 0, False: 6.89k]
  ------------------
  219|       |                    /*
  220|       |                     * If we successfully decoded then we *must* consume all the
  221|       |                     * bytes.
  222|       |                     */
  223|      0|                    ERR_clear_last_mark();
  224|      0|                    ERR_raise(ERR_LIB_ASN1, EVP_R_DECODE_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  225|      0|                    goto end;
  226|      0|                }
  227|  6.89k|            }
  228|  27.6k|    }
  229|       |
  230|  52.5k|    ERR_pop_to_mark();
  231|  52.5k|    ret = 1;
  232|  52.5k| end:
  233|  52.5k|    OSSL_DECODER_CTX_free(dctx);
  234|  52.5k|    OPENSSL_free(tmpbuf);
  ------------------
  |  |  115|  52.5k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  52.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  52.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  235|  52.5k|    return ret;
  236|  52.5k|}
x_pubkey.c:x509_pubkey_set0_libctx:
   49|   125k|{
   50|   125k|    if (x != NULL) {
  ------------------
  |  Branch (50:9): [True: 125k, False: 0]
  ------------------
   51|   125k|        x->libctx = libctx;
   52|   125k|        OPENSSL_free(x->propq);
  ------------------
  |  |  115|   125k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   125k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   125k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   53|   125k|        x->propq = NULL;
   54|   125k|        if (propq != NULL) {
  ------------------
  |  Branch (54:13): [True: 0, False: 125k]
  ------------------
   55|      0|            x->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   56|      0|            if (x->propq == NULL)
  ------------------
  |  Branch (56:17): [True: 0, False: 0]
  ------------------
   57|      0|                return 0;
   58|      0|        }
   59|   125k|    }
   60|   125k|    return 1;
   61|   125k|}
x_pubkey.c:x509_pubkey_ex_free:
   87|   101k|{
   88|   101k|    X509_PUBKEY *pubkey;
   89|       |
   90|   101k|    if (pval != NULL && (pubkey = (X509_PUBKEY *)*pval) != NULL) {
  ------------------
  |  Branch (90:9): [True: 101k, False: 0]
  |  Branch (90:25): [True: 101k, False: 0]
  ------------------
   91|   101k|        X509_ALGOR_free(pubkey->algor);
   92|   101k|        ASN1_BIT_STRING_free(pubkey->public_key);
   93|   101k|        EVP_PKEY_free(pubkey->pkey);
   94|   101k|        OPENSSL_free(pubkey->propq);
  ------------------
  |  |  115|   101k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   101k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   101k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   95|   101k|        OPENSSL_free(pubkey);
  ------------------
  |  |  115|   101k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   101k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   101k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   96|   101k|        *pval = NULL;
   97|   101k|    }
   98|   101k|}
x_pubkey.c:x509_pubkey_decode:
  405|  52.5k|{
  406|  52.5k|    EVP_PKEY *pkey;
  407|  52.5k|    int nid;
  408|       |
  409|  52.5k|    nid = OBJ_obj2nid(key->algor->algorithm);
  410|  52.5k|    if (!key->flag_force_legacy) {
  ------------------
  |  Branch (410:9): [True: 27.6k, False: 24.8k]
  ------------------
  411|  27.6k|#ifndef OPENSSL_NO_ENGINE
  412|  27.6k|        ENGINE *e = NULL;
  413|       |
  414|  27.6k|        e = ENGINE_get_pkey_meth_engine(nid);
  415|  27.6k|        if (e == NULL)
  ------------------
  |  Branch (415:13): [True: 27.6k, False: 0]
  ------------------
  416|  27.6k|            return 0;
  417|      0|        ENGINE_finish(e);
  418|       |#else
  419|       |        return 0;
  420|       |#endif
  421|      0|    }
  422|       |
  423|  24.8k|    pkey = EVP_PKEY_new();
  424|  24.8k|    if (pkey == NULL) {
  ------------------
  |  Branch (424:9): [True: 0, False: 24.8k]
  ------------------
  425|      0|        ERR_raise(ERR_LIB_X509, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  426|      0|        return -1;
  427|      0|    }
  428|       |
  429|  24.8k|    if (!EVP_PKEY_set_type(pkey, nid)) {
  ------------------
  |  Branch (429:9): [True: 0, False: 24.8k]
  ------------------
  430|      0|        ERR_raise(ERR_LIB_X509, X509_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  431|      0|        goto error;
  432|      0|    }
  433|       |
  434|  24.8k|    if (pkey->ameth->pub_decode) {
  ------------------
  |  Branch (434:9): [True: 24.8k, False: 0]
  ------------------
  435|       |        /*
  436|       |         * Treat any failure of pub_decode as a decode error. In
  437|       |         * future we could have different return codes for decode
  438|       |         * errors and fatal errors such as malloc failure.
  439|       |         */
  440|  24.8k|        if (!pkey->ameth->pub_decode(pkey, key))
  ------------------
  |  Branch (440:13): [True: 17.9k, False: 6.89k]
  ------------------
  441|  17.9k|            goto error;
  442|  24.8k|    } else {
  443|      0|        ERR_raise(ERR_LIB_X509, X509_R_METHOD_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  444|      0|        goto error;
  445|      0|    }
  446|       |
  447|  6.89k|    *ppkey = pkey;
  448|  6.89k|    return 1;
  449|       |
  450|  17.9k| error:
  451|  17.9k|    EVP_PKEY_free(pkey);
  452|  17.9k|    return 0;
  453|  24.8k|}
x_pubkey.c:d2i_PUBKEY_int:
  494|  24.8k|{
  495|  24.8k|    X509_PUBKEY *xpk, *xpk2 = NULL, **pxpk = NULL;
  496|  24.8k|    EVP_PKEY *pktmp = NULL;
  497|  24.8k|    const unsigned char *q;
  498|       |
  499|  24.8k|    q = *pp;
  500|       |
  501|       |    /*
  502|       |     * If libctx or propq are non-NULL, we take advantage of the reuse
  503|       |     * feature.  It's not generally recommended, but is safe enough for
  504|       |     * newly created structures.
  505|       |     */
  506|  24.8k|    if (libctx != NULL || propq != NULL || force_legacy) {
  ------------------
  |  Branch (506:9): [True: 0, False: 24.8k]
  |  Branch (506:27): [True: 0, False: 24.8k]
  |  Branch (506:44): [True: 24.8k, False: 2]
  ------------------
  507|  24.8k|        xpk2 = OPENSSL_zalloc(sizeof(*xpk2));
  ------------------
  |  |  104|  24.8k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  24.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  24.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  508|  24.8k|        if (xpk2 == NULL)
  ------------------
  |  Branch (508:13): [True: 0, False: 24.8k]
  ------------------
  509|      0|            return NULL;
  510|  24.8k|        if (!x509_pubkey_set0_libctx(xpk2, libctx, propq))
  ------------------
  |  Branch (510:13): [True: 0, False: 24.8k]
  ------------------
  511|      0|            goto end;
  512|  24.8k|        xpk2->flag_force_legacy = !!force_legacy;
  513|  24.8k|        pxpk = &xpk2;
  514|  24.8k|    }
  515|  24.8k|    xpk = d2i_x509_pubkey(pxpk, &q, length);
  516|  24.8k|    if (xpk == NULL)
  ------------------
  |  Branch (516:9): [True: 11, False: 24.8k]
  ------------------
  517|     11|        goto end;
  518|  24.8k|    pktmp = X509_PUBKEY_get(xpk);
  519|  24.8k|    X509_PUBKEY_free(xpk);
  520|  24.8k|    xpk2 = NULL;                 /* We know that xpk == xpk2 */
  521|  24.8k|    if (pktmp == NULL)
  ------------------
  |  Branch (521:9): [True: 17.9k, False: 6.89k]
  ------------------
  522|  17.9k|        goto end;
  523|  6.89k|    *pp = q;
  524|  6.89k|    if (a != NULL) {
  ------------------
  |  Branch (524:9): [True: 0, False: 6.89k]
  ------------------
  525|      0|        EVP_PKEY_free(*a);
  526|      0|        *a = pktmp;
  527|      0|    }
  528|  24.8k| end:
  529|  24.8k|    X509_PUBKEY_free(xpk2);
  530|  24.8k|    return pktmp;
  531|  6.89k|}

x_req.c:rinf_cb:
   37|  93.1k|{
   38|  93.1k|    X509_REQ_INFO *rinf = (X509_REQ_INFO *)*pval;
   39|       |
   40|  93.1k|    if (operation == ASN1_OP_NEW_POST) {
  ------------------
  |  |  743|  93.1k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (40:9): [True: 20.2k, False: 72.8k]
  ------------------
   41|  20.2k|        rinf->attributes = sk_X509_ATTRIBUTE_new_null();
  ------------------
  |  |  267|  20.2k|#define sk_X509_ATTRIBUTE_new_null() ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_new_null())
  ------------------
   42|  20.2k|        if (!rinf->attributes)
  ------------------
  |  Branch (42:13): [True: 0, False: 20.2k]
  ------------------
   43|      0|            return 0;
   44|  20.2k|    }
   45|  93.1k|    return 1;
   46|  93.1k|}
x_req.c:req_cb:
   50|  50.5k|{
   51|  50.5k|    X509_REQ *ret = (X509_REQ *)*pval;
   52|       |
   53|  50.5k|    switch (operation) {
  ------------------
  |  Branch (53:13): [True: 20.2k, False: 30.3k]
  ------------------
   54|  10.1k|    case ASN1_OP_D2I_PRE:
  ------------------
  |  |  746|  10.1k|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (54:5): [True: 10.1k, False: 40.4k]
  ------------------
   55|  10.1k|        ASN1_OCTET_STRING_free(ret->distinguishing_id);
   56|       |        /* fall through */
   57|  20.2k|    case ASN1_OP_NEW_POST:
  ------------------
  |  |  743|  20.2k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (57:5): [True: 10.1k, False: 40.4k]
  ------------------
   58|  20.2k|        ret->distinguishing_id = NULL;
   59|  20.2k|        break;
   60|       |
   61|  10.1k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|  10.1k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (61:5): [True: 10.1k, False: 40.4k]
  ------------------
   62|  10.1k|        ASN1_OCTET_STRING_free(ret->distinguishing_id);
   63|  10.1k|        OPENSSL_free(ret->propq);
  ------------------
  |  |  115|  10.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  10.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  10.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|  10.1k|        break;
   65|      0|    case ASN1_OP_DUP_POST:
  ------------------
  |  |  757|      0|# define ASN1_OP_DUP_POST        15
  ------------------
  |  Branch (65:5): [True: 0, False: 50.5k]
  ------------------
   66|      0|        {
   67|      0|            X509_REQ *old = exarg;
   68|       |
   69|      0|            if (!ossl_x509_req_set0_libctx(ret, old->libctx, old->propq))
  ------------------
  |  Branch (69:17): [True: 0, False: 0]
  ------------------
   70|      0|                return 0;
   71|      0|            if (old->req_info.pubkey != NULL) {
  ------------------
  |  Branch (71:17): [True: 0, False: 0]
  ------------------
   72|      0|                EVP_PKEY *pkey = X509_PUBKEY_get0(old->req_info.pubkey);
   73|       |
   74|      0|                if (pkey != NULL) {
  ------------------
  |  Branch (74:21): [True: 0, False: 0]
  ------------------
   75|      0|                    pkey = EVP_PKEY_dup(pkey);
   76|      0|                    if (pkey == NULL) {
  ------------------
  |  Branch (76:25): [True: 0, False: 0]
  ------------------
   77|      0|                        ERR_raise(ERR_LIB_X509, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   78|      0|                        return 0;
   79|      0|                    }
   80|      0|                    if (!X509_PUBKEY_set(&ret->req_info.pubkey, pkey)) {
  ------------------
  |  Branch (80:25): [True: 0, False: 0]
  ------------------
   81|      0|                        EVP_PKEY_free(pkey);
   82|      0|                        ERR_raise(ERR_LIB_X509, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   83|      0|                        return 0;
   84|      0|                    }
   85|      0|                    EVP_PKEY_free(pkey);
   86|      0|                }
   87|      0|            }
   88|      0|        }
   89|      0|        break;
   90|      0|    case ASN1_OP_GET0_LIBCTX:
  ------------------
  |  |  758|      0|# define ASN1_OP_GET0_LIBCTX     16
  ------------------
  |  Branch (90:5): [True: 0, False: 50.5k]
  ------------------
   91|      0|        {
   92|      0|            OSSL_LIB_CTX **libctx = exarg;
   93|       |
   94|      0|            *libctx = ret->libctx;
   95|      0|        }
   96|      0|        break;
   97|      0|    case ASN1_OP_GET0_PROPQ:
  ------------------
  |  |  759|      0|# define ASN1_OP_GET0_PROPQ      17
  ------------------
  |  Branch (97:5): [True: 0, False: 50.5k]
  ------------------
   98|      0|        {
   99|      0|            const char **propq = exarg;
  100|       |
  101|      0|            *propq = ret->propq;
  102|      0|        }
  103|      0|        break;
  104|  50.5k|    }
  105|       |
  106|  50.5k|    return 1;
  107|  50.5k|}

x_x509.c:x509_cb:
   38|   215k|{
   39|   215k|    X509 *ret = (X509 *)*pval;
   40|       |
   41|   215k|    switch (operation) {
   42|       |
   43|  37.2k|    case ASN1_OP_D2I_PRE:
  ------------------
  |  |  746|  37.2k|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (43:5): [True: 37.2k, False: 177k]
  ------------------
   44|  37.2k|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509, ret, &ret->ex_data);
  ------------------
  |  |  232|  37.2k|# define CRYPTO_EX_INDEX_X509             3
  ------------------
   45|  37.2k|        X509_CERT_AUX_free(ret->aux);
   46|  37.2k|        ASN1_OCTET_STRING_free(ret->skid);
   47|  37.2k|        AUTHORITY_KEYID_free(ret->akid);
   48|  37.2k|        CRL_DIST_POINTS_free(ret->crldp);
   49|  37.2k|        ossl_policy_cache_free(ret->policy_cache);
   50|  37.2k|        GENERAL_NAMES_free(ret->altname);
   51|  37.2k|        NAME_CONSTRAINTS_free(ret->nc);
   52|  37.2k|#ifndef OPENSSL_NO_RFC3779
   53|  37.2k|        sk_IPAddressFamily_pop_free(ret->rfc3779_addr, IPAddressFamily_free);
  ------------------
  |  | 1236|  37.2k|#define sk_IPAddressFamily_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_IPAddressFamily_sk_type(sk), ossl_check_IPAddressFamily_freefunc_type(freefunc))
  ------------------
   54|  37.2k|        ASIdentifiers_free(ret->rfc3779_asid);
   55|  37.2k|#endif
   56|  37.2k|        ASN1_OCTET_STRING_free(ret->distinguishing_id);
   57|       |
   58|       |        /* fall through */
   59|       |
   60|  74.4k|    case ASN1_OP_NEW_POST:
  ------------------
  |  |  743|  74.4k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (60:5): [True: 37.2k, False: 177k]
  ------------------
   61|  74.4k|        ret->ex_cached = 0;
   62|  74.4k|        ret->ex_kusage = 0;
   63|  74.4k|        ret->ex_xkusage = 0;
   64|  74.4k|        ret->ex_nscert = 0;
   65|  74.4k|        ret->ex_flags = 0;
   66|  74.4k|        ret->ex_pathlen = -1;
   67|  74.4k|        ret->ex_pcpathlen = -1;
   68|  74.4k|        ret->skid = NULL;
   69|  74.4k|        ret->akid = NULL;
   70|  74.4k|        ret->policy_cache = NULL;
   71|  74.4k|        ret->altname = NULL;
   72|  74.4k|        ret->nc = NULL;
   73|  74.4k|#ifndef OPENSSL_NO_RFC3779
   74|  74.4k|        ret->rfc3779_addr = NULL;
   75|  74.4k|        ret->rfc3779_asid = NULL;
   76|  74.4k|#endif
   77|  74.4k|        ret->distinguishing_id = NULL;
   78|  74.4k|        ret->aux = NULL;
   79|  74.4k|        ret->crldp = NULL;
   80|  74.4k|        if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509, ret, &ret->ex_data))
  ------------------
  |  |  232|  74.4k|# define CRYPTO_EX_INDEX_X509             3
  ------------------
  |  Branch (80:13): [True: 0, False: 74.4k]
  ------------------
   81|      0|            return 0;
   82|  74.4k|        break;
   83|       |
   84|  74.4k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|  37.2k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (84:5): [True: 37.2k, False: 177k]
  ------------------
   85|  37.2k|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509, ret, &ret->ex_data);
  ------------------
  |  |  232|  37.2k|# define CRYPTO_EX_INDEX_X509             3
  ------------------
   86|  37.2k|        X509_CERT_AUX_free(ret->aux);
   87|  37.2k|        ASN1_OCTET_STRING_free(ret->skid);
   88|  37.2k|        AUTHORITY_KEYID_free(ret->akid);
   89|  37.2k|        CRL_DIST_POINTS_free(ret->crldp);
   90|  37.2k|        ossl_policy_cache_free(ret->policy_cache);
   91|  37.2k|        GENERAL_NAMES_free(ret->altname);
   92|  37.2k|        NAME_CONSTRAINTS_free(ret->nc);
   93|  37.2k|#ifndef OPENSSL_NO_RFC3779
   94|  37.2k|        sk_IPAddressFamily_pop_free(ret->rfc3779_addr, IPAddressFamily_free);
  ------------------
  |  | 1236|  37.2k|#define sk_IPAddressFamily_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_IPAddressFamily_sk_type(sk), ossl_check_IPAddressFamily_freefunc_type(freefunc))
  ------------------
   95|  37.2k|        ASIdentifiers_free(ret->rfc3779_asid);
   96|  37.2k|#endif
   97|  37.2k|        ASN1_OCTET_STRING_free(ret->distinguishing_id);
   98|  37.2k|        OPENSSL_free(ret->propq);
  ------------------
  |  |  115|  37.2k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  37.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  37.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   99|  37.2k|        break;
  100|       |
  101|      0|    case ASN1_OP_DUP_POST:
  ------------------
  |  |  757|      0|# define ASN1_OP_DUP_POST        15
  ------------------
  |  Branch (101:5): [True: 0, False: 215k]
  ------------------
  102|      0|        {
  103|      0|            X509 *old = exarg;
  104|       |
  105|      0|            if (!ossl_x509_set0_libctx(ret, old->libctx, old->propq))
  ------------------
  |  Branch (105:17): [True: 0, False: 0]
  ------------------
  106|      0|                return 0;
  107|      0|        }
  108|      0|        break;
  109|      0|    case ASN1_OP_GET0_LIBCTX:
  ------------------
  |  |  758|      0|# define ASN1_OP_GET0_LIBCTX     16
  ------------------
  |  Branch (109:5): [True: 0, False: 215k]
  ------------------
  110|      0|        {
  111|      0|            OSSL_LIB_CTX **libctx = exarg;
  112|       |
  113|      0|            *libctx = ret->libctx;
  114|      0|        }
  115|      0|        break;
  116|       |
  117|      0|    case ASN1_OP_GET0_PROPQ:
  ------------------
  |  |  759|      0|# define ASN1_OP_GET0_PROPQ      17
  ------------------
  |  Branch (117:5): [True: 0, False: 215k]
  ------------------
  118|      0|        {
  119|      0|            const char **propq = exarg;
  120|       |
  121|      0|            *propq = ret->propq;
  122|      0|        }
  123|      0|        break;
  124|       |
  125|   103k|    default:
  ------------------
  |  Branch (125:5): [True: 103k, False: 111k]
  ------------------
  126|   103k|        break;
  127|   215k|    }
  128|       |
  129|   215k|    return 1;
  130|   215k|}

FuzzerInitialize:
  288|      2|{
  289|      2|    FuzzerSetRand();
  290|      2|    pctx = ASN1_PCTX_new();
  291|      2|    ASN1_PCTX_set_flags(pctx, ASN1_PCTX_FLAGS_SHOW_ABSENT |
  ------------------
  |  | 1051|      2|# define ASN1_PCTX_FLAGS_SHOW_ABSENT             0x001
  ------------------
  292|      2|        ASN1_PCTX_FLAGS_SHOW_SEQUENCE | ASN1_PCTX_FLAGS_SHOW_SSOF |
  ------------------
  |  | 1053|      2|# define ASN1_PCTX_FLAGS_SHOW_SEQUENCE           0x002
  ------------------
                      ASN1_PCTX_FLAGS_SHOW_SEQUENCE | ASN1_PCTX_FLAGS_SHOW_SSOF |
  ------------------
  |  | 1055|      2|# define ASN1_PCTX_FLAGS_SHOW_SSOF               0x004
  ------------------
  293|      2|        ASN1_PCTX_FLAGS_SHOW_TYPE | ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME);
  ------------------
  |  | 1057|      2|# define ASN1_PCTX_FLAGS_SHOW_TYPE               0x008
  ------------------
                      ASN1_PCTX_FLAGS_SHOW_TYPE | ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME);
  ------------------
  |  | 1065|      2|# define ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME  0x080
  ------------------
  294|      2|    ASN1_PCTX_set_str_flags(pctx, ASN1_STRFLGS_UTF8_CONVERT |
  ------------------
  |  |  475|      2|# define ASN1_STRFLGS_UTF8_CONVERT       0x10
  ------------------
  295|      2|        ASN1_STRFLGS_SHOW_TYPE | ASN1_STRFLGS_DUMP_ALL);
  ------------------
  |  |  486|      2|# define ASN1_STRFLGS_SHOW_TYPE          0x40
  ------------------
                      ASN1_STRFLGS_SHOW_TYPE | ASN1_STRFLGS_DUMP_ALL);
  ------------------
  |  |  496|      2|# define ASN1_STRFLGS_DUMP_ALL           0x80
  ------------------
  296|       |
  297|      2|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  467|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  298|      2|    OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL);
  ------------------
  |  | 2807|      2|# define OPENSSL_INIT_LOAD_SSL_STRINGS       0x00200000L
  ------------------
  299|      2|    ERR_clear_error();
  300|      2|    CRYPTO_free_ex_index(0, -1);
  301|       |
  302|      2|    return 1;
  303|      2|}
FuzzerTestOneInput:
  306|  12.7k|{
  307|  12.7k|    int n;
  308|       |
  309|       |
  310|  1.84M|    for (n = 0; item_type[n] != NULL; ++n) {
  ------------------
  |  Branch (310:17): [True: 1.83M, False: 12.7k]
  ------------------
  311|  1.83M|        const uint8_t *b = buf;
  312|  1.83M|        unsigned char *der = NULL;
  313|  1.83M|        const ASN1_ITEM *i = ASN1_ITEM_ptr(item_type[n]);
  ------------------
  |  |  422|  1.83M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  314|  1.83M|        ASN1_VALUE *o = ASN1_item_d2i(NULL, &b, len, i);
  315|       |
  316|  1.83M|        if (o != NULL) {
  ------------------
  |  Branch (316:13): [True: 49.4k, False: 1.78M]
  ------------------
  317|       |            /*
  318|       |             * Don't print excessively long output to prevent spurious fuzzer
  319|       |             * timeouts.
  320|       |             */
  321|  49.4k|            if (b - buf < 10000) {
  ------------------
  |  Branch (321:17): [True: 48.0k, False: 1.35k]
  ------------------
  322|  48.0k|                BIO *bio = BIO_new(BIO_s_null());
  323|  48.0k|                if (bio != NULL) {
  ------------------
  |  Branch (323:21): [True: 48.0k, False: 0]
  ------------------
  324|  48.0k|                    ASN1_item_print(bio, o, 4, i, pctx);
  325|  48.0k|                    BIO_free(bio);
  326|  48.0k|                }
  327|  48.0k|            }
  328|  49.4k|            if (ASN1_item_i2d(o, &der, i) > 0) {
  ------------------
  |  Branch (328:17): [True: 49.3k, False: 20]
  ------------------
  329|  49.3k|                OPENSSL_free(der);
  ------------------
  |  |  115|  49.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  49.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  49.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  330|  49.3k|            }
  331|  49.4k|            ASN1_item_free(o, i);
  332|  49.4k|        }
  333|  1.83M|    }
  334|       |
  335|  12.7k|#ifndef OPENSSL_NO_TS
  336|  12.7k|    DO_TEST(TS_REQ, d2i_TS_REQ, i2d_TS_REQ, TS_REQ_print_bio);
  ------------------
  |  |  214|  12.7k|#define DO_TEST(TYPE, D2I, I2D, PRINT) { \
  |  |  215|  12.7k|    const unsigned char *p = buf; \
  |  |  216|  12.7k|    unsigned char *der = NULL; \
  |  |  217|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  218|  12.7k|    \
  |  |  219|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 1.24k, False: 11.5k]
  |  |  ------------------
  |  |  220|  1.24k|        int len2; \
  |  |  221|  1.24k|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  222|  1.24k|        \
  |  |  223|  1.24k|        if (bio != NULL) { \
  |  |  ------------------
  |  |  |  Branch (223:13): [True: 1.24k, False: 0]
  |  |  ------------------
  |  |  224|  1.24k|            PRINT(bio, type); \
  |  |  225|  1.24k|            BIO_free(bio); \
  |  |  226|  1.24k|        } \
  |  |  227|  1.24k|        len2 = I2D(type, &der); \
  |  |  228|  1.24k|        if (len2 != 0) {} \
  |  |  ------------------
  |  |  |  Branch (228:13): [True: 1.24k, False: 0]
  |  |  ------------------
  |  |  229|  1.24k|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|  1.24k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.24k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.24k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  230|  1.24k|        TYPE ## _free(type); \
  |  |  231|  1.24k|    } \
  |  |  232|  12.7k|}
  ------------------
  337|  12.7k|    DO_TEST(TS_MSG_IMPRINT, d2i_TS_MSG_IMPRINT, i2d_TS_MSG_IMPRINT, TS_MSG_IMPRINT_print_bio);
  ------------------
  |  |  214|  12.7k|#define DO_TEST(TYPE, D2I, I2D, PRINT) { \
  |  |  215|  12.7k|    const unsigned char *p = buf; \
  |  |  216|  12.7k|    unsigned char *der = NULL; \
  |  |  217|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  218|  12.7k|    \
  |  |  219|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 5, False: 12.7k]
  |  |  ------------------
  |  |  220|      5|        int len2; \
  |  |  221|      5|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  222|      5|        \
  |  |  223|      5|        if (bio != NULL) { \
  |  |  ------------------
  |  |  |  Branch (223:13): [True: 5, False: 0]
  |  |  ------------------
  |  |  224|      5|            PRINT(bio, type); \
  |  |  225|      5|            BIO_free(bio); \
  |  |  226|      5|        } \
  |  |  227|      5|        len2 = I2D(type, &der); \
  |  |  228|      5|        if (len2 != 0) {} \
  |  |  ------------------
  |  |  |  Branch (228:13): [True: 5, False: 0]
  |  |  ------------------
  |  |  229|      5|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|      5|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  230|      5|        TYPE ## _free(type); \
  |  |  231|      5|    } \
  |  |  232|  12.7k|}
  ------------------
  338|  12.7k|    DO_TEST(TS_RESP, d2i_TS_RESP, i2d_TS_RESP, TS_RESP_print_bio);
  ------------------
  |  |  214|  12.7k|#define DO_TEST(TYPE, D2I, I2D, PRINT) { \
  |  |  215|  12.7k|    const unsigned char *p = buf; \
  |  |  216|  12.7k|    unsigned char *der = NULL; \
  |  |  217|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  218|  12.7k|    \
  |  |  219|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 100, False: 12.6k]
  |  |  ------------------
  |  |  220|    100|        int len2; \
  |  |  221|    100|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  222|    100|        \
  |  |  223|    100|        if (bio != NULL) { \
  |  |  ------------------
  |  |  |  Branch (223:13): [True: 100, False: 0]
  |  |  ------------------
  |  |  224|    100|            PRINT(bio, type); \
  |  |  225|    100|            BIO_free(bio); \
  |  |  226|    100|        } \
  |  |  227|    100|        len2 = I2D(type, &der); \
  |  |  228|    100|        if (len2 != 0) {} \
  |  |  ------------------
  |  |  |  Branch (228:13): [True: 100, False: 0]
  |  |  ------------------
  |  |  229|    100|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|    100|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    100|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    100|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  230|    100|        TYPE ## _free(type); \
  |  |  231|    100|    } \
  |  |  232|  12.7k|}
  ------------------
  339|  12.7k|    DO_TEST(TS_STATUS_INFO, d2i_TS_STATUS_INFO, i2d_TS_STATUS_INFO, TS_STATUS_INFO_print_bio);
  ------------------
  |  |  214|  12.7k|#define DO_TEST(TYPE, D2I, I2D, PRINT) { \
  |  |  215|  12.7k|    const unsigned char *p = buf; \
  |  |  216|  12.7k|    unsigned char *der = NULL; \
  |  |  217|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  218|  12.7k|    \
  |  |  219|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 504, False: 12.2k]
  |  |  ------------------
  |  |  220|    504|        int len2; \
  |  |  221|    504|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  222|    504|        \
  |  |  223|    504|        if (bio != NULL) { \
  |  |  ------------------
  |  |  |  Branch (223:13): [True: 504, False: 0]
  |  |  ------------------
  |  |  224|    504|            PRINT(bio, type); \
  |  |  225|    504|            BIO_free(bio); \
  |  |  226|    504|        } \
  |  |  227|    504|        len2 = I2D(type, &der); \
  |  |  228|    504|        if (len2 != 0) {} \
  |  |  ------------------
  |  |  |  Branch (228:13): [True: 504, False: 0]
  |  |  ------------------
  |  |  229|    504|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|    504|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    504|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    504|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  230|    504|        TYPE ## _free(type); \
  |  |  231|    504|    } \
  |  |  232|  12.7k|}
  ------------------
  340|  12.7k|    DO_TEST(TS_TST_INFO, d2i_TS_TST_INFO, i2d_TS_TST_INFO, TS_TST_INFO_print_bio);
  ------------------
  |  |  214|  12.7k|#define DO_TEST(TYPE, D2I, I2D, PRINT) { \
  |  |  215|  12.7k|    const unsigned char *p = buf; \
  |  |  216|  12.7k|    unsigned char *der = NULL; \
  |  |  217|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  218|  12.7k|    \
  |  |  219|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 11, False: 12.7k]
  |  |  ------------------
  |  |  220|     11|        int len2; \
  |  |  221|     11|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  222|     11|        \
  |  |  223|     11|        if (bio != NULL) { \
  |  |  ------------------
  |  |  |  Branch (223:13): [True: 11, False: 0]
  |  |  ------------------
  |  |  224|     11|            PRINT(bio, type); \
  |  |  225|     11|            BIO_free(bio); \
  |  |  226|     11|        } \
  |  |  227|     11|        len2 = I2D(type, &der); \
  |  |  228|     11|        if (len2 != 0) {} \
  |  |  ------------------
  |  |  |  Branch (228:13): [True: 11, False: 0]
  |  |  ------------------
  |  |  229|     11|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|     11|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     11|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     11|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  230|     11|        TYPE ## _free(type); \
  |  |  231|     11|    } \
  |  |  232|  12.7k|}
  ------------------
  341|  12.7k|    DO_TEST_NO_PRINT(TS_ACCURACY, d2i_TS_ACCURACY, i2d_TS_ACCURACY);
  ------------------
  |  |  271|  12.7k|#define DO_TEST_NO_PRINT(TYPE, D2I, I2D) { \
  |  |  272|  12.7k|    const unsigned char *p = buf; \
  |  |  273|  12.7k|    unsigned char *der = NULL; \
  |  |  274|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  275|  12.7k|    \
  |  |  276|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (276:9): [True: 332, False: 12.4k]
  |  |  ------------------
  |  |  277|    332|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  278|    332|        \
  |  |  279|    332|        BIO_free(bio); \
  |  |  280|    332|        I2D(type, &der); \
  |  |  281|    332|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|    332|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    332|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    332|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  282|    332|        TYPE ## _free(type); \
  |  |  283|    332|    } \
  |  |  284|  12.7k|}
  ------------------
  342|  12.7k|#endif
  343|  12.7k|    DO_TEST_NO_PRINT(ESS_ISSUER_SERIAL, d2i_ESS_ISSUER_SERIAL, i2d_ESS_ISSUER_SERIAL);
  ------------------
  |  |  271|  12.7k|#define DO_TEST_NO_PRINT(TYPE, D2I, I2D) { \
  |  |  272|  12.7k|    const unsigned char *p = buf; \
  |  |  273|  12.7k|    unsigned char *der = NULL; \
  |  |  274|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  275|  12.7k|    \
  |  |  276|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (276:9): [True: 4, False: 12.7k]
  |  |  ------------------
  |  |  277|      4|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  278|      4|        \
  |  |  279|      4|        BIO_free(bio); \
  |  |  280|      4|        I2D(type, &der); \
  |  |  281|      4|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|      4|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  282|      4|        TYPE ## _free(type); \
  |  |  283|      4|    } \
  |  |  284|  12.7k|}
  ------------------
  344|  12.7k|    DO_TEST_NO_PRINT(ESS_CERT_ID, d2i_ESS_CERT_ID, i2d_ESS_CERT_ID);
  ------------------
  |  |  271|  12.7k|#define DO_TEST_NO_PRINT(TYPE, D2I, I2D) { \
  |  |  272|  12.7k|    const unsigned char *p = buf; \
  |  |  273|  12.7k|    unsigned char *der = NULL; \
  |  |  274|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  275|  12.7k|    \
  |  |  276|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (276:9): [True: 21, False: 12.7k]
  |  |  ------------------
  |  |  277|     21|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  278|     21|        \
  |  |  279|     21|        BIO_free(bio); \
  |  |  280|     21|        I2D(type, &der); \
  |  |  281|     21|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|     21|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     21|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     21|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  282|     21|        TYPE ## _free(type); \
  |  |  283|     21|    } \
  |  |  284|  12.7k|}
  ------------------
  345|  12.7k|    DO_TEST_NO_PRINT(ESS_SIGNING_CERT, d2i_ESS_SIGNING_CERT, i2d_ESS_SIGNING_CERT);
  ------------------
  |  |  271|  12.7k|#define DO_TEST_NO_PRINT(TYPE, D2I, I2D) { \
  |  |  272|  12.7k|    const unsigned char *p = buf; \
  |  |  273|  12.7k|    unsigned char *der = NULL; \
  |  |  274|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  275|  12.7k|    \
  |  |  276|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (276:9): [True: 22, False: 12.7k]
  |  |  ------------------
  |  |  277|     22|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  278|     22|        \
  |  |  279|     22|        BIO_free(bio); \
  |  |  280|     22|        I2D(type, &der); \
  |  |  281|     22|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|     22|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     22|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     22|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  282|     22|        TYPE ## _free(type); \
  |  |  283|     22|    } \
  |  |  284|  12.7k|}
  ------------------
  346|  12.7k|    DO_TEST_NO_PRINT(ESS_CERT_ID_V2, d2i_ESS_CERT_ID_V2, i2d_ESS_CERT_ID_V2);
  ------------------
  |  |  271|  12.7k|#define DO_TEST_NO_PRINT(TYPE, D2I, I2D) { \
  |  |  272|  12.7k|    const unsigned char *p = buf; \
  |  |  273|  12.7k|    unsigned char *der = NULL; \
  |  |  274|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  275|  12.7k|    \
  |  |  276|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (276:9): [True: 26, False: 12.7k]
  |  |  ------------------
  |  |  277|     26|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  278|     26|        \
  |  |  279|     26|        BIO_free(bio); \
  |  |  280|     26|        I2D(type, &der); \
  |  |  281|     26|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|     26|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     26|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     26|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  282|     26|        TYPE ## _free(type); \
  |  |  283|     26|    } \
  |  |  284|  12.7k|}
  ------------------
  347|  12.7k|    DO_TEST_NO_PRINT(ESS_SIGNING_CERT_V2, d2i_ESS_SIGNING_CERT_V2, i2d_ESS_SIGNING_CERT_V2);
  ------------------
  |  |  271|  12.7k|#define DO_TEST_NO_PRINT(TYPE, D2I, I2D) { \
  |  |  272|  12.7k|    const unsigned char *p = buf; \
  |  |  273|  12.7k|    unsigned char *der = NULL; \
  |  |  274|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  275|  12.7k|    \
  |  |  276|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (276:9): [True: 22, False: 12.7k]
  |  |  ------------------
  |  |  277|     22|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  278|     22|        \
  |  |  279|     22|        BIO_free(bio); \
  |  |  280|     22|        I2D(type, &der); \
  |  |  281|     22|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|     22|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     22|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     22|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  282|     22|        TYPE ## _free(type); \
  |  |  283|     22|    } \
  |  |  284|  12.7k|}
  ------------------
  348|  12.7k|#if !defined(OPENSSL_NO_DH) && !defined(OPENSSL_NO_DEPRECATED_3_0)
  349|  12.7k|    DO_TEST_NO_PRINT(DH, d2i_DHparams, i2d_DHparams);
  ------------------
  |  |  271|  12.7k|#define DO_TEST_NO_PRINT(TYPE, D2I, I2D) { \
  |  |  272|  12.7k|    const unsigned char *p = buf; \
  |  |  273|  12.7k|    unsigned char *der = NULL; \
  |  |  274|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  275|  12.7k|    \
  |  |  276|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (276:9): [True: 71, False: 12.6k]
  |  |  ------------------
  |  |  277|     71|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  278|     71|        \
  |  |  279|     71|        BIO_free(bio); \
  |  |  280|     71|        I2D(type, &der); \
  |  |  281|     71|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|     71|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     71|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     71|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  282|     71|        TYPE ## _free(type); \
  |  |  283|     71|    } \
  |  |  284|  12.7k|}
  ------------------
  350|  12.7k|    DO_TEST_NO_PRINT(DH, d2i_DHxparams, i2d_DHxparams);
  ------------------
  |  |  271|  12.7k|#define DO_TEST_NO_PRINT(TYPE, D2I, I2D) { \
  |  |  272|  12.7k|    const unsigned char *p = buf; \
  |  |  273|  12.7k|    unsigned char *der = NULL; \
  |  |  274|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  275|  12.7k|    \
  |  |  276|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (276:9): [True: 60, False: 12.6k]
  |  |  ------------------
  |  |  277|     60|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  278|     60|        \
  |  |  279|     60|        BIO_free(bio); \
  |  |  280|     60|        I2D(type, &der); \
  |  |  281|     60|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|     60|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     60|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     60|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  282|     60|        TYPE ## _free(type); \
  |  |  283|     60|    } \
  |  |  284|  12.7k|}
  ------------------
  351|  12.7k|#endif
  352|  12.7k|#ifndef OPENSSL_NO_DSA
  353|  12.7k|    DO_TEST_NO_PRINT(DSA_SIG, d2i_DSA_SIG, i2d_DSA_SIG);
  ------------------
  |  |  271|  12.7k|#define DO_TEST_NO_PRINT(TYPE, D2I, I2D) { \
  |  |  272|  12.7k|    const unsigned char *p = buf; \
  |  |  273|  12.7k|    unsigned char *der = NULL; \
  |  |  274|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  275|  12.7k|    \
  |  |  276|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (276:9): [True: 35, False: 12.7k]
  |  |  ------------------
  |  |  277|     35|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  278|     35|        \
  |  |  279|     35|        BIO_free(bio); \
  |  |  280|     35|        I2D(type, &der); \
  |  |  281|     35|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|     35|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     35|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     35|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  282|     35|        TYPE ## _free(type); \
  |  |  283|     35|    } \
  |  |  284|  12.7k|}
  ------------------
  354|  12.7k|# ifndef OPENSSL_NO_DEPRECATED_3_0
  355|  12.7k|    DO_TEST_NO_PRINT(DSA, d2i_DSAPrivateKey, i2d_DSAPrivateKey);
  ------------------
  |  |  271|  12.7k|#define DO_TEST_NO_PRINT(TYPE, D2I, I2D) { \
  |  |  272|  12.7k|    const unsigned char *p = buf; \
  |  |  273|  12.7k|    unsigned char *der = NULL; \
  |  |  274|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  275|  12.7k|    \
  |  |  276|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (276:9): [True: 75, False: 12.6k]
  |  |  ------------------
  |  |  277|     75|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  278|     75|        \
  |  |  279|     75|        BIO_free(bio); \
  |  |  280|     75|        I2D(type, &der); \
  |  |  281|     75|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|     75|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     75|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     75|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  282|     75|        TYPE ## _free(type); \
  |  |  283|     75|    } \
  |  |  284|  12.7k|}
  ------------------
  356|  12.7k|    DO_TEST_NO_PRINT(DSA, d2i_DSAPublicKey, i2d_DSAPublicKey);
  ------------------
  |  |  271|  12.7k|#define DO_TEST_NO_PRINT(TYPE, D2I, I2D) { \
  |  |  272|  12.7k|    const unsigned char *p = buf; \
  |  |  273|  12.7k|    unsigned char *der = NULL; \
  |  |  274|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  275|  12.7k|    \
  |  |  276|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (276:9): [True: 5, False: 12.7k]
  |  |  ------------------
  |  |  277|      5|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  278|      5|        \
  |  |  279|      5|        BIO_free(bio); \
  |  |  280|      5|        I2D(type, &der); \
  |  |  281|      5|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|      5|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  282|      5|        TYPE ## _free(type); \
  |  |  283|      5|    } \
  |  |  284|  12.7k|}
  ------------------
  357|  12.7k|    DO_TEST_NO_PRINT(DSA, d2i_DSAparams, i2d_DSAparams);
  ------------------
  |  |  271|  12.7k|#define DO_TEST_NO_PRINT(TYPE, D2I, I2D) { \
  |  |  272|  12.7k|    const unsigned char *p = buf; \
  |  |  273|  12.7k|    unsigned char *der = NULL; \
  |  |  274|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  275|  12.7k|    \
  |  |  276|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (276:9): [True: 14, False: 12.7k]
  |  |  ------------------
  |  |  277|     14|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  278|     14|        \
  |  |  279|     14|        BIO_free(bio); \
  |  |  280|     14|        I2D(type, &der); \
  |  |  281|     14|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|     14|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     14|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     14|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  282|     14|        TYPE ## _free(type); \
  |  |  283|     14|    } \
  |  |  284|  12.7k|}
  ------------------
  358|  12.7k|# endif
  359|  12.7k|#endif
  360|  12.7k|#ifndef OPENSSL_NO_DEPRECATED_3_0
  361|  12.7k|    DO_TEST_NO_PRINT(RSA, d2i_RSAPublicKey, i2d_RSAPublicKey);
  ------------------
  |  |  271|  12.7k|#define DO_TEST_NO_PRINT(TYPE, D2I, I2D) { \
  |  |  272|  12.7k|    const unsigned char *p = buf; \
  |  |  273|  12.7k|    unsigned char *der = NULL; \
  |  |  274|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  275|  12.7k|    \
  |  |  276|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (276:9): [True: 60, False: 12.6k]
  |  |  ------------------
  |  |  277|     60|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  278|     60|        \
  |  |  279|     60|        BIO_free(bio); \
  |  |  280|     60|        I2D(type, &der); \
  |  |  281|     60|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|     60|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     60|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     60|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  282|     60|        TYPE ## _free(type); \
  |  |  283|     60|    } \
  |  |  284|  12.7k|}
  ------------------
  362|  12.7k|#endif
  363|  12.7k|#ifndef OPENSSL_NO_EC
  364|  12.7k|# ifndef OPENSSL_NO_DEPRECATED_3_0
  365|  12.7k|    DO_TEST_PRINT_OFFSET(EC_GROUP, d2i_ECPKParameters, i2d_ECPKParameters, ECPKParameters_print);
  ------------------
  |  |  234|  12.7k|#define DO_TEST_PRINT_OFFSET(TYPE, D2I, I2D, PRINT) { \
  |  |  235|  12.7k|    const unsigned char *p = buf; \
  |  |  236|  12.7k|    unsigned char *der = NULL; \
  |  |  237|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  238|  12.7k|    \
  |  |  239|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (239:9): [True: 99, False: 12.6k]
  |  |  ------------------
  |  |  240|     99|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  241|     99|        \
  |  |  242|     99|        if (bio != NULL) { \
  |  |  ------------------
  |  |  |  Branch (242:13): [True: 99, False: 0]
  |  |  ------------------
  |  |  243|     99|            PRINT(bio, type, 0); \
  |  |  244|     99|            BIO_free(bio); \
  |  |  245|     99|        } \
  |  |  246|     99|        I2D(type, &der); \
  |  |  247|     99|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|     99|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     99|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     99|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  248|     99|        TYPE ## _free(type); \
  |  |  249|     99|    } \
  |  |  250|  12.7k|}
  ------------------
  366|  12.7k|    DO_TEST_PRINT_OFFSET(EC_KEY, d2i_ECPrivateKey, i2d_ECPrivateKey, EC_KEY_print);
  ------------------
  |  |  234|  12.7k|#define DO_TEST_PRINT_OFFSET(TYPE, D2I, I2D, PRINT) { \
  |  |  235|  12.7k|    const unsigned char *p = buf; \
  |  |  236|  12.7k|    unsigned char *der = NULL; \
  |  |  237|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  238|  12.7k|    \
  |  |  239|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (239:9): [True: 777, False: 11.9k]
  |  |  ------------------
  |  |  240|    777|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  241|    777|        \
  |  |  242|    777|        if (bio != NULL) { \
  |  |  ------------------
  |  |  |  Branch (242:13): [True: 777, False: 0]
  |  |  ------------------
  |  |  243|    777|            PRINT(bio, type, 0); \
  |  |  244|    777|            BIO_free(bio); \
  |  |  245|    777|        } \
  |  |  246|    777|        I2D(type, &der); \
  |  |  247|    777|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|    777|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    777|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    777|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  248|    777|        TYPE ## _free(type); \
  |  |  249|    777|    } \
  |  |  250|  12.7k|}
  ------------------
  367|  12.7k|    DO_TEST(EC_KEY, d2i_ECParameters, i2d_ECParameters, ECParameters_print);
  ------------------
  |  |  214|  12.7k|#define DO_TEST(TYPE, D2I, I2D, PRINT) { \
  |  |  215|  12.7k|    const unsigned char *p = buf; \
  |  |  216|  12.7k|    unsigned char *der = NULL; \
  |  |  217|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  218|  12.7k|    \
  |  |  219|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 99, False: 12.6k]
  |  |  ------------------
  |  |  220|     99|        int len2; \
  |  |  221|     99|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  222|     99|        \
  |  |  223|     99|        if (bio != NULL) { \
  |  |  ------------------
  |  |  |  Branch (223:13): [True: 99, False: 0]
  |  |  ------------------
  |  |  224|     99|            PRINT(bio, type); \
  |  |  225|     99|            BIO_free(bio); \
  |  |  226|     99|        } \
  |  |  227|     99|        len2 = I2D(type, &der); \
  |  |  228|     99|        if (len2 != 0) {} \
  |  |  ------------------
  |  |  |  Branch (228:13): [True: 99, False: 0]
  |  |  ------------------
  |  |  229|     99|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|     99|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     99|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     99|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  230|     99|        TYPE ## _free(type); \
  |  |  231|     99|    } \
  |  |  232|  12.7k|}
  ------------------
  368|  12.7k|    DO_TEST_NO_PRINT(ECDSA_SIG, d2i_ECDSA_SIG, i2d_ECDSA_SIG);
  ------------------
  |  |  271|  12.7k|#define DO_TEST_NO_PRINT(TYPE, D2I, I2D) { \
  |  |  272|  12.7k|    const unsigned char *p = buf; \
  |  |  273|  12.7k|    unsigned char *der = NULL; \
  |  |  274|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  275|  12.7k|    \
  |  |  276|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (276:9): [True: 35, False: 12.7k]
  |  |  ------------------
  |  |  277|     35|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  278|     35|        \
  |  |  279|     35|        BIO_free(bio); \
  |  |  280|     35|        I2D(type, &der); \
  |  |  281|     35|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|     35|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     35|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     35|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  282|     35|        TYPE ## _free(type); \
  |  |  283|     35|    } \
  |  |  284|  12.7k|}
  ------------------
  369|  12.7k|# endif
  370|  12.7k|#endif
  371|  12.7k|    DO_TEST_PRINT_PCTX(EVP_PKEY, d2i_AutoPrivateKey, i2d_PrivateKey, EVP_PKEY_print_private);
  ------------------
  |  |  252|  12.7k|#define DO_TEST_PRINT_PCTX(TYPE, D2I, I2D, PRINT) { \
  |  |  253|  12.7k|    const unsigned char *p = buf; \
  |  |  254|  12.7k|    unsigned char *der = NULL; \
  |  |  255|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  256|  12.7k|    \
  |  |  257|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (257:9): [True: 1.78k, False: 10.9k]
  |  |  ------------------
  |  |  258|  1.78k|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  259|  1.78k|        \
  |  |  260|  1.78k|        if (bio != NULL) { \
  |  |  ------------------
  |  |  |  Branch (260:13): [True: 1.78k, False: 0]
  |  |  ------------------
  |  |  261|  1.78k|            PRINT(bio, type, 0, pctx); \
  |  |  262|  1.78k|            BIO_free(bio); \
  |  |  263|  1.78k|        } \
  |  |  264|  1.78k|        I2D(type, &der); \
  |  |  265|  1.78k|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|  1.78k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.78k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.78k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  266|  1.78k|        TYPE ## _free(type); \
  |  |  267|  1.78k|    } \
  |  |  268|  12.7k|}
  ------------------
  372|  12.7k|    DO_TEST(SSL_SESSION, d2i_SSL_SESSION, i2d_SSL_SESSION, SSL_SESSION_print);
  ------------------
  |  |  214|  12.7k|#define DO_TEST(TYPE, D2I, I2D, PRINT) { \
  |  |  215|  12.7k|    const unsigned char *p = buf; \
  |  |  216|  12.7k|    unsigned char *der = NULL; \
  |  |  217|  12.7k|    TYPE *type = D2I(NULL, &p, len); \
  |  |  218|  12.7k|    \
  |  |  219|  12.7k|    if (type != NULL) { \
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 414, False: 12.3k]
  |  |  ------------------
  |  |  220|    414|        int len2; \
  |  |  221|    414|        BIO *bio = BIO_new(BIO_s_null()); \
  |  |  222|    414|        \
  |  |  223|    414|        if (bio != NULL) { \
  |  |  ------------------
  |  |  |  Branch (223:13): [True: 414, False: 0]
  |  |  ------------------
  |  |  224|    414|            PRINT(bio, type); \
  |  |  225|    414|            BIO_free(bio); \
  |  |  226|    414|        } \
  |  |  227|    414|        len2 = I2D(type, &der); \
  |  |  228|    414|        if (len2 != 0) {} \
  |  |  ------------------
  |  |  |  Branch (228:13): [True: 414, False: 0]
  |  |  ------------------
  |  |  229|    414|        OPENSSL_free(der); \
  |  |  ------------------
  |  |  |  |  115|    414|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    414|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    414|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  230|    414|        TYPE ## _free(type); \
  |  |  231|    414|    } \
  |  |  232|  12.7k|}
  ------------------
  373|       |
  374|  12.7k|    ERR_clear_error();
  375|       |
  376|  12.7k|    return 0;
  377|  12.7k|}

LLVMFuzzerInitialize:
   22|      2|{
   23|      2|    return FuzzerInitialize(argc, argv);
   24|      2|}
LLVMFuzzerTestOneInput:
   27|  12.7k|{
   28|  12.7k|    return FuzzerTestOneInput(buf, len);
   29|  12.7k|}

FuzzerSetRand:
  158|      2|{
  159|      2|    if (!OSSL_PROVIDER_add_builtin(NULL, "fuzz-rand", fuzz_rand_provider_init)
  ------------------
  |  Branch (159:9): [True: 0, False: 2]
  ------------------
  160|      2|        || !RAND_set_DRBG_type(NULL, "fuzz", NULL, NULL, NULL)
  ------------------
  |  Branch (160:12): [True: 0, False: 2]
  ------------------
  161|      2|        || (r_prov = OSSL_PROVIDER_try_load(NULL, "fuzz-rand", 1)) == NULL)
  ------------------
  |  Branch (161:12): [True: 0, False: 2]
  ------------------
  162|      0|        exit(1);
  163|      2|}
fuzz_rand.c:fuzz_rand_provider_init:
  147|      2|{
  148|      2|    *provctx = OSSL_LIB_CTX_new();
  149|      2|    if (*provctx == NULL)
  ------------------
  |  Branch (149:9): [True: 0, False: 2]
  ------------------
  150|      0|        return 0;
  151|      2|    *out = fuzz_rand_method;
  152|      2|    return 1;
  153|      2|}
fuzz_rand.c:fuzz_rand_query:
  128|  6.60k|{
  129|  6.60k|    *no_cache = 0;
  130|  6.60k|    switch (operation_id) {
  ------------------
  |  Branch (130:13): [True: 6.60k, False: 2]
  ------------------
  131|      2|    case OSSL_OP_RAND:
  ------------------
  |  |  314|      2|# define OSSL_OP_RAND                                5
  ------------------
  |  Branch (131:5): [True: 2, False: 6.60k]
  ------------------
  132|      2|        return fuzz_rand_rand;
  133|  6.60k|    }
  134|  6.60k|    return NULL;
  135|  6.60k|}
fuzz_rand.c:fuzz_rand_newctx:
   27|      2|{
   28|      2|    int *st = OPENSSL_malloc(sizeof(*st));
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   29|       |
   30|      2|    if (st != NULL)
  ------------------
  |  Branch (30:9): [True: 2, False: 0]
  ------------------
   31|      2|        *st = EVP_RAND_STATE_UNINITIALISED;
  ------------------
  |  | 1347|      2|# define EVP_RAND_STATE_UNINITIALISED    0
  ------------------
   32|      2|    return st;
   33|      2|}
fuzz_rand.c:fuzz_rand_freectx:
   36|      2|{
   37|      2|    OPENSSL_free(vrng);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   38|      2|}
fuzz_rand.c:fuzz_rand_instantiate:
   46|      2|{
   47|      2|    *(int *)vrng = EVP_RAND_STATE_READY;
  ------------------
  |  | 1348|      2|# define EVP_RAND_STATE_READY            1
  ------------------
   48|      2|    return 1;
   49|      2|}
fuzz_rand.c:fuzz_rand_generate:
   63|  58.7k|{
   64|  58.7k|    unsigned char val = 1;
   65|  58.7k|    size_t i;
   66|       |
   67|  2.33M|    for (i = 0; i < outlen; i++)
  ------------------
  |  Branch (67:17): [True: 2.28M, False: 58.7k]
  ------------------
   68|  2.28M|        out[i] = val++;
   69|  58.7k|    return 1;
   70|  58.7k|}
fuzz_rand.c:fuzz_rand_enable_locking:
   73|      1|{
   74|      1|    return 1;
   75|      1|}
fuzz_rand.c:fuzz_rand_get_ctx_params:
   78|  58.7k|{
   79|  58.7k|    OSSL_PARAM *p;
   80|       |
   81|  58.7k|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STATE);
  ------------------
  |  |  533|  58.7k|# define OSSL_RAND_PARAM_STATE "state"
  ------------------
   82|  58.7k|    if (p != NULL && !OSSL_PARAM_set_int(p, *(int *)vrng))
  ------------------
  |  Branch (82:9): [True: 0, False: 58.7k]
  |  Branch (82:22): [True: 0, False: 0]
  ------------------
   83|      0|        return 0;
   84|       |
   85|  58.7k|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STRENGTH);
  ------------------
  |  |  534|  58.7k|# define OSSL_RAND_PARAM_STRENGTH "strength"
  ------------------
   86|  58.7k|    if (p != NULL && !OSSL_PARAM_set_int(p, 500))
  ------------------
  |  Branch (86:9): [True: 0, False: 58.7k]
  |  Branch (86:22): [True: 0, False: 0]
  ------------------
   87|      0|        return 0;
   88|       |
   89|  58.7k|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_MAX_REQUEST);
  ------------------
  |  |  532|  58.7k|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
   90|  58.7k|    if (p != NULL && !OSSL_PARAM_set_size_t(p, INT_MAX))
  ------------------
  |  Branch (90:9): [True: 58.7k, False: 0]
  |  Branch (90:22): [True: 0, False: 58.7k]
  ------------------
   91|      0|        return 0;
   92|  58.7k|    return 1;
   93|  58.7k|}

EVP_aria_128_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_cfb128:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_cfb128:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_cfb128:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_cfb1:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_cfb1:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_cfb1:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_cfb8:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_cfb8:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_cfb8:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_bf_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_bf_cfb64:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_bf_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_bf_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_cast5_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_cast5_cfb64:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_cast5_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_cast5_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_cfb64:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_cfb1:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_cfb8:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede_cfb64:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_cfb64:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_cfb1:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_cfb8:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_idea_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_idea_cfb64:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_idea_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_idea_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc2_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc2_cfb64:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc2_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc2_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc5_32_12_16_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc5_32_12_16_cfb64:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc5_32_12_16_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc5_32_12_16_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_seed_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_seed_cfb128:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_seed_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_seed_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }

SHA1_Update:
  155|  6.59k|{
  156|  6.59k|    const unsigned char *data = data_;
  157|  6.59k|    unsigned char *p;
  158|  6.59k|    HASH_LONG l;
  ------------------
  |  |   19|  6.59k|#define HASH_LONG               SHA_LONG
  |  |  ------------------
  |  |  |  |   34|  6.59k|#  define SHA_LONG unsigned int
  |  |  ------------------
  ------------------
  159|  6.59k|    size_t n;
  160|       |
  161|  6.59k|    if (len == 0)
  ------------------
  |  Branch (161:9): [True: 0, False: 6.59k]
  ------------------
  162|      0|        return 1;
  163|       |
  164|  6.59k|    l = (c->Nl + (((HASH_LONG) len) << 3)) & 0xffffffffUL;
  165|  6.59k|    if (l < c->Nl)              /* overflow */
  ------------------
  |  Branch (165:9): [True: 0, False: 6.59k]
  ------------------
  166|      0|        c->Nh++;
  167|  6.59k|    c->Nh += (HASH_LONG) (len >> 29); /* might cause compiler warning on
  168|       |                                       * 16-bit */
  169|  6.59k|    c->Nl = l;
  170|       |
  171|  6.59k|    n = c->num;
  172|  6.59k|    if (n != 0) {
  ------------------
  |  Branch (172:9): [True: 0, False: 6.59k]
  ------------------
  173|      0|        p = (unsigned char *)c->data;
  174|       |
  175|      0|        if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
  ------------------
  |  |   21|      0|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|      0|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
  ------------------
  |  |   21|      0|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|      0|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (175:13): [True: 0, False: 0]
  |  Branch (175:35): [True: 0, False: 0]
  ------------------
  176|      0|            memcpy(p + n, data, HASH_CBLOCK - n);
  ------------------
  |  |   21|      0|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|      0|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|      0|            HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |   35|      0|#define HASH_BLOCK_DATA_ORDER           sha1_block_data_order
  ------------------
  178|      0|            n = HASH_CBLOCK - n;
  ------------------
  |  |   21|      0|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|      0|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  179|      0|            data += n;
  180|      0|            len -= n;
  181|      0|            c->num = 0;
  182|       |            /*
  183|       |             * We use memset rather than OPENSSL_cleanse() here deliberately.
  184|       |             * Using OPENSSL_cleanse() here could be a performance issue. It
  185|       |             * will get properly cleansed on finalisation so this isn't a
  186|       |             * security problem.
  187|       |             */
  188|      0|            memset(p, 0, HASH_CBLOCK); /* keep it zeroed */
  ------------------
  |  |   21|      0|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|      0|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  189|      0|        } else {
  190|      0|            memcpy(p + n, data, len);
  191|      0|            c->num += (unsigned int)len;
  192|      0|            return 1;
  193|      0|        }
  194|      0|    }
  195|       |
  196|  6.59k|    n = len / HASH_CBLOCK;
  ------------------
  |  |   21|  6.59k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  6.59k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  6.59k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|  6.59k|    if (n > 0) {
  ------------------
  |  Branch (197:9): [True: 4.12k, False: 2.47k]
  ------------------
  198|  4.12k|        HASH_BLOCK_DATA_ORDER(c, data, n);
  ------------------
  |  |   35|  4.12k|#define HASH_BLOCK_DATA_ORDER           sha1_block_data_order
  ------------------
  199|  4.12k|        n *= HASH_CBLOCK;
  ------------------
  |  |   21|  4.12k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  4.12k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  4.12k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  200|  4.12k|        data += n;
  201|  4.12k|        len -= n;
  202|  4.12k|    }
  203|       |
  204|  6.59k|    if (len != 0) {
  ------------------
  |  Branch (204:9): [True: 6.55k, False: 45]
  ------------------
  205|  6.55k|        p = (unsigned char *)c->data;
  206|  6.55k|        c->num = (unsigned int)len;
  207|  6.55k|        memcpy(p, data, len);
  208|  6.55k|    }
  209|  6.59k|    return 1;
  210|  6.59k|}
SHA1_Final:
  218|  6.59k|{
  219|  6.59k|    unsigned char *p = (unsigned char *)c->data;
  220|  6.59k|    size_t n = c->num;
  221|       |
  222|  6.59k|    p[n] = 0x80;                /* there is always room for one */
  223|  6.59k|    n++;
  224|       |
  225|  6.59k|    if (n > (HASH_CBLOCK - 8)) {
  ------------------
  |  |   21|  6.59k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  6.59k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  6.59k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (225:9): [True: 1.52k, False: 5.06k]
  ------------------
  226|  1.52k|        memset(p + n, 0, HASH_CBLOCK - n);
  ------------------
  |  |   21|  1.52k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  1.52k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  1.52k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  227|  1.52k|        n = 0;
  228|  1.52k|        HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |   35|  1.52k|#define HASH_BLOCK_DATA_ORDER           sha1_block_data_order
  ------------------
  229|  1.52k|    }
  230|  6.59k|    memset(p + n, 0, HASH_CBLOCK - 8 - n);
  ------------------
  |  |   21|  6.59k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  6.59k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  6.59k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|       |
  232|  6.59k|    p += HASH_CBLOCK - 8;
  ------------------
  |  |   21|  6.59k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  6.59k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  6.59k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  233|  6.59k|# if   defined(DATA_ORDER_IS_BIG_ENDIAN)
  234|  6.59k|    (void)HOST_l2c(c->Nh, p);
  ------------------
  |  |  130|  6.59k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  131|  6.59k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  132|  6.59k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  133|  6.59k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  134|  6.59k|                         l)
  ------------------
  235|  6.59k|    (void)HOST_l2c(c->Nl, p);
  ------------------
  |  |  130|  6.59k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  131|  6.59k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  132|  6.59k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  133|  6.59k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  134|  6.59k|                         l)
  ------------------
  236|       |# elif defined(DATA_ORDER_IS_LITTLE_ENDIAN)
  237|       |    (void)HOST_l2c(c->Nl, p);
  238|       |    (void)HOST_l2c(c->Nh, p);
  239|       |# endif
  240|  6.59k|    p -= HASH_CBLOCK;
  ------------------
  |  |   21|  6.59k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  6.59k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  6.59k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|  6.59k|    HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |   35|  6.59k|#define HASH_BLOCK_DATA_ORDER           sha1_block_data_order
  ------------------
  242|  6.59k|    c->num = 0;
  243|  6.59k|    OPENSSL_cleanse(p, HASH_CBLOCK);
  ------------------
  |  |   21|  6.59k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  6.59k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  6.59k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  244|       |
  245|       |# ifndef HASH_MAKE_STRING
  246|       |#  error "HASH_MAKE_STRING must be defined!"
  247|       |# else
  248|  6.59k|    HASH_MAKE_STRING(c, md);
  ------------------
  |  |   22|  6.59k|#define HASH_MAKE_STRING(c,s)   do {    \
  |  |   23|  6.59k|        unsigned long ll;               \
  |  |   24|  6.59k|        ll=(c)->h0; (void)HOST_l2c(ll,(s));     \
  |  |  ------------------
  |  |  |  |  130|  6.59k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|  6.59k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|  6.59k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|  6.59k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|  6.59k|                         l)
  |  |  ------------------
  |  |   25|  6.59k|        ll=(c)->h1; (void)HOST_l2c(ll,(s));     \
  |  |  ------------------
  |  |  |  |  130|  6.59k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|  6.59k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|  6.59k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|  6.59k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|  6.59k|                         l)
  |  |  ------------------
  |  |   26|  6.59k|        ll=(c)->h2; (void)HOST_l2c(ll,(s));     \
  |  |  ------------------
  |  |  |  |  130|  6.59k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|  6.59k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|  6.59k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|  6.59k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|  6.59k|                         l)
  |  |  ------------------
  |  |   27|  6.59k|        ll=(c)->h3; (void)HOST_l2c(ll,(s));     \
  |  |  ------------------
  |  |  |  |  130|  6.59k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|  6.59k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|  6.59k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|  6.59k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|  6.59k|                         l)
  |  |  ------------------
  |  |   28|  6.59k|        ll=(c)->h4; (void)HOST_l2c(ll,(s));     \
  |  |  ------------------
  |  |  |  |  130|  6.59k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|  6.59k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|  6.59k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|  6.59k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|  6.59k|                         l)
  |  |  ------------------
  |  |   29|  6.59k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (29:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  249|  6.59k|# endif
  250|       |
  251|  6.59k|    return 1;
  252|  6.59k|}

property.c:ossl_sa_ALGORITHM_new:
   27|     16|    { \
   28|     16|        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new(); \
   29|     16|    } \
property.c:ossl_sa_ALGORITHM_doall_arg:
   56|  6.60k|    { \
   57|  6.60k|        ossl_sa_doall_arg((OPENSSL_SA *)sa, \
   58|  6.60k|                          (void (*)(ossl_uintmax_t, void *, void *))leaf, arg); \
   59|  6.60k|    } \
property.c:ossl_sa_ALGORITHM_set:
   68|    282|    { \
   69|    282|        return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \
   70|    282|    } \
property.c:ossl_sa_ALGORITHM_free:
   32|      8|    { \
   33|      8|        ossl_sa_free((OPENSSL_SA *)sa); \
   34|      8|    } \
property.c:ossl_sa_ALGORITHM_get:
   62|  7.46k|    { \
   63|  7.46k|        return (type *)ossl_sa_get((OPENSSL_SA *)sa, n); \
   64|  7.46k|    } \
property.c:ossl_sa_ALGORITHM_num:
   42|  6.59k|    { \
   43|  6.59k|        return ossl_sa_num((OPENSSL_SA *)sa); \
   44|  6.59k|    } \
property.c:ossl_sa_ALGORITHM_doall:
   48|      8|    { \
   49|      8|        ossl_sa_doall((OPENSSL_SA *)sa, \
   50|      8|                      (void (*)(ossl_uintmax_t, void *))leaf); \
   51|      8|    } \

bio_print.c:ossl_assert_int:
   45|   267M|{
   46|   267M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 267M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   267M|    return expr;
   50|   267M|}
decoder_lib.c:ossl_assert_int:
   45|   200k|{
   46|   200k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 200k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   200k|    return expr;
   50|   200k|}
decoder_meth.c:ossl_assert_int:
   45|   795k|{
   46|   795k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 795k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   795k|    return expr;
   50|   795k|}
encoder_lib.c:ossl_assert_int:
   45|   127k|{
   46|   127k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 127k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   127k|    return expr;
   50|   127k|}
encoder_meth.c:ossl_assert_int:
   45|  1.57M|{
   46|  1.57M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.57M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.57M|    return expr;
   50|  1.57M|}
encoder_pkey.c:ossl_assert_int:
   45|  6.86k|{
   46|  6.86k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 6.86k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  6.86k|    return expr;
   50|  6.86k|}
evp_fetch.c:ossl_assert_int:
   45|  20.3k|{
   46|  20.3k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 20.3k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  20.3k|    return expr;
   50|  20.3k|}
p_lib.c:ossl_assert_int:
   45|   161k|{
   46|   161k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 161k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   161k|    return expr;
   50|   161k|}
core_fetch.c:ossl_assert_int:
   45|  13.2k|{
   46|  13.2k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 13.2k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  13.2k|    return expr;
   50|  13.2k|}
core_namemap.c:ossl_assert_int:
   45|  1.00k|{
   46|  1.00k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.00k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.00k|    return expr;
   50|  1.00k|}
packet.c:ossl_assert_int:
   45|   155k|{
   46|   155k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 155k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   155k|    return expr;
   50|   155k|}
passphrase.c:ossl_assert_int:
   45|  1.62k|{
   46|  1.62k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.62k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.62k|    return expr;
   50|  1.62k|}
provider_core.c:ossl_assert_int:
   45|  13.2k|{
   46|  13.2k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 13.2k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  13.2k|    return expr;
   50|  13.2k|}
threads_pthread.c:ossl_assert_int:
   45|  6.18M|{
   46|  6.18M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 6.18M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  6.18M|    return expr;
   50|  6.18M|}
defn_cache.c:ossl_assert_int:
   45|    798|{
   46|    798|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 798]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    798|    return expr;
   50|    798|}
property.c:ossl_assert_int:
   45|    406|{
   46|    406|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 406]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    406|    return expr;
   50|    406|}
x_pubkey.c:ossl_assert_int:
   45|  52.5k|{
   46|  52.5k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 52.5k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  52.5k|    return expr;
   50|  52.5k|}
der_rsa_key.c:ossl_assert_int:
   45|      4|{
   46|      4|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 4]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|      4|    return expr;
   50|      4|}

bn_lib.c:constant_time_select_int:
  360|  1.06M|{
  361|  1.06M|    return (int)constant_time_select(mask, (unsigned)(a), (unsigned)(b));
  362|  1.06M|}
bn_lib.c:constant_time_select:
  340|  1.06M|{
  341|  1.06M|    return (value_barrier(mask) & a) | (value_barrier(~mask) & b);
  342|  1.06M|}
bn_lib.c:value_barrier:
  279|  2.12M|{
  280|  2.12M|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  281|  2.12M|    unsigned int r;
  282|  2.12M|    __asm__("" : "=r"(r) : "0"(a));
  283|       |#else
  284|       |    volatile unsigned int r = a;
  285|       |#endif
  286|  2.12M|    return r;
  287|  2.12M|}
bn_lib.c:constant_time_lt_bn:
  169|  1.06M|{
  170|  1.06M|    return constant_time_msb_bn(a ^ ((a ^ b) | ((a - b) ^ b)));
  171|  1.06M|}
bn_lib.c:constant_time_msb_bn:
  164|  1.06M|{
  165|  1.06M|    return 0 - (a >> (sizeof(a) * 8 - 1));
  166|  1.06M|}
bn_lib.c:constant_time_msb:
  104|  10.5M|{
  105|  10.5M|    return 0 - (a >> (sizeof(a) * 8 - 1));
  106|  10.5M|}
bn_lib.c:constant_time_eq_int:
  262|  10.5M|{
  263|  10.5M|    return constant_time_eq((unsigned)(a), (unsigned)(b));
  264|  10.5M|}
bn_lib.c:constant_time_eq:
  241|  10.5M|{
  242|  10.5M|    return constant_time_is_zero(a ^ b);
  243|  10.5M|}
bn_lib.c:constant_time_is_zero:
  215|  10.5M|{
  216|  10.5M|    return constant_time_msb(~a & (a - 1));
  217|  10.5M|}
bn_exp.c:constant_time_eq_int:
  262|   992k|{
  263|   992k|    return constant_time_eq((unsigned)(a), (unsigned)(b));
  264|   992k|}
bn_exp.c:constant_time_eq:
  241|   992k|{
  242|   992k|    return constant_time_is_zero(a ^ b);
  243|   992k|}
bn_exp.c:constant_time_is_zero:
  215|   992k|{
  216|   992k|    return constant_time_msb(~a & (a - 1));
  217|   992k|}
bn_exp.c:constant_time_msb:
  104|   992k|{
  105|   992k|    return 0 - (a >> (sizeof(a) * 8 - 1));
  106|   992k|}
rsaz_exp.c:constant_time_select_64:
  378|      8|{
  379|      8|    return (value_barrier_64(mask) & a) | (value_barrier_64(~mask) & b);
  380|      8|}
rsaz_exp.c:value_barrier_64:
  303|     16|{
  304|     16|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  305|     16|    uint64_t r;
  306|     16|    __asm__("" : "=r"(r) : "0"(a));
  307|       |#else
  308|       |    volatile uint64_t r = a;
  309|       |#endif
  310|     16|    return r;
  311|     16|}

core_namemap.c:ossl_ht_strcase:
  255|   212k|{
  256|   212k|    int i;
  257|       |#if defined(CHARSET_EBCDIC) && !defined(CHARSET_EBCDIC_TEST)
  258|       |    const long int case_adjust = ~0x40;
  259|       |#else
  260|   212k|    const long int case_adjust = ~0x20;
  261|   212k|#endif
  262|       |
  263|   212k|    if (src == NULL)
  ------------------
  |  Branch (263:9): [True: 0, False: 212k]
  ------------------
  264|      0|        return;
  265|       |
  266|  1.83M|    for (i = 0; src[i] != '\0' && i < len; i++)
  ------------------
  |  Branch (266:17): [True: 1.62M, False: 212k]
  |  Branch (266:35): [True: 1.62M, False: 56]
  ------------------
  267|  1.62M|        tgt[i] = case_adjust & src[i];
  268|   212k|}

asn1_dsa.c:PACKET_get_1:
  302|  64.2k|{
  303|  64.2k|    if (!PACKET_peek_1(pkt, data))
  ------------------
  |  Branch (303:9): [True: 844, False: 63.4k]
  ------------------
  304|    844|        return 0;
  305|       |
  306|  63.4k|    packet_forward(pkt, 1);
  307|       |
  308|  63.4k|    return 1;
  309|  64.2k|}
asn1_dsa.c:PACKET_peek_1:
  291|  64.2k|{
  292|  64.2k|    if (!PACKET_remaining(pkt))
  ------------------
  |  Branch (292:9): [True: 844, False: 63.4k]
  ------------------
  293|    844|        return 0;
  294|       |
  295|  63.4k|    *data = *pkt->curr;
  296|       |
  297|  63.4k|    return 1;
  298|  64.2k|}
asn1_dsa.c:packet_forward:
   31|  75.0k|{
   32|  75.0k|    pkt->curr += len;
   33|  75.0k|    pkt->remaining -= len;
   34|  75.0k|}
asn1_dsa.c:PACKET_get_sub_packet:
  123|  9.65k|{
  124|  9.65k|    if (!PACKET_peek_sub_packet(pkt, subpkt, len))
  ------------------
  |  Branch (124:9): [True: 60, False: 9.59k]
  ------------------
  125|     60|        return 0;
  126|       |
  127|  9.59k|    packet_forward(pkt, len);
  128|       |
  129|  9.59k|    return 1;
  130|  9.65k|}
asn1_dsa.c:PACKET_peek_sub_packet:
  109|  9.65k|{
  110|  9.65k|    if (PACKET_remaining(pkt) < len)
  ------------------
  |  Branch (110:9): [True: 60, False: 9.59k]
  ------------------
  111|     60|        return 0;
  112|       |
  113|  9.59k|    return PACKET_buf_init(subpkt, pkt->curr, len);
  114|  9.65k|}
asn1_dsa.c:PACKET_get_length_prefixed_1:
  516|    202|{
  517|    202|    unsigned int length;
  518|    202|    const unsigned char *data;
  519|    202|    PACKET tmp = *pkt;
  520|    202|    if (!PACKET_get_1(&tmp, &length) ||
  ------------------
  |  Branch (520:9): [True: 6, False: 196]
  ------------------
  521|    202|        !PACKET_get_bytes(&tmp, &data, (size_t)length)) {
  ------------------
  |  Branch (521:9): [True: 26, False: 170]
  ------------------
  522|     32|        return 0;
  523|     32|    }
  524|       |
  525|    170|    *pkt = tmp;
  526|    170|    subpkt->curr = data;
  527|    170|    subpkt->remaining = length;
  528|       |
  529|    170|    return 1;
  530|    202|}
asn1_dsa.c:PACKET_get_bytes:
  383|  1.18k|{
  384|  1.18k|    if (!PACKET_peek_bytes(pkt, data, len))
  ------------------
  |  Branch (384:9): [True: 106, False: 1.07k]
  ------------------
  385|    106|        return 0;
  386|       |
  387|  1.07k|    packet_forward(pkt, len);
  388|       |
  389|  1.07k|    return 1;
  390|  1.18k|}
asn1_dsa.c:PACKET_peek_bytes:
  365|  1.18k|{
  366|  1.18k|    if (PACKET_remaining(pkt) < len)
  ------------------
  |  Branch (366:9): [True: 106, False: 1.07k]
  ------------------
  367|    106|        return 0;
  368|       |
  369|  1.07k|    *data = pkt->curr;
  370|       |
  371|  1.07k|    return 1;
  372|  1.18k|}
asn1_dsa.c:PACKET_get_length_prefixed_2:
  564|    990|{
  565|    990|    unsigned int length;
  566|    990|    const unsigned char *data;
  567|    990|    PACKET tmp = *pkt;
  568|       |
  569|    990|    if (!PACKET_get_net_2(&tmp, &length) ||
  ------------------
  |  Branch (569:9): [True: 6, False: 984]
  ------------------
  570|    990|        !PACKET_get_bytes(&tmp, &data, (size_t)length)) {
  ------------------
  |  Branch (570:9): [True: 80, False: 904]
  ------------------
  571|     86|        return 0;
  572|     86|    }
  573|       |
  574|    904|    *pkt = tmp;
  575|    904|    subpkt->curr = data;
  576|    904|    subpkt->remaining = length;
  577|       |
  578|    904|    return 1;
  579|    990|}
asn1_dsa.c:PACKET_get_net_2:
  151|    990|{
  152|    990|    if (!PACKET_peek_net_2(pkt, data))
  ------------------
  |  Branch (152:9): [True: 6, False: 984]
  ------------------
  153|      6|        return 0;
  154|       |
  155|    984|    packet_forward(pkt, 2);
  156|       |
  157|    984|    return 1;
  158|    990|}
asn1_dsa.c:PACKET_peek_net_2:
  138|    990|{
  139|    990|    if (PACKET_remaining(pkt) < 2)
  ------------------
  |  Branch (139:9): [True: 6, False: 984]
  ------------------
  140|      6|        return 0;
  141|       |
  142|    984|    *data = ((unsigned int)(*pkt->curr)) << 8;
  143|    984|    *data |= *(pkt->curr + 1);
  144|       |
  145|    984|    return 1;
  146|    990|}
asn1_dsa.c:PACKET_remaining:
   40|  83.3k|{
   41|  83.3k|    return pkt->remaining;
   42|  83.3k|}
asn1_dsa.c:PACKET_data:
   60|  3.37k|{
   61|  3.37k|    return pkt->curr;
   62|  3.37k|}
asn1_dsa.c:PACKET_buf_init:
   72|  35.1k|{
   73|       |    /* Sanity check for negative values. */
   74|  35.1k|    if (len > (size_t)(SIZE_MAX / 2))
  ------------------
  |  Branch (74:9): [True: 0, False: 35.1k]
  ------------------
   75|      0|        return 0;
   76|       |
   77|  35.1k|    pkt->curr = buf;
   78|  35.1k|    pkt->remaining = len;
   79|  35.1k|    return 1;
   80|  35.1k|}

ssl_sess.c:CRYPTO_NEW_REF:
  280|    479|{
  281|    479|    refcnt->val = n;
  282|    479|    return 1;
  283|    479|}
ssl_sess.c:CRYPTO_FREE_REF:
  285|    479|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|    479|{
  287|    479|}
ssl_sess.c:CRYPTO_DOWN_REF:
   56|    479|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|    479|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|    479|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 479, False: 0]
  ------------------
   66|    479|        atomic_thread_fence(memory_order_acquire);
   67|    479|#   endif
   68|    479|    return 1;
   69|    479|}
tasn_utl.c:CRYPTO_NEW_REF:
  280|  64.0k|{
  281|  64.0k|    refcnt->val = n;
  282|  64.0k|    return 1;
  283|  64.0k|}
tasn_utl.c:CRYPTO_FREE_REF:
  285|  64.0k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|  64.0k|{
  287|  64.0k|}
tasn_utl.c:CRYPTO_DOWN_REF:
   56|  64.0k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  64.0k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  64.0k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 64.0k, False: 0]
  ------------------
   66|  64.0k|        atomic_thread_fence(memory_order_acquire);
   67|  64.0k|#   endif
   68|  64.0k|    return 1;
   69|  64.0k|}
bio_lib.c:CRYPTO_NEW_REF:
  280|  2.29M|{
  281|  2.29M|    refcnt->val = n;
  282|  2.29M|    return 1;
  283|  2.29M|}
bio_lib.c:CRYPTO_FREE_REF:
  285|  2.29M|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|  2.29M|{
  287|  2.29M|}
bio_lib.c:CRYPTO_DOWN_REF:
   56|  2.36M|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  2.36M|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  2.36M|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 2.29M, False: 66.3k]
  ------------------
   66|  2.29M|        atomic_thread_fence(memory_order_acquire);
   67|  2.36M|#   endif
   68|  2.36M|    return 1;
   69|  2.36M|}
bio_lib.c:CRYPTO_UP_REF:
   40|  66.3k|{
   41|  66.3k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  66.3k|    return 1;
   43|  66.3k|}
dh_lib.c:CRYPTO_NEW_REF:
  280|  33.0k|{
  281|  33.0k|    refcnt->val = n;
  282|  33.0k|    return 1;
  283|  33.0k|}
dh_lib.c:CRYPTO_DOWN_REF:
   56|  33.1k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  33.1k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  33.1k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 33.0k, False: 65]
  ------------------
   66|  33.0k|        atomic_thread_fence(memory_order_acquire);
   67|  33.1k|#   endif
   68|  33.1k|    return 1;
   69|  33.1k|}
dh_lib.c:CRYPTO_FREE_REF:
  285|  33.0k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|  33.0k|{
  287|  33.0k|}
dh_lib.c:CRYPTO_UP_REF:
   40|     65|{
   41|     65|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|     65|    return 1;
   43|     65|}
dsa_lib.c:CRYPTO_NEW_REF:
  280|  43.8k|{
  281|  43.8k|    refcnt->val = n;
  282|  43.8k|    return 1;
  283|  43.8k|}
dsa_lib.c:CRYPTO_DOWN_REF:
   56|  43.8k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  43.8k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  43.8k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 43.8k, False: 5]
  ------------------
   66|  43.8k|        atomic_thread_fence(memory_order_acquire);
   67|  43.8k|#   endif
   68|  43.8k|    return 1;
   69|  43.8k|}
dsa_lib.c:CRYPTO_FREE_REF:
  285|  43.8k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|  43.8k|{
  287|  43.8k|}
dsa_lib.c:CRYPTO_UP_REF:
   40|      5|{
   41|      5|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|      5|    return 1;
   43|      5|}
ec_key.c:CRYPTO_DOWN_REF:
   56|  46.2k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  46.2k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  46.2k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 39.4k, False: 6.77k]
  ------------------
   66|  39.4k|        atomic_thread_fence(memory_order_acquire);
   67|  46.2k|#   endif
   68|  46.2k|    return 1;
   69|  46.2k|}
ec_key.c:CRYPTO_FREE_REF:
  285|  39.4k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|  39.4k|{
  287|  39.4k|}
ec_key.c:CRYPTO_UP_REF:
   40|  6.77k|{
   41|  6.77k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  6.77k|    return 1;
   43|  6.77k|}
ec_kmeth.c:CRYPTO_NEW_REF:
  280|  39.4k|{
  281|  39.4k|    refcnt->val = n;
  282|  39.4k|    return 1;
  283|  39.4k|}
decoder_meth.c:CRYPTO_UP_REF:
   40|   605k|{
   41|   605k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|   605k|    return 1;
   43|   605k|}
decoder_meth.c:CRYPTO_DOWN_REF:
   56|   605k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|   605k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|   605k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 76, False: 605k]
  ------------------
   66|     76|        atomic_thread_fence(memory_order_acquire);
   67|   605k|#   endif
   68|   605k|    return 1;
   69|   605k|}
decoder_meth.c:CRYPTO_FREE_REF:
  285|     76|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     76|{
  287|     76|}
decoder_meth.c:CRYPTO_NEW_REF:
  280|     76|{
  281|     76|    refcnt->val = n;
  282|     76|    return 1;
  283|     76|}
encoder_meth.c:CRYPTO_UP_REF:
   40|  33.9k|{
   41|  33.9k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  33.9k|    return 1;
   43|  33.9k|}
encoder_meth.c:CRYPTO_DOWN_REF:
   56|  34.1k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  34.1k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  34.1k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 241, False: 33.9k]
  ------------------
   66|    241|        atomic_thread_fence(memory_order_acquire);
   67|  34.1k|#   endif
   68|  34.1k|    return 1;
   69|  34.1k|}
encoder_meth.c:CRYPTO_FREE_REF:
  285|    241|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|    241|{
  287|    241|}
encoder_meth.c:CRYPTO_NEW_REF:
  280|    241|{
  281|    241|    refcnt->val = n;
  282|    241|    return 1;
  283|    241|}
digest.c:CRYPTO_NEW_REF:
  280|     27|{
  281|     27|    refcnt->val = n;
  282|     27|    return 1;
  283|     27|}
digest.c:CRYPTO_UP_REF:
   40|  13.2k|{
   41|  13.2k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  13.2k|    return 1;
   43|  13.2k|}
digest.c:CRYPTO_DOWN_REF:
   56|  13.2k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  13.2k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  13.2k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 27, False: 13.2k]
  ------------------
   66|     27|        atomic_thread_fence(memory_order_acquire);
   67|  13.2k|#   endif
   68|  13.2k|    return 1;
   69|  13.2k|}
evp_lib.c:CRYPTO_FREE_REF:
  285|     27|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     27|{
  287|     27|}
keymgmt_meth.c:CRYPTO_NEW_REF:
  280|     40|{
  281|     40|    refcnt->val = n;
  282|     40|    return 1;
  283|     40|}
keymgmt_meth.c:CRYPTO_UP_REF:
   40|   550k|{
   41|   550k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|   550k|    return 1;
   43|   550k|}
keymgmt_meth.c:CRYPTO_DOWN_REF:
   56|   550k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|   550k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|   550k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 40, False: 550k]
  ------------------
   66|     40|        atomic_thread_fence(memory_order_acquire);
   67|   550k|#   endif
   68|   550k|    return 1;
   69|   550k|}
keymgmt_meth.c:CRYPTO_FREE_REF:
  285|     40|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     40|{
  287|     40|}
mac_meth.c:CRYPTO_NEW_REF:
  280|      9|{
  281|      9|    refcnt->val = n;
  282|      9|    return 1;
  283|      9|}
mac_meth.c:CRYPTO_UP_REF:
   40|     27|{
   41|     27|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|     27|    return 1;
   43|     27|}
mac_meth.c:CRYPTO_DOWN_REF:
   56|     36|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|     36|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|     36|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 9, False: 27]
  ------------------
   66|      9|        atomic_thread_fence(memory_order_acquire);
   67|     36|#   endif
   68|     36|    return 1;
   69|     36|}
mac_meth.c:CRYPTO_FREE_REF:
  285|      9|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|      9|{
  287|      9|}
p_lib.c:CRYPTO_NEW_REF:
  280|  43.1k|{
  281|  43.1k|    refcnt->val = n;
  282|  43.1k|    return 1;
  283|  43.1k|}
p_lib.c:CRYPTO_FREE_REF:
  285|  43.1k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|  43.1k|{
  287|  43.1k|}
p_lib.c:CRYPTO_UP_REF:
   40|  6.89k|{
   41|  6.89k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  6.89k|    return 1;
   43|  6.89k|}
p_lib.c:CRYPTO_DOWN_REF:
   56|  50.0k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  50.0k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  50.0k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 43.1k, False: 6.89k]
  ------------------
   66|  43.1k|        atomic_thread_fence(memory_order_acquire);
   67|  50.0k|#   endif
   68|  50.0k|    return 1;
   69|  50.0k|}
provider_core.c:CRYPTO_UP_REF:
   40|  13.6k|{
   41|  13.6k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  13.6k|    return 1;
   43|  13.6k|}
provider_core.c:CRYPTO_NEW_REF:
  280|      3|{
  281|      3|    refcnt->val = n;
  282|      3|    return 1;
  283|      3|}
provider_core.c:CRYPTO_DOWN_REF:
   56|  13.6k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  13.6k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  13.6k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 1, False: 13.6k]
  ------------------
   66|      1|        atomic_thread_fence(memory_order_acquire);
   67|  13.6k|#   endif
   68|  13.6k|    return 1;
   69|  13.6k|}
provider_core.c:CRYPTO_FREE_REF:
  285|      1|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|      1|{
  287|      1|}
rsa_lib.c:CRYPTO_NEW_REF:
  280|  48.6k|{
  281|  48.6k|    refcnt->val = n;
  282|  48.6k|    return 1;
  283|  48.6k|}
rsa_lib.c:CRYPTO_DOWN_REF:
   56|  48.6k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  48.6k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  48.6k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 48.6k, False: 47]
  ------------------
   66|  48.6k|        atomic_thread_fence(memory_order_acquire);
   67|  48.6k|#   endif
   68|  48.6k|    return 1;
   69|  48.6k|}
rsa_lib.c:CRYPTO_FREE_REF:
  285|  48.6k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|  48.6k|{
  287|  48.6k|}
rsa_lib.c:CRYPTO_UP_REF:
   40|     47|{
   41|     47|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|     47|    return 1;
   43|     47|}
ossl_core_bio.c:CRYPTO_UP_REF:
   40|   469k|{
   41|   469k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|   469k|    return 1;
   43|   469k|}
ossl_core_bio.c:CRYPTO_DOWN_REF:
   56|   535k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|   535k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|   535k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 66.3k, False: 469k]
  ------------------
   66|  66.3k|        atomic_thread_fence(memory_order_acquire);
   67|   535k|#   endif
   68|   535k|    return 1;
   69|   535k|}
ossl_core_bio.c:CRYPTO_FREE_REF:
  285|  66.3k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|  66.3k|{
  287|  66.3k|}
ossl_core_bio.c:CRYPTO_NEW_REF:
  280|  66.3k|{
  281|  66.3k|    refcnt->val = n;
  282|  66.3k|    return 1;
  283|  66.3k|}
ecx_key.c:CRYPTO_NEW_REF:
  280|     10|{
  281|     10|    refcnt->val = n;
  282|     10|    return 1;
  283|     10|}
ecx_key.c:CRYPTO_FREE_REF:
  285|     10|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     10|{
  287|     10|}
ecx_key.c:CRYPTO_DOWN_REF:
   56|     14|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|     14|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|     14|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 10, False: 4]
  ------------------
   66|     10|        atomic_thread_fence(memory_order_acquire);
   67|     14|#   endif
   68|     14|    return 1;
   69|     14|}
ecx_key.c:CRYPTO_UP_REF:
   40|      4|{
   41|      4|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|      4|    return 1;
   43|      4|}
evp_rand.c:CRYPTO_UP_REF:
   40|     16|{
   41|     16|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|     16|    return 1;
   43|     16|}
evp_rand.c:CRYPTO_NEW_REF:
  280|      9|{
  281|      9|    refcnt->val = n;
  282|      9|    return 1;
  283|      9|}
evp_rand.c:CRYPTO_FREE_REF:
  285|      9|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|      9|{
  287|      9|}
evp_rand.c:CRYPTO_DOWN_REF:
   56|     25|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|     25|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|     25|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 9, False: 16]
  ------------------
   66|      9|        atomic_thread_fence(memory_order_acquire);
   67|     25|#   endif
   68|     25|    return 1;
   69|     25|}

ssl_sess.c:safe_add_time:
   51|    897|    {                                                                        \
   52|    897|        type r;                                                              \
   53|    897|                                                                             \
   54|    897|        if (!__builtin_add_overflow(a, b, &r))                               \
  ------------------
  |  Branch (54:13): [True: 786, False: 111]
  ------------------
   55|    897|            return r;                                                        \
   56|    897|        *err |= 1;                                                           \
   57|    111|        return a + b;                                                            \
   58|    897|    }
stack.c:safe_muldiv_int:
  324|  66.4k|    {                                                                        \
  325|  66.4k|        int e2 = 0;                                                          \
  326|  66.4k|        type q, r, x, y;                                                     \
  327|  66.4k|                                                                             \
  328|  66.4k|        if (c == 0) {                                                        \
  ------------------
  |  Branch (328:13): [True: 0, False: 66.4k]
  ------------------
  329|      0|            *err |= 1;                                                       \
  330|      0|            return a == 0 || b == 0 ? 0 : max;                               \
  ------------------
  |  Branch (330:20): [True: 0, False: 0]
  |  Branch (330:30): [True: 0, False: 0]
  ------------------
  331|      0|        }                                                                    \
  332|  66.4k|        x = safe_mul_ ## type_name(a, b, &e2);                               \
  333|  66.4k|        if (!e2)                                                             \
  ------------------
  |  Branch (333:13): [True: 66.4k, False: 0]
  ------------------
  334|  66.4k|            return safe_div_ ## type_name(x, c, err);                        \
  335|  66.4k|        if (b > a) {                                                         \
  ------------------
  |  Branch (335:13): [True: 0, False: 0]
  ------------------
  336|      0|            x = b;                                                           \
  337|      0|            b = a;                                                           \
  338|      0|            a = x;                                                           \
  339|      0|        }                                                                    \
  340|      0|        q = safe_div_ ## type_name(a, c, err);                               \
  341|      0|        r = safe_mod_ ## type_name(a, c, err);                               \
  342|      0|        x = safe_mul_ ## type_name(r, b, err);                               \
  343|      0|        y = safe_mul_ ## type_name(q, b, err);                               \
  344|      0|        q = safe_div_ ## type_name(x, c, err);                               \
  345|      0|        return safe_add_ ## type_name(y, q, err);                            \
  346|  66.4k|    }
stack.c:safe_mul_int:
  138|  66.4k|    {                                                                        \
  139|  66.4k|        type r;                                                              \
  140|  66.4k|                                                                             \
  141|  66.4k|        if (!__builtin_mul_overflow(a, b, &r))                               \
  ------------------
  |  Branch (141:13): [True: 66.4k, False: 0]
  ------------------
  142|  66.4k|            return r;                                                        \
  143|  66.4k|        *err |= 1;                                                           \
  144|      0|        return (a < 0) ^ (b < 0) ? min : max;                                \
  ------------------
  |  Branch (144:16): [True: 0, False: 0]
  ------------------
  145|  66.4k|    }
stack.c:safe_div_int:
  201|  66.4k|    {                                                                        \
  202|  66.4k|        if (b == 0) {                                                        \
  ------------------
  |  Branch (202:13): [True: 0, False: 66.4k]
  ------------------
  203|      0|            *err |= 1;                                                       \
  204|      0|            return a < 0 ? min : max;                                        \
  ------------------
  |  Branch (204:20): [True: 0, False: 0]
  ------------------
  205|      0|        }                                                                    \
  206|  66.4k|        if (b == -1 && a == min) {                                           \
  ------------------
  |  Branch (206:13): [True: 0, False: 66.4k]
  |  Branch (206:24): [True: 0, False: 0]
  ------------------
  207|      0|            *err |= 1;                                                       \
  208|      0|            return max;                                                      \
  209|      0|        }                                                                    \
  210|  66.4k|        return a / b;                                                        \
  211|  66.4k|    }

ssl_init.c:ossl_init_ssl_base_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
conf_mod.c:do_init_module_list_lock_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
do_engine_lock_init_ossl_:
   41|      1|    {                                           \
   42|      1|        init##_ossl_ret_ = init();              \
   43|      1|    }                                           \
err.c:do_err_strings_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
err.c:err_do_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
context.c:default_context_do_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_base_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_register_atexit_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_load_crypto_nodelete_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_load_crypto_strings_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_load_ssl_strings_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_add_all_ciphers_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_add_all_digests_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_config_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
initthread.c:create_global_tevent_register_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
o_names.c:o_names_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
obj_dat.c:obj_lock_initialise_ossl_:
   73|      1|    {                                           \
   74|      1|        init##_ossl_ret_ = init();              \
   75|      1|    }                                           \
rand_lib.c:do_rand_init_ossl_:
   73|      1|    {                                           \
   74|      1|        init##_ossl_ret_ = init();              \
   75|      1|    }                                           \

ssl_asn1.c:ossl_time_to_time_t:
  131|    414|{
  132|    414|    return (time_t)(t.t / OSSL_TIME_SECOND);
  ------------------
  |  |   31|    414|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  ------------------
  133|    414|}
ssl_asn1.c:ossl_time2ticks:
   69|    414|{
   70|    414|    return t.t;
   71|    414|}
ssl_asn1.c:ossl_time_from_time_t:
  138|    102|{
  139|    102|    OSSL_TIME ot;
  140|       |
  141|    102|    ot.t = t;
  142|    102|    ot.t *= OSSL_TIME_SECOND;
  ------------------
  |  |   31|    102|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  ------------------
  143|    102|    return ot;
  144|    102|}
ssl_asn1.c:ossl_ticks2time:
   59|    418|{
   60|    418|    OSSL_TIME r;
   61|       |
   62|    418|    r.t = ticks;
   63|    418|    return r;
   64|    418|}
ssl_sess.c:ossl_time_add:
  173|    897|{
  174|    897|    OSSL_TIME r;
  175|    897|    int err = 0;
  176|       |
  177|    897|    r.t = safe_add_time(a.t, b.t, &err);
  178|    897|    return err ? ossl_time_infinite() : r;
  ------------------
  |  Branch (178:12): [True: 111, False: 786]
  ------------------
  179|    897|}
ssl_sess.c:ossl_time_infinite:
   85|    111|{
   86|    111|    return ossl_ticks2time(~(uint64_t)0);
   87|    111|}
ssl_sess.c:ossl_ticks2time:
   59|    590|{
   60|    590|    OSSL_TIME r;
   61|       |
   62|    590|    r.t = ticks;
   63|    590|    return r;
   64|    590|}
ssl_txt.c:ossl_time_is_zero:
  160|    818|{
  161|    818|    return ossl_time_compare(t, ossl_time_zero()) == 0;
  162|    818|}
ssl_txt.c:ossl_time_compare:
  149|    818|{
  150|    818|    if (a.t > b.t)
  ------------------
  |  Branch (150:9): [True: 815, False: 3]
  ------------------
  151|    815|        return 1;
  152|      3|    if (a.t < b.t)
  ------------------
  |  Branch (152:9): [True: 0, False: 3]
  ------------------
  153|      0|        return -1;
  154|      3|    return 0;
  155|      3|}
ssl_txt.c:ossl_time_zero:
   79|    818|{
   80|    818|    return ossl_ticks2time(0);
   81|    818|}
ssl_txt.c:ossl_ticks2time:
   59|    818|{
   60|    818|    OSSL_TIME r;
   61|       |
   62|    818|    r.t = ticks;
   63|    818|    return r;
   64|    818|}
ssl_txt.c:ossl_time_to_time_t:
  131|    407|{
  132|    407|    return (time_t)(t.t / OSSL_TIME_SECOND);
  ------------------
  |  |   31|    407|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  ------------------
  133|    407|}
ssl_txt.c:ossl_time2ticks:
   69|    408|{
   70|    408|    return t.t;
   71|    408|}

o_str.c:to_hex:
   15|  1.13M|{
   16|  1.13M|    *buf++ = hexdig[(n >> 4) & 0xf];
   17|  1.13M|    *buf = hexdig[n & 0xf];
   18|  1.13M|    return 2;
   19|  1.13M|}

a_utf8.c:is_unicode_surrogate:
   22|  37.3k|{
   23|  37.3k|    return value >= SURROGATE_MIN && value <= SURROGATE_MAX;
  ------------------
  |  Branch (23:12): [True: 16.5k, False: 20.7k]
  |  Branch (23:38): [True: 349, False: 16.2k]
  ------------------
   24|  37.3k|}
a_mbstr.c:is_unicode_valid:
   27|  12.5M|{
   28|  12.5M|    return value <= UNICODE_MAX && !is_unicode_surrogate(value);
  ------------------
  |  Branch (28:12): [True: 12.5M, False: 49]
  |  Branch (28:36): [True: 12.5M, False: 14]
  ------------------
   29|  12.5M|}
a_mbstr.c:is_unicode_surrogate:
   22|  12.5M|{
   23|  12.5M|    return value >= SURROGATE_MIN && value <= SURROGATE_MAX;
  ------------------
  |  Branch (23:12): [True: 1.65k, False: 12.5M]
  |  Branch (23:38): [True: 14, False: 1.63k]
  ------------------
   24|  12.5M|}

ssl_asn1.c:i2d_SSL_SESSION_ASN1:
  848|    414|        { \
  849|    414|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, \
  850|    414|                                     ASN1_ITEM_rptr(stname)); \
  ------------------
  |  |  427|    414|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  851|    414|        }
ssl_asn1.c:d2i_SSL_SESSION_ASN1:
  843|  12.7k|        { \
  844|  12.7k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, \
  845|  12.7k|                                               ASN1_ITEM_rptr(stname)); \
  ------------------
  |  |  427|  12.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  846|  12.7k|        } \
ssl_asn1.c:SSL_SESSION_ASN1_it:
  178|  25.9k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  25.9k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  25.9k|        { \
  |  |  |  |   96|  25.9k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  25.9k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  25.9k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  25.9k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  25.9k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  25.9k|                tname##_seq_tt,\
  182|  25.9k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  25.9k|                NULL,\
  184|  25.9k|                sizeof(stname),\
  185|  25.9k|                #stname \
  186|  25.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  25.9k|                }; \
  |  |  103|  25.9k|        return &local_it; \
  |  |  104|  25.9k|        }
  ------------------
ASN1_TIME_it:
  770|   584k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   584k|        { \
  |  |   96|   584k|                static const ASN1_ITEM local_it = {
  ------------------
  771|   584k|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|   584k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|   584k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   584k|                }; \
  |  |  103|   584k|        return &local_it; \
  |  |  104|   584k|        }
  ------------------
NETSCAPE_CERT_SEQUENCE_it:
  247|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  12.7k|                tname##_seq_tt,\
  251|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  12.7k|                &tname##_aux,\
  253|  12.7k|                sizeof(stname),\
  254|  12.7k|                #tname \
  255|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
PBEPARAM_it:
  166|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.7k|                tname##_seq_tt,\
  170|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.7k|                NULL,\
  172|  12.7k|                sizeof(stname),\
  173|  12.7k|                #tname \
  174|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
PBE2PARAM_it:
  166|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.7k|                tname##_seq_tt,\
  170|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.7k|                NULL,\
  172|  12.7k|                sizeof(stname),\
  173|  12.7k|                #tname \
  174|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
PBKDF2PARAM_it:
  166|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.7k|                tname##_seq_tt,\
  170|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.7k|                NULL,\
  172|  12.7k|                sizeof(stname),\
  173|  12.7k|                #tname \
  174|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
PKCS8_PRIV_KEY_INFO_it:
  247|   493k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   493k|        { \
  |  |   96|   493k|                static const ASN1_ITEM local_it = {
  ------------------
  248|   493k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   493k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|   493k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   493k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|   493k|                tname##_seq_tt,\
  251|   493k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|   493k|                &tname##_aux,\
  253|   493k|                sizeof(stname),\
  254|   493k|                #tname \
  255|   493k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   493k|                }; \
  |  |  103|   493k|        return &local_it; \
  |  |  104|   493k|        }
  ------------------
d2i_PKCS8_PRIV_KEY_INFO:
  826|   277k|        { \
  827|   277k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|   277k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|   277k|        } \
i2d_PKCS8_PRIV_KEY_INFO:
  830|     50|        { \
  831|     50|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|     50|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     50|        }
PKCS8_PRIV_KEY_INFO_new:
  812|    239|        { \
  813|    239|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|    239|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|    239|        } \
PKCS8_PRIV_KEY_INFO_free:
  816|   202k|        { \
  817|   202k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|   202k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   202k|        }
ASN1_OCTET_STRING_it:
  764|  2.76M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  2.76M|        { \
  |  |   96|  2.76M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  2.76M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  2.76M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  2.76M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  2.76M|                }; \
  |  |  103|  2.76M|        return &local_it; \
  |  |  104|  2.76M|        }
  ------------------
d2i_ASN1_OCTET_STRING:
  826|   174k|        { \
  827|   174k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|   174k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|   174k|        } \
i2d_ASN1_OCTET_STRING:
  830|      5|        { \
  831|      5|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|      5|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|      5|        }
ASN1_INTEGER_it:
  764|  3.41M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  3.41M|        { \
  |  |   96|  3.41M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  3.41M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  3.41M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  3.41M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  3.41M|                }; \
  |  |  103|  3.41M|        return &local_it; \
  |  |  104|  3.41M|        }
  ------------------
d2i_ASN1_INTEGER:
  826|   190k|        { \
  827|   190k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|   190k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|   190k|        } \
i2d_ASN1_INTEGER:
  830|     18|        { \
  831|     18|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|     18|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     18|        }
ASN1_ENUMERATED_it:
  764|  94.8k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  94.8k|        { \
  |  |   96|  94.8k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  94.8k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  94.8k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  94.8k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  94.8k|                }; \
  |  |  103|  94.8k|        return &local_it; \
  |  |  104|  94.8k|        }
  ------------------
d2i_ASN1_ENUMERATED:
  826|  5.87k|        { \
  827|  5.87k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  5.87k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  5.87k|        } \
ASN1_BIT_STRING_it:
  764|  2.05M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  2.05M|        { \
  |  |   96|  2.05M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  2.05M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  2.05M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  2.05M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  2.05M|                }; \
  |  |  103|  2.05M|        return &local_it; \
  |  |  104|  2.05M|        }
  ------------------
ASN1_UTF8STRING_it:
  764|   115k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   115k|        { \
  |  |   96|   115k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   115k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   115k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   115k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   115k|                }; \
  |  |  103|   115k|        return &local_it; \
  |  |  104|   115k|        }
  ------------------
ASN1_PRINTABLESTRING_it:
  764|  12.7k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  12.7k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  12.7k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
ASN1_T61STRING_it:
  764|  12.7k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  12.7k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  12.7k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
ASN1_IA5STRING_it:
  764|   272k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   272k|        { \
  |  |   96|   272k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   272k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   272k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   272k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   272k|                }; \
  |  |  103|   272k|        return &local_it; \
  |  |  104|   272k|        }
  ------------------
ASN1_GENERALSTRING_it:
  764|  12.7k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  12.7k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  12.7k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
ASN1_UTCTIME_it:
  764|  12.7k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  12.7k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  12.7k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
ASN1_GENERALIZEDTIME_it:
  764|   323k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   323k|        { \
  |  |   96|   323k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   323k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   323k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   323k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   323k|                }; \
  |  |  103|   323k|        return &local_it; \
  |  |  104|   323k|        }
  ------------------
ASN1_VISIBLESTRING_it:
  764|  12.7k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  12.7k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  12.7k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
ASN1_UNIVERSALSTRING_it:
  764|  12.7k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  12.7k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  12.7k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
ASN1_BMPSTRING_it:
  764|  12.7k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  12.7k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  12.7k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
ASN1_NULL_it:
  764|  70.4k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  70.4k|        { \
  |  |   96|  70.4k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  70.4k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  70.4k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  70.4k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  70.4k|                }; \
  |  |  103|  70.4k|        return &local_it; \
  |  |  104|  70.4k|        }
  ------------------
ASN1_OBJECT_it:
  764|  5.93M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  5.93M|        { \
  |  |   96|  5.93M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  5.93M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  5.93M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  5.93M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  5.93M|                }; \
  |  |  103|  5.93M|        return &local_it; \
  |  |  104|  5.93M|        }
  ------------------
ASN1_ANY_it:
  764|  8.80M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  8.80M|        { \
  |  |   96|  8.80M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  8.80M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  8.80M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  8.80M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  8.80M|                }; \
  |  |  103|  8.80M|        return &local_it; \
  |  |  104|  8.80M|        }
  ------------------
ASN1_SEQUENCE_it:
  764|  1.12M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  1.12M|        { \
  |  |   96|  1.12M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  1.12M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  1.12M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  1.12M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  1.12M|                }; \
  |  |  103|  1.12M|        return &local_it; \
  |  |  104|  1.12M|        }
  ------------------
i2d_ASN1_TYPE:
  830|  3.74k|        { \
  831|  3.74k|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  3.74k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|  3.74k|        }
ASN1_TYPE_new:
  812|  1.58M|        { \
  813|  1.58M|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  1.58M|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|  1.58M|        } \
ASN1_TYPE_free:
  816|   718k|        { \
  817|   718k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|   718k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   718k|        }
ASN1_PRINTABLE_it:
  770|  2.45M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  2.45M|        { \
  |  |   96|  2.45M|                static const ASN1_ITEM local_it = {
  ------------------
  771|  2.45M|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|  2.45M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|  2.45M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  2.45M|                }; \
  |  |  103|  2.45M|        return &local_it; \
  |  |  104|  2.45M|        }
  ------------------
DISPLAYTEXT_it:
  770|  87.6k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  87.6k|        { \
  |  |   96|  87.6k|                static const ASN1_ITEM local_it = {
  ------------------
  771|  87.6k|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|  87.6k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|  87.6k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  87.6k|                }; \
  |  |  103|  87.6k|        return &local_it; \
  |  |  104|  87.6k|        }
  ------------------
DIRECTORYSTRING_it:
  770|  78.1k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  78.1k|        { \
  |  |   96|  78.1k|                static const ASN1_ITEM local_it = {
  ------------------
  771|  78.1k|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|  78.1k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|  78.1k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  78.1k|                }; \
  |  |  103|  78.1k|        return &local_it; \
  |  |  104|  78.1k|        }
  ------------------
ASN1_BOOLEAN_it:
  764|  12.7k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  12.7k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  12.7k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
ASN1_TBOOLEAN_it:
  764|  13.7k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  13.7k|        { \
  |  |   96|  13.7k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  13.7k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  13.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  13.7k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  13.7k|                }; \
  |  |  103|  13.7k|        return &local_it; \
  |  |  104|  13.7k|        }
  ------------------
ASN1_FBOOLEAN_it:
  764|  1.19M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  1.19M|        { \
  |  |   96|  1.19M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  1.19M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  1.19M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  1.19M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  1.19M|                }; \
  |  |  103|  1.19M|        return &local_it; \
  |  |  104|  1.19M|        }
  ------------------
ASN1_OCTET_STRING_NDEF_it:
  764|   139k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   139k|        { \
  |  |   96|   139k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   139k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   139k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   139k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   139k|                }; \
  |  |  103|   139k|        return &local_it; \
  |  |  104|   139k|        }
  ------------------
ASN1_SEQUENCE_ANY_it:
  113|  24.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  24.1k|        { \
  |  |   96|  24.1k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  24.1k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  24.1k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  24.1k|                -1,\
  116|  24.1k|                &tname##_item_tt,\
  117|  24.1k|                0,\
  118|  24.1k|                NULL,\
  119|  24.1k|                0,\
  120|  24.1k|                #tname \
  121|  24.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  24.1k|                }; \
  |  |  103|  24.1k|        return &local_it; \
  |  |  104|  24.1k|        }
  ------------------
ASN1_SET_ANY_it:
  113|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  12.7k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  12.7k|                -1,\
  116|  12.7k|                &tname##_item_tt,\
  117|  12.7k|                0,\
  118|  12.7k|                NULL,\
  119|  12.7k|                0,\
  120|  12.7k|                #tname \
  121|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
d2i_ASN1_SEQUENCE_ANY:
  826|  11.3k|        { \
  827|  11.3k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  11.3k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.3k|        } \
X509_ALGOR_it:
  166|  2.33M|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  2.33M|        { \
  |  |   96|  2.33M|                static const ASN1_ITEM local_it = {
  ------------------
  167|  2.33M|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  2.33M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  2.33M|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  2.33M|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  2.33M|                tname##_seq_tt,\
  170|  2.33M|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  2.33M|                NULL,\
  172|  2.33M|                sizeof(stname),\
  173|  2.33M|                #tname \
  174|  2.33M|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.33M|                }; \
  |  |  103|  2.33M|        return &local_it; \
  |  |  104|  2.33M|        }
  ------------------
X509_ALGORS_it:
  113|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  12.7k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  12.7k|                -1,\
  116|  12.7k|                &tname##_item_tt,\
  117|  12.7k|                0,\
  118|  12.7k|                NULL,\
  119|  12.7k|                0,\
  120|  12.7k|                #tname \
  121|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
X509_ALGOR_new:
  812|   125k|        { \
  813|   125k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|   125k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|   125k|        } \
X509_ALGOR_free:
  816|   121k|        { \
  817|   121k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|   121k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   121k|        }
X509_SIG_it:
  166|  43.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  43.0k|        { \
  |  |   96|  43.0k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  43.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  43.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  43.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  43.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  43.0k|                tname##_seq_tt,\
  170|  43.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  43.0k|                NULL,\
  172|  43.0k|                sizeof(stname),\
  173|  43.0k|                #tname \
  174|  43.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  43.0k|                }; \
  |  |  103|  43.0k|        return &local_it; \
  |  |  104|  43.0k|        }
  ------------------
NETSCAPE_SPKAC_it:
  166|  43.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  43.0k|        { \
  |  |   96|  43.0k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  43.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  43.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  43.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  43.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  43.0k|                tname##_seq_tt,\
  170|  43.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  43.0k|                NULL,\
  172|  43.0k|                sizeof(stname),\
  173|  43.0k|                #tname \
  174|  43.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  43.0k|                }; \
  |  |  103|  43.0k|        return &local_it; \
  |  |  104|  43.0k|        }
  ------------------
NETSCAPE_SPKI_it:
  166|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.7k|                tname##_seq_tt,\
  170|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.7k|                NULL,\
  172|  12.7k|                sizeof(stname),\
  173|  12.7k|                #tname \
  174|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
X509_VAL_it:
  166|   134k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   134k|        { \
  |  |   96|   134k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   134k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   134k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   134k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   134k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   134k|                tname##_seq_tt,\
  170|   134k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   134k|                NULL,\
  172|   134k|                sizeof(stname),\
  173|   134k|                #tname \
  174|   134k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   134k|                }; \
  |  |  103|   134k|        return &local_it; \
  |  |  104|   134k|        }
  ------------------
CMS_IssuerAndSerialNumber_it:
  166|  8.40k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  8.40k|        { \
  |  |   96|  8.40k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  8.40k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  8.40k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  8.40k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  8.40k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  8.40k|                tname##_seq_tt,\
  170|  8.40k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  8.40k|                NULL,\
  172|  8.40k|                sizeof(stname),\
  173|  8.40k|                #tname \
  174|  8.40k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  8.40k|                }; \
  |  |  103|  8.40k|        return &local_it; \
  |  |  104|  8.40k|        }
  ------------------
CMS_CertificateChoices_it:
  320|   737k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   737k|        { \
  |  |   96|   737k|                static const ASN1_ITEM local_it = {
  ------------------
  321|   737k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|   737k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|   737k|                offsetof(stname,selname) ,\
  323|   737k|                tname##_ch_tt,\
  324|   737k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|   737k|                NULL,\
  326|   737k|                sizeof(stname),\
  327|   737k|                #stname \
  328|   737k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   737k|                }; \
  |  |  103|   737k|        return &local_it; \
  |  |  104|   737k|        }
  ------------------
CMS_SignerInfo_it:
  247|  6.14k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  6.14k|        { \
  |  |   96|  6.14k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  6.14k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  6.14k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  6.14k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  6.14k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  6.14k|                tname##_seq_tt,\
  251|  6.14k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  6.14k|                &tname##_aux,\
  253|  6.14k|                sizeof(stname),\
  254|  6.14k|                #tname \
  255|  6.14k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  6.14k|                }; \
  |  |  103|  6.14k|        return &local_it; \
  |  |  104|  6.14k|        }
  ------------------
CMS_RevocationInfoChoice_it:
  320|  7.69k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  7.69k|        { \
  |  |   96|  7.69k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  7.69k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  7.69k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  7.69k|                offsetof(stname,selname) ,\
  323|  7.69k|                tname##_ch_tt,\
  324|  7.69k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  7.69k|                NULL,\
  326|  7.69k|                sizeof(stname),\
  327|  7.69k|                #stname \
  328|  7.69k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  7.69k|                }; \
  |  |  103|  7.69k|        return &local_it; \
  |  |  104|  7.69k|        }
  ------------------
CMS_SignedData_it:
  218|  1.20k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.20k|        { \
  |  |   96|  1.20k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  1.20k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  1.20k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  1.20k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.20k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  1.20k|                tname##_seq_tt,\
  222|  1.20k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  1.20k|                NULL,\
  224|  1.20k|                sizeof(tname),\
  225|  1.20k|                #tname \
  226|  1.20k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.20k|                }; \
  |  |  103|  1.20k|        return &local_it; \
  |  |  104|  1.20k|        }
  ------------------
CMS_EncryptedContentInfo_it:
  270|    449|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    449|        { \
  |  |   96|    449|                static const ASN1_ITEM local_it = {
  ------------------
  271|    449|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|    449|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  272|    449|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    449|# define V_ASN1_SEQUENCE                 16
  ------------------
  273|    449|                tname##_seq_tt,\
  274|    449|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  275|    449|                &tname##_aux,\
  276|    449|                sizeof(stname),\
  277|    449|                #stname \
  278|    449|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    449|                }; \
  |  |  103|    449|        return &local_it; \
  |  |  104|    449|        }
  ------------------
CMS_KeyTransRecipientInfo_it:
  166|  10.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  10.5k|        { \
  |  |   96|  10.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  10.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  10.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  10.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  10.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  10.5k|                tname##_seq_tt,\
  170|  10.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  10.5k|                NULL,\
  172|  10.5k|                sizeof(stname),\
  173|  10.5k|                #tname \
  174|  10.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  10.5k|                }; \
  |  |  103|  10.5k|        return &local_it; \
  |  |  104|  10.5k|        }
  ------------------
CMS_OtherKeyAttribute_it:
  166|  5.95k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  5.95k|        { \
  |  |   96|  5.95k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  5.95k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  5.95k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  5.95k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  5.95k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  5.95k|                tname##_seq_tt,\
  170|  5.95k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  5.95k|                NULL,\
  172|  5.95k|                sizeof(stname),\
  173|  5.95k|                #tname \
  174|  5.95k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  5.95k|                }; \
  |  |  103|  5.95k|        return &local_it; \
  |  |  104|  5.95k|        }
  ------------------
CMS_RecipientKeyIdentifier_it:
  166|  2.00k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  2.00k|        { \
  |  |   96|  2.00k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  2.00k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  2.00k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  2.00k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  2.00k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  2.00k|                tname##_seq_tt,\
  170|  2.00k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  2.00k|                NULL,\
  172|  2.00k|                sizeof(stname),\
  173|  2.00k|                #tname \
  174|  2.00k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.00k|                }; \
  |  |  103|  2.00k|        return &local_it; \
  |  |  104|  2.00k|        }
  ------------------
CMS_RecipientEncryptedKey_it:
  247|  3.52k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  3.52k|        { \
  |  |   96|  3.52k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  3.52k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  3.52k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  3.52k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  3.52k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  3.52k|                tname##_seq_tt,\
  251|  3.52k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  3.52k|                &tname##_aux,\
  253|  3.52k|                sizeof(stname),\
  254|  3.52k|                #tname \
  255|  3.52k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.52k|                }; \
  |  |  103|  3.52k|        return &local_it; \
  |  |  104|  3.52k|        }
  ------------------
CMS_OriginatorPublicKey_it:
  166|      3|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      3|        { \
  |  |   96|      3|                static const ASN1_ITEM local_it = {
  ------------------
  167|      3|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      3|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|      3|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      3|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|      3|                tname##_seq_tt,\
  170|      3|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|      3|                NULL,\
  172|      3|                sizeof(stname),\
  173|      3|                #tname \
  174|      3|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      3|                }; \
  |  |  103|      3|        return &local_it; \
  |  |  104|      3|        }
  ------------------
CMS_KeyAgreeRecipientInfo_it:
  247|  12.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.3k|        { \
  |  |   96|  12.3k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  12.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  12.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  12.3k|                tname##_seq_tt,\
  251|  12.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  12.3k|                &tname##_aux,\
  253|  12.3k|                sizeof(stname),\
  254|  12.3k|                #tname \
  255|  12.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.3k|                }; \
  |  |  103|  12.3k|        return &local_it; \
  |  |  104|  12.3k|        }
  ------------------
CMS_KEKRecipientInfo_it:
  166|  8.75k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  8.75k|        { \
  |  |   96|  8.75k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  8.75k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  8.75k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  8.75k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  8.75k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  8.75k|                tname##_seq_tt,\
  170|  8.75k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  8.75k|                NULL,\
  172|  8.75k|                sizeof(stname),\
  173|  8.75k|                #tname \
  174|  8.75k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  8.75k|                }; \
  |  |  103|  8.75k|        return &local_it; \
  |  |  104|  8.75k|        }
  ------------------
CMS_PasswordRecipientInfo_it:
  166|  27.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  27.6k|        { \
  |  |   96|  27.6k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  27.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  27.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  27.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  27.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  27.6k|                tname##_seq_tt,\
  170|  27.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  27.6k|                NULL,\
  172|  27.6k|                sizeof(stname),\
  173|  27.6k|                #tname \
  174|  27.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  27.6k|                }; \
  |  |  103|  27.6k|        return &local_it; \
  |  |  104|  27.6k|        }
  ------------------
CMS_RecipientInfo_it:
  344|  33.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  33.0k|        { \
  |  |   96|  33.0k|                static const ASN1_ITEM local_it = {
  ------------------
  345|  33.0k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  33.0k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  346|  33.0k|                offsetof(stname,selname) ,\
  347|  33.0k|                tname##_ch_tt,\
  348|  33.0k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  349|  33.0k|                &tname##_aux,\
  350|  33.0k|                sizeof(stname),\
  351|  33.0k|                #stname \
  352|  33.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  33.0k|                }; \
  |  |  103|  33.0k|        return &local_it; \
  |  |  104|  33.0k|        }
  ------------------
CMS_EnvelopedData_it:
  218|    344|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    344|        { \
  |  |   96|    344|                static const ASN1_ITEM local_it = {
  ------------------
  219|    344|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|    344|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|    344|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    344|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|    344|                tname##_seq_tt,\
  222|    344|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|    344|                NULL,\
  224|    344|                sizeof(tname),\
  225|    344|                #tname \
  226|    344|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    344|                }; \
  |  |  103|    344|        return &local_it; \
  |  |  104|    344|        }
  ------------------
CMS_DigestedData_it:
  218|     12|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     12|        { \
  |  |   96|     12|                static const ASN1_ITEM local_it = {
  ------------------
  219|     12|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|     12|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|     12|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     12|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|     12|                tname##_seq_tt,\
  222|     12|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|     12|                NULL,\
  224|     12|                sizeof(tname),\
  225|     12|                #tname \
  226|     12|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     12|                }; \
  |  |  103|     12|        return &local_it; \
  |  |  104|     12|        }
  ------------------
CMS_EncryptedData_it:
  218|     38|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     38|        { \
  |  |   96|     38|                static const ASN1_ITEM local_it = {
  ------------------
  219|     38|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|     38|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|     38|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     38|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|     38|                tname##_seq_tt,\
  222|     38|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|     38|                NULL,\
  224|     38|                sizeof(tname),\
  225|     38|                #tname \
  226|     38|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     38|                }; \
  |  |  103|     38|        return &local_it; \
  |  |  104|     38|        }
  ------------------
CMS_AuthEnvelopedData_it:
  218|      3|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      3|        { \
  |  |   96|      3|                static const ASN1_ITEM local_it = {
  ------------------
  219|      3|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|      3|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|      3|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      3|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|      3|                tname##_seq_tt,\
  222|      3|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|      3|                NULL,\
  224|      3|                sizeof(tname),\
  225|      3|                #tname \
  226|      3|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      3|                }; \
  |  |  103|      3|        return &local_it; \
  |  |  104|      3|        }
  ------------------
CMS_CompressedData_it:
  218|     11|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     11|        { \
  |  |   96|     11|                static const ASN1_ITEM local_it = {
  ------------------
  219|     11|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|     11|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|     11|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     11|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|     11|                tname##_seq_tt,\
  222|     11|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|     11|                NULL,\
  224|     11|                sizeof(tname),\
  225|     11|                #tname \
  226|     11|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     11|                }; \
  |  |  103|     11|        return &local_it; \
  |  |  104|     11|        }
  ------------------
CMS_ContentInfo_it:
  270|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  271|  12.7k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  12.7k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  272|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  273|  12.7k|                tname##_seq_tt,\
  274|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  275|  12.7k|                &tname##_aux,\
  276|  12.7k|                sizeof(stname),\
  277|  12.7k|                #stname \
  278|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
CMS_ReceiptRequest_it:
  166|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.7k|                tname##_seq_tt,\
  170|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.7k|                NULL,\
  172|  12.7k|                sizeof(stname),\
  173|  12.7k|                #tname \
  174|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
cms_asn1.c:CMS_OtherCertificateFormat_it:
  178|    219|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|    219|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|    219|        { \
  |  |  |  |   96|    219|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|    219|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    219|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|    219|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    219|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|    219|                tname##_seq_tt,\
  182|    219|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|    219|                NULL,\
  184|    219|                sizeof(stname),\
  185|    219|                #stname \
  186|    219|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    219|                }; \
  |  |  103|    219|        return &local_it; \
  |  |  104|    219|        }
  ------------------
cms_asn1.c:CMS_SignerIdentifier_it:
  332|  10.5k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  10.5k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  10.5k|        { \
  |  |  |  |   96|  10.5k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  333|  10.5k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  10.5k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  334|  10.5k|                offsetof(stname,selname) ,\
  335|  10.5k|                tname##_ch_tt,\
  336|  10.5k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  337|  10.5k|                NULL,\
  338|  10.5k|                sizeof(stname),\
  339|  10.5k|                #stname \
  340|  10.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  10.5k|                }; \
  |  |  103|  10.5k|        return &local_it; \
  |  |  104|  10.5k|        }
  ------------------
cms_asn1.c:CMS_OtherRevocationInfoFormat_it:
  178|    665|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|    665|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|    665|        { \
  |  |  |  |   96|    665|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|    665|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    665|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|    665|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    665|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|    665|                tname##_seq_tt,\
  182|    665|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|    665|                NULL,\
  184|    665|                sizeof(stname),\
  185|    665|                #stname \
  186|    665|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    665|                }; \
  |  |  103|    665|        return &local_it; \
  |  |  104|    665|        }
  ------------------
cms_asn1.c:CMS_EncapsulatedContentInfo_it:
  229|  3.22k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  3.22k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  3.22k|        { \
  |  |  |  |   96|  3.22k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  230|  3.22k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  3.22k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  231|  3.22k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  3.22k|# define V_ASN1_SEQUENCE                 16
  ------------------
  232|  3.22k|                tname##_seq_tt,\
  233|  3.22k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  234|  3.22k|                NULL,\
  235|  3.22k|                sizeof(tname),\
  236|  3.22k|                #tname \
  237|  3.22k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.22k|                }; \
  |  |  103|  3.22k|        return &local_it; \
  |  |  104|  3.22k|        }
  ------------------
cms_asn1.c:CMS_KeyAgreeRecipientIdentifier_it:
  332|  3.26k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  3.26k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  3.26k|        { \
  |  |  |  |   96|  3.26k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  333|  3.26k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  3.26k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  334|  3.26k|                offsetof(stname,selname) ,\
  335|  3.26k|                tname##_ch_tt,\
  336|  3.26k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  337|  3.26k|                NULL,\
  338|  3.26k|                sizeof(stname),\
  339|  3.26k|                #stname \
  340|  3.26k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.26k|                }; \
  |  |  103|  3.26k|        return &local_it; \
  |  |  104|  3.26k|        }
  ------------------
cms_asn1.c:CMS_OriginatorIdentifierOrKey_it:
  332|  5.82k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  5.82k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  5.82k|        { \
  |  |  |  |   96|  5.82k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  333|  5.82k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  5.82k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  334|  5.82k|                offsetof(stname,selname) ,\
  335|  5.82k|                tname##_ch_tt,\
  336|  5.82k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  337|  5.82k|                NULL,\
  338|  5.82k|                sizeof(stname),\
  339|  5.82k|                #stname \
  340|  5.82k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  5.82k|                }; \
  |  |  103|  5.82k|        return &local_it; \
  |  |  104|  5.82k|        }
  ------------------
cms_asn1.c:CMS_KEKIdentifier_it:
  178|  1.54k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  1.54k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  1.54k|        { \
  |  |  |  |   96|  1.54k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  1.54k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.54k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  1.54k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.54k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  1.54k|                tname##_seq_tt,\
  182|  1.54k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  1.54k|                NULL,\
  184|  1.54k|                sizeof(stname),\
  185|  1.54k|                #stname \
  186|  1.54k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.54k|                }; \
  |  |  103|  1.54k|        return &local_it; \
  |  |  104|  1.54k|        }
  ------------------
cms_asn1.c:CMS_OtherRecipientInfo_it:
  178|  2.55k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  2.55k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  2.55k|        { \
  |  |  |  |   96|  2.55k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  2.55k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  2.55k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  2.55k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  2.55k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  2.55k|                tname##_seq_tt,\
  182|  2.55k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  2.55k|                NULL,\
  184|  2.55k|                sizeof(stname),\
  185|  2.55k|                #stname \
  186|  2.55k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.55k|                }; \
  |  |  103|  2.55k|        return &local_it; \
  |  |  104|  2.55k|        }
  ------------------
cms_asn1.c:CMS_OriginatorInfo_it:
  178|  3.38k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  3.38k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  3.38k|        { \
  |  |  |  |   96|  3.38k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  3.38k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  3.38k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  3.38k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  3.38k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  3.38k|                tname##_seq_tt,\
  182|  3.38k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  3.38k|                NULL,\
  184|  3.38k|                sizeof(stname),\
  185|  3.38k|                #stname \
  186|  3.38k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.38k|                }; \
  |  |  103|  3.38k|        return &local_it; \
  |  |  104|  3.38k|        }
  ------------------
cms_asn1.c:CMS_ContentInfo_adb:
  463|  33.4k|        { \
  464|  33.4k|        static const ASN1_ADB internal_adb = \
  465|  33.4k|                {\
  466|  33.4k|                flags,\
  467|  33.4k|                offsetof(name, field),\
  468|  33.4k|                adb_cb,\
  469|  33.4k|                name##_adbtbl,\
  470|  33.4k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  33.4k|                def,\
  472|  33.4k|                none\
  473|  33.4k|                }; \
  474|  33.4k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  33.4k|        } \
cms_asn1.c:CMS_AuthenticatedData_it:
  229|  1.46k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  1.46k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  1.46k|        { \
  |  |  |  |   96|  1.46k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  230|  1.46k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  1.46k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  231|  1.46k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.46k|# define V_ASN1_SEQUENCE                 16
  ------------------
  232|  1.46k|                tname##_seq_tt,\
  233|  1.46k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  234|  1.46k|                NULL,\
  235|  1.46k|                sizeof(tname),\
  236|  1.46k|                #tname \
  237|  1.46k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.46k|                }; \
  |  |  103|  1.46k|        return &local_it; \
  |  |  104|  1.46k|        }
  ------------------
cms_asn1.c:CMS_ReceiptsFrom_it:
  332|  20.3k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  20.3k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  20.3k|        { \
  |  |  |  |   96|  20.3k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  333|  20.3k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  20.3k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  334|  20.3k|                offsetof(stname,selname) ,\
  335|  20.3k|                tname##_ch_tt,\
  336|  20.3k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  337|  20.3k|                NULL,\
  338|  20.3k|                sizeof(stname),\
  339|  20.3k|                #stname \
  340|  20.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  20.3k|                }; \
  |  |  103|  20.3k|        return &local_it; \
  |  |  104|  20.3k|        }
  ------------------
DHparams_it:
  247|  25.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  25.6k|        { \
  |  |   96|  25.6k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  25.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  25.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  25.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  25.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  25.6k|                tname##_seq_tt,\
  251|  25.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  25.6k|                &tname##_aux,\
  253|  25.6k|                sizeof(stname),\
  254|  25.6k|                #tname \
  255|  25.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  25.6k|                }; \
  |  |  103|  25.6k|        return &local_it; \
  |  |  104|  25.6k|        }
  ------------------
d2i_DHparams:
  826|  12.8k|        { \
  827|  12.8k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  12.8k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  12.8k|        } \
i2d_DHparams:
  830|     71|        { \
  831|     71|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|     71|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     71|        }
d2i_int_dhx:
  826|  12.7k|        { \
  827|  12.7k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  12.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  12.7k|        } \
i2d_int_dhx:
  830|     78|        { \
  831|     78|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|     78|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     78|        }
dh_asn1.c:DHxparams_it:
  178|  12.8k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  12.8k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  12.8k|        { \
  |  |  |  |   96|  12.8k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  12.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  12.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  12.8k|                tname##_seq_tt,\
  182|  12.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  12.8k|                NULL,\
  184|  12.8k|                sizeof(stname),\
  185|  12.8k|                #stname \
  186|  12.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.8k|                }; \
  |  |  103|  12.8k|        return &local_it; \
  |  |  104|  12.8k|        }
  ------------------
dh_asn1.c:DHvparams_it:
  178|  31.3k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  31.3k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  31.3k|        { \
  |  |  |  |   96|  31.3k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  31.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  31.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  31.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  31.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  31.3k|                tname##_seq_tt,\
  182|  31.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  31.3k|                NULL,\
  184|  31.3k|                sizeof(stname),\
  185|  31.3k|                #stname \
  186|  31.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  31.3k|                }; \
  |  |  103|  31.3k|        return &local_it; \
  |  |  104|  31.3k|        }
  ------------------
d2i_DSAPrivateKey:
  826|  30.1k|        { \
  827|  30.1k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  30.1k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  30.1k|        } \
i2d_DSAPrivateKey:
  830|    593|        { \
  831|    593|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|    593|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    593|        }
d2i_DSAparams:
  826|  13.2k|        { \
  827|  13.2k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  13.2k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  13.2k|        } \
i2d_DSAparams:
  830|     14|        { \
  831|     14|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|     14|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     14|        }
d2i_DSAPublicKey:
  826|  12.7k|        { \
  827|  12.7k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  12.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  12.7k|        } \
i2d_DSAPublicKey:
  830|      5|        { \
  831|      5|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|      5|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|      5|        }
dsa_asn1.c:DSAPrivateKey_it:
  258|  30.7k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  30.7k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  30.7k|        { \
  |  |  |  |   96|  30.7k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  259|  30.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  30.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  260|  30.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  30.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  261|  30.7k|                tname##_seq_tt,\
  262|  30.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  263|  30.7k|                &tname##_aux,\
  264|  30.7k|                sizeof(stname),\
  265|  30.7k|                #stname \
  266|  30.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  30.7k|                }; \
  |  |  103|  30.7k|        return &local_it; \
  |  |  104|  30.7k|        }
  ------------------
dsa_asn1.c:DSAparams_it:
  258|  13.2k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  13.2k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  13.2k|        { \
  |  |  |  |   96|  13.2k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  259|  13.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  13.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  260|  13.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  13.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  261|  13.2k|                tname##_seq_tt,\
  262|  13.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  263|  13.2k|                &tname##_aux,\
  264|  13.2k|                sizeof(stname),\
  265|  13.2k|                #stname \
  266|  13.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  13.2k|                }; \
  |  |  103|  13.2k|        return &local_it; \
  |  |  104|  13.2k|        }
  ------------------
dsa_asn1.c:DSAPublicKey_it:
  258|  12.7k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  12.7k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  12.7k|        { \
  |  |  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  259|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  260|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  261|  12.7k|                tname##_seq_tt,\
  262|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  263|  12.7k|                &tname##_aux,\
  264|  12.7k|                sizeof(stname),\
  265|  12.7k|                #stname \
  266|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
ECPARAMETERS_it:
  166|  83.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  83.8k|        { \
  |  |   96|  83.8k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  83.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  83.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  83.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  83.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  83.8k|                tname##_seq_tt,\
  170|  83.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  83.8k|                NULL,\
  172|  83.8k|                sizeof(stname),\
  173|  83.8k|                #tname \
  174|  83.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  83.8k|                }; \
  |  |  103|  83.8k|        return &local_it; \
  |  |  104|  83.8k|        }
  ------------------
ECPARAMETERS_new:
  812|    269|        { \
  813|    269|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|    269|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|    269|        } \
ECPKPARAMETERS_it:
  320|   169k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   169k|        { \
  |  |   96|   169k|                static const ASN1_ITEM local_it = {
  ------------------
  321|   169k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|   169k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|   169k|                offsetof(stname,selname) ,\
  323|   169k|                tname##_ch_tt,\
  324|   169k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|   169k|                NULL,\
  326|   169k|                sizeof(stname),\
  327|   169k|                #stname \
  328|   169k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   169k|                }; \
  |  |  103|   169k|        return &local_it; \
  |  |  104|   169k|        }
  ------------------
d2i_ECPKPARAMETERS:
  826|  25.6k|        { \
  827|  25.6k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  25.6k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  25.6k|        } \
i2d_ECPKPARAMETERS:
  830|    248|        { \
  831|    248|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|    248|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    248|        }
ECPKPARAMETERS_new:
  812|  1.36k|        { \
  813|  1.36k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  1.36k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|  1.36k|        } \
ECPKPARAMETERS_free:
  816|  25.8k|        { \
  817|  25.8k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  25.8k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  25.8k|        }
d2i_EC_PRIVATEKEY:
  826|  39.4k|        { \
  827|  39.4k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  39.4k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  39.4k|        } \
i2d_EC_PRIVATEKEY:
  830|  1.10k|        { \
  831|  1.10k|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  1.10k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|  1.10k|        }
EC_PRIVATEKEY_new:
  812|  1.72k|        { \
  813|  1.72k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  1.72k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|  1.72k|        } \
EC_PRIVATEKEY_free:
  816|  4.81k|        { \
  817|  4.81k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  4.81k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  4.81k|        }
ec_asn1.c:X9_62_PENTANOMIAL_it:
  178|     33|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|     33|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|     33|        { \
  |  |  |  |   96|     33|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|     33|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     33|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|     33|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     33|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|     33|                tname##_seq_tt,\
  182|     33|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|     33|                NULL,\
  184|     33|                sizeof(stname),\
  185|     33|                #stname \
  186|     33|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     33|                }; \
  |  |  103|     33|        return &local_it; \
  |  |  104|     33|        }
  ------------------
ec_asn1.c:X9_62_CHARACTERISTIC_TWO_it:
  178|     66|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|     66|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|     66|        { \
  |  |  |  |   96|     66|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|     66|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     66|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|     66|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     66|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|     66|                tname##_seq_tt,\
  182|     66|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|     66|                NULL,\
  184|     66|                sizeof(stname),\
  185|     66|                #stname \
  186|     66|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     66|                }; \
  |  |  103|     66|        return &local_it; \
  |  |  104|     66|        }
  ------------------
ec_asn1.c:X9_62_CHARACTERISTIC_TWO_adb:
  463|     96|        { \
  464|     96|        static const ASN1_ADB internal_adb = \
  465|     96|                {\
  466|     96|                flags,\
  467|     96|                offsetof(name, field),\
  468|     96|                adb_cb,\
  469|     96|                name##_adbtbl,\
  470|     96|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|     96|                def,\
  472|     96|                none\
  473|     96|                }; \
  474|     96|                return (const ASN1_ITEM *) &internal_adb; \
  475|     96|        } \
ec_asn1.c:X9_62_FIELDID_it:
  178|   106k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|   106k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|   106k|        { \
  |  |  |  |   96|   106k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|   106k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   106k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|   106k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   106k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|   106k|                tname##_seq_tt,\
  182|   106k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|   106k|                NULL,\
  184|   106k|                sizeof(stname),\
  185|   106k|                #stname \
  186|   106k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   106k|                }; \
  |  |  103|   106k|        return &local_it; \
  |  |  104|   106k|        }
  ------------------
ec_asn1.c:X9_62_FIELDID_adb:
  463|   102k|        { \
  464|   102k|        static const ASN1_ADB internal_adb = \
  465|   102k|                {\
  466|   102k|                flags,\
  467|   102k|                offsetof(name, field),\
  468|   102k|                adb_cb,\
  469|   102k|                name##_adbtbl,\
  470|   102k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|   102k|                def,\
  472|   102k|                none\
  473|   102k|                }; \
  474|   102k|                return (const ASN1_ITEM *) &internal_adb; \
  475|   102k|        } \
ec_asn1.c:X9_62_CURVE_it:
  178|  90.3k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  90.3k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  90.3k|        { \
  |  |  |  |   96|  90.3k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  90.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  90.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  90.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  90.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  90.3k|                tname##_seq_tt,\
  182|  90.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  90.3k|                NULL,\
  184|  90.3k|                sizeof(stname),\
  185|  90.3k|                #stname \
  186|  90.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  90.3k|                }; \
  |  |  103|  90.3k|        return &local_it; \
  |  |  104|  90.3k|        }
  ------------------
ec_asn1.c:EC_PRIVATEKEY_it:
  178|  47.1k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  47.1k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  47.1k|        { \
  |  |  |  |   96|  47.1k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  47.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  47.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  47.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  47.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  47.1k|                tname##_seq_tt,\
  182|  47.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  47.1k|                NULL,\
  184|  47.1k|                sizeof(stname),\
  185|  47.1k|                #stname \
  186|  47.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  47.1k|                }; \
  |  |  103|  47.1k|        return &local_it; \
  |  |  104|  47.1k|        }
  ------------------
d2i_ESS_ISSUER_SERIAL:
  826|  12.7k|        { \
  827|  12.7k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  12.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  12.7k|        } \
i2d_ESS_ISSUER_SERIAL:
  830|      4|        { \
  831|      4|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|      4|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|      4|        }
ESS_ISSUER_SERIAL_free:
  816|      4|        { \
  817|      4|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|      4|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|      4|        }
d2i_ESS_CERT_ID:
  826|  12.7k|        { \
  827|  12.7k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  12.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  12.7k|        } \
i2d_ESS_CERT_ID:
  830|     21|        { \
  831|     21|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|     21|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     21|        }
ESS_CERT_ID_free:
  816|     21|        { \
  817|     21|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|     21|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|     21|        }
ESS_SIGNING_CERT_it:
  166|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.7k|                tname##_seq_tt,\
  170|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.7k|                NULL,\
  172|  12.7k|                sizeof(stname),\
  173|  12.7k|                #tname \
  174|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
d2i_ESS_SIGNING_CERT:
  826|  12.7k|        { \
  827|  12.7k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  12.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  12.7k|        } \
i2d_ESS_SIGNING_CERT:
  830|     22|        { \
  831|     22|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|     22|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     22|        }
ESS_SIGNING_CERT_free:
  816|     22|        { \
  817|     22|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|     22|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|     22|        }
d2i_ESS_CERT_ID_V2:
  826|  12.7k|        { \
  827|  12.7k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  12.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  12.7k|        } \
i2d_ESS_CERT_ID_V2:
  830|     26|        { \
  831|     26|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|     26|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     26|        }
ESS_CERT_ID_V2_free:
  816|     26|        { \
  817|     26|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|     26|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|     26|        }
ESS_SIGNING_CERT_V2_it:
  166|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.7k|                tname##_seq_tt,\
  170|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.7k|                NULL,\
  172|  12.7k|                sizeof(stname),\
  173|  12.7k|                #tname \
  174|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
d2i_ESS_SIGNING_CERT_V2:
  826|  12.7k|        { \
  827|  12.7k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  12.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  12.7k|        } \
i2d_ESS_SIGNING_CERT_V2:
  830|     22|        { \
  831|     22|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|     22|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     22|        }
ESS_SIGNING_CERT_V2_free:
  816|     22|        { \
  817|     22|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|     22|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|     22|        }
ess_asn1.c:ESS_ISSUER_SERIAL_it:
  178|  86.8k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  86.8k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  86.8k|        { \
  |  |  |  |   96|  86.8k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  86.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  86.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  86.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  86.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  86.8k|                tname##_seq_tt,\
  182|  86.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  86.8k|                NULL,\
  184|  86.8k|                sizeof(stname),\
  185|  86.8k|                #stname \
  186|  86.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  86.8k|                }; \
  |  |  103|  86.8k|        return &local_it; \
  |  |  104|  86.8k|        }
  ------------------
ess_asn1.c:ESS_CERT_ID_it:
  178|  29.7k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  29.7k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  29.7k|        { \
  |  |  |  |   96|  29.7k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  29.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  29.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  29.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  29.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  29.7k|                tname##_seq_tt,\
  182|  29.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  29.7k|                NULL,\
  184|  29.7k|                sizeof(stname),\
  185|  29.7k|                #stname \
  186|  29.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  29.7k|                }; \
  |  |  103|  29.7k|        return &local_it; \
  |  |  104|  29.7k|        }
  ------------------
ess_asn1.c:ESS_CERT_ID_V2_it:
  178|  29.8k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  29.8k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  29.8k|        { \
  |  |  |  |   96|  29.8k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  29.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  29.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  29.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  29.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  29.8k|                tname##_seq_tt,\
  182|  29.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  29.8k|                NULL,\
  184|  29.8k|                sizeof(stname),\
  185|  29.8k|                #stname \
  186|  29.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  29.8k|                }; \
  |  |  103|  29.8k|        return &local_it; \
  |  |  104|  29.8k|        }
  ------------------
OCSP_SIGNATURE_it:
  166|  43.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  43.1k|        { \
  |  |   96|  43.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  43.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  43.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  43.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  43.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  43.1k|                tname##_seq_tt,\
  170|  43.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  43.1k|                NULL,\
  172|  43.1k|                sizeof(stname),\
  173|  43.1k|                #tname \
  174|  43.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  43.1k|                }; \
  |  |  103|  43.1k|        return &local_it; \
  |  |  104|  43.1k|        }
  ------------------
OCSP_CERTID_it:
  166|  74.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  74.4k|        { \
  |  |   96|  74.4k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  74.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  74.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  74.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  74.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  74.4k|                tname##_seq_tt,\
  170|  74.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  74.4k|                NULL,\
  172|  74.4k|                sizeof(stname),\
  173|  74.4k|                #tname \
  174|  74.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  74.4k|                }; \
  |  |  103|  74.4k|        return &local_it; \
  |  |  104|  74.4k|        }
  ------------------
OCSP_ONEREQ_it:
  166|  37.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  37.6k|        { \
  |  |   96|  37.6k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  37.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  37.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  37.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  37.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  37.6k|                tname##_seq_tt,\
  170|  37.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  37.6k|                NULL,\
  172|  37.6k|                sizeof(stname),\
  173|  37.6k|                #tname \
  174|  37.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  37.6k|                }; \
  |  |  103|  37.6k|        return &local_it; \
  |  |  104|  37.6k|        }
  ------------------
OCSP_REQINFO_it:
  166|  43.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  43.0k|        { \
  |  |   96|  43.0k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  43.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  43.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  43.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  43.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  43.0k|                tname##_seq_tt,\
  170|  43.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  43.0k|                NULL,\
  172|  43.0k|                sizeof(stname),\
  173|  43.0k|                #tname \
  174|  43.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  43.0k|                }; \
  |  |  103|  43.0k|        return &local_it; \
  |  |  104|  43.0k|        }
  ------------------
OCSP_REQUEST_it:
  166|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.7k|                tname##_seq_tt,\
  170|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.7k|                NULL,\
  172|  12.7k|                sizeof(stname),\
  173|  12.7k|                #tname \
  174|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
OCSP_RESPBYTES_it:
  166|  43.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  43.1k|        { \
  |  |   96|  43.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  43.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  43.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  43.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  43.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  43.1k|                tname##_seq_tt,\
  170|  43.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  43.1k|                NULL,\
  172|  43.1k|                sizeof(stname),\
  173|  43.1k|                #tname \
  174|  43.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  43.1k|                }; \
  |  |  103|  43.1k|        return &local_it; \
  |  |  104|  43.1k|        }
  ------------------
OCSP_RESPONSE_it:
  166|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.7k|                tname##_seq_tt,\
  170|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.7k|                NULL,\
  172|  12.7k|                sizeof(stname),\
  173|  12.7k|                #tname \
  174|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
OCSP_RESPID_it:
  320|  64.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  64.9k|        { \
  |  |   96|  64.9k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  64.9k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  64.9k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  64.9k|                offsetof(stname,selname) ,\
  323|  64.9k|                tname##_ch_tt,\
  324|  64.9k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  64.9k|                NULL,\
  326|  64.9k|                sizeof(stname),\
  327|  64.9k|                #stname \
  328|  64.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  64.9k|                }; \
  |  |  103|  64.9k|        return &local_it; \
  |  |  104|  64.9k|        }
  ------------------
OCSP_REVOKEDINFO_it:
  166|  25.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  25.2k|        { \
  |  |   96|  25.2k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  25.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  25.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  25.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  25.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  25.2k|                tname##_seq_tt,\
  170|  25.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  25.2k|                NULL,\
  172|  25.2k|                sizeof(stname),\
  173|  25.2k|                #tname \
  174|  25.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  25.2k|                }; \
  |  |  103|  25.2k|        return &local_it; \
  |  |  104|  25.2k|        }
  ------------------
OCSP_CERTSTATUS_it:
  320|  32.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  32.9k|        { \
  |  |   96|  32.9k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  32.9k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  32.9k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  32.9k|                offsetof(stname,selname) ,\
  323|  32.9k|                tname##_ch_tt,\
  324|  32.9k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  32.9k|                NULL,\
  326|  32.9k|                sizeof(stname),\
  327|  32.9k|                #stname \
  328|  32.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  32.9k|                }; \
  |  |  103|  32.9k|        return &local_it; \
  |  |  104|  32.9k|        }
  ------------------
OCSP_SINGLERESP_it:
  166|  32.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  32.9k|        { \
  |  |   96|  32.9k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  32.9k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  32.9k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  32.9k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  32.9k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  32.9k|                tname##_seq_tt,\
  170|  32.9k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  32.9k|                NULL,\
  172|  32.9k|                sizeof(stname),\
  173|  32.9k|                #tname \
  174|  32.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  32.9k|                }; \
  |  |  103|  32.9k|        return &local_it; \
  |  |  104|  32.9k|        }
  ------------------
OCSP_RESPDATA_it:
  166|  43.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  43.0k|        { \
  |  |   96|  43.0k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  43.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  43.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  43.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  43.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  43.0k|                tname##_seq_tt,\
  170|  43.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  43.0k|                NULL,\
  172|  43.0k|                sizeof(stname),\
  173|  43.0k|                #tname \
  174|  43.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  43.0k|                }; \
  |  |  103|  43.0k|        return &local_it; \
  |  |  104|  43.0k|        }
  ------------------
OCSP_BASICRESP_it:
  166|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.7k|                tname##_seq_tt,\
  170|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.7k|                NULL,\
  172|  12.7k|                sizeof(stname),\
  173|  12.7k|                #tname \
  174|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
OCSP_CRLID_it:
  166|  14.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  14.9k|        { \
  |  |   96|  14.9k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  14.9k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  14.9k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  14.9k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  14.9k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  14.9k|                tname##_seq_tt,\
  170|  14.9k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  14.9k|                NULL,\
  172|  14.9k|                sizeof(stname),\
  173|  14.9k|                #tname \
  174|  14.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  14.9k|                }; \
  |  |  103|  14.9k|        return &local_it; \
  |  |  104|  14.9k|        }
  ------------------
OCSP_SERVICELOC_it:
  166|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.7k|                tname##_seq_tt,\
  170|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.7k|                NULL,\
  172|  12.7k|                sizeof(stname),\
  173|  12.7k|                #tname \
  174|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
PKCS12_it:
  166|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.7k|                tname##_seq_tt,\
  170|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.7k|                NULL,\
  172|  12.7k|                sizeof(stname),\
  173|  12.7k|                #tname \
  174|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
PKCS12_MAC_DATA_it:
  166|  43.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  43.2k|        { \
  |  |   96|  43.2k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  43.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  43.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  43.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  43.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  43.2k|                tname##_seq_tt,\
  170|  43.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  43.2k|                NULL,\
  172|  43.2k|                sizeof(stname),\
  173|  43.2k|                #tname \
  174|  43.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  43.2k|                }; \
  |  |  103|  43.2k|        return &local_it; \
  |  |  104|  43.2k|        }
  ------------------
PKCS12_BAGS_it:
  166|  13.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  13.5k|        { \
  |  |   96|  13.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  13.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  13.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  13.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  13.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  13.5k|                tname##_seq_tt,\
  170|  13.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  13.5k|                NULL,\
  172|  13.5k|                sizeof(stname),\
  173|  13.5k|                #tname \
  174|  13.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  13.5k|                }; \
  |  |  103|  13.5k|        return &local_it; \
  |  |  104|  13.5k|        }
  ------------------
PKCS12_SAFEBAG_it:
  166|  46.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  46.0k|        { \
  |  |   96|  46.0k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  46.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  46.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  46.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  46.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  46.0k|                tname##_seq_tt,\
  170|  46.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  46.0k|                NULL,\
  172|  46.0k|                sizeof(stname),\
  173|  46.0k|                #tname \
  174|  46.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  46.0k|                }; \
  |  |  103|  46.0k|        return &local_it; \
  |  |  104|  46.0k|        }
  ------------------
PKCS12_SAFEBAGS_it:
  113|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  12.7k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  12.7k|                -1,\
  116|  12.7k|                &tname##_item_tt,\
  117|  12.7k|                0,\
  118|  12.7k|                NULL,\
  119|  12.7k|                0,\
  120|  12.7k|                #tname \
  121|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
PKCS12_AUTHSAFES_it:
  113|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  12.7k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  12.7k|                -1,\
  116|  12.7k|                &tname##_item_tt,\
  117|  12.7k|                0,\
  118|  12.7k|                NULL,\
  119|  12.7k|                0,\
  120|  12.7k|                #tname \
  121|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
p12_asn.c:PKCS12_BAGS_adb:
  463|  34.6k|        { \
  464|  34.6k|        static const ASN1_ADB internal_adb = \
  465|  34.6k|                {\
  466|  34.6k|                flags,\
  467|  34.6k|                offsetof(name, field),\
  468|  34.6k|                adb_cb,\
  469|  34.6k|                name##_adbtbl,\
  470|  34.6k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  34.6k|                def,\
  472|  34.6k|                none\
  473|  34.6k|                }; \
  474|  34.6k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  34.6k|        } \
p12_asn.c:PKCS12_SAFEBAG_adb:
  463|  55.7k|        { \
  464|  55.7k|        static const ASN1_ADB internal_adb = \
  465|  55.7k|                {\
  466|  55.7k|                flags,\
  467|  55.7k|                offsetof(name, field),\
  468|  55.7k|                adb_cb,\
  469|  55.7k|                name##_adbtbl,\
  470|  55.7k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  55.7k|                def,\
  472|  55.7k|                none\
  473|  55.7k|                }; \
  474|  55.7k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  55.7k|        } \
PKCS7_it:
  270|   151k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   151k|        { \
  |  |   96|   151k|                static const ASN1_ITEM local_it = {
  ------------------
  271|   151k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|   151k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  272|   151k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   151k|# define V_ASN1_SEQUENCE                 16
  ------------------
  273|   151k|                tname##_seq_tt,\
  274|   151k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  275|   151k|                &tname##_aux,\
  276|   151k|                sizeof(stname),\
  277|   151k|                #stname \
  278|   151k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   151k|                }; \
  |  |  103|   151k|        return &local_it; \
  |  |  104|   151k|        }
  ------------------
PKCS7_SIGNED_it:
  218|  13.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  13.9k|        { \
  |  |   96|  13.9k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  13.9k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  13.9k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  13.9k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  13.9k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  13.9k|                tname##_seq_tt,\
  222|  13.9k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  13.9k|                NULL,\
  224|  13.9k|                sizeof(tname),\
  225|  13.9k|                #tname \
  226|  13.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  13.9k|                }; \
  |  |  103|  13.9k|        return &local_it; \
  |  |  104|  13.9k|        }
  ------------------
PKCS7_SIGNER_INFO_it:
  247|  37.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  37.4k|        { \
  |  |   96|  37.4k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  37.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  37.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  37.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  37.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  37.4k|                tname##_seq_tt,\
  251|  37.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  37.4k|                &tname##_aux,\
  253|  37.4k|                sizeof(stname),\
  254|  37.4k|                #tname \
  255|  37.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  37.4k|                }; \
  |  |  103|  37.4k|        return &local_it; \
  |  |  104|  37.4k|        }
  ------------------
PKCS7_ISSUER_AND_SERIAL_it:
  166|  71.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  71.8k|        { \
  |  |   96|  71.8k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  71.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  71.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  71.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  71.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  71.8k|                tname##_seq_tt,\
  170|  71.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  71.8k|                NULL,\
  172|  71.8k|                sizeof(stname),\
  173|  71.8k|                #tname \
  174|  71.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  71.8k|                }; \
  |  |  103|  71.8k|        return &local_it; \
  |  |  104|  71.8k|        }
  ------------------
PKCS7_ENVELOPE_it:
  218|  13.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  13.0k|        { \
  |  |   96|  13.0k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  13.0k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  13.0k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  13.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  13.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  13.0k|                tname##_seq_tt,\
  222|  13.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  13.0k|                NULL,\
  224|  13.0k|                sizeof(tname),\
  225|  13.0k|                #tname \
  226|  13.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  13.0k|                }; \
  |  |  103|  13.0k|        return &local_it; \
  |  |  104|  13.0k|        }
  ------------------
PKCS7_RECIP_INFO_it:
  247|  35.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  35.9k|        { \
  |  |   96|  35.9k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  35.9k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  35.9k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  35.9k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  35.9k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  35.9k|                tname##_seq_tt,\
  251|  35.9k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  35.9k|                &tname##_aux,\
  253|  35.9k|                sizeof(stname),\
  254|  35.9k|                #tname \
  255|  35.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  35.9k|                }; \
  |  |  103|  35.9k|        return &local_it; \
  |  |  104|  35.9k|        }
  ------------------
PKCS7_ENC_CONTENT_it:
  218|  77.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  77.9k|        { \
  |  |   96|  77.9k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  77.9k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  77.9k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  77.9k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  77.9k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  77.9k|                tname##_seq_tt,\
  222|  77.9k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  77.9k|                NULL,\
  224|  77.9k|                sizeof(tname),\
  225|  77.9k|                #tname \
  226|  77.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  77.9k|                }; \
  |  |  103|  77.9k|        return &local_it; \
  |  |  104|  77.9k|        }
  ------------------
PKCS7_SIGN_ENVELOPE_it:
  218|  12.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.8k|        { \
  |  |   96|  12.8k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  12.8k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  12.8k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  12.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  12.8k|                tname##_seq_tt,\
  222|  12.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  12.8k|                NULL,\
  224|  12.8k|                sizeof(tname),\
  225|  12.8k|                #tname \
  226|  12.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.8k|                }; \
  |  |  103|  12.8k|        return &local_it; \
  |  |  104|  12.8k|        }
  ------------------
PKCS7_ENCRYPT_it:
  218|  13.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  13.2k|        { \
  |  |   96|  13.2k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  13.2k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  13.2k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  13.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  13.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  13.2k|                tname##_seq_tt,\
  222|  13.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  13.2k|                NULL,\
  224|  13.2k|                sizeof(tname),\
  225|  13.2k|                #tname \
  226|  13.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  13.2k|                }; \
  |  |  103|  13.2k|        return &local_it; \
  |  |  104|  13.2k|        }
  ------------------
PKCS7_DIGEST_it:
  218|  12.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.8k|        { \
  |  |   96|  12.8k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  12.8k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  12.8k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  12.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  12.8k|                tname##_seq_tt,\
  222|  12.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  12.8k|                NULL,\
  224|  12.8k|                sizeof(tname),\
  225|  12.8k|                #tname \
  226|  12.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.8k|                }; \
  |  |  103|  12.8k|        return &local_it; \
  |  |  104|  12.8k|        }
  ------------------
PKCS7_ATTR_SIGN_it:
  113|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  12.7k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  12.7k|                -1,\
  116|  12.7k|                &tname##_item_tt,\
  117|  12.7k|                0,\
  118|  12.7k|                NULL,\
  119|  12.7k|                0,\
  120|  12.7k|                #tname \
  121|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
PKCS7_ATTR_VERIFY_it:
  113|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  12.7k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  12.7k|                -1,\
  116|  12.7k|                &tname##_item_tt,\
  117|  12.7k|                0,\
  118|  12.7k|                NULL,\
  119|  12.7k|                0,\
  120|  12.7k|                #tname \
  121|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
pk7_asn1.c:PKCS7_adb:
  463|   151k|        { \
  464|   151k|        static const ASN1_ADB internal_adb = \
  465|   151k|                {\
  466|   151k|                flags,\
  467|   151k|                offsetof(name, field),\
  468|   151k|                adb_cb,\
  469|   151k|                name##_adbtbl,\
  470|   151k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|   151k|                def,\
  472|   151k|                none\
  473|   151k|                }; \
  474|   151k|                return (const ASN1_ITEM *) &internal_adb; \
  475|   151k|        } \
RSA_PRIME_INFO_it:
  166|   187k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   187k|        { \
  |  |   96|   187k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   187k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   187k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   187k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   187k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   187k|                tname##_seq_tt,\
  170|   187k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   187k|                NULL,\
  172|   187k|                sizeof(stname),\
  173|   187k|                #tname \
  174|   187k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   187k|                }; \
  |  |  103|   187k|        return &local_it; \
  |  |  104|   187k|        }
  ------------------
RSAPrivateKey_it:
  247|  38.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  38.4k|        { \
  |  |   96|  38.4k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  38.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  38.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  38.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  38.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  38.4k|                tname##_seq_tt,\
  251|  38.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  38.4k|                &tname##_aux,\
  253|  38.4k|                sizeof(stname),\
  254|  38.4k|                #tname \
  255|  38.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  38.4k|                }; \
  |  |  103|  38.4k|        return &local_it; \
  |  |  104|  38.4k|        }
  ------------------
RSAPublicKey_it:
  247|  25.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  25.6k|        { \
  |  |   96|  25.6k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  25.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  25.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  25.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  25.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  25.6k|                tname##_seq_tt,\
  251|  25.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  25.6k|                &tname##_aux,\
  253|  25.6k|                sizeof(stname),\
  254|  25.6k|                #tname \
  255|  25.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  25.6k|                }; \
  |  |  103|  25.6k|        return &local_it; \
  |  |  104|  25.6k|        }
  ------------------
RSA_PSS_PARAMS_it:
  247|  61.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  61.3k|        { \
  |  |   96|  61.3k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  61.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  61.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  61.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  61.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  61.3k|                tname##_seq_tt,\
  251|  61.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  61.3k|                &tname##_aux,\
  253|  61.3k|                sizeof(stname),\
  254|  61.3k|                #tname \
  255|  61.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  61.3k|                }; \
  |  |  103|  61.3k|        return &local_it; \
  |  |  104|  61.3k|        }
  ------------------
RSA_PSS_PARAMS_free:
  816|  48.6k|        { \
  817|  48.6k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  48.6k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  48.6k|        }
RSA_OAEP_PARAMS_it:
  247|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  12.7k|                tname##_seq_tt,\
  251|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  12.7k|                &tname##_aux,\
  253|  12.7k|                sizeof(stname),\
  254|  12.7k|                #tname \
  255|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
d2i_RSAPrivateKey:
  826|  25.2k|        { \
  827|  25.2k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  25.2k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  25.2k|        } \
i2d_RSAPrivateKey:
  830|    507|        { \
  831|    507|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|    507|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    507|        }
d2i_RSAPublicKey:
  826|  12.8k|        { \
  827|  12.8k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  12.8k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  12.8k|        } \
i2d_RSAPublicKey:
  830|     60|        { \
  831|     60|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|     60|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     60|        }
d2i_TS_MSG_IMPRINT:
  826|  12.7k|        { \
  827|  12.7k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  12.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  12.7k|        } \
i2d_TS_MSG_IMPRINT:
  830|      5|        { \
  831|      5|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|      5|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|      5|        }
TS_MSG_IMPRINT_free:
  816|      5|        { \
  817|      5|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|      5|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|      5|        }
d2i_TS_REQ:
  826|  12.7k|        { \
  827|  12.7k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  12.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  12.7k|        } \
i2d_TS_REQ:
  830|  1.24k|        { \
  831|  1.24k|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  1.24k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|  1.24k|        }
TS_REQ_free:
  816|  1.24k|        { \
  817|  1.24k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  1.24k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  1.24k|        }
d2i_TS_ACCURACY:
  826|  12.7k|        { \
  827|  12.7k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  12.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  12.7k|        } \
i2d_TS_ACCURACY:
  830|    332|        { \
  831|    332|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|    332|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    332|        }
TS_ACCURACY_free:
  816|    332|        { \
  817|    332|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|    332|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|    332|        }
d2i_TS_TST_INFO:
  826|  12.7k|        { \
  827|  12.7k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  12.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  12.7k|        } \
i2d_TS_TST_INFO:
  830|     11|        { \
  831|     11|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|     11|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     11|        }
TS_TST_INFO_free:
  816|  10.1k|        { \
  817|  10.1k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  10.1k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  10.1k|        }
d2i_TS_STATUS_INFO:
  826|  12.7k|        { \
  827|  12.7k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  12.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  12.7k|        } \
i2d_TS_STATUS_INFO:
  830|    504|        { \
  831|    504|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|    504|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    504|        }
TS_STATUS_INFO_free:
  816|    504|        { \
  817|    504|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|    504|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|    504|        }
d2i_TS_RESP:
  826|  12.7k|        { \
  827|  12.7k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  12.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  12.7k|        } \
i2d_TS_RESP:
  830|    100|        { \
  831|    100|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|    100|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    100|        }
TS_RESP_free:
  816|    100|        { \
  817|    100|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|    100|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|    100|        }
ts_asn1.c:TS_MSG_IMPRINT_it:
  178|  61.2k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  61.2k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  61.2k|        { \
  |  |  |  |   96|  61.2k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  61.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  61.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  61.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  61.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  61.2k|                tname##_seq_tt,\
  182|  61.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  61.2k|                NULL,\
  184|  61.2k|                sizeof(stname),\
  185|  61.2k|                #stname \
  186|  61.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  61.2k|                }; \
  |  |  103|  61.2k|        return &local_it; \
  |  |  104|  61.2k|        }
  ------------------
ts_asn1.c:TS_REQ_it:
  178|  15.2k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  15.2k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  15.2k|        { \
  |  |  |  |   96|  15.2k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  15.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  15.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  15.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  15.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  15.2k|                tname##_seq_tt,\
  182|  15.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  15.2k|                NULL,\
  184|  15.2k|                sizeof(stname),\
  185|  15.2k|                #stname \
  186|  15.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  15.2k|                }; \
  |  |  103|  15.2k|        return &local_it; \
  |  |  104|  15.2k|        }
  ------------------
ts_asn1.c:TS_ACCURACY_it:
  178|  43.8k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  43.8k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  43.8k|        { \
  |  |  |  |   96|  43.8k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  43.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  43.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  43.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  43.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  43.8k|                tname##_seq_tt,\
  182|  43.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  43.8k|                NULL,\
  184|  43.8k|                sizeof(stname),\
  185|  43.8k|                #stname \
  186|  43.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  43.8k|                }; \
  |  |  103|  43.8k|        return &local_it; \
  |  |  104|  43.8k|        }
  ------------------
ts_asn1.c:TS_TST_INFO_it:
  178|  22.8k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  22.8k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  22.8k|        { \
  |  |  |  |   96|  22.8k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  22.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  22.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  22.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  22.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  22.8k|                tname##_seq_tt,\
  182|  22.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  22.8k|                NULL,\
  184|  22.8k|                sizeof(stname),\
  185|  22.8k|                #stname \
  186|  22.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  22.8k|                }; \
  |  |  103|  22.8k|        return &local_it; \
  |  |  104|  22.8k|        }
  ------------------
ts_asn1.c:TS_STATUS_INFO_it:
  178|  44.3k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  44.3k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  44.3k|        { \
  |  |  |  |   96|  44.3k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  44.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  44.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  44.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  44.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  44.3k|                tname##_seq_tt,\
  182|  44.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  44.3k|                NULL,\
  184|  44.3k|                sizeof(stname),\
  185|  44.3k|                #stname \
  186|  44.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  44.3k|                }; \
  |  |  103|  44.3k|        return &local_it; \
  |  |  104|  44.3k|        }
  ------------------
ts_asn1.c:TS_RESP_it:
  258|  12.9k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  12.9k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  12.9k|        { \
  |  |  |  |   96|  12.9k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  259|  12.9k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.9k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  260|  12.9k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.9k|# define V_ASN1_SEQUENCE                 16
  ------------------
  261|  12.9k|                tname##_seq_tt,\
  262|  12.9k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  263|  12.9k|                &tname##_aux,\
  264|  12.9k|                sizeof(stname),\
  265|  12.9k|                #stname \
  266|  12.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.9k|                }; \
  |  |  103|  12.9k|        return &local_it; \
  |  |  104|  12.9k|        }
  ------------------
OSSL_TARGET_it:
  320|  9.08k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  9.08k|        { \
  |  |   96|  9.08k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  9.08k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  9.08k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  9.08k|                offsetof(stname,selname) ,\
  323|  9.08k|                tname##_ch_tt,\
  324|  9.08k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  9.08k|                NULL,\
  326|  9.08k|                sizeof(stname),\
  327|  9.08k|                #stname \
  328|  9.08k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  9.08k|                }; \
  |  |  103|  9.08k|        return &local_it; \
  |  |  104|  9.08k|        }
  ------------------
OSSL_TARGETS_it:
  113|  42.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  42.8k|        { \
  |  |   96|  42.8k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  42.8k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  42.8k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  42.8k|                -1,\
  116|  42.8k|                &tname##_item_tt,\
  117|  42.8k|                0,\
  118|  42.8k|                NULL,\
  119|  42.8k|                0,\
  120|  42.8k|                #tname \
  121|  42.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  42.8k|                }; \
  |  |  103|  42.8k|        return &local_it; \
  |  |  104|  42.8k|        }
  ------------------
OSSL_TARGETING_INFORMATION_it:
  113|  12.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.8k|        { \
  |  |   96|  12.8k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  12.8k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  12.8k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  12.8k|                -1,\
  116|  12.8k|                &tname##_item_tt,\
  117|  12.8k|                0,\
  118|  12.8k|                NULL,\
  119|  12.8k|                0,\
  120|  12.8k|                #tname \
  121|  12.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.8k|                }; \
  |  |  103|  12.8k|        return &local_it; \
  |  |  104|  12.8k|        }
  ------------------
v3_ac_tgt.c:OSSL_TARGET_CERT_it:
  178|  1.99k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  1.99k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  1.99k|        { \
  |  |  |  |   96|  1.99k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  1.99k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.99k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  1.99k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.99k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  1.99k|                tname##_seq_tt,\
  182|  1.99k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  1.99k|                NULL,\
  184|  1.99k|                sizeof(stname),\
  185|  1.99k|                #stname \
  186|  1.99k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.99k|                }; \
  |  |  103|  1.99k|        return &local_it; \
  |  |  104|  1.99k|        }
  ------------------
v3_ac_tgt.c:OSSL_ISSUER_SERIAL_it:
  178|     23|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|     23|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|     23|        { \
  |  |  |  |   96|     23|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|     23|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     23|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|     23|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     23|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|     23|                tname##_seq_tt,\
  182|     23|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|     23|                NULL,\
  184|     23|                sizeof(stname),\
  185|     23|                #stname \
  186|     23|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     23|                }; \
  |  |  103|     23|        return &local_it; \
  |  |  104|     23|        }
  ------------------
v3_ac_tgt.c:OSSL_OBJECT_DIGEST_INFO_it:
  178|     27|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|     27|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|     27|        { \
  |  |  |  |   96|     27|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|     27|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     27|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|     27|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     27|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|     27|                tname##_seq_tt,\
  182|     27|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|     27|                NULL,\
  184|     27|                sizeof(stname),\
  185|     27|                #stname \
  186|     27|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     27|                }; \
  |  |  103|     27|        return &local_it; \
  |  |  104|     27|        }
  ------------------
IPAddressRange_it:
  166|  48.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  48.1k|        { \
  |  |   96|  48.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  48.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  48.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  48.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  48.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  48.1k|                tname##_seq_tt,\
  170|  48.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  48.1k|                NULL,\
  172|  48.1k|                sizeof(stname),\
  173|  48.1k|                #tname \
  174|  48.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  48.1k|                }; \
  |  |  103|  48.1k|        return &local_it; \
  |  |  104|  48.1k|        }
  ------------------
IPAddressOrRange_it:
  320|  36.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  36.2k|        { \
  |  |   96|  36.2k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  36.2k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  36.2k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  36.2k|                offsetof(stname,selname) ,\
  323|  36.2k|                tname##_ch_tt,\
  324|  36.2k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  36.2k|                NULL,\
  326|  36.2k|                sizeof(stname),\
  327|  36.2k|                #stname \
  328|  36.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  36.2k|                }; \
  |  |  103|  36.2k|        return &local_it; \
  |  |  104|  36.2k|        }
  ------------------
IPAddressChoice_it:
  320|  33.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  33.0k|        { \
  |  |   96|  33.0k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  33.0k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  33.0k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  33.0k|                offsetof(stname,selname) ,\
  323|  33.0k|                tname##_ch_tt,\
  324|  33.0k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  33.0k|                NULL,\
  326|  33.0k|                sizeof(stname),\
  327|  33.0k|                #stname \
  328|  33.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  33.0k|                }; \
  |  |  103|  33.0k|        return &local_it; \
  |  |  104|  33.0k|        }
  ------------------
IPAddressFamily_it:
  166|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.7k|                tname##_seq_tt,\
  170|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.7k|                NULL,\
  172|  12.7k|                sizeof(stname),\
  173|  12.7k|                #tname \
  174|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
AUTHORITY_KEYID_it:
  166|   125k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   125k|        { \
  |  |   96|   125k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   125k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   125k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   125k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   125k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   125k|                tname##_seq_tt,\
  170|   125k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   125k|                NULL,\
  172|   125k|                sizeof(stname),\
  173|   125k|                #tname \
  174|   125k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   125k|                }; \
  |  |  103|   125k|        return &local_it; \
  |  |  104|   125k|        }
  ------------------
AUTHORITY_KEYID_free:
  816|   107k|        { \
  817|   107k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|   107k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   107k|        }
ASRange_it:
  166|  48.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  48.8k|        { \
  |  |   96|  48.8k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  48.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  48.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  48.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  48.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  48.8k|                tname##_seq_tt,\
  170|  48.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  48.8k|                NULL,\
  172|  48.8k|                sizeof(stname),\
  173|  48.8k|                #tname \
  174|  48.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  48.8k|                }; \
  |  |  103|  48.8k|        return &local_it; \
  |  |  104|  48.8k|        }
  ------------------
ASIdOrRange_it:
  320|  56.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  56.9k|        { \
  |  |   96|  56.9k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  56.9k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  56.9k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  56.9k|                offsetof(stname,selname) ,\
  323|  56.9k|                tname##_ch_tt,\
  324|  56.9k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  56.9k|                NULL,\
  326|  56.9k|                sizeof(stname),\
  327|  56.9k|                #stname \
  328|  56.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  56.9k|                }; \
  |  |  103|  56.9k|        return &local_it; \
  |  |  104|  56.9k|        }
  ------------------
ASIdentifierChoice_it:
  320|  83.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  83.6k|        { \
  |  |   96|  83.6k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  83.6k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  83.6k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  83.6k|                offsetof(stname,selname) ,\
  323|  83.6k|                tname##_ch_tt,\
  324|  83.6k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  83.6k|                NULL,\
  326|  83.6k|                sizeof(stname),\
  327|  83.6k|                #stname \
  328|  83.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  83.6k|                }; \
  |  |  103|  83.6k|        return &local_it; \
  |  |  104|  83.6k|        }
  ------------------
ASIdentifiers_it:
  166|  87.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  87.1k|        { \
  |  |   96|  87.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  87.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  87.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  87.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  87.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  87.1k|                tname##_seq_tt,\
  170|  87.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  87.1k|                NULL,\
  172|  87.1k|                sizeof(stname),\
  173|  87.1k|                #tname \
  174|  87.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  87.1k|                }; \
  |  |  103|  87.1k|        return &local_it; \
  |  |  104|  87.1k|        }
  ------------------
ASIdentifiers_free:
  816|  74.4k|        { \
  817|  74.4k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  74.4k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  74.4k|        }
BASIC_CONSTRAINTS_it:
  166|  13.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  13.2k|        { \
  |  |   96|  13.2k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  13.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  13.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  13.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  13.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  13.2k|                tname##_seq_tt,\
  170|  13.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  13.2k|                NULL,\
  172|  13.2k|                sizeof(stname),\
  173|  13.2k|                #tname \
  174|  13.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  13.2k|                }; \
  |  |  103|  13.2k|        return &local_it; \
  |  |  104|  13.2k|        }
  ------------------
CERTIFICATEPOLICIES_it:
  113|  13.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  13.2k|        { \
  |  |   96|  13.2k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  13.2k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  13.2k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  13.2k|                -1,\
  116|  13.2k|                &tname##_item_tt,\
  117|  13.2k|                0,\
  118|  13.2k|                NULL,\
  119|  13.2k|                0,\
  120|  13.2k|                #tname \
  121|  13.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  13.2k|                }; \
  |  |  103|  13.2k|        return &local_it; \
  |  |  104|  13.2k|        }
  ------------------
POLICYINFO_it:
  166|  73.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  73.3k|        { \
  |  |   96|  73.3k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  73.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  73.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  73.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  73.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  73.3k|                tname##_seq_tt,\
  170|  73.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  73.3k|                NULL,\
  172|  73.3k|                sizeof(stname),\
  173|  73.3k|                #tname \
  174|  73.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  73.3k|                }; \
  |  |  103|  73.3k|        return &local_it; \
  |  |  104|  73.3k|        }
  ------------------
POLICYQUALINFO_it:
  166|  35.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  35.4k|        { \
  |  |   96|  35.4k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  35.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  35.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  35.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  35.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  35.4k|                tname##_seq_tt,\
  170|  35.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  35.4k|                NULL,\
  172|  35.4k|                sizeof(stname),\
  173|  35.4k|                #tname \
  174|  35.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  35.4k|                }; \
  |  |  103|  35.4k|        return &local_it; \
  |  |  104|  35.4k|        }
  ------------------
USERNOTICE_it:
  166|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.7k|                tname##_seq_tt,\
  170|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.7k|                NULL,\
  172|  12.7k|                sizeof(stname),\
  173|  12.7k|                #tname \
  174|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
NOTICEREF_it:
  166|  61.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  61.2k|        { \
  |  |   96|  61.2k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  61.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  61.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  61.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  61.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  61.2k|                tname##_seq_tt,\
  170|  61.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  61.2k|                NULL,\
  172|  61.2k|                sizeof(stname),\
  173|  61.2k|                #tname \
  174|  61.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  61.2k|                }; \
  |  |  103|  61.2k|        return &local_it; \
  |  |  104|  61.2k|        }
  ------------------
v3_cpols.c:POLICYQUALINFO_adb:
  463|  37.0k|        { \
  464|  37.0k|        static const ASN1_ADB internal_adb = \
  465|  37.0k|                {\
  466|  37.0k|                flags,\
  467|  37.0k|                offsetof(name, field),\
  468|  37.0k|                adb_cb,\
  469|  37.0k|                name##_adbtbl,\
  470|  37.0k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  37.0k|                def,\
  472|  37.0k|                none\
  473|  37.0k|                }; \
  474|  37.0k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  37.0k|        } \
DIST_POINT_NAME_it:
  344|   200k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   200k|        { \
  |  |   96|   200k|                static const ASN1_ITEM local_it = {
  ------------------
  345|   200k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|   200k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  346|   200k|                offsetof(stname,selname) ,\
  347|   200k|                tname##_ch_tt,\
  348|   200k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  349|   200k|                &tname##_aux,\
  350|   200k|                sizeof(stname),\
  351|   200k|                #stname \
  352|   200k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   200k|                }; \
  |  |  103|   200k|        return &local_it; \
  |  |  104|   200k|        }
  ------------------
DIST_POINT_it:
  166|  61.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  61.1k|        { \
  |  |   96|  61.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  61.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  61.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  61.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  61.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  61.1k|                tname##_seq_tt,\
  170|  61.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  61.1k|                NULL,\
  172|  61.1k|                sizeof(stname),\
  173|  61.1k|                #tname \
  174|  61.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  61.1k|                }; \
  |  |  103|  61.1k|        return &local_it; \
  |  |  104|  61.1k|        }
  ------------------
CRL_DIST_POINTS_it:
  113|  90.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  90.0k|        { \
  |  |   96|  90.0k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  90.0k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  90.0k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  90.0k|                -1,\
  116|  90.0k|                &tname##_item_tt,\
  117|  90.0k|                0,\
  118|  90.0k|                NULL,\
  119|  90.0k|                0,\
  120|  90.0k|                #tname \
  121|  90.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  90.0k|                }; \
  |  |  103|  90.0k|        return &local_it; \
  |  |  104|  90.0k|        }
  ------------------
CRL_DIST_POINTS_free:
  816|  74.4k|        { \
  817|  74.4k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  74.4k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  74.4k|        }
ISSUING_DIST_POINT_it:
  166|  64.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  64.0k|        { \
  |  |   96|  64.0k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  64.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  64.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  64.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  64.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  64.0k|                tname##_seq_tt,\
  170|  64.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  64.0k|                NULL,\
  172|  64.0k|                sizeof(stname),\
  173|  64.0k|                #tname \
  174|  64.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  64.0k|                }; \
  |  |  103|  64.0k|        return &local_it; \
  |  |  104|  64.0k|        }
  ------------------
ISSUING_DIST_POINT_free:
  816|  33.3k|        { \
  817|  33.3k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  33.3k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  33.3k|        }
OSSL_AA_DIST_POINT_it:
  166|    157|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    157|        { \
  |  |   96|    157|                static const ASN1_ITEM local_it = {
  ------------------
  167|    157|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    157|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    157|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    157|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    157|                tname##_seq_tt,\
  170|    157|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    157|                NULL,\
  172|    157|                sizeof(stname),\
  173|    157|                #tname \
  174|    157|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    157|                }; \
  |  |  103|    157|        return &local_it; \
  |  |  104|    157|        }
  ------------------
EXTENDED_KEY_USAGE_it:
  113|  14.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  14.0k|        { \
  |  |   96|  14.0k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  14.0k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  14.0k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  14.0k|                -1,\
  116|  14.0k|                &tname##_item_tt,\
  117|  14.0k|                0,\
  118|  14.0k|                NULL,\
  119|  14.0k|                0,\
  120|  14.0k|                #tname \
  121|  14.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  14.0k|                }; \
  |  |  103|  14.0k|        return &local_it; \
  |  |  104|  14.0k|        }
  ------------------
OTHERNAME_it:
  166|  76.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  76.6k|        { \
  |  |   96|  76.6k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  76.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  76.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  76.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  76.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  76.6k|                tname##_seq_tt,\
  170|  76.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  76.6k|                NULL,\
  172|  76.6k|                sizeof(stname),\
  173|  76.6k|                #tname \
  174|  76.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  76.6k|                }; \
  |  |  103|  76.6k|        return &local_it; \
  |  |  104|  76.6k|        }
  ------------------
EDIPARTYNAME_it:
  166|  59.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  59.8k|        { \
  |  |   96|  59.8k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  59.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  59.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  59.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  59.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  59.8k|                tname##_seq_tt,\
  170|  59.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  59.8k|                NULL,\
  172|  59.8k|                sizeof(stname),\
  173|  59.8k|                #tname \
  174|  59.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  59.8k|                }; \
  |  |  103|  59.8k|        return &local_it; \
  |  |  104|  59.8k|        }
  ------------------
GENERAL_NAME_it:
  320|   316k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   316k|        { \
  |  |   96|   316k|                static const ASN1_ITEM local_it = {
  ------------------
  321|   316k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|   316k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|   316k|                offsetof(stname,selname) ,\
  323|   316k|                tname##_ch_tt,\
  324|   316k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|   316k|                NULL,\
  326|   316k|                sizeof(stname),\
  327|   316k|                #stname \
  328|   316k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   316k|                }; \
  |  |  103|   316k|        return &local_it; \
  |  |  104|   316k|        }
  ------------------
GENERAL_NAMES_it:
  113|   103k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   103k|        { \
  |  |   96|   103k|                static const ASN1_ITEM local_it = {
  ------------------
  114|   103k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|   103k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|   103k|                -1,\
  116|   103k|                &tname##_item_tt,\
  117|   103k|                0,\
  118|   103k|                NULL,\
  119|   103k|                0,\
  120|   103k|                #tname \
  121|   103k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   103k|                }; \
  |  |  103|   103k|        return &local_it; \
  |  |  104|   103k|        }
  ------------------
GENERAL_NAMES_free:
  816|  74.9k|        { \
  817|  74.9k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  74.9k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  74.9k|        }
ACCESS_DESCRIPTION_it:
  166|  43.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  43.5k|        { \
  |  |   96|  43.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  43.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  43.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  43.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  43.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  43.5k|                tname##_seq_tt,\
  170|  43.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  43.5k|                NULL,\
  172|  43.5k|                sizeof(stname),\
  173|  43.5k|                #tname \
  174|  43.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  43.5k|                }; \
  |  |  103|  43.5k|        return &local_it; \
  |  |  104|  43.5k|        }
  ------------------
AUTHORITY_INFO_ACCESS_it:
  113|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  12.7k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  12.7k|                -1,\
  116|  12.7k|                &tname##_item_tt,\
  117|  12.7k|                0,\
  118|  12.7k|                NULL,\
  119|  12.7k|                0,\
  120|  12.7k|                #tname \
  121|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
GENERAL_SUBTREE_it:
  166|  41.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  41.1k|        { \
  |  |   96|  41.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  41.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  41.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  41.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  41.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  41.1k|                tname##_seq_tt,\
  170|  41.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  41.1k|                NULL,\
  172|  41.1k|                sizeof(stname),\
  173|  41.1k|                #tname \
  174|  41.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  41.1k|                }; \
  |  |  103|  41.1k|        return &local_it; \
  |  |  104|  41.1k|        }
  ------------------
NAME_CONSTRAINTS_it:
  166|  89.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  89.1k|        { \
  |  |   96|  89.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  89.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  89.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  89.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  89.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  89.1k|                tname##_seq_tt,\
  170|  89.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  89.1k|                NULL,\
  172|  89.1k|                sizeof(stname),\
  173|  89.1k|                #tname \
  174|  89.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  89.1k|                }; \
  |  |  103|  89.1k|        return &local_it; \
  |  |  104|  89.1k|        }
  ------------------
NAME_CONSTRAINTS_free:
  816|  74.4k|        { \
  817|  74.4k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  74.4k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  74.4k|        }
PROXY_POLICY_it:
  166|  41.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  41.8k|        { \
  |  |   96|  41.8k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  41.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  41.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  41.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  41.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  41.8k|                tname##_seq_tt,\
  170|  41.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  41.8k|                NULL,\
  172|  41.8k|                sizeof(stname),\
  173|  41.8k|                #tname \
  174|  41.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  41.8k|                }; \
  |  |  103|  41.8k|        return &local_it; \
  |  |  104|  41.8k|        }
  ------------------
PROXY_CERT_INFO_EXTENSION_it:
  166|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.7k|                tname##_seq_tt,\
  170|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.7k|                NULL,\
  172|  12.7k|                sizeof(stname),\
  173|  12.7k|                #tname \
  174|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
POLICY_CONSTRAINTS_it:
  166|  13.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  13.6k|        { \
  |  |   96|  13.6k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  13.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  13.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  13.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  13.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  13.6k|                tname##_seq_tt,\
  170|  13.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  13.6k|                NULL,\
  172|  13.6k|                sizeof(stname),\
  173|  13.6k|                #tname \
  174|  13.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  13.6k|                }; \
  |  |  103|  13.6k|        return &local_it; \
  |  |  104|  13.6k|        }
  ------------------
PKEY_USAGE_PERIOD_it:
  166|  13.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  13.2k|        { \
  |  |   96|  13.2k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  13.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  13.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  13.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  13.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  13.2k|                tname##_seq_tt,\
  170|  13.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  13.2k|                NULL,\
  172|  13.2k|                sizeof(stname),\
  173|  13.2k|                #tname \
  174|  13.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  13.2k|                }; \
  |  |  103|  13.2k|        return &local_it; \
  |  |  104|  13.2k|        }
  ------------------
POLICY_MAPPING_it:
  166|  34.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  34.3k|        { \
  |  |   96|  34.3k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  34.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  34.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  34.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  34.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  34.3k|                tname##_seq_tt,\
  170|  34.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  34.3k|                NULL,\
  172|  34.3k|                sizeof(stname),\
  173|  34.3k|                #tname \
  174|  34.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  34.3k|                }; \
  |  |  103|  34.3k|        return &local_it; \
  |  |  104|  34.3k|        }
  ------------------
POLICY_MAPPINGS_it:
  113|  13.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  13.3k|        { \
  |  |   96|  13.3k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  13.3k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  13.3k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  13.3k|                -1,\
  116|  13.3k|                &tname##_item_tt,\
  117|  13.3k|                0,\
  118|  13.3k|                NULL,\
  119|  13.3k|                0,\
  120|  13.3k|                #tname \
  121|  13.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  13.3k|                }; \
  |  |  103|  13.3k|        return &local_it; \
  |  |  104|  13.3k|        }
  ------------------
OSSL_ROLE_SPEC_CERT_ID_it:
  166|     16|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     16|        { \
  |  |   96|     16|                static const ASN1_ITEM local_it = {
  ------------------
  167|     16|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     16|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     16|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     16|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     16|                tname##_seq_tt,\
  170|     16|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     16|                NULL,\
  172|     16|                sizeof(stname),\
  173|     16|                #tname \
  174|     16|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     16|                }; \
  |  |  103|     16|        return &local_it; \
  |  |  104|     16|        }
  ------------------
OSSL_ROLE_SPEC_CERT_ID_SYNTAX_it:
  113|    107|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    107|        { \
  |  |   96|    107|                static const ASN1_ITEM local_it = {
  ------------------
  114|    107|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|    107|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|    107|                -1,\
  116|    107|                &tname##_item_tt,\
  117|    107|                0,\
  118|    107|                NULL,\
  119|    107|                0,\
  120|    107|                #tname \
  121|    107|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    107|                }; \
  |  |  103|    107|        return &local_it; \
  |  |  104|    107|        }
  ------------------
OSSL_ATTRIBUTES_SYNTAX_it:
  113|     30|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     30|        { \
  |  |   96|     30|                static const ASN1_ITEM local_it = {
  ------------------
  114|     30|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|     30|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|     30|                -1,\
  116|     30|                &tname##_item_tt,\
  117|     30|                0,\
  118|     30|                NULL,\
  119|     30|                0,\
  120|     30|                #tname \
  121|     30|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     30|                }; \
  |  |  103|     30|        return &local_it; \
  |  |  104|     30|        }
  ------------------
SXNETID_it:
  166|  27.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  27.8k|        { \
  |  |   96|  27.8k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  27.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  27.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  27.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  27.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  27.8k|                tname##_seq_tt,\
  170|  27.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  27.8k|                NULL,\
  172|  27.8k|                sizeof(stname),\
  173|  27.8k|                #tname \
  174|  27.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  27.8k|                }; \
  |  |  103|  27.8k|        return &local_it; \
  |  |  104|  27.8k|        }
  ------------------
SXNET_it:
  166|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.7k|                tname##_seq_tt,\
  170|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.7k|                NULL,\
  172|  12.7k|                sizeof(stname),\
  173|  12.7k|                #tname \
  174|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
OSSL_TIME_SPEC_ABSOLUTE_it:
  166|    853|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    853|        { \
  |  |   96|    853|                static const ASN1_ITEM local_it = {
  ------------------
  167|    853|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    853|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    853|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    853|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    853|                tname##_seq_tt,\
  170|    853|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    853|                NULL,\
  172|    853|                sizeof(stname),\
  173|    853|                #tname \
  174|    853|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    853|                }; \
  |  |  103|    853|        return &local_it; \
  |  |  104|    853|        }
  ------------------
OSSL_DAY_TIME_BAND_it:
  166|    749|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    749|        { \
  |  |   96|    749|                static const ASN1_ITEM local_it = {
  ------------------
  167|    749|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    749|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    749|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    749|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    749|                tname##_seq_tt,\
  170|    749|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    749|                NULL,\
  172|    749|                sizeof(stname),\
  173|    749|                #tname \
  174|    749|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    749|                }; \
  |  |  103|    749|        return &local_it; \
  |  |  104|    749|        }
  ------------------
OSSL_NAMED_DAY_it:
  320|      3|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      3|        { \
  |  |   96|      3|                static const ASN1_ITEM local_it = {
  ------------------
  321|      3|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|      3|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|      3|                offsetof(stname,selname) ,\
  323|      3|                tname##_ch_tt,\
  324|      3|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|      3|                NULL,\
  326|      3|                sizeof(stname),\
  327|      3|                #stname \
  328|      3|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      3|                }; \
  |  |  103|      3|        return &local_it; \
  |  |  104|      3|        }
  ------------------
OSSL_TIME_SPEC_X_DAY_OF_it:
  320|      5|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      5|        { \
  |  |   96|      5|                static const ASN1_ITEM local_it = {
  ------------------
  321|      5|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|      5|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|      5|                offsetof(stname,selname) ,\
  323|      5|                tname##_ch_tt,\
  324|      5|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|      5|                NULL,\
  326|      5|                sizeof(stname),\
  327|      5|                #stname \
  328|      5|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      5|                }; \
  |  |  103|      5|        return &local_it; \
  |  |  104|      5|        }
  ------------------
OSSL_TIME_SPEC_DAY_it:
  320|  2.99k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  2.99k|        { \
  |  |   96|  2.99k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  2.99k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  2.99k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  2.99k|                offsetof(stname,selname) ,\
  323|  2.99k|                tname##_ch_tt,\
  324|  2.99k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  2.99k|                NULL,\
  326|  2.99k|                sizeof(stname),\
  327|  2.99k|                #stname \
  328|  2.99k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.99k|                }; \
  |  |  103|  2.99k|        return &local_it; \
  |  |  104|  2.99k|        }
  ------------------
OSSL_TIME_SPEC_WEEKS_it:
  320|  2.99k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  2.99k|        { \
  |  |   96|  2.99k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  2.99k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  2.99k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  2.99k|                offsetof(stname,selname) ,\
  323|  2.99k|                tname##_ch_tt,\
  324|  2.99k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  2.99k|                NULL,\
  326|  2.99k|                sizeof(stname),\
  327|  2.99k|                #stname \
  328|  2.99k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.99k|                }; \
  |  |  103|  2.99k|        return &local_it; \
  |  |  104|  2.99k|        }
  ------------------
OSSL_TIME_SPEC_MONTH_it:
  320|  2.99k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  2.99k|        { \
  |  |   96|  2.99k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  2.99k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  2.99k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  2.99k|                offsetof(stname,selname) ,\
  323|  2.99k|                tname##_ch_tt,\
  324|  2.99k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  2.99k|                NULL,\
  326|  2.99k|                sizeof(stname),\
  327|  2.99k|                #stname \
  328|  2.99k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.99k|                }; \
  |  |  103|  2.99k|        return &local_it; \
  |  |  104|  2.99k|        }
  ------------------
OSSL_TIME_PERIOD_it:
  166|  1.95k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.95k|        { \
  |  |   96|  1.95k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  1.95k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.95k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  1.95k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.95k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  1.95k|                tname##_seq_tt,\
  170|  1.95k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  1.95k|                NULL,\
  172|  1.95k|                sizeof(stname),\
  173|  1.95k|                #tname \
  174|  1.95k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.95k|                }; \
  |  |  103|  1.95k|        return &local_it; \
  |  |  104|  1.95k|        }
  ------------------
OSSL_TIME_SPEC_TIME_it:
  320|  2.39k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  2.39k|        { \
  |  |   96|  2.39k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  2.39k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  2.39k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  2.39k|                offsetof(stname,selname) ,\
  323|  2.39k|                tname##_ch_tt,\
  324|  2.39k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  2.39k|                NULL,\
  326|  2.39k|                sizeof(stname),\
  327|  2.39k|                #stname \
  328|  2.39k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.39k|                }; \
  |  |  103|  2.39k|        return &local_it; \
  |  |  104|  2.39k|        }
  ------------------
OSSL_TIME_SPEC_it:
  166|  1.36k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.36k|        { \
  |  |   96|  1.36k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  1.36k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.36k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  1.36k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.36k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  1.36k|                tname##_seq_tt,\
  170|  1.36k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  1.36k|                NULL,\
  172|  1.36k|                sizeof(stname),\
  173|  1.36k|                #tname \
  174|  1.36k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.36k|                }; \
  |  |  103|  1.36k|        return &local_it; \
  |  |  104|  1.36k|        }
  ------------------
OSSL_USER_NOTICE_SYNTAX_it:
  113|     31|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     31|        { \
  |  |   96|     31|                static const ASN1_ITEM local_it = {
  ------------------
  114|     31|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|     31|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|     31|                -1,\
  116|     31|                &tname##_item_tt,\
  117|     31|                0,\
  118|     31|                NULL,\
  119|     31|                0,\
  120|     31|                #tname \
  121|     31|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     31|                }; \
  |  |  103|     31|        return &local_it; \
  |  |  104|     31|        }
  ------------------
X509_ATTRIBUTE_it:
  166|   302k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   302k|        { \
  |  |   96|   302k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   302k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   302k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   302k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   302k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   302k|                tname##_seq_tt,\
  170|   302k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   302k|                NULL,\
  172|   302k|                sizeof(stname),\
  173|   302k|                #tname \
  174|   302k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   302k|                }; \
  |  |  103|   302k|        return &local_it; \
  |  |  104|   302k|        }
  ------------------
X509_REVOKED_it:
  166|   108k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   108k|        { \
  |  |   96|   108k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   108k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   108k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   108k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   108k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   108k|                tname##_seq_tt,\
  170|   108k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   108k|                NULL,\
  172|   108k|                sizeof(stname),\
  173|   108k|                #tname \
  174|   108k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   108k|                }; \
  |  |  103|   108k|        return &local_it; \
  |  |  104|   108k|        }
  ------------------
X509_CRL_INFO_it:
  247|  83.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  83.7k|        { \
  |  |   96|  83.7k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  83.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  83.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  83.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  83.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  83.7k|                tname##_seq_tt,\
  251|  83.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  83.7k|                &tname##_aux,\
  253|  83.7k|                sizeof(stname),\
  254|  83.7k|                #tname \
  255|  83.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  83.7k|                }; \
  |  |  103|  83.7k|        return &local_it; \
  |  |  104|  83.7k|        }
  ------------------
X509_CRL_it:
  247|  53.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  53.6k|        { \
  |  |   96|  53.6k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  53.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  53.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  53.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  53.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  53.6k|                tname##_seq_tt,\
  251|  53.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  53.6k|                &tname##_aux,\
  253|  53.6k|                sizeof(stname),\
  254|  53.6k|                #tname \
  255|  53.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  53.6k|                }; \
  |  |  103|  53.6k|        return &local_it; \
  |  |  104|  53.6k|        }
  ------------------
X509_EXTENSION_it:
  166|   544k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   544k|        { \
  |  |   96|   544k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   544k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   544k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   544k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   544k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   544k|                tname##_seq_tt,\
  170|   544k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   544k|                NULL,\
  172|   544k|                sizeof(stname),\
  173|   544k|                #tname \
  174|   544k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   544k|                }; \
  |  |  103|   544k|        return &local_it; \
  |  |  104|   544k|        }
  ------------------
X509_EXTENSIONS_it:
  113|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  12.7k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  12.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  12.7k|                -1,\
  116|  12.7k|                &tname##_item_tt,\
  117|  12.7k|                0,\
  118|  12.7k|                NULL,\
  119|  12.7k|                0,\
  120|  12.7k|                #tname \
  121|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
X509_NAME_ENTRY_it:
  166|  1.68M|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.68M|        { \
  |  |   96|  1.68M|                static const ASN1_ITEM local_it = {
  ------------------
  167|  1.68M|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.68M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  1.68M|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.68M|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  1.68M|                tname##_seq_tt,\
  170|  1.68M|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  1.68M|                NULL,\
  172|  1.68M|                sizeof(stname),\
  173|  1.68M|                #tname \
  174|  1.68M|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.68M|                }; \
  |  |  103|  1.68M|        return &local_it; \
  |  |  104|  1.68M|        }
  ------------------
X509_NAME_ENTRY_new:
  812|   226k|        { \
  813|   226k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|   226k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|   226k|        } \
X509_NAME_ENTRY_free:
  816|   427k|        { \
  817|   427k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|   427k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   427k|        }
X509_NAME_ENTRY_dup:
  855|  1.37k|        { \
  856|  1.37k|        return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
  ------------------
  |  |  427|  1.37k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  857|  1.37k|        }
X509_NAME_it:
  775|   533k|        ASN1_ITEM_start(sname) \
  ------------------
  |  |   95|   533k|        { \
  |  |   96|   533k|                static const ASN1_ITEM local_it = {
  ------------------
  776|   533k|                ASN1_ITYPE_EXTERN, \
  ------------------
  |  |   84|   533k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  777|   533k|                tag, \
  778|   533k|                NULL, \
  779|   533k|                0, \
  780|   533k|                &fptrs, \
  781|   533k|                0, \
  782|   533k|                #sname \
  783|   533k|        ASN1_ITEM_end(sname)
  ------------------
  |  |  102|   533k|                }; \
  |  |  103|   533k|        return &local_it; \
  |  |  104|   533k|        }
  ------------------
i2d_X509_NAME:
  830|    235|        { \
  831|    235|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|    235|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    235|        }
X509_NAME_free:
  816|  20.6k|        { \
  817|  20.6k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  20.6k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  20.6k|        }
X509_NAME_dup:
  855|    239|        { \
  856|    239|        return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
  ------------------
  |  |  427|    239|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  857|    239|        }
x_name.c:X509_NAME_INTERNAL_it:
  124|   116k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|   116k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|   116k|        { \
  |  |  |  |   96|   116k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  125|   116k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|   116k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  126|   116k|                -1,\
  127|   116k|                &tname##_item_tt,\
  128|   116k|                0,\
  129|   116k|                NULL,\
  130|   116k|                0,\
  131|   116k|                #tname \
  132|   116k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   116k|                }; \
  |  |  103|   116k|        return &local_it; \
  |  |  104|   116k|        }
  ------------------
x_name.c:X509_NAME_ENTRIES_it:
  124|  3.34M|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  3.34M|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  3.34M|        { \
  |  |  |  |   96|  3.34M|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  125|  3.34M|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  3.34M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  126|  3.34M|                -1,\
  127|  3.34M|                &tname##_item_tt,\
  128|  3.34M|                0,\
  129|  3.34M|                NULL,\
  130|  3.34M|                0,\
  131|  3.34M|                #tname \
  132|  3.34M|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.34M|                }; \
  |  |  103|  3.34M|        return &local_it; \
  |  |  104|  3.34M|        }
  ------------------
X509_PUBKEY_it:
  775|   302k|        ASN1_ITEM_start(sname) \
  ------------------
  |  |   95|   302k|        { \
  |  |   96|   302k|                static const ASN1_ITEM local_it = {
  ------------------
  776|   302k|                ASN1_ITYPE_EXTERN, \
  ------------------
  |  |   84|   302k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  777|   302k|                tag, \
  778|   302k|                NULL, \
  779|   302k|                0, \
  780|   302k|                &fptrs, \
  781|   302k|                0, \
  782|   302k|                #sname \
  783|   302k|        ASN1_ITEM_end(sname)
  ------------------
  |  |  102|   302k|                }; \
  |  |  103|   302k|        return &local_it; \
  |  |  104|   302k|        }
  ------------------
d2i_X509_PUBKEY:
  826|  24.8k|        { \
  827|  24.8k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  24.8k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  24.8k|        } \
X509_PUBKEY_free:
  816|  49.7k|        { \
  817|  49.7k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  49.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  49.7k|        }
x_pubkey.c:X509_PUBKEY_INTERNAL_it:
  178|   174k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|   174k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|   174k|        { \
  |  |  |  |   96|   174k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|   174k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   174k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|   174k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   174k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|   174k|                tname##_seq_tt,\
  182|   174k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|   174k|                NULL,\
  184|   174k|                sizeof(stname),\
  185|   174k|                #stname \
  186|   174k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   174k|                }; \
  |  |  103|   174k|        return &local_it; \
  |  |  104|   174k|        }
  ------------------
X509_REQ_INFO_it:
  247|  43.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  43.0k|        { \
  |  |   96|  43.0k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  43.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  43.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  43.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  43.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  43.0k|                tname##_seq_tt,\
  251|  43.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  43.0k|                &tname##_aux,\
  253|  43.0k|                sizeof(stname),\
  254|  43.0k|                #tname \
  255|  43.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  43.0k|                }; \
  |  |  103|  43.0k|        return &local_it; \
  |  |  104|  43.0k|        }
  ------------------
X509_REQ_it:
  247|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  12.7k|                tname##_seq_tt,\
  251|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  12.7k|                &tname##_aux,\
  253|  12.7k|                sizeof(stname),\
  254|  12.7k|                #tname \
  255|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
X509_CINF_it:
  247|   126k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   126k|        { \
  |  |   96|   126k|                static const ASN1_ITEM local_it = {
  ------------------
  248|   126k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   126k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|   126k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   126k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|   126k|                tname##_seq_tt,\
  251|   126k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|   126k|                &tname##_aux,\
  253|   126k|                sizeof(stname),\
  254|   126k|                #tname \
  255|   126k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   126k|                }; \
  |  |  103|   126k|        return &local_it; \
  |  |  104|   126k|        }
  ------------------
X509_it:
  247|   314k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   314k|        { \
  |  |   96|   314k|                static const ASN1_ITEM local_it = {
  ------------------
  248|   314k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   314k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|   314k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   314k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|   314k|                tname##_seq_tt,\
  251|   314k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|   314k|                &tname##_aux,\
  253|   314k|                sizeof(stname),\
  254|   314k|                #tname \
  255|   314k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   314k|                }; \
  |  |  103|   314k|        return &local_it; \
  |  |  104|   314k|        }
  ------------------
X509_free:
  816|  14.3k|        { \
  817|  14.3k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  14.3k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  14.3k|        }
X509_CERT_AUX_it:
  166|  87.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  87.1k|        { \
  |  |   96|  87.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  87.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  87.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  87.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  87.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  87.1k|                tname##_seq_tt,\
  170|  87.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  87.1k|                NULL,\
  172|  87.1k|                sizeof(stname),\
  173|  87.1k|                #tname \
  174|  87.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  87.1k|                }; \
  |  |  103|  87.1k|        return &local_it; \
  |  |  104|  87.1k|        }
  ------------------
X509_CERT_AUX_free:
  816|  74.4k|        { \
  817|  74.4k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  74.4k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  74.4k|        }
decode_der2key.c:BARE_PUBKEY_it:
  178|      3|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|      3|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|      3|        { \
  |  |  |  |   96|      3|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|      3|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      3|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|      3|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      3|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|      3|                tname##_seq_tt,\
  182|      3|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|      3|                NULL,\
  184|      3|                sizeof(stname),\
  185|      3|                #stname \
  186|      3|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      3|                }; \
  |  |  103|      3|        return &local_it; \
  |  |  104|      3|        }
  ------------------
decode_der2key.c:BARE_ALGOR_it:
  178|      4|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|      4|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|      4|        { \
  |  |  |  |   96|      4|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|      4|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      4|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|      4|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      4|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|      4|                tname##_seq_tt,\
  182|      4|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|      4|                NULL,\
  184|      4|                sizeof(stname),\
  185|      4|                #stname \
  186|      4|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      4|                }; \
  |  |  103|      4|        return &local_it; \
  |  |  104|      4|        }
  ------------------
OSSL_ALLOWED_ATTRIBUTES_CHOICE_it:
  320|     36|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     36|        { \
  |  |   96|     36|                static const ASN1_ITEM local_it = {
  ------------------
  321|     36|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|     36|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|     36|                offsetof(stname,selname) ,\
  323|     36|                tname##_ch_tt,\
  324|     36|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|     36|                NULL,\
  326|     36|                sizeof(stname),\
  327|     36|                #stname \
  328|     36|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     36|                }; \
  |  |  103|     36|        return &local_it; \
  |  |  104|     36|        }
  ------------------
OSSL_ALLOWED_ATTRIBUTES_ITEM_it:
  166|     98|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     98|        { \
  |  |   96|     98|                static const ASN1_ITEM local_it = {
  ------------------
  167|     98|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     98|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     98|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     98|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     98|                tname##_seq_tt,\
  170|     98|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     98|                NULL,\
  172|     98|                sizeof(stname),\
  173|     98|                #tname \
  174|     98|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     98|                }; \
  |  |  103|     98|        return &local_it; \
  |  |  104|     98|        }
  ------------------
OSSL_ALLOWED_ATTRIBUTES_SYNTAX_it:
  113|     77|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     77|        { \
  |  |   96|     77|                static const ASN1_ITEM local_it = {
  ------------------
  114|     77|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|     77|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|     77|                -1,\
  116|     77|                &tname##_item_tt,\
  117|     77|                0,\
  118|     77|                NULL,\
  119|     77|                0,\
  120|     77|                #tname \
  121|     77|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     77|                }; \
  |  |  103|     77|        return &local_it; \
  |  |  104|     77|        }
  ------------------
NAMING_AUTHORITY_it:
  166|     23|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     23|        { \
  |  |   96|     23|                static const ASN1_ITEM local_it = {
  ------------------
  167|     23|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     23|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     23|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     23|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     23|                tname##_seq_tt,\
  170|     23|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     23|                NULL,\
  172|     23|                sizeof(stname),\
  173|     23|                #tname \
  174|     23|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     23|                }; \
  |  |  103|     23|        return &local_it; \
  |  |  104|     23|        }
  ------------------
PROFESSION_INFO_it:
  166|      7|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      7|        { \
  |  |   96|      7|                static const ASN1_ITEM local_it = {
  ------------------
  167|      7|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      7|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|      7|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      7|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|      7|                tname##_seq_tt,\
  170|      7|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|      7|                NULL,\
  172|      7|                sizeof(stname),\
  173|      7|                #tname \
  174|      7|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      7|                }; \
  |  |  103|      7|        return &local_it; \
  |  |  104|      7|        }
  ------------------
ADMISSIONS_it:
  166|     44|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     44|        { \
  |  |   96|     44|                static const ASN1_ITEM local_it = {
  ------------------
  167|     44|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     44|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     44|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     44|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     44|                tname##_seq_tt,\
  170|     44|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     44|                NULL,\
  172|     44|                sizeof(stname),\
  173|     44|                #tname \
  174|     44|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     44|                }; \
  |  |  103|     44|        return &local_it; \
  |  |  104|     44|        }
  ------------------
ADMISSION_SYNTAX_it:
  166|     58|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     58|        { \
  |  |   96|     58|                static const ASN1_ITEM local_it = {
  ------------------
  167|     58|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     58|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     58|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     58|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     58|                tname##_seq_tt,\
  170|     58|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     58|                NULL,\
  172|     58|                sizeof(stname),\
  173|     58|                #tname \
  174|     58|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     58|                }; \
  |  |  103|     58|        return &local_it; \
  |  |  104|     58|        }
  ------------------
OSSL_INFO_SYNTAX_it:
  320|     16|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     16|        { \
  |  |   96|     16|                static const ASN1_ITEM local_it = {
  ------------------
  321|     16|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|     16|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|     16|                offsetof(stname,selname) ,\
  323|     16|                tname##_ch_tt,\
  324|     16|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|     16|                NULL,\
  326|     16|                sizeof(stname),\
  327|     16|                #stname \
  328|     16|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     16|                }; \
  |  |  103|     16|        return &local_it; \
  |  |  104|     16|        }
  ------------------
OSSL_PRIVILEGE_POLICY_ID_it:
  166|     16|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     16|        { \
  |  |   96|     16|                static const ASN1_ITEM local_it = {
  ------------------
  167|     16|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     16|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     16|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     16|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     16|                tname##_seq_tt,\
  170|     16|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     16|                NULL,\
  172|     16|                sizeof(stname),\
  173|     16|                #tname \
  174|     16|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     16|                }; \
  |  |  103|     16|        return &local_it; \
  |  |  104|     16|        }
  ------------------
OSSL_ATTRIBUTE_DESCRIPTOR_it:
  166|     21|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     21|        { \
  |  |   96|     21|                static const ASN1_ITEM local_it = {
  ------------------
  167|     21|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     21|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     21|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     21|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     21|                tname##_seq_tt,\
  170|     21|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     21|                NULL,\
  172|     21|                sizeof(stname),\
  173|     21|                #tname \
  174|     21|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     21|                }; \
  |  |  103|     21|        return &local_it; \
  |  |  104|     21|        }
  ------------------
OSSL_ATAV_it:
  166|    568|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    568|        { \
  |  |   96|    568|                static const ASN1_ITEM local_it = {
  ------------------
  167|    568|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    568|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    568|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    568|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    568|                tname##_seq_tt,\
  170|    568|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    568|                NULL,\
  172|    568|                sizeof(stname),\
  173|    568|                #tname \
  174|    568|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    568|                }; \
  |  |  103|    568|        return &local_it; \
  |  |  104|    568|        }
  ------------------
OSSL_ATTRIBUTE_TYPE_MAPPING_it:
  166|    138|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    138|        { \
  |  |   96|    138|                static const ASN1_ITEM local_it = {
  ------------------
  167|    138|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    138|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    138|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    138|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    138|                tname##_seq_tt,\
  170|    138|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    138|                NULL,\
  172|    138|                sizeof(stname),\
  173|    138|                #tname \
  174|    138|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    138|                }; \
  |  |  103|    138|        return &local_it; \
  |  |  104|    138|        }
  ------------------
OSSL_ATTRIBUTE_VALUE_MAPPING_it:
  166|    230|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    230|        { \
  |  |   96|    230|                static const ASN1_ITEM local_it = {
  ------------------
  167|    230|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    230|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    230|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    230|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    230|                tname##_seq_tt,\
  170|    230|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    230|                NULL,\
  172|    230|                sizeof(stname),\
  173|    230|                #tname \
  174|    230|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    230|                }; \
  |  |  103|    230|        return &local_it; \
  |  |  104|    230|        }
  ------------------
OSSL_ATTRIBUTE_MAPPING_it:
  320|    254|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    254|        { \
  |  |   96|    254|                static const ASN1_ITEM local_it = {
  ------------------
  321|    254|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|    254|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|    254|                offsetof(stname,selname) ,\
  323|    254|                tname##_ch_tt,\
  324|    254|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|    254|                NULL,\
  326|    254|                sizeof(stname),\
  327|    254|                #stname \
  328|    254|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    254|                }; \
  |  |  103|    254|        return &local_it; \
  |  |  104|    254|        }
  ------------------
OSSL_ATTRIBUTE_MAPPINGS_it:
  113|    154|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    154|        { \
  |  |   96|    154|                static const ASN1_ITEM local_it = {
  ------------------
  114|    154|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|    154|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|    154|                -1,\
  116|    154|                &tname##_item_tt,\
  117|    154|                0,\
  118|    154|                NULL,\
  119|    154|                0,\
  120|    154|                #tname \
  121|    154|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    154|                }; \
  |  |  103|    154|        return &local_it; \
  |  |  104|    154|        }
  ------------------
OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX_it:
  113|     45|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     45|        { \
  |  |   96|     45|                static const ASN1_ITEM local_it = {
  ------------------
  114|     45|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|     45|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|     45|                -1,\
  116|     45|                &tname##_item_tt,\
  117|     45|                0,\
  118|     45|                NULL,\
  119|     45|                0,\
  120|     45|                #tname \
  121|     45|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     45|                }; \
  |  |  103|     45|        return &local_it; \
  |  |  104|     45|        }
  ------------------
OSSL_BASIC_ATTR_CONSTRAINTS_it:
  166|     44|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     44|        { \
  |  |   96|     44|                static const ASN1_ITEM local_it = {
  ------------------
  167|     44|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     44|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     44|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     44|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     44|                tname##_seq_tt,\
  170|     44|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     44|                NULL,\
  172|     44|                sizeof(stname),\
  173|     44|                #tname \
  174|     44|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     44|                }; \
  |  |  103|     44|        return &local_it; \
  |  |  104|     44|        }
  ------------------
ISSUER_SIGN_TOOL_it:
  166|     10|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     10|        { \
  |  |   96|     10|                static const ASN1_ITEM local_it = {
  ------------------
  167|     10|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     10|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     10|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     10|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     10|                tname##_seq_tt,\
  170|     10|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     10|                NULL,\
  172|     10|                sizeof(stname),\
  173|     10|                #tname \
  174|     10|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     10|                }; \
  |  |  103|     10|        return &local_it; \
  |  |  104|     10|        }
  ------------------
OSSL_ISSUER_SERIAL_it:
  166|     36|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     36|        { \
  |  |   96|     36|                static const ASN1_ITEM local_it = {
  ------------------
  167|     36|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     36|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     36|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     36|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     36|                tname##_seq_tt,\
  170|     36|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     36|                NULL,\
  172|     36|                sizeof(stname),\
  173|     36|                #tname \
  174|     36|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     36|                }; \
  |  |  103|     36|        return &local_it; \
  |  |  104|     36|        }
  ------------------

decoder_meth.c:OSSL_FUNC_decoder_newctx:
   59|     76|    {                                                                   \
   60|     76|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     76|    }
decoder_meth.c:OSSL_FUNC_decoder_freectx:
   59|     76|    {                                                                   \
   60|     76|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     76|    }
decoder_meth.c:OSSL_FUNC_decoder_set_ctx_params:
   59|     74|    {                                                                   \
   60|     74|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     74|    }
decoder_meth.c:OSSL_FUNC_decoder_settable_ctx_params:
   59|     74|    {                                                                   \
   60|     74|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     74|    }
decoder_meth.c:OSSL_FUNC_decoder_does_selection:
   59|     73|    {                                                                   \
   60|     73|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     73|    }
decoder_meth.c:OSSL_FUNC_decoder_decode:
   59|     76|    {                                                                   \
   60|     76|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     76|    }
decoder_meth.c:OSSL_FUNC_decoder_export_object:
   59|     73|    {                                                                   \
   60|     73|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     73|    }
encoder_meth.c:OSSL_FUNC_encoder_newctx:
   59|    241|    {                                                                   \
   60|    241|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    241|    }
encoder_meth.c:OSSL_FUNC_encoder_freectx:
   59|    241|    {                                                                   \
   60|    241|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    241|    }
encoder_meth.c:OSSL_FUNC_encoder_set_ctx_params:
   59|    208|    {                                                                   \
   60|    208|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    208|    }
encoder_meth.c:OSSL_FUNC_encoder_settable_ctx_params:
   59|    208|    {                                                                   \
   60|    208|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    208|    }
encoder_meth.c:OSSL_FUNC_encoder_does_selection:
   59|    212|    {                                                                   \
   60|    212|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    212|    }
encoder_meth.c:OSSL_FUNC_encoder_encode:
   59|    241|    {                                                                   \
   60|    241|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    241|    }
encoder_meth.c:OSSL_FUNC_encoder_import_object:
   59|    241|    {                                                                   \
   60|    241|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    241|    }
encoder_meth.c:OSSL_FUNC_encoder_free_object:
   59|    241|    {                                                                   \
   60|    241|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    241|    }
digest.c:OSSL_FUNC_digest_newctx:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_init:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_update:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_final:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_squeeze:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
digest.c:OSSL_FUNC_digest_freectx:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_dupctx:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_get_params:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_set_ctx_params:
   59|      8|    {                                                                   \
   60|      8|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      8|    }
digest.c:OSSL_FUNC_digest_get_ctx_params:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
digest.c:OSSL_FUNC_digest_gettable_params:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_settable_ctx_params:
   59|      8|    {                                                                   \
   60|      8|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      8|    }
digest.c:OSSL_FUNC_digest_gettable_ctx_params:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
digest.c:OSSL_FUNC_digest_copyctx:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_new:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_init:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_set_template:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_set_params:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_settable_params:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_get_params:
   59|      2|    {                                                                   \
   60|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      2|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_gettable_params:
   59|      2|    {                                                                   \
   60|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      2|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_cleanup:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_free:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_load:
   59|     29|    {                                                                   \
   60|     29|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     29|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_get_params:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gettable_params:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_set_params:
   59|     19|    {                                                                   \
   60|     19|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     19|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_settable_params:
   59|     19|    {                                                                   \
   60|     19|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     19|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_query_operation_name:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_has:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_dup:
   59|     33|    {                                                                   \
   60|     33|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     33|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_validate:
   59|     29|    {                                                                   \
   60|     29|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     29|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_match:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_import:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_import_types:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_export:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_export_types:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
mac_meth.c:OSSL_FUNC_mac_newctx:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_dupctx:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_freectx:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_init:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_update:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_final:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_gettable_params:
   59|      2|    {                                                                   \
   60|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      2|    }
mac_meth.c:OSSL_FUNC_mac_gettable_ctx_params:
   59|      7|    {                                                                   \
   60|      7|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      7|    }
mac_meth.c:OSSL_FUNC_mac_settable_ctx_params:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_get_params:
   59|      2|    {                                                                   \
   60|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      2|    }
mac_meth.c:OSSL_FUNC_mac_get_ctx_params:
   59|      7|    {                                                                   \
   60|      7|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      7|    }
mac_meth.c:OSSL_FUNC_mac_set_ctx_params:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
provider_core.c:OSSL_FUNC_provider_teardown:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
provider_core.c:OSSL_FUNC_provider_gettable_params:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_core.c:OSSL_FUNC_provider_get_params:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_core.c:OSSL_FUNC_provider_get_capabilities:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_core.c:OSSL_FUNC_provider_query_operation:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
defltprov.c:OSSL_FUNC_core_gettable_params:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
defltprov.c:OSSL_FUNC_core_get_params:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
defltprov.c:OSSL_FUNC_core_get_libctx:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_new_file:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_new_membuf:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_read_ex:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_write_ex:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_gets:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_puts:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_ctrl:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_up_ref:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_free:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_vprintf:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_get_entropy:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_get_user_entropy:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_entropy:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_user_entropy:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_get_nonce:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_get_user_nonce:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_nonce:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_user_nonce:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
evp_rand.c:OSSL_FUNC_rand_newctx:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_freectx:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_instantiate:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_uninstantiate:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_generate:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_reseed:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_nonce:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
evp_rand.c:OSSL_FUNC_rand_enable_locking:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_lock:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_unlock:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_gettable_ctx_params:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_settable_ctx_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
evp_rand.c:OSSL_FUNC_rand_get_ctx_params:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_set_ctx_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
evp_rand.c:OSSL_FUNC_rand_verify_zeroization:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_get_seed:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_clear_seed:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }

conf_mod.c:ERR_GET_REASON:
  256|      2|{
  257|      2|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|      2|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|      2|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  258|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  219|      0|# define ERR_SYSTEM_MASK                ((unsigned int)INT_MAX)
  ------------------
  259|      2|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  230|      2|# define ERR_REASON_MASK                0X7FFFFF
  ------------------
  260|      2|}
ecp_oct.c:ERR_GET_LIB:
  242|    688|{
  243|    688|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|    688|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|    688|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 688]
  |  |  ------------------
  ------------------
  244|      0|        return ERR_LIB_SYS;
  ------------------
  |  |   72|      0|# define ERR_LIB_SYS             2
  ------------------
  245|    688|    return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  226|    688|# define ERR_LIB_OFFSET                 23L
  ------------------
                  return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  227|    688|# define ERR_LIB_MASK                   0xFF
  ------------------
  246|    688|}
ecp_oct.c:ERR_GET_REASON:
  256|    688|{
  257|    688|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|    688|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|    688|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 688]
  |  |  ------------------
  ------------------
  258|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  219|      0|# define ERR_SYSTEM_MASK                ((unsigned int)INT_MAX)
  ------------------
  259|    688|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  230|    688|# define ERR_REASON_MASK                0X7FFFFF
  ------------------
  260|    688|}
err.c:ERR_GET_LIB:
  242|  9.71k|{
  243|  9.71k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|  9.71k|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|  9.71k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 9.71k]
  |  |  ------------------
  ------------------
  244|      0|        return ERR_LIB_SYS;
  ------------------
  |  |   72|      0|# define ERR_LIB_SYS             2
  ------------------
  245|  9.71k|    return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  226|  9.71k|# define ERR_LIB_OFFSET                 23L
  ------------------
                  return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  227|  9.71k|# define ERR_LIB_MASK                   0xFF
  ------------------
  246|  9.71k|}
err.c:ERR_GET_REASON:
  256|     70|{
  257|     70|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|     70|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|     70|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 70]
  |  |  ------------------
  ------------------
  258|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  219|      0|# define ERR_SYSTEM_MASK                ((unsigned int)INT_MAX)
  ------------------
  259|     70|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  230|     70|# define ERR_REASON_MASK                0X7FFFFF
  ------------------
  260|     70|}
a_d2i_fp.c:ERR_GET_REASON:
  256|  11.0M|{
  257|  11.0M|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|  11.0M|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|  11.0M|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 11.0M]
  |  |  ------------------
  ------------------
  258|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  219|      0|# define ERR_SYSTEM_MASK                ((unsigned int)INT_MAX)
  ------------------
  259|  11.0M|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  230|  11.0M|# define ERR_REASON_MASK                0X7FFFFF
  ------------------
  260|  11.0M|}
ec2_oct.c:ERR_GET_LIB:
  242|  4.65k|{
  243|  4.65k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|  4.65k|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|  4.65k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 4.65k]
  |  |  ------------------
  ------------------
  244|      0|        return ERR_LIB_SYS;
  ------------------
  |  |   72|      0|# define ERR_LIB_SYS             2
  ------------------
  245|  4.65k|    return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  226|  4.65k|# define ERR_LIB_OFFSET                 23L
  ------------------
                  return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  227|  4.65k|# define ERR_LIB_MASK                   0xFF
  ------------------
  246|  4.65k|}
ec2_oct.c:ERR_GET_REASON:
  256|  4.65k|{
  257|  4.65k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|  4.65k|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|  4.65k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 4.65k]
  |  |  ------------------
  ------------------
  258|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  219|      0|# define ERR_SYSTEM_MASK                ((unsigned int)INT_MAX)
  ------------------
  259|  4.65k|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  230|  4.65k|# define ERR_REASON_MASK                0X7FFFFF
  ------------------
  260|  4.65k|}
conf_def.c:ERR_GET_REASON:
  256|      2|{
  257|      2|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|      2|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|      2|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  258|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  219|      0|# define ERR_SYSTEM_MASK                ((unsigned int)INT_MAX)
  ------------------
  259|      2|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  230|      2|# define ERR_REASON_MASK                0X7FFFFF
  ------------------
  260|      2|}

decoder_pkey.c:lh_DECODER_CACHE_ENTRY_new:
  317|      4|    { \
  318|      4|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      4|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      4|                                lh_##type##_doall_thunk, \
  321|      4|                                lh_##type##_doall_arg_thunk); \
  322|      4|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_hfn_thunk:
  243|  40.8k|    { \
  244|  40.8k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  40.8k|        return hfn_conv((const type *)data); \
  246|  40.8k|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_cfn_thunk:
  248|  40.1k|    { \
  249|  40.1k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  40.1k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  40.1k|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_doall_thunk:
  299|    223|    { \
  300|    223|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|    223|        doall_conv((type *)node); \
  302|    223|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_doall:
  311|      4|    { \
  312|      4|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      4|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_flush:
  259|      2|    { \
  260|      2|        OPENSSL_LH_flush((OPENSSL_LHASH *)lh); \
  261|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_retrieve:
  274|  40.5k|    { \
  275|  40.5k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  40.5k|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_insert:
  264|    223|    { \
  265|    223|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|    223|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_error:
  279|    223|    { \
  280|    223|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|    223|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_type:
  196|  9.64k|    { \
  197|  9.64k|        return (OPENSSL_LHASH *)lh; \
  198|  9.64k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_hashfunc_type:
  206|      2|    { \
  207|      2|        return (OPENSSL_LH_HASHFUNC)hfn; \
  208|      2|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_compfunc_type:
  201|      2|    { \
  202|      2|        return (OPENSSL_LH_COMPFUNC)cmp; \
  203|      2|    } \
err.c:lh_ERR_STRING_DATA_hash_thunk:
  160|  9.64k|    { \
  161|  9.64k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  162|  9.64k|        return hfn_conv((const type *)data); \
  163|  9.64k|    } \
err.c:lh_ERR_STRING_DATA_comp_thunk:
  165|  6.16k|    { \
  166|  6.16k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  167|  6.16k|        return cfn_conv((const type *)da, (const type *)db); \
  168|  6.16k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_plain_type:
  181|  9.50k|    { \
  182|  9.50k|        return ptr; \
  183|  9.50k|    } \
err.c:ossl_check_const_ERR_STRING_DATA_lh_plain_type:
  186|    140|    { \
  187|    140|        return ptr; \
  188|    140|    } \
o_names.c:lh_OBJ_NAME_new:
  317|      2|    { \
  318|      2|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      2|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      2|                                lh_##type##_doall_thunk, \
  321|      2|                                lh_##type##_doall_arg_thunk); \
  322|      2|    } \
o_names.c:lh_OBJ_NAME_hfn_thunk:
  243|  1.72k|    { \
  244|  1.72k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  1.72k|        return hfn_conv((const type *)data); \
  246|  1.72k|    } \
o_names.c:lh_OBJ_NAME_cfn_thunk:
  248|  1.18k|    { \
  249|  1.18k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  1.18k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  1.18k|    } \
o_names.c:lh_OBJ_NAME_doall_thunk:
  299|  1.08k|    { \
  300|  1.08k|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|  1.08k|        doall_conv((type *)node); \
  302|  1.08k|    } \
o_names.c:lh_OBJ_NAME_retrieve:
  274|    388|    { \
  275|    388|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|    388|    } \
o_names.c:lh_OBJ_NAME_insert:
  264|    848|    { \
  265|    848|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|    848|    } \
o_names.c:lh_OBJ_NAME_error:
  279|    484|    { \
  280|    484|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|    484|    } \
o_names.c:lh_OBJ_NAME_delete:
  269|    484|    { \
  270|    484|        return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
  271|    484|    } \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL:
  354|      2|    { \
  355|      2|        OPENSSL_LH_doall_arg_thunk((OPENSSL_LHASH *)lh, \
  356|      2|                             lh_##type##_doall_##argtype##_thunk, \
  357|      2|                             (OPENSSL_LH_DOALL_FUNCARG)fn, \
  358|      2|                             (void *)arg); \
  359|      2|    } \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL_thunk:
  346|    484|    { \
  347|    484|        void (*fn_conv)(cbargtype *, argtype *) = (void (*)(cbargtype *, argtype *))fn; \
  348|    484|        fn_conv((cbargtype *)node, (argtype *)arg); \
  349|    484|    } \
o_names.c:lh_OBJ_NAME_get_down_load:
  289|      8|    { \
  290|      8|        return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \
  291|      8|    } \
o_names.c:lh_OBJ_NAME_set_down_load:
  294|     14|    { \
  295|     14|        OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
  296|     14|    } \
o_names.c:lh_OBJ_NAME_doall:
  311|      8|    { \
  312|      8|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      8|    } \
o_names.c:lh_OBJ_NAME_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall:
  311|      2|    { \
  312|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_new:
  317|      4|    { \
  318|      4|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      4|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      4|                                lh_##type##_doall_thunk, \
  321|      4|                                lh_##type##_doall_arg_thunk); \
  322|      4|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_hfn_thunk:
  243|    513|    { \
  244|    513|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|    513|        return hfn_conv((const type *)data); \
  246|    513|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_cfn_thunk:
  248|    342|    { \
  249|    342|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|    342|        return cfn_conv((const type *)da, (const type *)db); \
  251|    342|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall_thunk:
  299|     57|    { \
  300|     57|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|     57|        doall_conv((type *)node); \
  302|     57|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_retrieve:
  274|    456|    { \
  275|    456|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|    456|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_insert:
  264|     57|    { \
  265|     57|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|     57|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_error:
  279|     57|    { \
  280|     57|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|     57|    } \
property.c:lh_QUERY_doall:
  311|    399|    { \
  312|    399|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|    399|    } \
property.c:lh_QUERY_free:
  254|    141|    { \
  255|    141|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|    141|    } \
property.c:lh_QUERY_new:
  317|    141|    { \
  318|    141|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|    141|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|    141|                                lh_##type##_doall_thunk, \
  321|    141|                                lh_##type##_doall_arg_thunk); \
  322|    141|    } \
property.c:lh_QUERY_hfn_thunk:
  243|  6.66k|    { \
  244|  6.66k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  6.66k|        return hfn_conv((const type *)data); \
  246|  6.66k|    } \
property.c:lh_QUERY_cfn_thunk:
  248|  6.65k|    { \
  249|  6.65k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  6.65k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  6.65k|    } \
property.c:lh_QUERY_doall_thunk:
  299|      7|    { \
  300|      7|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|      7|        doall_conv((type *)node); \
  302|      7|    } \
property.c:lh_QUERY_num_items:
  284|    258|    { \
  285|    258|        return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \
  286|    258|    } \
property.c:lh_QUERY_flush:
  259|    258|    { \
  260|    258|        OPENSSL_LH_flush((OPENSSL_LHASH *)lh); \
  261|    258|    } \
property.c:lh_QUERY_retrieve:
  274|  6.65k|    { \
  275|  6.65k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  6.65k|    } \
property.c:lh_QUERY_insert:
  264|      7|    { \
  265|      7|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|      7|    } \
property.c:lh_QUERY_error:
  279|      7|    { \
  280|      7|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|      7|    } \
property_string.c:lh_PROPERTY_STRING_doall:
  311|      4|    { \
  312|      4|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      4|    } \
property_string.c:lh_PROPERTY_STRING_free:
  254|      4|    { \
  255|      4|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      4|    } \
property_string.c:lh_PROPERTY_STRING_new:
  317|      8|    { \
  318|      8|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      8|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      8|                                lh_##type##_doall_thunk, \
  321|      8|                                lh_##type##_doall_arg_thunk); \
  322|      8|    } \
property_string.c:lh_PROPERTY_STRING_hfn_thunk:
  243|  71.0k|    { \
  244|  71.0k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  71.0k|        return hfn_conv((const type *)data); \
  246|  71.0k|    } \
property_string.c:lh_PROPERTY_STRING_cfn_thunk:
  248|  70.9k|    { \
  249|  70.9k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  70.9k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  70.9k|    } \
property_string.c:lh_PROPERTY_STRING_doall_thunk:
  299|     37|    { \
  300|     37|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|     37|        doall_conv((type *)node); \
  302|     37|    } \
property_string.c:lh_PROPERTY_STRING_retrieve:
  274|  71.0k|    { \
  275|  71.0k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  71.0k|    } \
property_string.c:lh_PROPERTY_STRING_insert:
  264|     53|    { \
  265|     53|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|     53|    } \
property_string.c:lh_PROPERTY_STRING_error:
  279|     53|    { \
  280|     53|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|     53|    } \
store_register.c:lh_OSSL_STORE_LOADER_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \

OBJ_bsearch_ssl_cipher_id:
  143|    748|      { \
  144|    748|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  145|    748|                                        nm##_cmp_BSEARCH_CMP_FN); \
  146|    748|      } \
ssl_lib.c:ssl_cipher_id_cmp_BSEARCH_CMP_FN:
  137|  3.06k|      { \
  138|  3.06k|      type1 const *a = a_; \
  139|  3.06k|      type2 const *b = b_; \
  140|  3.06k|      return nm##_cmp(a,b); \
  141|  3.06k|      } \
ameth_lib.c:OBJ_bsearch_ameth:
  129|  49.0k|      { \
  130|  49.0k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  49.0k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  49.0k|      } \
ameth_lib.c:ameth_cmp_BSEARCH_CMP_FN:
  123|  83.1k|      { \
  124|  83.1k|      type1 const *a = a_; \
  125|  83.1k|      type2 const *b = b_; \
  126|  83.1k|      return nm##_cmp(a,b); \
  127|  83.1k|      } \
obj_dat.c:OBJ_bsearch_ln:
  129|     73|      { \
  130|     73|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|     73|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|     73|      } \
obj_dat.c:ln_cmp_BSEARCH_CMP_FN:
  123|    770|      { \
  124|    770|      type1 const *a = a_; \
  125|    770|      type2 const *b = b_; \
  126|    770|      return nm##_cmp(a,b); \
  127|    770|      } \
obj_dat.c:OBJ_bsearch_sn:
  129|     78|      { \
  130|     78|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|     78|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|     78|      } \
obj_dat.c:sn_cmp_BSEARCH_CMP_FN:
  123|    813|      { \
  124|    813|      type1 const *a = a_; \
  125|    813|      type2 const *b = b_; \
  126|    813|      return nm##_cmp(a,b); \
  127|    813|      } \
obj_dat.c:OBJ_bsearch_obj:
  129|  1.17M|      { \
  130|  1.17M|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  1.17M|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  1.17M|      } \
obj_dat.c:obj_cmp_BSEARCH_CMP_FN:
  123|  11.5M|      { \
  124|  11.5M|      type1 const *a = a_; \
  125|  11.5M|      type2 const *b = b_; \
  126|  11.5M|      return nm##_cmp(a,b); \
  127|  11.5M|      } \
v3_lib.c:OBJ_bsearch_ext:
  129|  61.3k|      { \
  130|  61.3k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  61.3k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  61.3k|      } \
v3_lib.c:ext_cmp_BSEARCH_CMP_FN:
  123|   336k|      { \
  124|   336k|      type1 const *a = a_; \
  125|   336k|      type2 const *b = b_; \
  126|   336k|      return nm##_cmp(a,b); \
  127|   336k|      } \

ssl_ciph.c:ossl_check_SSL_COMP_sk_type:
   53|      1|    { \
   54|      1|        return (OPENSSL_STACK *)sk; \
   55|      1|    } \
ssl_ciph.c:ossl_check_SSL_COMP_type:
   45|      1|    { \
   46|      1|        return ptr; \
   47|      1|    } \
d2i_pr.c:ossl_check_const_ASN1_TYPE_sk_type:
   49|  33.0k|    { \
   50|  33.0k|        return (const OPENSSL_STACK *)sk; \
   51|  33.0k|    } \
d2i_pr.c:ossl_check_ASN1_TYPE_sk_type:
   53|  11.3k|    { \
   54|  11.3k|        return (OPENSSL_STACK *)sk; \
   55|  11.3k|    } \
d2i_pr.c:ossl_check_ASN1_TYPE_freefunc_type:
   65|  11.3k|    { \
   66|  11.3k|        return (OPENSSL_sk_freefunc)fr; \
   67|  11.3k|    }
tasn_dec.c:ossl_check_const_ASN1_VALUE_sk_type:
   49|  14.5k|    { \
   50|  14.5k|        return (const OPENSSL_STACK *)sk; \
   51|  14.5k|    } \
tasn_dec.c:ossl_check_ASN1_VALUE_sk_type:
   53|  4.10M|    { \
   54|  4.10M|        return (OPENSSL_STACK *)sk; \
   55|  4.10M|    } \
tasn_dec.c:ossl_check_ASN1_VALUE_type:
   45|  4.10M|    { \
   46|  4.10M|        return ptr; \
   47|  4.10M|    } \
tasn_enc.c:sk_const_ASN1_VALUE_num:
   80|  4.40M|    { \
   81|  4.40M|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  4.40M|    } \
tasn_enc.c:sk_const_ASN1_VALUE_value:
   84|  3.73M|    { \
   85|  3.73M|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  3.73M|    } \
tasn_enc.c:sk_const_ASN1_VALUE_set:
  158|    367|    { \
  159|    367|        return (t2 *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); \
  160|    367|    } \
tasn_fre.c:ossl_check_const_ASN1_VALUE_sk_type:
   49|  7.97M|    { \
   50|  7.97M|        return (const OPENSSL_STACK *)sk; \
   51|  7.97M|    } \
tasn_fre.c:ossl_check_ASN1_VALUE_sk_type:
   53|  2.76M|    { \
   54|  2.76M|        return (OPENSSL_STACK *)sk; \
   55|  2.76M|    } \
tasn_prn.c:sk_const_ASN1_VALUE_num:
   80|   113k|    { \
   81|   113k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|   113k|    } \
tasn_prn.c:sk_const_ASN1_VALUE_value:
   84|  90.0k|    { \
   85|  90.0k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  90.0k|    } \
conf_mod.c:sk_CONF_IMODULE_free:
  112|      4|    { \
  113|      4|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      4|    } \
conf_mod.c:sk_CONF_MODULE_dup:
  182|      2|    { \
  183|      2|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  184|      2|    } \
conf_mod.c:sk_CONF_MODULE_new_null:
   96|      2|    { \
   97|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      2|    } \
conf_mod.c:sk_CONF_MODULE_num:
   80|      4|    { \
   81|      4|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      4|    } \
conf_mod.c:sk_CONF_MODULE_free:
  112|      6|    { \
  113|      6|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      6|    } \
conf_mod.c:sk_CONF_MODULE_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
conf_mod.c:sk_CONF_IMODULE_num:
   80|      2|    { \
   81|      2|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      2|    } \
ct_sct.c:ossl_check_SCT_sk_type:
   53|     12|    { \
   54|     12|        return (OPENSSL_STACK *)sk; \
   55|     12|    } \
ct_sct.c:ossl_check_SCT_freefunc_type:
   65|     12|    { \
   66|     12|        return (OPENSSL_sk_freefunc)fr; \
   67|     12|    }
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_new_null:
   96|     45|    { \
   97|     45|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|     45|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_push:
  129|    232|    { \
  130|    232|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    232|    } \
decoder_lib.c:sk_OSSL_DECODER_new_null:
   96|     45|    { \
   97|     45|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|     45|    } \
decoder_lib.c:sk_OSSL_DECODER_push:
  129|  3.42k|    { \
  130|  3.42k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|  3.42k|    } \
decoder_lib.c:sk_OSSL_DECODER_num:
   80|     45|    { \
   81|     45|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|     45|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_num:
   80|  75.3k|    { \
   81|  75.3k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  75.3k|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_value:
   84|   639k|    { \
   85|   639k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|   639k|    } \
decoder_lib.c:sk_OSSL_DECODER_value:
   84|  35.2k|    { \
   85|  35.2k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  35.2k|    } \
decoder_lib.c:sk_OSSL_DECODER_pop_free:
  145|     45|    { \
  146|     45|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|     45|        \
  148|     45|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|     45|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|     45|        \
  151|     45|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|     45|    } \
decoder_lib.c:sk_OSSL_DECODER_freefunc_thunk:
   75|  3.42k|    { \
   76|  3.42k|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|  3.42k|        freefunc((t3 *)ptr);\
   78|  3.42k|    } \
decoder_meth.c:sk_OSSL_DECODER_INSTANCE_pop_free:
  145|  40.5k|    { \
  146|  40.5k|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|  40.5k|        \
  148|  40.5k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|  40.5k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|  40.5k|        \
  151|  40.5k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|  40.5k|    } \
decoder_meth.c:sk_OSSL_DECODER_INSTANCE_freefunc_thunk:
   75|   601k|    { \
   76|   601k|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|   601k|        freefunc((t3 *)ptr);\
   78|   601k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_new_null:
   96|    223|    { \
   97|    223|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|    223|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_push:
  129|     86|    { \
  130|     86|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|     86|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_num:
   80|  16.9k|    { \
   81|  16.9k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  16.9k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_value:
   84|  14.0k|    { \
   85|  14.0k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  14.0k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_pop_free:
  145|  37.8k|    { \
  146|  37.8k|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|  37.8k|        \
  148|  37.8k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|  37.8k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|  37.8k|        \
  151|  37.8k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|  37.8k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_freefunc_thunk:
   75|   533k|    { \
   76|   533k|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|   533k|        freefunc((t3 *)ptr);\
   78|   533k|    } \
decoder_pkey.c:sk_OSSL_DECODER_INSTANCE_deep_copy:
  188|  37.6k|    { \
  189|  37.6k|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  190|  37.6k|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  191|  37.6k|                                            (OPENSSL_sk_freefunc)freefunc); \
  192|  37.6k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_deep_copy:
  188|  37.6k|    { \
  189|  37.6k|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  190|  37.6k|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  191|  37.6k|                                            (OPENSSL_sk_freefunc)freefunc); \
  192|  37.6k|    } \
encoder_lib.c:sk_OSSL_ENCODER_INSTANCE_new_null:
   96|  3.05k|    { \
   97|  3.05k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|  3.05k|    } \
encoder_lib.c:sk_OSSL_ENCODER_INSTANCE_push:
  129|  33.6k|    { \
  130|  33.6k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|  33.6k|    } \
encoder_lib.c:sk_OSSL_ENCODER_INSTANCE_num:
   80|  10.5k|    { \
   81|  10.5k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  10.5k|    } \
encoder_lib.c:sk_OSSL_ENCODER_INSTANCE_value:
   84|  33.6k|    { \
   85|  33.6k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  33.6k|    } \
encoder_meth.c:sk_OSSL_ENCODER_INSTANCE_value:
   84|  33.6k|    { \
   85|  33.6k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  33.6k|    } \
encoder_meth.c:sk_OSSL_ENCODER_INSTANCE_pop_free:
  145|  3.43k|    { \
  146|  3.43k|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|  3.43k|        \
  148|  3.43k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|  3.43k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|  3.43k|        \
  151|  3.43k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|  3.43k|    } \
encoder_meth.c:sk_OSSL_ENCODER_INSTANCE_freefunc_thunk:
   75|  33.6k|    { \
   76|  33.6k|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|  33.6k|        freefunc((t3 *)ptr);\
   78|  33.6k|    } \
encoder_pkey.c:ossl_check_OPENSSL_CSTRING_type:
   45|  12.5k|    { \
   46|  12.5k|        return ptr; \
   47|  12.5k|    } \
encoder_pkey.c:ossl_check_OPENSSL_CSTRING_sk_type:
   53|  15.6k|    { \
   54|  15.6k|        return (OPENSSL_STACK *)sk; \
   55|  15.6k|    } \
encoder_pkey.c:ossl_check_const_OPENSSL_CSTRING_sk_type:
   49|   751k|    { \
   50|   751k|        return (const OPENSSL_STACK *)sk; \
   51|   751k|    } \
keymgmt_lib.c:sk_OP_CACHE_ELEM_pop_free:
  145|  43.1k|    { \
  146|  43.1k|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|  43.1k|        \
  148|  43.1k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|  43.1k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|  43.1k|        \
  151|  43.1k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|  43.1k|    } \
p_lib.c:ossl_check_X509_ATTRIBUTE_sk_type:
   53|  43.1k|    { \
   54|  43.1k|        return (OPENSSL_STACK *)sk; \
   55|  43.1k|    } \
p_lib.c:ossl_check_X509_ATTRIBUTE_freefunc_type:
   65|  43.1k|    { \
   66|  43.1k|        return (OPENSSL_sk_freefunc)fr; \
   67|  43.1k|    }
core_namemap.c:sk_NAMES_value:
   84|  11.6k|    { \
   85|  11.6k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  11.6k|    } \
core_namemap.c:ossl_check_const_OPENSSL_STRING_sk_type:
   49|   101k|    { \
   50|   101k|        return (const OPENSSL_STACK *)sk; \
   51|   101k|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_sk_type:
   53|  11.9k|    { \
   54|  11.9k|        return (OPENSSL_STACK *)sk; \
   55|  11.9k|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_type:
   45|    385|    { \
   46|    385|        return ptr; \
   47|    385|    } \
core_namemap.c:sk_NAMES_push:
  129|    167|    { \
  130|    167|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    167|    } \
core_namemap.c:sk_NAMES_num:
   80|    167|    { \
   81|    167|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    167|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_freefunc_type:
   65|    167|    { \
   66|    167|        return (OPENSSL_sk_freefunc)fr; \
   67|    167|    }
core_namemap.c:sk_NAMES_new_null:
   96|      4|    { \
   97|      4|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      4|    } \
core_namemap.c:sk_NAMES_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
core_namemap.c:sk_NAMES_freefunc_thunk:
   75|    167|    { \
   76|    167|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|    167|        freefunc((t3 *)ptr);\
   78|    167|    } \
ex_data.c:sk_EX_CALLBACK_pop_free:
  145|     36|    { \
  146|     36|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|     36|        \
  148|     36|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|     36|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|     36|        \
  151|     36|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|     36|    } \
ex_data.c:sk_EX_CALLBACK_num:
   80|  5.16M|    { \
   81|  5.16M|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  5.16M|    } \
ex_data.c:ossl_check_void_sk_type:
   53|  2.58M|    { \
   54|  2.58M|        return (OPENSSL_STACK *)sk; \
   55|  2.58M|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_new_null:
   96|      2|    { \
   97|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_free:
  112|      2|    { \
  113|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_push:
  129|      2|    { \
  130|      2|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_num:
   80|      5|    { \
   81|      5|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      5|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_value:
   84|      2|    { \
   85|      2|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_delete:
  120|      2|    { \
  121|      2|        return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \
  122|      2|    } \
param_build_set.c:sk_BIGNUM_const_num:
   80|    420|    { \
   81|    420|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    420|    } \
param_build_set.c:sk_BIGNUM_const_value:
   84|  1.46k|    { \
   85|  1.46k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  1.46k|    } \
provider_conf.c:sk_OSSL_PROVIDER_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
provider_core.c:sk_INFOPAIR_pop_free:
  145|      3|    { \
  146|      3|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      3|        \
  148|      3|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      3|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      3|        \
  151|      3|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_freefunc_thunk:
   75|      3|    { \
   76|      3|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|      3|        freefunc((t3 *)ptr);\
   78|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_new:
   88|      4|    { \
   89|      4|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   90|      4|        OPENSSL_sk_freefunc_thunk f_thunk; \
   91|      4|        \
   92|      4|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
   93|      4|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \
   94|      4|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_new_null:
   96|      4|    { \
   97|      4|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      4|    } \
provider_core.c:sk_OSSL_PROVIDER_sort:
  174|      2|    { \
  175|      2|        OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
  176|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_find:
  162|      4|    { \
  163|      4|        return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); \
  164|      4|    } \
provider_core.c:sk_OSSL_PROVIDER_value:
   84|  39.6k|    { \
   85|  39.6k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  39.6k|    } \
provider_core.c:sk_INFOPAIR_deep_copy:
  188|      3|    { \
  189|      3|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  190|      3|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  191|      3|                                            (OPENSSL_sk_freefunc)freefunc); \
  192|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_push:
  129|      3|    { \
  130|      3|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|      3|    } \
provider_core.c:sk_INFOPAIR_num:
   80|      3|    { \
   81|      3|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_dup:
  182|  6.60k|    { \
  183|  6.60k|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  184|  6.60k|    } \
provider_core.c:sk_OSSL_PROVIDER_num:
   80|  6.60k|    { \
   81|  6.60k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  6.60k|    } \
provider_core.c:sk_OSSL_PROVIDER_free:
  112|  6.60k|    { \
  113|  6.60k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|  6.60k|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_num:
   80|      5|    { \
   81|      5|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      5|    } \
o_names.c:sk_NAME_FUNCS_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
obj_xref.c:sk_nid_triple_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
obj_xref.c:sk_nid_triple_free:
  112|      2|    { \
  113|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      2|    } \
property.c:sk_IMPLEMENTATION_pop_free:
  145|    141|    { \
  146|    141|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|    141|        \
  148|    141|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|    141|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|    141|        \
  151|    141|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|    141|    } \
property.c:sk_IMPLEMENTATION_freefunc_thunk:
   75|    399|    { \
   76|    399|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|    399|        freefunc((t3 *)ptr);\
   78|    399|    } \
property.c:sk_IMPLEMENTATION_new_null:
   96|    141|    { \
   97|    141|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|    141|    } \
property.c:sk_IMPLEMENTATION_num:
   80|   203k|    { \
   81|   203k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|   203k|    } \
property.c:sk_IMPLEMENTATION_value:
   84|  1.50M|    { \
   85|  1.50M|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  1.50M|    } \
property.c:sk_IMPLEMENTATION_push:
  129|    399|    { \
  130|    399|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    399|    } \
property.c:sk_ALGORITHM_new_reserve:
  100|  6.59k|    { \
  101|  6.59k|        OPENSSL_STACK *ret = OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); \
  102|  6.59k|        OPENSSL_sk_freefunc_thunk f_thunk; \
  103|  6.59k|        \
  104|  6.59k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  105|  6.59k|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \
  106|  6.59k|    } \
property.c:sk_ALGORITHM_push:
  129|   201k|    { \
  130|   201k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|   201k|    } \
property.c:sk_ALGORITHM_num:
   80|  6.59k|    { \
   81|  6.59k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  6.59k|    } \
property.c:sk_ALGORITHM_value:
   84|   201k|    { \
   85|   201k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|   201k|    } \
property.c:sk_ALGORITHM_free:
  112|  6.59k|    { \
  113|  6.59k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|  6.59k|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_new:
   88|    381|    { \
   89|    381|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   90|    381|        OPENSSL_sk_freefunc_thunk f_thunk; \
   91|    381|        \
   92|    381|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
   93|    381|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \
   94|    381|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_freefunc_thunk:
   75|  1.44k|    { \
   76|  1.44k|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|  1.44k|        freefunc((t3 *)ptr);\
   78|  1.44k|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_push:
  129|  1.44k|    { \
  130|  1.44k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|  1.44k|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_num:
   80|    381|    { \
   81|    381|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    381|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_sort:
  174|    381|    { \
  175|    381|        OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
  176|    381|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_value:
   84|  1.44k|    { \
   85|  1.44k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  1.44k|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_pop_free:
  145|    381|    { \
  146|    381|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|    381|        \
  148|    381|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|    381|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|    381|        \
  151|    381|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|    381|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_sk_type:
   53|     57|    { \
   54|     57|        return (OPENSSL_STACK *)sk; \
   55|     57|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_type:
   45|     53|    { \
   46|     53|        return ptr; \
   47|     53|    } \
property_string.c:ossl_check_const_OPENSSL_CSTRING_sk_type:
   49|  62.2k|    { \
   50|  62.2k|        return (const OPENSSL_STACK *)sk; \
   51|  62.2k|    } \
rsa_ameth.c:sk_RSA_PRIME_INFO_num:
   80|  18.8k|    { \
   81|  18.8k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  18.8k|    } \
rsa_ameth.c:sk_RSA_PRIME_INFO_value:
   84|  18.0k|    { \
   85|  18.0k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  18.0k|    } \
rsa_backend.c:sk_BIGNUM_const_new_null:
   96|    561|    { \
   97|    561|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|    561|    } \
rsa_backend.c:sk_BIGNUM_const_free:
  112|    561|    { \
  113|    561|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|    561|    } \
rsa_lib.c:sk_RSA_PRIME_INFO_pop_free:
  145|  48.6k|    { \
  146|  48.6k|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|  48.6k|        \
  148|  48.6k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|  48.6k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|  48.6k|        \
  151|  48.6k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|  48.6k|    } \
rsa_lib.c:sk_RSA_PRIME_INFO_freefunc_thunk:
   75|  64.6k|    { \
   76|  64.6k|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|  64.6k|        freefunc((t3 *)ptr);\
   78|  64.6k|    } \
rsa_lib.c:sk_RSA_PRIME_INFO_num:
   80|  1.12k|    { \
   81|  1.12k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  1.12k|    } \
rsa_lib.c:sk_RSA_PRIME_INFO_value:
   84|  20.0k|    { \
   85|  20.0k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  20.0k|    } \
rsa_lib.c:sk_BIGNUM_const_push:
  129|  65.6k|    { \
  130|  65.6k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|  65.6k|    } \
rsa_lib.c:sk_BIGNUM_const_new_null:
   96|  2.57k|    { \
   97|  2.57k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|  2.57k|    } \
rsa_lib.c:sk_BIGNUM_const_num:
   80|  10.1k|    { \
   81|  10.1k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  10.1k|    } \
rsa_lib.c:sk_BIGNUM_const_value:
   84|  18.7k|    { \
   85|  18.7k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  18.7k|    } \
rsa_lib.c:sk_BIGNUM_const_free:
  112|  2.57k|    { \
  113|  2.57k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|  2.57k|    } \
rsa_mp.c:sk_RSA_PRIME_INFO_num:
   80|  1.16k|    { \
   81|  1.16k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  1.16k|    } \
rsa_mp.c:sk_RSA_PRIME_INFO_value:
   84|  47.6k|    { \
   85|  47.6k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  47.6k|    } \
rsa_ossl.c:sk_RSA_PRIME_INFO_num:
   80|   113k|    { \
   81|   113k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|   113k|    } \
rsa_ossl.c:sk_RSA_PRIME_INFO_value:
   84|  64.6k|    { \
   85|  64.6k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  64.6k|    } \
ts_rsp_print.c:ossl_check_const_ASN1_UTF8STRING_sk_type:
   49|  12.4k|    { \
   50|  12.4k|        return (const OPENSSL_STACK *)sk; \
   51|  12.4k|    } \
ts_rsp_print.c:ossl_check_CONF_VALUE_sk_type:
   53|      2|    { \
   54|      2|        return (OPENSSL_STACK *)sk; \
   55|      2|    } \
ts_rsp_print.c:ossl_check_CONF_VALUE_freefunc_type:
   65|      2|    { \
   66|      2|        return (OPENSSL_sk_freefunc)fr; \
   67|      2|    }
t_x509.c:ossl_check_X509_sk_type:
   53|    479|    { \
   54|    479|        return (OPENSSL_STACK *)sk; \
   55|    479|    } \
t_x509.c:ossl_check_X509_freefunc_type:
   65|    479|    { \
   66|    479|        return (OPENSSL_sk_freefunc)fr; \
   67|    479|    }
v3_ac_tgt.c:ossl_check_const_OSSL_TARGETS_sk_type:
   49|    158|    { \
   50|    158|        return (const OPENSSL_STACK *)sk; \
   51|    158|    } \
v3_ac_tgt.c:ossl_check_const_OSSL_TARGET_sk_type:
   49|     56|    { \
   50|     56|        return (const OPENSSL_STACK *)sk; \
   51|     56|    } \
v3_cpols.c:ossl_check_const_POLICYINFO_sk_type:
   49|    261|    { \
   50|    261|        return (const OPENSSL_STACK *)sk; \
   51|    261|    } \
v3_crld.c:ossl_check_const_DIST_POINT_sk_type:
   49|  2.48k|    { \
   50|  2.48k|        return (const OPENSSL_STACK *)sk; \
   51|  2.48k|    } \
v3_crld.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   49|  2.98k|    { \
   50|  2.98k|        return (const OPENSSL_STACK *)sk; \
   51|  2.98k|    } \
v3_extku.c:ossl_check_const_ASN1_OBJECT_sk_type:
   49|    989|    { \
   50|    989|        return (const OPENSSL_STACK *)sk; \
   51|    989|    } \
v3_lib.c:ossl_check_const_X509_EXTENSION_sk_type:
   49|   211k|    { \
   50|   211k|        return (const OPENSSL_STACK *)sk; \
   51|   211k|    } \
v3_ncons.c:ossl_check_const_GENERAL_SUBTREE_sk_type:
   49|  6.47k|    { \
   50|  6.47k|        return (const OPENSSL_STACK *)sk; \
   51|  6.47k|    } \
v3_pmaps.c:ossl_check_const_POLICY_MAPPING_sk_type:
   49|    282|    { \
   50|    282|        return (const OPENSSL_STACK *)sk; \
   51|    282|    } \
v3_prn.c:ossl_check_const_CONF_VALUE_sk_type:
   49|  16.1k|    { \
   50|  16.1k|        return (const OPENSSL_STACK *)sk; \
   51|  16.1k|    } \
v3_prn.c:ossl_check_CONF_VALUE_sk_type:
   53|  31.7k|    { \
   54|  31.7k|        return (OPENSSL_STACK *)sk; \
   55|  31.7k|    } \
v3_prn.c:ossl_check_CONF_VALUE_freefunc_type:
   65|  31.7k|    { \
   66|  31.7k|        return (OPENSSL_sk_freefunc)fr; \
   67|  31.7k|    }
v3_rolespec.c:ossl_check_const_OSSL_ROLE_SPEC_CERT_ID_sk_type:
   49|     40|    { \
   50|     40|        return (const OPENSSL_STACK *)sk; \
   51|     40|    } \
v3_san.c:ossl_check_const_GENERAL_NAME_sk_type:
   49|  8.43k|    { \
   50|  8.43k|        return (const OPENSSL_STACK *)sk; \
   51|  8.43k|    } \
v3_san.c:ossl_check_CONF_VALUE_sk_type:
   53|    128|    { \
   54|    128|        return (OPENSSL_STACK *)sk; \
   55|    128|    } \
v3_san.c:ossl_check_CONF_VALUE_freefunc_type:
   65|    128|    { \
   66|    128|        return (OPENSSL_sk_freefunc)fr; \
   67|    128|    }
v3_sda.c:ossl_check_const_X509_ATTRIBUTE_sk_type:
   49|     11|    { \
   50|     11|        return (const OPENSSL_STACK *)sk; \
   51|     11|    } \
v3_timespec.c:ossl_check_const_OSSL_TIME_PERIOD_sk_type:
   49|  1.50k|    { \
   50|  1.50k|        return (const OPENSSL_STACK *)sk; \
   51|  1.50k|    } \
v3_usernotice.c:ossl_check_const_USERNOTICE_sk_type:
   49|     26|    { \
   50|     26|        return (const OPENSSL_STACK *)sk; \
   51|     26|    } \
v3_utl.c:ossl_check_CONF_VALUE_type:
   45|  5.07k|    { \
   46|  5.07k|        return ptr; \
   47|  5.07k|    } \
v3_utl.c:ossl_check_CONF_VALUE_sk_type:
   53|  5.13k|    { \
   54|  5.13k|        return (OPENSSL_STACK *)sk; \
   55|  5.13k|    } \
v3_utl.c:ossl_check_const_GENERAL_NAME_sk_type:
   49|  3.43k|    { \
   50|  3.43k|        return (const OPENSSL_STACK *)sk; \
   51|  3.43k|    } \
x509_obj.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   49|  17.9k|    { \
   50|  17.9k|        return (const OPENSSL_STACK *)sk; \
   51|  17.9k|    } \
x509_v3.c:ossl_check_const_X509_EXTENSION_sk_type:
   49|  86.2k|    { \
   50|  86.2k|        return (const OPENSSL_STACK *)sk; \
   51|  86.2k|    } \
x509name.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   49|  21.5k|    { \
   50|  21.5k|        return (const OPENSSL_STACK *)sk; \
   51|  21.5k|    } \
x509name.c:ossl_check_X509_NAME_ENTRY_sk_type:
   53|  1.37k|    { \
   54|  1.37k|        return (OPENSSL_STACK *)sk; \
   55|  1.37k|    } \
x509name.c:ossl_check_X509_NAME_ENTRY_type:
   45|  1.37k|    { \
   46|  1.37k|        return ptr; \
   47|  1.37k|    } \
x_crl.c:ossl_check_GENERAL_NAMES_sk_type:
   53|  33.8k|    { \
   54|  33.8k|        return (OPENSSL_STACK *)sk; \
   55|  33.8k|    } \
x_crl.c:ossl_check_GENERAL_NAMES_freefunc_type:
   65|  33.3k|    { \
   66|  33.3k|        return (OPENSSL_sk_freefunc)fr; \
   67|  33.3k|    }
x_crl.c:ossl_check_const_X509_EXTENSION_sk_type:
   49|  82.3k|    { \
   50|  82.3k|        return (const OPENSSL_STACK *)sk; \
   51|  82.3k|    } \
x_crl.c:ossl_check_const_X509_REVOKED_sk_type:
   49|  45.7k|    { \
   50|  45.7k|        return (const OPENSSL_STACK *)sk; \
   51|  45.7k|    } \
x_crl.c:ossl_check_GENERAL_NAMES_type:
   45|    504|    { \
   46|    504|        return ptr; \
   47|    504|    } \
x_crl.c:ossl_check_X509_REVOKED_compfunc_type:
   57|  1.83k|    { \
   58|  1.83k|        return (OPENSSL_sk_compfunc)cmp; \
   59|  1.83k|    } \
x_crl.c:ossl_check_X509_REVOKED_sk_type:
   53|  1.83k|    { \
   54|  1.83k|        return (OPENSSL_STACK *)sk; \
   55|  1.83k|    } \
x_name.c:ossl_check_X509_NAME_ENTRY_sk_type:
   53|  1.59M|    { \
   54|  1.59M|        return (OPENSSL_STACK *)sk; \
   55|  1.59M|    } \
x_name.c:ossl_check_X509_NAME_ENTRY_freefunc_type:
   65|   316k|    { \
   66|   316k|        return (OPENSSL_sk_freefunc)fr; \
   67|   316k|    }
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_num:
   80|   690k|    { \
   81|   690k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|   690k|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_value:
   84|   620k|    { \
   85|   620k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|   620k|    } \
x_name.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   49|  1.60M|    { \
   50|  1.60M|        return (const OPENSSL_STACK *)sk; \
   51|  1.60M|    } \
x_name.c:ossl_check_X509_NAME_ENTRY_type:
   45|   646k|    { \
   46|   646k|        return ptr; \
   47|   646k|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_new_null:
   96|  6.29k|    { \
   97|  6.29k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|  6.29k|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_push:
  129|  71.1k|    { \
  130|  71.1k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|  71.1k|    } \
x_name.c:ossl_check_const_ASN1_VALUE_sk_type:
   49|   246k|    { \
   50|   246k|        return (const OPENSSL_STACK *)sk; \
   51|   246k|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_pop_free:
  145|  76.9k|    { \
  146|  76.9k|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|  76.9k|        \
  148|  76.9k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|  76.9k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|  76.9k|        \
  151|  76.9k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|  76.9k|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_freefunc_thunk:
   75|   691k|    { \
   76|   691k|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|   691k|        freefunc((t3 *)ptr);\
   78|   691k|    } \
x_x509.c:ossl_check_IPAddressFamily_sk_type:
   53|  74.4k|    { \
   54|  74.4k|        return (OPENSSL_STACK *)sk; \
   55|  74.4k|    } \
x_x509.c:ossl_check_IPAddressFamily_freefunc_type:
   65|  74.4k|    { \
   66|  74.4k|        return (OPENSSL_sk_freefunc)fr; \
   67|  74.4k|    }
encode_key2text.c:sk_BIGNUM_const_new_null:
   96|    420|    { \
   97|    420|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|    420|    } \
encode_key2text.c:sk_BIGNUM_const_num:
   80|  1.58k|    { \
   81|  1.58k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  1.58k|    } \
encode_key2text.c:sk_BIGNUM_const_value:
   84|  4.60k|    { \
   85|  4.60k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  4.60k|    } \
encode_key2text.c:sk_BIGNUM_const_free:
  112|    420|    { \
  113|    420|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|    420|    } \
ct_x509v3.c:ossl_check_const_SCT_sk_type:
   49|     11|    { \
   50|     11|        return (const OPENSSL_STACK *)sk; \
   51|     11|    } \
evp_pbe.c:sk_EVP_PBE_CTL_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
comp_methods.c:ossl_check_SSL_COMP_compfunc_type:
   57|      4|    { \
   58|      4|        return (OPENSSL_sk_compfunc)cmp; \
   59|      4|    } \
comp_methods.c:ossl_check_SSL_COMP_sk_type:
   53|      2|    { \
   54|      2|        return (OPENSSL_STACK *)sk; \
   55|      2|    } \
comp_methods.c:ossl_check_SSL_COMP_freefunc_type:
   65|      2|    { \
   66|      2|        return (OPENSSL_sk_freefunc)fr; \
   67|      2|    }
v3_aaa.c:ossl_check_const_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type:
   49|     12|    { \
   50|     12|        return (const OPENSSL_STACK *)sk; \
   51|     12|    } \
v3_admis.c:ossl_check_const_ADMISSIONS_sk_type:
   49|     12|    { \
   50|     12|        return (const OPENSSL_STACK *)sk; \
   51|     12|    } \
v3_admis.c:ossl_check_const_PROFESSION_INFO_sk_type:
   49|      1|    { \
   50|      1|        return (const OPENSSL_STACK *)sk; \
   51|      1|    } \
v3_akid.c:ossl_check_CONF_VALUE_sk_type:
   53|     11|    { \
   54|     11|        return (OPENSSL_STACK *)sk; \
   55|     11|    } \
v3_akid.c:ossl_check_CONF_VALUE_freefunc_type:
   65|     11|    { \
   66|     11|        return (OPENSSL_sk_freefunc)fr; \
   67|     11|    }
v3_attrmap.c:ossl_check_const_OSSL_ATTRIBUTE_MAPPING_sk_type:
   49|     11|    { \
   50|     11|        return (const OPENSSL_STACK *)sk; \
   51|     11|    } \
v3_authattid.c:ossl_check_const_OSSL_ISSUER_SERIAL_sk_type:
   49|     11|    { \
   50|     11|        return (const OPENSSL_STACK *)sk; \
   51|     11|    } \
ct_prn.c:ossl_check_const_SCT_sk_type:
   49|     11|    { \
   50|     11|        return (const OPENSSL_STACK *)sk; \
   51|     11|    } \

ossl_prov_bio_from_dispatch:
   27|      1|{
   28|     53|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (28:12): [True: 52, False: 1]
  ------------------
   29|     52|        switch (fns->function_id) {
  ------------------
  |  Branch (29:17): [True: 42, False: 10]
  ------------------
   30|      1|        case OSSL_FUNC_BIO_NEW_FILE:
  ------------------
  |  |  156|      1|#define OSSL_FUNC_BIO_NEW_FILE                40
  ------------------
  |  Branch (30:9): [True: 1, False: 51]
  ------------------
   31|      1|            if (c_bio_new_file == NULL)
  ------------------
  |  Branch (31:17): [True: 1, False: 0]
  ------------------
   32|      1|                c_bio_new_file = OSSL_FUNC_BIO_new_file(fns);
   33|      1|            break;
   34|      1|        case OSSL_FUNC_BIO_NEW_MEMBUF:
  ------------------
  |  |  157|      1|#define OSSL_FUNC_BIO_NEW_MEMBUF              41
  ------------------
  |  Branch (34:9): [True: 1, False: 51]
  ------------------
   35|      1|            if (c_bio_new_membuf == NULL)
  ------------------
  |  Branch (35:17): [True: 1, False: 0]
  ------------------
   36|      1|                c_bio_new_membuf = OSSL_FUNC_BIO_new_membuf(fns);
   37|      1|            break;
   38|      1|        case OSSL_FUNC_BIO_READ_EX:
  ------------------
  |  |  158|      1|#define OSSL_FUNC_BIO_READ_EX                 42
  ------------------
  |  Branch (38:9): [True: 1, False: 51]
  ------------------
   39|      1|            if (c_bio_read_ex == NULL)
  ------------------
  |  Branch (39:17): [True: 1, False: 0]
  ------------------
   40|      1|                c_bio_read_ex = OSSL_FUNC_BIO_read_ex(fns);
   41|      1|            break;
   42|      1|        case OSSL_FUNC_BIO_WRITE_EX:
  ------------------
  |  |  159|      1|#define OSSL_FUNC_BIO_WRITE_EX                43
  ------------------
  |  Branch (42:9): [True: 1, False: 51]
  ------------------
   43|      1|            if (c_bio_write_ex == NULL)
  ------------------
  |  Branch (43:17): [True: 1, False: 0]
  ------------------
   44|      1|                c_bio_write_ex = OSSL_FUNC_BIO_write_ex(fns);
   45|      1|            break;
   46|      1|        case OSSL_FUNC_BIO_GETS:
  ------------------
  |  |  165|      1|#define OSSL_FUNC_BIO_GETS                    49
  ------------------
  |  Branch (46:9): [True: 1, False: 51]
  ------------------
   47|      1|            if (c_bio_gets == NULL)
  ------------------
  |  Branch (47:17): [True: 1, False: 0]
  ------------------
   48|      1|                c_bio_gets = OSSL_FUNC_BIO_gets(fns);
   49|      1|            break;
   50|      1|        case OSSL_FUNC_BIO_PUTS:
  ------------------
  |  |  164|      1|#define OSSL_FUNC_BIO_PUTS                    48
  ------------------
  |  Branch (50:9): [True: 1, False: 51]
  ------------------
   51|      1|            if (c_bio_puts == NULL)
  ------------------
  |  Branch (51:17): [True: 1, False: 0]
  ------------------
   52|      1|                c_bio_puts = OSSL_FUNC_BIO_puts(fns);
   53|      1|            break;
   54|      1|        case OSSL_FUNC_BIO_CTRL:
  ------------------
  |  |  166|      1|#define OSSL_FUNC_BIO_CTRL                    50
  ------------------
  |  Branch (54:9): [True: 1, False: 51]
  ------------------
   55|      1|            if (c_bio_ctrl == NULL)
  ------------------
  |  Branch (55:17): [True: 1, False: 0]
  ------------------
   56|      1|                c_bio_ctrl = OSSL_FUNC_BIO_ctrl(fns);
   57|      1|            break;
   58|      1|        case OSSL_FUNC_BIO_UP_REF:
  ------------------
  |  |  160|      1|#define OSSL_FUNC_BIO_UP_REF                  44
  ------------------
  |  Branch (58:9): [True: 1, False: 51]
  ------------------
   59|      1|            if (c_bio_up_ref == NULL)
  ------------------
  |  Branch (59:17): [True: 1, False: 0]
  ------------------
   60|      1|                c_bio_up_ref = OSSL_FUNC_BIO_up_ref(fns);
   61|      1|            break;
   62|      1|        case OSSL_FUNC_BIO_FREE:
  ------------------
  |  |  161|      1|#define OSSL_FUNC_BIO_FREE                    45
  ------------------
  |  Branch (62:9): [True: 1, False: 51]
  ------------------
   63|      1|            if (c_bio_free == NULL)
  ------------------
  |  Branch (63:17): [True: 1, False: 0]
  ------------------
   64|      1|                c_bio_free = OSSL_FUNC_BIO_free(fns);
   65|      1|            break;
   66|      1|        case OSSL_FUNC_BIO_VPRINTF:
  ------------------
  |  |  162|      1|#define OSSL_FUNC_BIO_VPRINTF                 46
  ------------------
  |  Branch (66:9): [True: 1, False: 51]
  ------------------
   67|      1|            if (c_bio_vprintf == NULL)
  ------------------
  |  Branch (67:17): [True: 1, False: 0]
  ------------------
   68|      1|                c_bio_vprintf = OSSL_FUNC_BIO_vprintf(fns);
   69|      1|            break;
   70|     52|        }
   71|     52|    }
   72|       |
   73|      1|    return 1;
   74|      1|}
ossl_prov_bio_read_ex:
   92|   193M|{
   93|   193M|    if (c_bio_read_ex == NULL)
  ------------------
  |  Branch (93:9): [True: 0, False: 193M]
  ------------------
   94|      0|        return 0;
   95|   193M|    return c_bio_read_ex(bio, data, data_len, bytes_read);
   96|   193M|}
ossl_prov_bio_write_ex:
  100|   630k|{
  101|   630k|    if (c_bio_write_ex == NULL)
  ------------------
  |  Branch (101:9): [True: 0, False: 630k]
  ------------------
  102|      0|        return 0;
  103|   630k|    return c_bio_write_ex(bio, data, data_len, written);
  104|   630k|}
ossl_prov_bio_up_ref:
  128|   469k|{
  129|   469k|    if (c_bio_up_ref == NULL)
  ------------------
  |  Branch (129:9): [True: 0, False: 469k]
  ------------------
  130|      0|        return 0;
  131|   469k|    return c_bio_up_ref(bio);
  132|   469k|}
ossl_prov_bio_free:
  135|   469k|{
  136|   469k|    if (c_bio_free == NULL)
  ------------------
  |  Branch (136:9): [True: 0, False: 469k]
  ------------------
  137|      0|        return 0;
  138|   469k|    return c_bio_free(bio);
  139|   469k|}
ossl_bio_prov_init_bio_method:
  207|      1|{
  208|      1|    BIO_METHOD *corebiometh = NULL;
  209|       |
  210|      1|    corebiometh = BIO_meth_new(BIO_TYPE_CORE_TO_PROV, "BIO to Core filter");
  ------------------
  |  |   69|      1|# define BIO_TYPE_CORE_TO_PROV   (25|BIO_TYPE_SOURCE_SINK)
  |  |  ------------------
  |  |  |  |   41|      1|# define BIO_TYPE_SOURCE_SINK    0x0400
  |  |  ------------------
  ------------------
  211|      1|    if (corebiometh == NULL
  ------------------
  |  Branch (211:9): [True: 0, False: 1]
  ------------------
  212|      1|            || !BIO_meth_set_write_ex(corebiometh, bio_core_write_ex)
  ------------------
  |  Branch (212:16): [True: 0, False: 1]
  ------------------
  213|      1|            || !BIO_meth_set_read_ex(corebiometh, bio_core_read_ex)
  ------------------
  |  Branch (213:16): [True: 0, False: 1]
  ------------------
  214|      1|            || !BIO_meth_set_puts(corebiometh, bio_core_puts)
  ------------------
  |  Branch (214:16): [True: 0, False: 1]
  ------------------
  215|      1|            || !BIO_meth_set_gets(corebiometh, bio_core_gets)
  ------------------
  |  Branch (215:16): [True: 0, False: 1]
  ------------------
  216|      1|            || !BIO_meth_set_ctrl(corebiometh, bio_core_ctrl)
  ------------------
  |  Branch (216:16): [True: 0, False: 1]
  ------------------
  217|      1|            || !BIO_meth_set_create(corebiometh, bio_core_new)
  ------------------
  |  Branch (217:16): [True: 0, False: 1]
  ------------------
  218|      1|            || !BIO_meth_set_destroy(corebiometh, bio_core_free)) {
  ------------------
  |  Branch (218:16): [True: 0, False: 1]
  ------------------
  219|      0|        BIO_meth_free(corebiometh);
  220|      0|        return NULL;
  221|      0|    }
  222|       |
  223|      1|    return corebiometh;
  224|      1|}
ossl_bio_new_from_core_bio:
  227|   469k|{
  228|   469k|    BIO *outbio;
  229|   469k|    BIO_METHOD *corebiometh = ossl_prov_ctx_get0_core_bio_method(provctx);
  230|       |
  231|   469k|    if (corebiometh == NULL)
  ------------------
  |  Branch (231:9): [True: 0, False: 469k]
  ------------------
  232|      0|        return NULL;
  233|       |
  234|   469k|    if ((outbio = BIO_new(corebiometh)) == NULL)
  ------------------
  |  Branch (234:9): [True: 0, False: 469k]
  ------------------
  235|      0|        return NULL;
  236|   469k|    if (!ossl_prov_bio_up_ref(corebio)) {
  ------------------
  |  Branch (236:9): [True: 0, False: 469k]
  ------------------
  237|      0|        BIO_free(outbio);
  238|      0|        return NULL;
  239|      0|    }
  240|   469k|    BIO_set_data(outbio, corebio);
  241|   469k|    return outbio;
  242|   469k|}
bio_prov.c:bio_core_write_ex:
  172|   630k|{
  173|   630k|    return ossl_prov_bio_write_ex(BIO_get_data(bio), data, data_len, written);
  174|   630k|}
bio_prov.c:bio_core_read_ex:
  166|   193M|{
  167|   193M|    return ossl_prov_bio_read_ex(BIO_get_data(bio), data, data_len, bytes_read);
  168|   193M|}
bio_prov.c:bio_core_new:
  192|   469k|{
  193|   469k|    BIO_set_init(bio, 1);
  194|       |
  195|   469k|    return 1;
  196|   469k|}
bio_prov.c:bio_core_free:
  199|   469k|{
  200|   469k|    BIO_set_init(bio, 0);
  201|   469k|    ossl_prov_bio_free(BIO_get_data(bio));
  202|       |
  203|   469k|    return 1;
  204|   469k|}

ossl_DER_w_RSASSA_PSS_params:
  285|      4|{
  286|      4|    int hashalg_nid, default_hashalg_nid;
  287|      4|    int saltlen, default_saltlen;
  288|      4|    int trailerfield, default_trailerfield;
  289|      4|    const unsigned char *hashalg = NULL;
  290|      4|    size_t hashalg_sz = 0;
  291|       |
  292|       |    /*
  293|       |     * For an unrestricted key, this function should not have been called;
  294|       |     * the caller must be in control, because unrestricted keys are permitted
  295|       |     * in some situations (when encoding the public key in a SubjectKeyInfo,
  296|       |     * for example) while not in others, and this function doesn't know the
  297|       |     * intent.  Therefore, we assert that here, the PSS parameters must show
  298|       |     * that the key is restricted.
  299|       |     */
  300|      4|    if (!ossl_assert(pss != NULL
  ------------------
  |  |   52|      8|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 4, False: 0]
  |  |  |  Branch (52:43): [True: 4, False: 0]
  |  |  ------------------
  |  |   53|      4|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (300:9): [True: 0, False: 4]
  ------------------
  301|      4|                     && !ossl_rsa_pss_params_30_is_unrestricted(pss)))
  302|      0|        return 0;
  303|       |
  304|      4|    hashalg_nid = ossl_rsa_pss_params_30_hashalg(pss);
  305|      4|    saltlen = ossl_rsa_pss_params_30_saltlen(pss);
  306|      4|    trailerfield = ossl_rsa_pss_params_30_trailerfield(pss);
  307|       |
  308|      4|    if (saltlen < 0) {
  ------------------
  |  Branch (308:9): [True: 0, False: 4]
  ------------------
  309|      0|        ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_SALT_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  310|      0|        return 0;
  311|      0|    }
  312|      4|    if (trailerfield != 1) {
  ------------------
  |  Branch (312:9): [True: 0, False: 4]
  ------------------
  313|      0|        ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_TRAILER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  314|      0|        return 0;
  315|      0|    }
  316|       |
  317|       |    /* Getting default values */
  318|      4|    default_hashalg_nid = ossl_rsa_pss_params_30_hashalg(NULL);
  319|      4|    default_saltlen = ossl_rsa_pss_params_30_saltlen(NULL);
  320|      4|    default_trailerfield = ossl_rsa_pss_params_30_trailerfield(NULL);
  321|       |
  322|       |    /*
  323|       |     * From https://tools.ietf.org/html/rfc8017#appendix-A.2.1:
  324|       |     *
  325|       |     * OAEP-PSSDigestAlgorithms    ALGORITHM-IDENTIFIER ::= {
  326|       |     *     { OID id-sha1       PARAMETERS NULL }|
  327|       |     *     { OID id-sha224     PARAMETERS NULL }|
  328|       |     *     { OID id-sha256     PARAMETERS NULL }|
  329|       |     *     { OID id-sha384     PARAMETERS NULL }|
  330|       |     *     { OID id-sha512     PARAMETERS NULL }|
  331|       |     *     { OID id-sha512-224 PARAMETERS NULL }|
  332|       |     *     { OID id-sha512-256 PARAMETERS NULL },
  333|       |     *     ...  -- Allows for future expansion --
  334|       |     * }
  335|       |     */
  336|      4|    switch (hashalg_nid) {
  337|      4|        OAEP_PSS_MD_CASE(sha1, hashalg);
  ------------------
  |  |  278|      4|    case NID_##name:                                                    \
  |  |  ------------------
  |  |  |  Branch (278:5): [True: 4, False: 0]
  |  |  ------------------
  |  |  279|      4|        var = ossl_der_aid_##name##Identifier;                          \
  |  |  280|      4|        var##_sz = sizeof(ossl_der_aid_##name##Identifier);             \
  |  |  281|      4|        break;
  ------------------
  338|      0|        OAEP_PSS_MD_CASE(sha224, hashalg);
  ------------------
  |  |  278|      0|    case NID_##name:                                                    \
  |  |  ------------------
  |  |  |  Branch (278:5): [True: 0, False: 4]
  |  |  ------------------
  |  |  279|      0|        var = ossl_der_aid_##name##Identifier;                          \
  |  |  280|      0|        var##_sz = sizeof(ossl_der_aid_##name##Identifier);             \
  |  |  281|      0|        break;
  ------------------
  339|      0|        OAEP_PSS_MD_CASE(sha256, hashalg);
  ------------------
  |  |  278|      0|    case NID_##name:                                                    \
  |  |  ------------------
  |  |  |  Branch (278:5): [True: 0, False: 4]
  |  |  ------------------
  |  |  279|      0|        var = ossl_der_aid_##name##Identifier;                          \
  |  |  280|      0|        var##_sz = sizeof(ossl_der_aid_##name##Identifier);             \
  |  |  281|      0|        break;
  ------------------
  340|      0|        OAEP_PSS_MD_CASE(sha384, hashalg);
  ------------------
  |  |  278|      0|    case NID_##name:                                                    \
  |  |  ------------------
  |  |  |  Branch (278:5): [True: 0, False: 4]
  |  |  ------------------
  |  |  279|      0|        var = ossl_der_aid_##name##Identifier;                          \
  |  |  280|      0|        var##_sz = sizeof(ossl_der_aid_##name##Identifier);             \
  |  |  281|      0|        break;
  ------------------
  341|      0|        OAEP_PSS_MD_CASE(sha512, hashalg);
  ------------------
  |  |  278|      0|    case NID_##name:                                                    \
  |  |  ------------------
  |  |  |  Branch (278:5): [True: 0, False: 4]
  |  |  ------------------
  |  |  279|      0|        var = ossl_der_aid_##name##Identifier;                          \
  |  |  280|      0|        var##_sz = sizeof(ossl_der_aid_##name##Identifier);             \
  |  |  281|      0|        break;
  ------------------
  342|      0|        OAEP_PSS_MD_CASE(sha512_224, hashalg);
  ------------------
  |  |  278|      0|    case NID_##name:                                                    \
  |  |  ------------------
  |  |  |  Branch (278:5): [True: 0, False: 4]
  |  |  ------------------
  |  |  279|      0|        var = ossl_der_aid_##name##Identifier;                          \
  |  |  280|      0|        var##_sz = sizeof(ossl_der_aid_##name##Identifier);             \
  |  |  281|      0|        break;
  ------------------
  343|      0|        OAEP_PSS_MD_CASE(sha512_256, hashalg);
  ------------------
  |  |  278|      0|    case NID_##name:                                                    \
  |  |  ------------------
  |  |  |  Branch (278:5): [True: 0, False: 4]
  |  |  ------------------
  |  |  279|      0|        var = ossl_der_aid_##name##Identifier;                          \
  |  |  280|      0|        var##_sz = sizeof(ossl_der_aid_##name##Identifier);             \
  |  |  281|      0|        break;
  ------------------
  344|      0|    default:
  ------------------
  |  Branch (344:5): [True: 0, False: 4]
  ------------------
  345|      0|        return 0;
  346|      4|    }
  347|       |
  348|      4|    return ossl_DER_w_begin_sequence(pkt, tag)
  ------------------
  |  Branch (348:12): [True: 4, False: 0]
  ------------------
  349|      4|        && (trailerfield == default_trailerfield
  ------------------
  |  Branch (349:13): [True: 4, False: 0]
  ------------------
  350|      4|            || ossl_DER_w_uint32(pkt, 3, (uint32_t)trailerfield))
  ------------------
  |  Branch (350:16): [True: 0, False: 0]
  ------------------
  351|      4|        && (saltlen == default_saltlen || ossl_DER_w_uint32(pkt, 2, (uint32_t)saltlen))
  ------------------
  |  Branch (351:13): [True: 4, False: 0]
  |  Branch (351:43): [True: 0, False: 0]
  ------------------
  352|      4|        && DER_w_MaskGenAlgorithm(pkt, 1, pss)
  ------------------
  |  Branch (352:12): [True: 4, False: 0]
  ------------------
  353|      4|        && (hashalg_nid == default_hashalg_nid
  ------------------
  |  Branch (353:13): [True: 4, False: 0]
  ------------------
  354|      4|            || ossl_DER_w_precompiled(pkt, 0, hashalg, hashalg_sz))
  ------------------
  |  Branch (354:16): [True: 0, False: 0]
  ------------------
  355|      4|        && ossl_DER_w_end_sequence(pkt, tag);
  ------------------
  |  Branch (355:12): [True: 4, False: 0]
  ------------------
  356|      4|}
der_rsa_key.c:DER_w_MaskGenAlgorithm:
  249|      4|{
  250|      4|    if (pss != NULL && ossl_rsa_pss_params_30_maskgenalg(pss) == NID_mgf1) {
  ------------------
  |  |  573|      4|#define NID_mgf1                911
  ------------------
  |  Branch (250:9): [True: 4, False: 0]
  |  Branch (250:24): [True: 4, False: 0]
  ------------------
  251|      4|        int maskgenhashalg_nid = ossl_rsa_pss_params_30_maskgenhashalg(pss);
  252|      4|        const unsigned char *maskgenalg = NULL;
  253|      4|        size_t maskgenalg_sz = 0;
  254|       |
  255|      4|        switch (maskgenhashalg_nid) {
  256|      4|        case NID_sha1:
  ------------------
  |  | 2321|      4|#define NID_sha1                64
  ------------------
  |  Branch (256:9): [True: 4, False: 0]
  ------------------
  257|      4|            break;
  258|      0|            MGF1_SHA_CASE(224, maskgenalg);
  ------------------
  |  |  237|      0|    case NID_sha##bits:                                         \
  |  |  ------------------
  |  |  |  Branch (237:5): [True: 0, False: 4]
  |  |  ------------------
  |  |  238|      0|        var = der_aid_mgf1SHA##bits##Identifier;                \
  |  |  239|      0|        var##_sz = sizeof(der_aid_mgf1SHA##bits##Identifier);   \
  |  |  240|      0|        break;
  ------------------
  259|      0|            MGF1_SHA_CASE(256, maskgenalg);
  ------------------
  |  |  237|      0|    case NID_sha##bits:                                         \
  |  |  ------------------
  |  |  |  Branch (237:5): [True: 0, False: 4]
  |  |  ------------------
  |  |  238|      0|        var = der_aid_mgf1SHA##bits##Identifier;                \
  |  |  239|      0|        var##_sz = sizeof(der_aid_mgf1SHA##bits##Identifier);   \
  |  |  240|      0|        break;
  ------------------
  260|      0|            MGF1_SHA_CASE(384, maskgenalg);
  ------------------
  |  |  237|      0|    case NID_sha##bits:                                         \
  |  |  ------------------
  |  |  |  Branch (237:5): [True: 0, False: 4]
  |  |  ------------------
  |  |  238|      0|        var = der_aid_mgf1SHA##bits##Identifier;                \
  |  |  239|      0|        var##_sz = sizeof(der_aid_mgf1SHA##bits##Identifier);   \
  |  |  240|      0|        break;
  ------------------
  261|      0|            MGF1_SHA_CASE(512, maskgenalg);
  ------------------
  |  |  237|      0|    case NID_sha##bits:                                         \
  |  |  ------------------
  |  |  |  Branch (237:5): [True: 0, False: 4]
  |  |  ------------------
  |  |  238|      0|        var = der_aid_mgf1SHA##bits##Identifier;                \
  |  |  239|      0|        var##_sz = sizeof(der_aid_mgf1SHA##bits##Identifier);   \
  |  |  240|      0|        break;
  ------------------
  262|      0|            MGF1_SHA_CASE(512_224, maskgenalg);
  ------------------
  |  |  237|      0|    case NID_sha##bits:                                         \
  |  |  ------------------
  |  |  |  Branch (237:5): [True: 0, False: 4]
  |  |  ------------------
  |  |  238|      0|        var = der_aid_mgf1SHA##bits##Identifier;                \
  |  |  239|      0|        var##_sz = sizeof(der_aid_mgf1SHA##bits##Identifier);   \
  |  |  240|      0|        break;
  ------------------
  263|      0|            MGF1_SHA_CASE(512_256, maskgenalg);
  ------------------
  |  |  237|      0|    case NID_sha##bits:                                         \
  |  |  ------------------
  |  |  |  Branch (237:5): [True: 0, False: 4]
  |  |  ------------------
  |  |  238|      0|        var = der_aid_mgf1SHA##bits##Identifier;                \
  |  |  239|      0|        var##_sz = sizeof(der_aid_mgf1SHA##bits##Identifier);   \
  |  |  240|      0|        break;
  ------------------
  264|      0|        default:
  ------------------
  |  Branch (264:9): [True: 0, False: 4]
  ------------------
  265|      0|            return 0;
  266|      4|        }
  267|       |
  268|       |        /* If there is none (or it was the default), we write nothing */
  269|      4|        if (maskgenalg == NULL)
  ------------------
  |  Branch (269:13): [True: 4, False: 0]
  ------------------
  270|      4|            return 1;
  271|       |
  272|      0|        return ossl_DER_w_precompiled(pkt, tag, maskgenalg, maskgenalg_sz);
  273|      4|    }
  274|      0|    return 0;
  275|      4|}

sha2_prov.c:ossl_param_is_empty:
   30|  6.59k|{
   31|  6.59k|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 6.59k, False: 0]
  |  Branch (31:30): [True: 0, False: 0]
  ------------------
   32|  6.59k|}

ossl_prov_ctx_new:
   16|      1|{
   17|      1|    return OPENSSL_zalloc(sizeof(PROV_CTX));
  ------------------
  |  |  104|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   18|      1|}
ossl_prov_ctx_free:
   21|      1|{
   22|      1|    OPENSSL_free(ctx);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   23|      1|}
ossl_prov_ctx_set0_libctx:
   26|      1|{
   27|      1|    if (ctx != NULL)
  ------------------
  |  Branch (27:9): [True: 1, False: 0]
  ------------------
   28|      1|        ctx->libctx = libctx;
   29|      1|}
ossl_prov_ctx_set0_handle:
   32|      1|{
   33|      1|    if (ctx != NULL)
  ------------------
  |  Branch (33:9): [True: 1, False: 0]
  ------------------
   34|      1|        ctx->handle = handle;
   35|      1|}
ossl_prov_ctx_set0_core_bio_method:
   38|      1|{
   39|      1|    if (ctx != NULL)
  ------------------
  |  Branch (39:9): [True: 1, False: 0]
  ------------------
   40|      1|        ctx->corebiometh = corebiometh;
   41|      1|}
ossl_prov_ctx_set0_core_get_params:
   46|      1|{
   47|      1|    if (ctx != NULL)
  ------------------
  |  Branch (47:9): [True: 1, False: 0]
  ------------------
   48|      1|        ctx->core_get_params = c_get_params;
   49|      1|}
ossl_prov_ctx_get0_libctx:
   52|   178k|{
   53|   178k|    if (ctx == NULL)
  ------------------
  |  Branch (53:9): [True: 0, False: 178k]
  ------------------
   54|      0|        return NULL;
   55|   178k|    return ctx->libctx;
   56|   178k|}
ossl_prov_ctx_get0_core_bio_method:
   66|   469k|{
   67|   469k|    if (ctx == NULL)
  ------------------
  |  Branch (67:9): [True: 0, False: 469k]
  ------------------
   68|      0|        return NULL;
   69|   469k|    return ctx->corebiometh;
   70|   469k|}
ossl_prov_ctx_get_param:
   81|      3|{
   82|      3|    char *val = NULL;
   83|      3|    OSSL_PARAM param[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      3|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM param[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      3|    { NULL, 0, NULL, 0, 0 }
  ------------------
   84|       |
   85|      3|    if (ctx == NULL
  ------------------
  |  Branch (85:9): [True: 0, False: 3]
  ------------------
   86|      3|        || ctx->handle == NULL
  ------------------
  |  Branch (86:12): [True: 0, False: 3]
  ------------------
   87|      3|        || ctx->core_get_params == NULL)
  ------------------
  |  Branch (87:12): [True: 0, False: 3]
  ------------------
   88|      0|        return defval;
   89|       |
   90|      3|    param[0].key = (char *) name;
   91|      3|    param[0].data_type = OSSL_PARAM_UTF8_PTR;
  ------------------
  |  |  141|      3|# define OSSL_PARAM_UTF8_PTR             6
  ------------------
   92|      3|    param[0].data = (void *) &val;
   93|      3|    param[0].data_size = sizeof(val);
   94|      3|    param[0].return_size = OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|      3|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
   95|       |
   96|       |    /* Errors are ignored, returning the default value */
   97|      3|    if (ctx->core_get_params(ctx->handle, param)
  ------------------
  |  Branch (97:9): [True: 3, False: 0]
  ------------------
   98|      3|        && OSSL_PARAM_modified(param)
  ------------------
  |  Branch (98:12): [True: 0, False: 3]
  ------------------
   99|      3|        && val != NULL)
  ------------------
  |  Branch (99:12): [True: 0, False: 0]
  ------------------
  100|      0|        return val;
  101|      3|    return defval;
  102|      3|}

ossl_err_load_PROV_strings:
  259|      2|{
  260|      2|#ifndef OPENSSL_NO_ERR
  261|      2|    if (ERR_reason_error_string(PROV_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (261:9): [True: 2, False: 0]
  ------------------
  262|      2|        ERR_load_strings_const(PROV_str_reasons);
  263|      2|#endif
  264|      2|    return 1;
  265|      2|}

ossl_prov_seeding_from_dispatch:
   42|      1|{
   43|     53|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (43:12): [True: 52, False: 1]
  ------------------
   44|       |        /*
   45|       |         * We do not support the scenario of an application linked against
   46|       |         * multiple versions of libcrypto (e.g. one static and one dynamic), but
   47|       |         * sharing a single fips.so. We do a simple sanity check here.
   48|       |         */
   49|     52|#define set_func(c, f) \
   50|     52|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
   51|     52|        switch (fns->function_id) {
  ------------------
  |  Branch (51:17): [True: 44, False: 8]
  ------------------
   52|      1|        case OSSL_FUNC_GET_ENTROPY:
  ------------------
  |  |  201|      1|#define OSSL_FUNC_GET_ENTROPY                101
  ------------------
  |  Branch (52:9): [True: 1, False: 51]
  ------------------
   53|      1|            set_func(c_get_entropy, OSSL_FUNC_get_entropy(fns));
  ------------------
  |  |   50|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [True: 1, False: 0]
  |  |  |  Branch (50:41): [True: 0, False: 0]
  |  |  |  Branch (50:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   54|      1|            break;
   55|      1|        case OSSL_FUNC_GET_USER_ENTROPY:
  ------------------
  |  |  190|      1|#define OSSL_FUNC_GET_USER_ENTROPY            98
  ------------------
  |  Branch (55:9): [True: 1, False: 51]
  ------------------
   56|      1|            set_func(c_get_user_entropy, OSSL_FUNC_get_user_entropy(fns));
  ------------------
  |  |   50|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [True: 1, False: 0]
  |  |  |  Branch (50:41): [True: 0, False: 0]
  |  |  |  Branch (50:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   57|      1|            break;
   58|      1|        case OSSL_FUNC_CLEANUP_ENTROPY:
  ------------------
  |  |  202|      1|#define OSSL_FUNC_CLEANUP_ENTROPY            102
  ------------------
  |  Branch (58:9): [True: 1, False: 51]
  ------------------
   59|      1|            set_func(c_cleanup_entropy, OSSL_FUNC_cleanup_entropy(fns));
  ------------------
  |  |   50|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [True: 1, False: 0]
  |  |  |  Branch (50:41): [True: 0, False: 0]
  |  |  |  Branch (50:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   60|      1|            break;
   61|      1|        case OSSL_FUNC_CLEANUP_USER_ENTROPY:
  ------------------
  |  |  188|      1|#define OSSL_FUNC_CLEANUP_USER_ENTROPY        96
  ------------------
  |  Branch (61:9): [True: 1, False: 51]
  ------------------
   62|      1|            set_func(c_cleanup_user_entropy, OSSL_FUNC_cleanup_user_entropy(fns));
  ------------------
  |  |   50|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [True: 1, False: 0]
  |  |  |  Branch (50:41): [True: 0, False: 0]
  |  |  |  Branch (50:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   63|      1|            break;
   64|      1|        case OSSL_FUNC_GET_NONCE:
  ------------------
  |  |  203|      1|#define OSSL_FUNC_GET_NONCE                  103
  ------------------
  |  Branch (64:9): [True: 1, False: 51]
  ------------------
   65|      1|            set_func(c_get_nonce, OSSL_FUNC_get_nonce(fns));
  ------------------
  |  |   50|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [True: 1, False: 0]
  |  |  |  Branch (50:41): [True: 0, False: 0]
  |  |  |  Branch (50:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   66|      1|            break;
   67|      1|        case OSSL_FUNC_GET_USER_NONCE:
  ------------------
  |  |  191|      1|#define OSSL_FUNC_GET_USER_NONCE              99
  ------------------
  |  Branch (67:9): [True: 1, False: 51]
  ------------------
   68|      1|            set_func(c_get_user_nonce, OSSL_FUNC_get_user_nonce(fns));
  ------------------
  |  |   50|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [True: 1, False: 0]
  |  |  |  Branch (50:41): [True: 0, False: 0]
  |  |  |  Branch (50:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   69|      1|            break;
   70|      1|        case OSSL_FUNC_CLEANUP_NONCE:
  ------------------
  |  |  204|      1|#define OSSL_FUNC_CLEANUP_NONCE              104
  ------------------
  |  Branch (70:9): [True: 1, False: 51]
  ------------------
   71|      1|            set_func(c_cleanup_nonce, OSSL_FUNC_cleanup_nonce(fns));
  ------------------
  |  |   50|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [True: 1, False: 0]
  |  |  |  Branch (50:41): [True: 0, False: 0]
  |  |  |  Branch (50:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   72|      1|            break;
   73|      1|        case OSSL_FUNC_CLEANUP_USER_NONCE:
  ------------------
  |  |  189|      1|#define OSSL_FUNC_CLEANUP_USER_NONCE          97
  ------------------
  |  Branch (73:9): [True: 1, False: 51]
  ------------------
   74|      1|            set_func(c_cleanup_user_nonce, OSSL_FUNC_cleanup_user_nonce(fns));
  ------------------
  |  |   50|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [True: 1, False: 0]
  |  |  |  Branch (50:41): [True: 0, False: 0]
  |  |  |  Branch (50:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   75|      1|            break;
   76|     52|        }
   77|     52|#undef set_func
   78|     52|    }
   79|      1|    return 1;
   80|      1|}

ossl_prov_cache_exported_algorithms:
  349|      1|{
  350|      1|    int i, j;
  351|       |
  352|      1|    if (out[0].algorithm_names == NULL) {
  ------------------
  |  Branch (352:9): [True: 1, False: 0]
  ------------------
  353|    140|        for (i = j = 0; in[i].alg.algorithm_names != NULL; ++i) {
  ------------------
  |  Branch (353:25): [True: 139, False: 1]
  ------------------
  354|    139|            if (in[i].capable == NULL || in[i].capable())
  ------------------
  |  Branch (354:17): [True: 126, False: 13]
  |  Branch (354:42): [True: 4, False: 9]
  ------------------
  355|    130|                out[j++] = in[i].alg;
  356|    139|        }
  357|      1|        out[j++] = in[i].alg;
  358|      1|    }
  359|      1|}

ossl_default_provider_init:
  745|      1|{
  746|      1|    OSSL_FUNC_core_get_libctx_fn *c_get_libctx = NULL;
  747|      1|    BIO_METHOD *corebiometh;
  748|       |
  749|      1|    if (!ossl_prov_bio_from_dispatch(in)
  ------------------
  |  Branch (749:9): [True: 0, False: 1]
  ------------------
  750|      1|            || !ossl_prov_seeding_from_dispatch(in))
  ------------------
  |  Branch (750:16): [True: 0, False: 1]
  ------------------
  751|      0|        return 0;
  752|     53|    for (; in->function_id != 0; in++) {
  ------------------
  |  Branch (752:12): [True: 52, False: 1]
  ------------------
  753|     52|        switch (in->function_id) {
  754|      1|        case OSSL_FUNC_CORE_GETTABLE_PARAMS:
  ------------------
  |  |   71|      1|# define OSSL_FUNC_CORE_GETTABLE_PARAMS        1
  ------------------
  |  Branch (754:9): [True: 1, False: 51]
  ------------------
  755|      1|            c_gettable_params = OSSL_FUNC_core_gettable_params(in);
  756|      1|            break;
  757|      1|        case OSSL_FUNC_CORE_GET_PARAMS:
  ------------------
  |  |   74|      1|# define OSSL_FUNC_CORE_GET_PARAMS             2
  ------------------
  |  Branch (757:9): [True: 1, False: 51]
  ------------------
  758|      1|            c_get_params = OSSL_FUNC_core_get_params(in);
  759|      1|            break;
  760|      1|        case OSSL_FUNC_CORE_GET_LIBCTX:
  ------------------
  |  |   81|      1|# define OSSL_FUNC_CORE_GET_LIBCTX             4
  ------------------
  |  Branch (760:9): [True: 1, False: 51]
  ------------------
  761|      1|            c_get_libctx = OSSL_FUNC_core_get_libctx(in);
  762|      1|            break;
  763|     49|        default:
  ------------------
  |  Branch (763:9): [True: 49, False: 3]
  ------------------
  764|       |            /* Just ignore anything we don't understand */
  765|     49|            break;
  766|     52|        }
  767|     52|    }
  768|       |
  769|      1|    if (c_get_libctx == NULL)
  ------------------
  |  Branch (769:9): [True: 0, False: 1]
  ------------------
  770|      0|        return 0;
  771|       |
  772|       |    /*
  773|       |     * We want to make sure that all calls from this provider that requires
  774|       |     * a library context use the same context as the one used to call our
  775|       |     * functions.  We do that by passing it along in the provider context.
  776|       |     *
  777|       |     * This only works for built-in providers.  Most providers should
  778|       |     * create their own library context.
  779|       |     */
  780|      1|    if ((*provctx = ossl_prov_ctx_new()) == NULL
  ------------------
  |  Branch (780:9): [True: 0, False: 1]
  ------------------
  781|      1|            || (corebiometh = ossl_bio_prov_init_bio_method()) == NULL) {
  ------------------
  |  Branch (781:16): [True: 0, False: 1]
  ------------------
  782|      0|        ossl_prov_ctx_free(*provctx);
  783|      0|        *provctx = NULL;
  784|      0|        return 0;
  785|      0|    }
  786|      1|    ossl_prov_ctx_set0_libctx(*provctx,
  787|      1|                                       (OSSL_LIB_CTX *)c_get_libctx(handle));
  788|      1|    ossl_prov_ctx_set0_handle(*provctx, handle);
  789|      1|    ossl_prov_ctx_set0_core_bio_method(*provctx, corebiometh);
  790|      1|    ossl_prov_ctx_set0_core_get_params(*provctx, c_get_params);
  791|       |
  792|      1|    *out = deflt_dispatch_table;
  793|      1|    ossl_prov_cache_exported_algorithms(deflt_ciphers, exported_ciphers);
  794|       |
  795|      1|    return 1;
  796|      1|}
defltprov.c:deflt_teardown:
  723|      1|{
  724|      1|    BIO_meth_free(ossl_prov_ctx_get0_core_bio_method(provctx));
  725|      1|    ossl_prov_ctx_free(provctx);
  726|      1|}
defltprov.c:deflt_query:
  686|  6.60k|{
  687|  6.60k|    *no_cache = 0;
  688|  6.60k|    switch (operation_id) {
  ------------------
  |  Branch (688:13): [True: 0, False: 6.60k]
  ------------------
  689|      4|    case OSSL_OP_DIGEST:
  ------------------
  |  |  310|      4|# define OSSL_OP_DIGEST                              1
  ------------------
  |  Branch (689:5): [True: 4, False: 6.60k]
  ------------------
  690|      4|        return deflt_digests;
  691|      0|    case OSSL_OP_CIPHER:
  ------------------
  |  |  311|      0|# define OSSL_OP_CIPHER                              2   /* Symmetric Ciphers */
  ------------------
  |  Branch (691:5): [True: 0, False: 6.60k]
  ------------------
  692|      0|        return exported_ciphers;
  693|      1|    case OSSL_OP_MAC:
  ------------------
  |  |  312|      1|# define OSSL_OP_MAC                                 3
  ------------------
  |  Branch (693:5): [True: 1, False: 6.60k]
  ------------------
  694|      1|        return deflt_macs;
  695|      0|    case OSSL_OP_KDF:
  ------------------
  |  |  313|      0|# define OSSL_OP_KDF                                 4
  ------------------
  |  Branch (695:5): [True: 0, False: 6.60k]
  ------------------
  696|      0|        return deflt_kdfs;
  697|      2|    case OSSL_OP_RAND:
  ------------------
  |  |  314|      2|# define OSSL_OP_RAND                                5
  ------------------
  |  Branch (697:5): [True: 2, False: 6.60k]
  ------------------
  698|      2|        return deflt_rands;
  699|    223|    case OSSL_OP_KEYMGMT:
  ------------------
  |  |  315|    223|# define OSSL_OP_KEYMGMT                            10
  ------------------
  |  Branch (699:5): [True: 223, False: 6.38k]
  ------------------
  700|    223|        return deflt_keymgmt;
  701|      0|    case OSSL_OP_KEYEXCH:
  ------------------
  |  |  316|      0|# define OSSL_OP_KEYEXCH                            11
  ------------------
  |  Branch (701:5): [True: 0, False: 6.60k]
  ------------------
  702|      0|        return deflt_keyexch;
  703|      0|    case OSSL_OP_SIGNATURE:
  ------------------
  |  |  317|      0|# define OSSL_OP_SIGNATURE                          12
  ------------------
  |  Branch (703:5): [True: 0, False: 6.60k]
  ------------------
  704|      0|        return deflt_signature;
  705|      0|    case OSSL_OP_ASYM_CIPHER:
  ------------------
  |  |  318|      0|# define OSSL_OP_ASYM_CIPHER                        13
  ------------------
  |  Branch (705:5): [True: 0, False: 6.60k]
  ------------------
  706|      0|        return deflt_asym_cipher;
  707|      0|    case OSSL_OP_KEM:
  ------------------
  |  |  319|      0|# define OSSL_OP_KEM                                14
  ------------------
  |  Branch (707:5): [True: 0, False: 6.60k]
  ------------------
  708|      0|        return deflt_asym_kem;
  709|  6.10k|    case OSSL_OP_ENCODER:
  ------------------
  |  |  322|  6.10k|# define OSSL_OP_ENCODER                            20
  ------------------
  |  Branch (709:5): [True: 6.10k, False: 498]
  ------------------
  710|  6.10k|        return deflt_encoder;
  711|    268|    case OSSL_OP_DECODER:
  ------------------
  |  |  323|    268|# define OSSL_OP_DECODER                            21
  ------------------
  |  Branch (711:5): [True: 268, False: 6.33k]
  ------------------
  712|    268|        return deflt_decoder;
  713|      0|    case OSSL_OP_STORE:
  ------------------
  |  |  324|      0|# define OSSL_OP_STORE                              22
  ------------------
  |  Branch (713:5): [True: 0, False: 6.60k]
  ------------------
  714|      0|        return deflt_store;
  715|      0|    case OSSL_OP_SKEYMGMT:
  ------------------
  |  |  320|      0|# define OSSL_OP_SKEYMGMT                           15
  ------------------
  |  Branch (715:5): [True: 0, False: 6.60k]
  ------------------
  716|      0|        return deflt_skeymgmt;
  717|  6.60k|    }
  718|      0|    return NULL;
  719|  6.60k|}

ossl_cipher_capable_aes_cbc_hmac_sha1_etm:
   14|      3|{
   15|      3|    return 0;
   16|      3|}

ossl_cipher_capable_aes_cbc_hmac_sha1:
   41|      2|{
   42|      2|    return AESNI_CBC_HMAC_SHA_CAPABLE;
  ------------------
  |  |  177|      2|#  define AESNI_CBC_HMAC_SHA_CAPABLE (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  ------------------
   43|      2|}

ossl_cipher_capable_aes_cbc_hmac_sha256_etm:
   14|      3|{
   15|      3|    return 0;
   16|      3|}

ossl_cipher_capable_aes_cbc_hmac_sha256:
   41|      2|{
   42|      2|    return AESNI_CBC_HMAC_SHA_CAPABLE
  ------------------
  |  |  177|      4|#  define AESNI_CBC_HMAC_SHA_CAPABLE (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (177:38): [True: 2, False: 0]
  |  |  ------------------
  ------------------
   43|      2|           && aesni_cbc_sha256_enc(NULL, NULL, 0, NULL, NULL, NULL, NULL);
  ------------------
  |  Branch (43:15): [True: 2, False: 0]
  ------------------
   44|      2|}

ossl_cipher_capable_aes_cbc_hmac_sha512_etm:
   20|      3|{
   21|      3|    return 0;
   22|      3|}

blake2_prov.c:blake2s256_get_params:
  170|      1|static int blake##variantsize##_get_params(OSSL_PARAM params[]) \
  171|      1|{ \
  172|      1|    return ossl_digest_default_get_params(params, BLAKE##VARIANT##_BLOCKBYTES, BLAKE##VARIANT##_OUTBYTES, 0); \
  173|      1|} \
blake2_prov.c:blake2b512_get_params:
  170|      1|static int blake##variantsize##_get_params(OSSL_PARAM params[]) \
  171|      1|{ \
  172|      1|    return ossl_digest_default_get_params(params, BLAKE##VARIANT##_BLOCKBYTES, BLAKE##VARIANT##_OUTBYTES, 0); \
  173|      1|} \

ossl_digest_default_get_params:
   16|     27|{
   17|     27|    OSSL_PARAM *p = NULL;
   18|       |
   19|     27|    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_BLOCK_SIZE);
  ------------------
  |  |  220|     27|# define OSSL_DIGEST_PARAM_BLOCK_SIZE "blocksize"
  ------------------
   20|     27|    if (p != NULL && !OSSL_PARAM_set_size_t(p, blksz)) {
  ------------------
  |  Branch (20:9): [True: 27, False: 0]
  |  Branch (20:22): [True: 0, False: 27]
  ------------------
   21|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   22|      0|        return 0;
   23|      0|    }
   24|     27|    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_SIZE);
  ------------------
  |  |  223|     27|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
   25|     27|    if (p != NULL && !OSSL_PARAM_set_size_t(p, paramsz)) {
  ------------------
  |  Branch (25:9): [True: 27, False: 0]
  |  Branch (25:22): [True: 0, False: 27]
  ------------------
   26|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   27|      0|        return 0;
   28|      0|    }
   29|     27|    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_XOF);
  ------------------
  |  |  225|     27|# define OSSL_DIGEST_PARAM_XOF "xof"
  ------------------
   30|     27|    if (p != NULL
  ------------------
  |  Branch (30:9): [True: 27, False: 0]
  ------------------
   31|     27|        && !OSSL_PARAM_set_int(p, (flags & PROV_DIGEST_FLAG_XOF) != 0)) {
  ------------------
  |  |   19|     27|#define PROV_DIGEST_FLAG_XOF             0x0001
  ------------------
  |  Branch (31:12): [True: 0, False: 27]
  ------------------
   32|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   33|      0|        return 0;
   34|      0|    }
   35|     27|    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_ALGID_ABSENT);
  ------------------
  |  |  219|     27|# define OSSL_DIGEST_PARAM_ALGID_ABSENT "algid-absent"
  ------------------
   36|     27|    if (p != NULL
  ------------------
  |  Branch (36:9): [True: 27, False: 0]
  ------------------
   37|     27|        && !OSSL_PARAM_set_int(p, (flags & PROV_DIGEST_FLAG_ALGID_ABSENT) != 0)) {
  ------------------
  |  |   20|     27|#define PROV_DIGEST_FLAG_ALGID_ABSENT    0x0002
  ------------------
  |  Branch (37:12): [True: 0, False: 27]
  ------------------
   38|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   39|      0|        return 0;
   40|      0|    }
   41|     27|    return 1;
   42|     27|}

sha2_prov.c:sha1_set_ctx_params:
   43|  6.59k|{
   44|  6.59k|    const OSSL_PARAM *p;
   45|  6.59k|    SHA_CTX *ctx = (SHA_CTX *)vctx;
   46|       |
   47|  6.59k|    if (ctx == NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 6.59k]
  ------------------
   48|      0|        return 0;
   49|  6.59k|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (49:9): [True: 6.59k, False: 0]
  ------------------
   50|  6.59k|        return 1;
   51|       |
   52|      0|    p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_SSL3_MS);
  ------------------
  |  |  224|      0|# define OSSL_DIGEST_PARAM_SSL3_MS "ssl3-ms"
  ------------------
   53|      0|    if (p != NULL && p->data_type == OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|      0|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (53:9): [True: 0, False: 0]
  |  Branch (53:22): [True: 0, False: 0]
  ------------------
   54|      0|        return ossl_sha1_ctrl(ctx, EVP_CTRL_SSL3_MASTER_SECRET,
  ------------------
  |  |  430|      0|# define         EVP_CTRL_SSL3_MASTER_SECRET             0x1d
  ------------------
   55|      0|                              p->data_size, p->data);
   56|      0|    return 1;
   57|      0|}

decode_der2key.c:PrivateKeyInfo_der2dh_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:der2key_newctx:
  162|   488k|{
  163|   488k|    struct der2key_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|   488k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   488k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   488k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  164|       |
  165|   488k|    if (ctx != NULL) {
  ------------------
  |  Branch (165:9): [True: 488k, False: 0]
  ------------------
  166|   488k|        ctx->provctx = provctx;
  167|   488k|        ctx->desc = desc;
  168|   488k|    }
  169|   488k|    return ctx;
  170|   488k|}
decode_der2key.c:dh_d2i_PKCS8:
  419|  16.9k|{
  420|  16.9k|    return der2key_decode_p8(der, der_len, ctx,
  421|  16.9k|                             (key_from_pkcs8_t *)ossl_dh_key_from_pkcs8);
  422|  16.9k|}
decode_der2key.c:der2key_decode_p8:
  135|  94.8k|{
  136|  94.8k|    PKCS8_PRIV_KEY_INFO *p8inf = NULL;
  137|  94.8k|    const X509_ALGOR *alg = NULL;
  138|  94.8k|    void *key = NULL;
  139|       |
  140|  94.8k|    if ((p8inf = d2i_PKCS8_PRIV_KEY_INFO(NULL, input_der, input_der_len)) != NULL
  ------------------
  |  Branch (140:9): [True: 910, False: 93.9k]
  ------------------
  141|  94.8k|        && PKCS8_pkey_get0(NULL, NULL, NULL, &alg, p8inf)
  ------------------
  |  Branch (141:12): [True: 910, False: 0]
  ------------------
  142|  94.8k|        && (OBJ_obj2nid(alg->algorithm) == ctx->desc->evp_type
  ------------------
  |  Branch (142:13): [True: 592, False: 318]
  ------------------
  143|       |            /* Allow decoding sm2 private key with id_ecPublicKey */
  144|    910|            || (OBJ_obj2nid(alg->algorithm) == NID_X9_62_id_ecPublicKey
  ------------------
  |  |  178|    636|#define NID_X9_62_id_ecPublicKey                408
  ------------------
  |  Branch (144:17): [True: 131, False: 187]
  ------------------
  145|    318|                && ctx->desc->evp_type == NID_sm2)))
  ------------------
  |  | 1232|    131|#define NID_sm2         1172
  ------------------
  |  Branch (145:20): [True: 80, False: 51]
  ------------------
  146|    672|        key = key_from_pkcs8(p8inf, PROV_LIBCTX_OF(ctx->provctx), ctx->propq);
  ------------------
  |  |   31|    672|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  147|  94.8k|    PKCS8_PRIV_KEY_INFO_free(p8inf);
  148|       |
  149|  94.8k|    return key;
  150|  94.8k|}
decode_der2key.c:dh_adjust:
  428|     83|{
  429|     83|    ossl_dh_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   31|     83|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  430|     83|}
decode_der2key.c:der2key_freectx:
  195|   488k|{
  196|   488k|    struct der2key_ctx_st *ctx = vctx;
  197|       |
  198|   488k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|   488k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   488k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   488k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  199|   488k|}
decode_der2key.c:PrivateKeyInfo_der2dh_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:der2key_check_selection:
  203|  15.3k|{
  204|       |    /*
  205|       |     * The selections are kinda sorta "levels", i.e. each selection given
  206|       |     * here is assumed to include those following.
  207|       |     */
  208|  15.3k|    int checks[] = {
  209|  15.3k|        OSSL_KEYMGMT_SELECT_PRIVATE_KEY,
  ------------------
  |  |  640|  15.3k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  210|  15.3k|        OSSL_KEYMGMT_SELECT_PUBLIC_KEY,
  ------------------
  |  |  641|  15.3k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  211|  15.3k|        OSSL_KEYMGMT_SELECT_ALL_PARAMETERS
  ------------------
  |  |  647|  15.3k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  ------------------
  |  |  |  |  642|  15.3k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  |  |  648|  15.3k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  643|  15.3k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  ------------------
  ------------------
  212|  15.3k|    };
  213|  15.3k|    size_t i;
  214|       |
  215|       |    /* The decoder implementations made here support guessing */
  216|  15.3k|    if (selection == 0)
  ------------------
  |  Branch (216:9): [True: 0, False: 15.3k]
  ------------------
  217|      0|        return 1;
  218|       |
  219|  28.9k|    for (i = 0; i < OSSL_NELEM(checks); i++) {
  ------------------
  |  |   14|  28.9k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (219:17): [True: 28.9k, False: 0]
  ------------------
  220|  28.9k|        int check1 = (selection & checks[i]) != 0;
  221|  28.9k|        int check2 = (desc->selection_mask & checks[i]) != 0;
  222|       |
  223|       |        /*
  224|       |         * If the caller asked for the currently checked bit(s), return
  225|       |         * whether the decoder description says it's supported.
  226|       |         */
  227|  28.9k|        if (check1)
  ------------------
  |  Branch (227:13): [True: 15.3k, False: 13.5k]
  ------------------
  228|  15.3k|            return check2;
  229|  28.9k|    }
  230|       |
  231|       |    /* This should be dead code, but just to be safe... */
  232|      0|    return 0;
  233|  15.3k|}
decode_der2key.c:der2key_decode:
  238|   428k|{
  239|   428k|    struct der2key_ctx_st *ctx = vctx;
  240|   428k|    unsigned char *der = NULL;
  241|   428k|    const unsigned char *derp;
  242|   428k|    long der_len = 0;
  243|   428k|    void *key = NULL;
  244|   428k|    int ok = 0;
  245|       |
  246|   428k|    ctx->selection = selection;
  247|       |    /*
  248|       |     * The caller is allowed to specify 0 as a selection mask, to have the
  249|       |     * structure and key type guessed.  For type-specific structures, this
  250|       |     * is not recommended, as some structures are very similar.
  251|       |     * Note that 0 isn't the same as OSSL_KEYMGMT_SELECT_ALL, as the latter
  252|       |     * signifies a private key structure, where everything else is assumed
  253|       |     * to be present as well.
  254|       |     */
  255|   428k|    if (selection == 0)
  ------------------
  |  Branch (255:9): [True: 0, False: 428k]
  ------------------
  256|      0|        selection = ctx->desc->selection_mask;
  257|   428k|    if ((selection & ctx->desc->selection_mask) == 0) {
  ------------------
  |  Branch (257:9): [True: 0, False: 428k]
  ------------------
  258|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  259|      0|        return 0;
  260|      0|    }
  261|       |
  262|   428k|    ok = ossl_read_der(ctx->provctx, cin, &der, &der_len);
  263|   428k|    if (!ok)
  ------------------
  |  Branch (263:9): [True: 90.0k, False: 338k]
  ------------------
  264|  90.0k|        goto next;
  265|       |
  266|   338k|    ok = 0; /* Assume that we fail */
  267|       |
  268|   338k|    ERR_set_mark();
  269|   338k|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  640|   338k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (269:9): [True: 313k, False: 24.9k]
  ------------------
  270|   313k|        derp = der;
  271|   313k|        if (ctx->desc->d2i_PKCS8 != NULL) {
  ------------------
  |  Branch (271:13): [True: 254k, False: 59.2k]
  ------------------
  272|   254k|            key = ctx->desc->d2i_PKCS8(&derp, der_len, ctx);
  273|   254k|            if (ctx->flag_fatal) {
  ------------------
  |  Branch (273:17): [True: 0, False: 254k]
  ------------------
  274|      0|                ERR_clear_last_mark();
  275|      0|                goto end;
  276|      0|            }
  277|   254k|        } else if (ctx->desc->d2i_private_key != NULL) {
  ------------------
  |  Branch (277:20): [True: 59.2k, False: 0]
  ------------------
  278|  59.2k|            key = ctx->desc->d2i_private_key(NULL, &derp, der_len);
  279|  59.2k|        }
  280|   313k|        if (key == NULL && ctx->selection != 0) {
  ------------------
  |  Branch (280:13): [True: 310k, False: 2.80k]
  |  Branch (280:28): [True: 310k, False: 0]
  ------------------
  281|   310k|            ERR_clear_last_mark();
  282|   310k|            goto next;
  283|   310k|        }
  284|   313k|    }
  285|  27.7k|    if (key == NULL && (selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
  ------------------
  |  |  641|  24.9k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (285:9): [True: 24.9k, False: 2.80k]
  |  Branch (285:24): [True: 24.9k, False: 0]
  ------------------
  286|  24.9k|        derp = der;
  287|  24.9k|        if (ctx->desc->d2i_PUBKEY != NULL)
  ------------------
  |  Branch (287:13): [True: 24.9k, False: 14]
  ------------------
  288|  24.9k|            key = ctx->desc->d2i_PUBKEY(&derp, der_len, ctx);
  289|     14|        else if (ctx->desc->d2i_public_key != NULL)
  ------------------
  |  Branch (289:18): [True: 14, False: 0]
  ------------------
  290|     14|            key = ctx->desc->d2i_public_key(NULL, &derp, der_len);
  291|  24.9k|        if (key == NULL && ctx->selection != 0) {
  ------------------
  |  Branch (291:13): [True: 18.0k, False: 6.89k]
  |  Branch (291:28): [True: 18.0k, False: 0]
  ------------------
  292|  18.0k|            ERR_clear_last_mark();
  293|  18.0k|            goto next;
  294|  18.0k|        }
  295|  24.9k|    }
  296|  9.69k|    if (key == NULL && (selection & OSSL_KEYMGMT_SELECT_ALL_PARAMETERS) != 0) {
  ------------------
  |  |  647|      0|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  ------------------
  |  |  |  |  642|      0|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  |  |  648|      0|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  643|      0|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  ------------------
  ------------------
  |  Branch (296:9): [True: 0, False: 9.69k]
  |  Branch (296:24): [True: 0, False: 0]
  ------------------
  297|      0|        derp = der;
  298|      0|        if (ctx->desc->d2i_key_params != NULL)
  ------------------
  |  Branch (298:13): [True: 0, False: 0]
  ------------------
  299|      0|            key = ctx->desc->d2i_key_params(NULL, &derp, der_len);
  300|      0|        if (key == NULL && ctx->selection != 0) {
  ------------------
  |  Branch (300:13): [True: 0, False: 0]
  |  Branch (300:28): [True: 0, False: 0]
  ------------------
  301|      0|            ERR_clear_last_mark();
  302|      0|            goto next;
  303|      0|        }
  304|      0|    }
  305|  9.69k|    if (key == NULL)
  ------------------
  |  Branch (305:9): [True: 0, False: 9.69k]
  ------------------
  306|      0|        ERR_clear_last_mark();
  307|  9.69k|    else
  308|  9.69k|        ERR_pop_to_mark();
  309|       |
  310|       |    /*
  311|       |     * Last minute check to see if this was the correct type of key.  This
  312|       |     * should never lead to a fatal error, i.e. the decoding itself was
  313|       |     * correct, it was just an unexpected key type.  This is generally for
  314|       |     * classes of key types that have subtle variants, like RSA-PSS keys as
  315|       |     * opposed to plain RSA keys.
  316|       |     */
  317|  9.69k|    if (key != NULL
  ------------------
  |  Branch (317:9): [True: 9.69k, False: 0]
  ------------------
  318|  9.69k|        && ctx->desc->check_key != NULL
  ------------------
  |  Branch (318:12): [True: 9.09k, False: 609]
  ------------------
  319|  9.69k|        && !ctx->desc->check_key(key, ctx)) {
  ------------------
  |  Branch (319:12): [True: 1.39k, False: 7.69k]
  ------------------
  320|  1.39k|        ctx->desc->free_key(key);
  321|  1.39k|        key = NULL;
  322|  1.39k|    }
  323|       |
  324|  9.69k|    if (key != NULL && ctx->desc->adjust_key != NULL)
  ------------------
  |  Branch (324:9): [True: 8.30k, False: 1.39k]
  |  Branch (324:24): [True: 8.30k, False: 0]
  ------------------
  325|  8.30k|        ctx->desc->adjust_key(key, ctx);
  326|       |
  327|   428k| next:
  328|       |    /*
  329|       |     * Indicated that we successfully decoded something, or not at all.
  330|       |     * Ending up "empty handed" is not an error.
  331|       |     */
  332|   428k|    ok = 1;
  333|       |
  334|       |    /*
  335|       |     * We free memory here so it's not held up during the callback, because
  336|       |     * we know the process is recursive and the allocated chunks of memory
  337|       |     * add up.
  338|       |     */
  339|   428k|    OPENSSL_free(der);
  ------------------
  |  |  115|   428k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   428k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   428k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  340|   428k|    der = NULL;
  341|       |
  342|   428k|    if (key != NULL) {
  ------------------
  |  Branch (342:9): [True: 8.30k, False: 420k]
  ------------------
  343|  8.30k|        OSSL_PARAM params[4];
  344|  8.30k|        int object_type = OSSL_OBJECT_PKEY;
  ------------------
  |  |   29|  8.30k|# define OSSL_OBJECT_PKEY               2 /* EVP_PKEY * */
  ------------------
  345|       |
  346|  8.30k|        params[0] =
  347|  8.30k|            OSSL_PARAM_construct_int(OSSL_OBJECT_PARAM_TYPE, &object_type);
  ------------------
  |  |  356|  8.30k|# define OSSL_OBJECT_PARAM_TYPE "type"
  ------------------
  348|       |
  349|  8.30k|#ifndef OPENSSL_NO_SM2
  350|  8.30k|        if (strcmp(ctx->desc->keytype_name, "EC") == 0
  ------------------
  |  Branch (350:13): [True: 7.49k, False: 801]
  ------------------
  351|  8.30k|            && (EC_KEY_get_flags(key) & EC_FLAG_SM2_RANGE) != 0)
  ------------------
  |  |  962|  7.49k|#  define EC_FLAG_SM2_RANGE              0x0004
  ------------------
  |  Branch (351:16): [True: 0, False: 7.49k]
  ------------------
  352|      0|            params[1] =
  353|      0|                OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_TYPE,
  ------------------
  |  |  352|      0|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  354|      0|                                                 "SM2", 0);
  355|  8.30k|        else
  356|  8.30k|#endif
  357|  8.30k|            params[1] =
  358|  8.30k|                OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_TYPE,
  ------------------
  |  |  352|  8.30k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  359|  8.30k|                                                 (char *)ctx->desc->keytype_name,
  360|  8.30k|                                                 0);
  361|       |        /* The address of the key becomes the octet string */
  362|  8.30k|        params[2] =
  363|  8.30k|            OSSL_PARAM_construct_octet_string(OSSL_OBJECT_PARAM_REFERENCE,
  ------------------
  |  |  355|  8.30k|# define OSSL_OBJECT_PARAM_REFERENCE "reference"
  ------------------
  364|  8.30k|                                              &key, sizeof(key));
  365|  8.30k|        params[3] = OSSL_PARAM_construct_end();
  366|       |
  367|  8.30k|        ok = data_cb(params, data_cbarg);
  368|  8.30k|    }
  369|       |
  370|   428k| end:
  371|   428k|    ctx->desc->free_key(key);
  372|   428k|    OPENSSL_free(der);
  ------------------
  |  |  115|   428k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   428k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   428k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  373|       |
  374|   428k|    return ok;
  375|   428k|}
decode_der2key.c:SubjectPublicKeyInfo_der2dh_newctx:
 1193|     77|    {                                                                   \
 1194|     77|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|     77|    }                                                                   \
decode_der2key.c:dh_d2i_PUBKEY:
  403|     75|    {                                                       \
  404|     75|        return f(NULL, der, der_len);                       \
  405|     75|    }
decode_der2key.c:SubjectPublicKeyInfo_der2dh_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:type_specific_params_der2dh_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:DH_der2dh_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2dhx_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2dhx_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dhx_newctx:
 1193|     40|    {                                                                   \
 1194|     40|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|     40|    }                                                                   \
decode_der2key.c:dhx_d2i_PUBKEY:
  403|     39|    {                                                       \
  404|     39|        return f(NULL, der, der_len);                       \
  405|     39|    }
decode_der2key.c:SubjectPublicKeyInfo_der2dhx_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:type_specific_params_der2dhx_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:DHX_der2dhx_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2dsa_newctx:
 1193|  12.5k|    {                                                                   \
 1194|  12.5k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.5k|    }                                                                   \
decode_der2key.c:dsa_d2i_PKCS8:
  454|  8.54k|{
  455|  8.54k|    return der2key_decode_p8(der, der_len, ctx,
  456|  8.54k|                             (key_from_pkcs8_t *)ossl_dsa_key_from_pkcs8);
  457|  8.54k|}
decode_der2key.c:dsa_adjust:
  462|    519|{
  463|    519|    ossl_dsa_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   31|    519|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  464|    519|}
decode_der2key.c:PrivateKeyInfo_der2dsa_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dsa_newctx:
 1193|  1.08k|    {                                                                   \
 1194|  1.08k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  1.08k|    }                                                                   \
decode_der2key.c:dsa_d2i_PUBKEY:
  403|  1.08k|    {                                                       \
  404|  1.08k|        return f(NULL, der, der_len);                       \
  405|  1.08k|    }
decode_der2key.c:SubjectPublicKeyInfo_der2dsa_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:type_specific_der2dsa_newctx:
 1193|  13.6k|    {                                                                   \
 1194|  13.6k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  13.6k|    }                                                                   \
decode_der2key.c:type_specific_der2dsa_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:DSA_der2dsa_newctx:
 1193|  13.6k|    {                                                                   \
 1194|  13.6k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  13.6k|    }                                                                   \
decode_der2key.c:DSA_der2dsa_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ec_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:ec_d2i_PKCS8:
  478|  8.23k|{
  479|  8.23k|    return der2key_decode_p8(der, der_len, ctx,
  480|  8.23k|                             (key_from_pkcs8_t *)ossl_ec_key_from_pkcs8);
  481|  8.23k|}
decode_der2key.c:ec_check:
  486|  8.23k|{
  487|       |    /* We're trying to be clever by comparing two truths */
  488|  8.23k|    int ret = 0;
  489|  8.23k|    int sm2 = (EC_KEY_get_flags(key) & EC_FLAG_SM2_RANGE) != 0;
  ------------------
  |  |  962|  8.23k|#  define EC_FLAG_SM2_RANGE              0x0004
  ------------------
  490|       |
  491|  8.23k|    if (sm2)
  ------------------
  |  Branch (491:9): [True: 5, False: 8.22k]
  ------------------
  492|      5|        ret = ctx->desc->evp_type == EVP_PKEY_SM2
  ------------------
  |  |   74|      5|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|     10|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (492:15): [True: 5, False: 0]
  ------------------
  493|      5|            || ctx->desc->evp_type == NID_X9_62_id_ecPublicKey;
  ------------------
  |  |  178|      0|#define NID_X9_62_id_ecPublicKey                408
  ------------------
  |  Branch (493:16): [True: 0, False: 0]
  ------------------
  494|  8.22k|    else
  495|  8.22k|        ret = ctx->desc->evp_type != EVP_PKEY_SM2;
  ------------------
  |  |   74|  8.22k|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|  8.22k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  496|       |
  497|  8.23k|    return ret;
  498|  8.23k|}
decode_der2key.c:ec_adjust:
  501|  7.50k|{
  502|  7.50k|    ossl_ec_key_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   31|  7.50k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  503|  7.50k|}
decode_der2key.c:PrivateKeyInfo_der2ec_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ec_newctx:
 1193|  23.5k|    {                                                                   \
 1194|  23.5k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  23.5k|    }                                                                   \
decode_der2key.c:ec_d2i_PUBKEY:
  403|  23.5k|    {                                                       \
  404|  23.5k|        return f(NULL, der, der_len);                       \
  405|  23.5k|    }
decode_der2key.c:SubjectPublicKeyInfo_der2ec_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:type_specific_no_pub_der2ec_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:type_specific_no_pub_der2ec_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:EC_der2ec_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:EC_der2ec_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2x25519_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:ecx_d2i_PKCS8:
  513|  35.3k|{
  514|  35.3k|    return der2key_decode_p8(der, der_len, ctx,
  515|  35.3k|                             (key_from_pkcs8_t *)ossl_ecx_key_from_pkcs8);
  516|  35.3k|}
decode_der2key.c:ecx_key_adjust:
  524|      7|{
  525|      7|    ossl_ecx_key_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   31|      7|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  526|      7|}
decode_der2key.c:PrivateKeyInfo_der2x25519_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2x25519_newctx:
 1193|      6|    {                                                                   \
 1194|      6|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      6|    }                                                                   \
decode_der2key.c:x25519_d2i_PUBKEY:
  403|      5|    {                                                       \
  404|      5|        return f(NULL, der, der_len);                       \
  405|      5|    }
decode_der2key.c:SubjectPublicKeyInfo_der2x25519_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2x448_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2x448_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2x448_newctx:
 1193|      8|    {                                                                   \
 1194|      8|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      8|    }                                                                   \
decode_der2key.c:x448_d2i_PUBKEY:
  403|      7|    {                                                       \
  404|      7|        return f(NULL, der, der_len);                       \
  405|      7|    }
decode_der2key.c:SubjectPublicKeyInfo_der2x448_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ed25519_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ed25519_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ed25519_newctx:
 1193|     10|    {                                                                   \
 1194|     10|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|     10|    }                                                                   \
decode_der2key.c:ed25519_d2i_PUBKEY:
  403|      9|    {                                                       \
  404|      9|        return f(NULL, der, der_len);                       \
  405|      9|    }
decode_der2key.c:SubjectPublicKeyInfo_der2ed25519_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ed448_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ed448_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ed448_newctx:
 1193|      8|    {                                                                   \
 1194|      8|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      8|    }                                                                   \
decode_der2key.c:ed448_d2i_PUBKEY:
  403|      7|    {                                                       \
  404|      7|        return f(NULL, der, der_len);                       \
  405|      7|    }
decode_der2key.c:SubjectPublicKeyInfo_der2ed448_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2sm2_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:sm2_d2i_PKCS8:
  577|  8.91k|{
  578|  8.91k|    return der2key_decode_p8(der, der_len, ctx,
  579|  8.91k|                             (key_from_pkcs8_t *)ossl_ec_key_from_pkcs8);
  580|  8.91k|}
decode_der2key.c:PrivateKeyInfo_der2sm2_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2sm2_newctx:
 1193|  23.5k|    {                                                                   \
 1194|  23.5k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  23.5k|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2sm2_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:type_specific_no_pub_der2sm2_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:type_specific_no_pub_der2sm2_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ml_kem_512_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:ml_kem_d2i_PKCS8:
  590|  26.5k|{
  591|  26.5k|    ML_KEM_KEY *key;
  592|       |
  593|  26.5k|    key = ossl_ml_kem_d2i_PKCS8(*der, der_len, ctx->desc->evp_type,
  594|  26.5k|                                ctx->provctx, ctx->propq);
  595|  26.5k|    if (key != NULL)
  ------------------
  |  Branch (595:9): [True: 0, False: 26.5k]
  ------------------
  596|      0|        *der += der_len;
  597|  26.5k|    return key;
  598|  26.5k|}
decode_der2key.c:PrivateKeyInfo_der2ml_kem_512_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_kem_512_newctx:
 1193|      3|    {                                                                   \
 1194|      3|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      3|    }                                                                   \
decode_der2key.c:ml_kem_d2i_PUBKEY:
  603|      7|{
  604|      7|    ML_KEM_KEY *key;
  605|       |
  606|      7|    key = ossl_ml_kem_d2i_PUBKEY(*der, der_len, ctx->desc->evp_type,
  607|      7|                                 ctx->provctx, ctx->propq);
  608|      7|    if (key != NULL)
  ------------------
  |  Branch (608:9): [True: 0, False: 7]
  ------------------
  609|      0|        *der += der_len;
  610|      7|    return key;
  611|      7|}
decode_der2key.c:SubjectPublicKeyInfo_der2ml_kem_512_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ml_kem_768_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ml_kem_768_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_kem_768_newctx:
 1193|      4|    {                                                                   \
 1194|      4|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      4|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_kem_768_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ml_kem_1024_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ml_kem_1024_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_kem_1024_newctx:
 1193|      3|    {                                                                   \
 1194|      3|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      3|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_kem_1024_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_128s_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:slh_dsa_d2i_PKCS8:
  648|   106k|{
  649|   106k|    SLH_DSA_KEY *key = NULL, *ret = NULL;
  650|   106k|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
  ------------------
  |  |   31|   106k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  651|   106k|    PKCS8_PRIV_KEY_INFO *p8inf = NULL;
  652|   106k|    const unsigned char *p;
  653|   106k|    const X509_ALGOR *alg = NULL;
  654|   106k|    int plen, ptype;
  655|       |
  656|   106k|    if ((p8inf = d2i_PKCS8_PRIV_KEY_INFO(NULL, der, der_len)) == NULL
  ------------------
  |  Branch (656:9): [True: 105k, False: 301]
  ------------------
  657|   106k|        || !PKCS8_pkey_get0(NULL, &p, &plen, &alg, p8inf))
  ------------------
  |  Branch (657:12): [True: 0, False: 301]
  ------------------
  658|   105k|        goto end;
  659|       |
  660|       |    /* Algorithm parameters must be absent. */
  661|    301|    if ((X509_ALGOR_get0(NULL, &ptype, NULL, alg), ptype != V_ASN1_UNDEF)) {
  ------------------
  |  |   60|    301|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (661:9): [True: 193, False: 108]
  ------------------
  662|    193|        ERR_raise_data(ERR_LIB_PROV, PROV_R_UNEXPECTED_KEY_PARAMETERS,
  ------------------
  |  |  403|    193|    (ERR_new(),                                                 \
  |  |  404|    193|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|    193|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|    193|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|    193|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|    193|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_UNEXPECTED_KEY_PARAMETERS,
  ------------------
  |  |  118|    193|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_UNEXPECTED_KEY_PARAMETERS,
  ------------------
  |  |  153|    193|# define PROV_R_UNEXPECTED_KEY_PARAMETERS                 249
  ------------------
  663|    193|                       "unexpected parameters with a PKCS#8 %s private key",
  664|    193|                       ctx->desc->keytype_name);
  665|    193|        goto end;
  666|    193|    }
  667|    108|    if (OBJ_obj2nid(alg->algorithm) != ctx->desc->evp_type)
  ------------------
  |  Branch (667:9): [True: 108, False: 0]
  ------------------
  668|    108|        goto end;
  669|      0|    if ((key = ossl_slh_dsa_key_new(libctx, ctx->propq,
  ------------------
  |  Branch (669:9): [True: 0, False: 0]
  ------------------
  670|      0|                                    ctx->desc->keytype_name)) == NULL)
  671|      0|        goto end;
  672|       |
  673|      0|    if (!ossl_slh_dsa_set_priv(key, p, plen))
  ------------------
  |  Branch (673:9): [True: 0, False: 0]
  ------------------
  674|      0|        goto end;
  675|      0|    ret = key;
  676|   106k| end:
  677|   106k|    PKCS8_PRIV_KEY_INFO_free(p8inf);
  678|   106k|    if (ret == NULL)
  ------------------
  |  Branch (678:9): [True: 106k, False: 0]
  ------------------
  679|   106k|        ossl_slh_dsa_key_free(key);
  680|   106k|    return ret;
  681|      0|}
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_128s_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_128f_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_128f_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_192s_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_192s_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_192f_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_192f_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_256s_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_256s_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_256f_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_256f_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_128s_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_128s_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_128f_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_128f_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_192s_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_192s_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_192f_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_192f_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_256s_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_256s_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_256f_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_256f_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_128s_newctx:
 1193|      8|    {                                                                   \
 1194|      8|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      8|    }                                                                   \
decode_der2key.c:slh_dsa_d2i_PUBKEY:
  685|     31|{
  686|     31|    int ok = 0;
  687|     31|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
  ------------------
  |  |   31|     31|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  688|     31|    SLH_DSA_KEY *ret = NULL;
  689|     31|    BARE_PUBKEY *spki = NULL;
  690|     31|    const uint8_t *end = *der;
  691|     31|    size_t len;
  692|       |
  693|     31|    ret = ossl_slh_dsa_key_new(libctx, ctx->propq, ctx->desc->keytype_name);
  694|     31|    if (ret == NULL)
  ------------------
  |  Branch (694:9): [True: 0, False: 31]
  ------------------
  695|      0|        return NULL;
  696|     31|    len = ossl_slh_dsa_key_get_pub_len(ret);
  697|       |
  698|       |    /*-
  699|       |     * The DER ASN.1 encoding of SLH-DSA public keys prepends 18 bytes to the
  700|       |     * encoded public key (since the largest public key size is 64 bytes):
  701|       |     *
  702|       |     * - 2 byte outer sequence tag and length
  703|       |     * -  2 byte algorithm sequence tag and length
  704|       |     * -    2 byte algorithm OID tag and length
  705|       |     * -      9 byte algorithm OID
  706|       |     * -  2 byte bit string tag and length
  707|       |     * -    1 bitstring lead byte
  708|       |     *
  709|       |     * Check that we have the right OID, the bit string has no "bits left" and
  710|       |     * that we consume all the input exactly.
  711|       |     */
  712|     31|    if (der_len != 18 + (long)len) {
  ------------------
  |  Branch (712:9): [True: 28, False: 3]
  ------------------
  713|     28|        ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  403|     28|    (ERR_new(),                                                 \
  |  |  404|     28|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|     28|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|     28|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|     28|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|     28|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  118|     28|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |   28|     28|# define PROV_R_BAD_ENCODING                              141
  ------------------
  714|     28|                       "unexpected %s public key length: %ld != %ld",
  715|     28|                       ctx->desc->keytype_name, der_len,
  716|     28|                       18 + (long)len);
  717|     28|        goto err;
  718|     28|    }
  719|       |
  720|      3|    if ((spki = OPENSSL_zalloc(sizeof(*spki))) == NULL)
  ------------------
  |  |  104|      3|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (720:9): [True: 0, False: 3]
  ------------------
  721|      0|        goto err;
  722|       |
  723|       |    /* The spki storage is freed on error */
  724|      3|    if (ASN1_item_d2i_ex((ASN1_VALUE **)&spki, &end, der_len,
  ------------------
  |  Branch (724:9): [True: 1, False: 2]
  ------------------
  725|      3|                         ASN1_ITEM_rptr(BARE_PUBKEY), NULL, NULL) == NULL) {
  ------------------
  |  |  427|      3|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  726|      1|        ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      1|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  118|      1|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |   28|      1|# define PROV_R_BAD_ENCODING                              141
  ------------------
  727|      1|                       "malformed %s public key ASN.1 encoding",
  728|      1|                       ossl_slh_dsa_key_get_name(ret));
  729|      1|        goto err;
  730|      1|    }
  731|       |
  732|       |    /* The spki structure now owns some memory */
  733|      2|    if ((spki->pubkey->flags & 0x7) != 0 || end != *der + der_len) {
  ------------------
  |  Branch (733:9): [True: 1, False: 1]
  |  Branch (733:45): [True: 1, False: 0]
  ------------------
  734|      2|        ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  403|      2|    (ERR_new(),                                                 \
  |  |  404|      2|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      2|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      2|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  118|      2|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |   28|      2|# define PROV_R_BAD_ENCODING                              141
  ------------------
  735|      2|                       "malformed %s public key ASN.1 encoding",
  736|      2|                       ossl_slh_dsa_key_get_name(ret));
  737|      2|        goto err;
  738|      2|    }
  739|      0|    if (OBJ_cmp(OBJ_nid2obj(ctx->desc->evp_type), spki->algor.oid) != 0) {
  ------------------
  |  Branch (739:9): [True: 0, False: 0]
  ------------------
  740|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |   28|      0|# define PROV_R_BAD_ENCODING                              141
  ------------------
  741|      0|                       "unexpected algorithm OID for an %s public key",
  742|      0|                       ossl_slh_dsa_key_get_name(ret));
  743|      0|        goto err;
  744|      0|    }
  745|       |
  746|      0|    if (!ossl_slh_dsa_set_pub(ret, spki->pubkey->data, spki->pubkey->length)) {
  ------------------
  |  Branch (746:9): [True: 0, False: 0]
  ------------------
  747|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |   28|      0|# define PROV_R_BAD_ENCODING                              141
  ------------------
  748|      0|                       "failed to parse %s public key from the input data",
  749|      0|                       ossl_slh_dsa_key_get_name(ret));
  750|      0|        goto err;
  751|      0|    }
  752|      0|    ok = 1;
  753|     31| err:
  754|     31|    if (spki != NULL) {
  ------------------
  |  Branch (754:9): [True: 2, False: 29]
  ------------------
  755|      2|        ASN1_OBJECT_free(spki->algor.oid);
  756|      2|        ASN1_BIT_STRING_free(spki->pubkey);
  757|      2|        OPENSSL_free(spki);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  758|      2|    }
  759|     31|    if (!ok) {
  ------------------
  |  Branch (759:9): [True: 31, False: 0]
  ------------------
  760|     31|        ossl_slh_dsa_key_free(ret);
  761|     31|        ret = NULL;
  762|     31|    }
  763|     31|    return ret;
  764|      0|}
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_128s_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_128f_newctx:
 1193|      3|    {                                                                   \
 1194|      3|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      3|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_128f_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_192s_newctx:
 1193|      3|    {                                                                   \
 1194|      3|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      3|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_192s_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_192f_newctx:
 1193|      3|    {                                                                   \
 1194|      3|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      3|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_192f_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_256s_newctx:
 1193|      3|    {                                                                   \
 1194|      3|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      3|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_256s_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_256f_newctx:
 1193|      3|    {                                                                   \
 1194|      3|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      3|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_256f_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_128s_newctx:
 1193|      3|    {                                                                   \
 1194|      3|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      3|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_128s_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_128f_newctx:
 1193|      3|    {                                                                   \
 1194|      3|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      3|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_128f_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_192s_newctx:
 1193|      3|    {                                                                   \
 1194|      3|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      3|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_192s_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_192f_newctx:
 1193|      4|    {                                                                   \
 1194|      4|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      4|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_192f_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_256s_newctx:
 1193|      4|    {                                                                   \
 1194|      4|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      4|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_256s_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_256f_newctx:
 1193|      3|    {                                                                   \
 1194|      3|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      3|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_256f_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2rsa_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:rsa_d2i_PKCS8:
  897|  16.8k|{
  898|  16.8k|    return der2key_decode_p8(der, der_len, ctx,
  899|  16.8k|                             (key_from_pkcs8_t *)ossl_rsa_key_from_pkcs8);
  900|  16.8k|}
decode_der2key.c:rsa_check:
  910|    859|{
  911|    859|    int valid;
  912|       |
  913|    859|    switch (RSA_test_flags(key, RSA_FLAG_TYPE_MASK)) {
  ------------------
  |  |  117|    859|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  914|    852|    case RSA_FLAG_TYPE_RSA:
  ------------------
  |  |  118|    852|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  |  Branch (914:5): [True: 852, False: 7]
  ------------------
  915|    852|        valid = (ctx->desc->evp_type == EVP_PKEY_RSA);
  ------------------
  |  |   63|    852|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|    852|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  916|    852|        break;
  917|      7|    case RSA_FLAG_TYPE_RSASSAPSS:
  ------------------
  |  |  119|      7|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (917:5): [True: 7, False: 852]
  ------------------
  918|      7|        valid = (ctx->desc->evp_type == EVP_PKEY_RSA_PSS);
  ------------------
  |  |   65|      7|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      7|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  919|      7|        break;
  920|      0|    default:
  ------------------
  |  Branch (920:5): [True: 0, False: 859]
  ------------------
  921|       |        /* Currently unsupported RSA key type */
  922|      0|        valid = 0;
  923|    859|    }
  924|       |
  925|    859|    valid = (valid && ossl_rsa_check_factors(key));
  ------------------
  |  Branch (925:14): [True: 859, False: 0]
  |  Branch (925:23): [True: 187, False: 672]
  ------------------
  926|       |
  927|    859|    return valid;
  928|    859|}
decode_der2key.c:rsa_adjust:
  931|    187|{
  932|    187|    ossl_rsa_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   31|    187|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  933|    187|}
decode_der2key.c:PrivateKeyInfo_der2rsa_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsa_newctx:
 1193|     52|    {                                                                   \
 1194|     52|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|     52|    }                                                                   \
decode_der2key.c:rsa_d2i_PUBKEY:
  905|     59|{
  906|     59|    return d2i_RSA_PUBKEY(NULL, der, der_len);
  907|     59|}
decode_der2key.c:SubjectPublicKeyInfo_der2rsa_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:type_specific_keypair_der2rsa_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:type_specific_keypair_der2rsa_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:RSA_der2rsa_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:RSA_der2rsa_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2rsapss_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2rsapss_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsapss_newctx:
 1193|      9|    {                                                                   \
 1194|      9|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      9|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsapss_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ml_dsa_44_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:ml_dsa_d2i_PKCS8:
  950|  26.5k|{
  951|  26.5k|    ML_DSA_KEY *key;
  952|       |
  953|  26.5k|    key = ossl_ml_dsa_d2i_PKCS8(*der, der_len, ctx->desc->evp_type,
  954|  26.5k|                                ctx->provctx, ctx->propq);
  955|  26.5k|    if (key != NULL)
  ------------------
  |  Branch (955:9): [True: 0, False: 26.5k]
  ------------------
  956|      0|        *der += der_len;
  957|  26.5k|    return key;
  958|  26.5k|}
decode_der2key.c:PrivateKeyInfo_der2ml_dsa_44_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_dsa_44_newctx:
 1193|      3|    {                                                                   \
 1194|      3|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      3|    }                                                                   \
decode_der2key.c:ml_dsa_d2i_PUBKEY:
  962|      7|{
  963|      7|    ML_DSA_KEY *key;
  964|       |
  965|      7|    key = ossl_ml_dsa_d2i_PUBKEY(*der, der_len, ctx->desc->evp_type,
  966|      7|                                 ctx->provctx, ctx->propq);
  967|      7|    if (key != NULL)
  ------------------
  |  Branch (967:9): [True: 0, False: 7]
  ------------------
  968|      0|        *der += der_len;
  969|      7|    return key;
  970|      7|}
decode_der2key.c:SubjectPublicKeyInfo_der2ml_dsa_44_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ml_dsa_65_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ml_dsa_65_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_dsa_65_newctx:
 1193|      4|    {                                                                   \
 1194|      4|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      4|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_dsa_65_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ml_dsa_87_newctx:
 1193|  12.1k|    {                                                                   \
 1194|  12.1k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  12.1k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ml_dsa_87_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_dsa_87_newctx:
 1193|      3|    {                                                                   \
 1194|      3|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      3|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_dsa_87_does_selection:
 1198|    223|    {                                                                   \
 1199|    223|        return der2key_check_selection(selection,                       \
 1200|    223|                                       &kind##_##keytype##_desc);       \
 1201|    223|    }                                                                   \

decode_epki2pki.c:epki2pki_newctx:
   42|  37.6k|{
   43|  37.6k|    struct epki2pki_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|  37.6k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  37.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  37.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|       |
   45|  37.6k|    if (ctx != NULL)
  ------------------
  |  Branch (45:9): [True: 37.6k, False: 0]
  ------------------
   46|  37.6k|        ctx->provctx = provctx;
   47|  37.6k|    return ctx;
   48|  37.6k|}
decode_epki2pki.c:epki2pki_freectx:
   51|  37.6k|{
   52|  37.6k|    struct epki2pki_ctx_st *ctx = vctx;
   53|       |
   54|  37.6k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  37.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  37.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  37.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   55|  37.6k|}
decode_epki2pki.c:epki2pki_set_ctx_params:
   67|     45|{
   68|     45|    struct epki2pki_ctx_st *ctx = vctx;
   69|     45|    const OSSL_PARAM *p;
   70|     45|    char *str = ctx->propq;
   71|       |
   72|     45|    p = OSSL_PARAM_locate_const(params, OSSL_DECODER_PARAM_PROPERTIES);
  ------------------
  |  |  218|     45|# define OSSL_DECODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  126|     45|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
   73|     45|    if (p != NULL && !OSSL_PARAM_get_utf8_string(p, &str, sizeof(ctx->propq)))
  ------------------
  |  Branch (73:9): [True: 0, False: 45]
  |  Branch (73:22): [True: 0, False: 0]
  ------------------
   74|      0|        return 0;
   75|       |
   76|     45|    return 1;
   77|     45|}

decode_msblob2key.c:msblob2dsa_newctx:
  268|      4|    {                                                                   \
  269|      4|        return msblob2key_newctx(provctx, &mstype##2##keytype##_desc);  \
  270|      4|    }                                                                   \
decode_msblob2key.c:msblob2key_newctx:
   65|      8|{
   66|      8|    struct msblob2key_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|      8|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|       |
   68|      8|    if (ctx != NULL) {
  ------------------
  |  Branch (68:9): [True: 8, False: 0]
  ------------------
   69|      8|        ctx->provctx = provctx;
   70|      8|        ctx->desc = desc;
   71|      8|    }
   72|      8|    return ctx;
   73|      8|}
decode_msblob2key.c:msblob2key_freectx:
   76|      8|{
   77|      8|    struct msblob2key_ctx_st *ctx = vctx;
   78|       |
   79|      8|    OPENSSL_free(ctx);
  ------------------
  |  |  115|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   80|      8|}
decode_msblob2key.c:msblob2key_does_selection:
   83|    446|{
   84|    446|    if (selection == 0)
  ------------------
  |  Branch (84:9): [True: 0, False: 446]
  ------------------
   85|      0|        return 1;
   86|       |
   87|    446|    if ((selection & (OSSL_KEYMGMT_SELECT_PRIVATE_KEY
  ------------------
  |  |  640|    446|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (87:9): [True: 446, False: 0]
  ------------------
   88|    446|                      | OSSL_KEYMGMT_SELECT_PUBLIC_KEY))  != 0)
  ------------------
  |  |  641|    446|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
   89|    446|        return 1;
   90|       |
   91|      0|    return 0;
   92|    446|}
decode_msblob2key.c:msblob2rsa_newctx:
  268|      4|    {                                                                   \
  269|      4|        return msblob2key_newctx(provctx, &mstype##2##keytype##_desc);  \
  270|      4|    }                                                                   \

decode_pem2der.c:pem2der_newctx:
   62|  37.7k|{
   63|  37.7k|    struct pem2der_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|  37.7k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  37.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  37.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|       |
   65|  37.7k|    if (ctx != NULL)
  ------------------
  |  Branch (65:9): [True: 37.7k, False: 0]
  ------------------
   66|  37.7k|        ctx->provctx = provctx;
   67|  37.7k|    return ctx;
   68|  37.7k|}
decode_pem2der.c:pem2der_freectx:
   71|  37.7k|{
   72|  37.7k|    struct pem2der_ctx_st *ctx = vctx;
   73|       |
   74|  37.7k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  37.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  37.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  37.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   75|  37.7k|}
decode_pem2der.c:pem2der_set_ctx_params:
   88|    142|{
   89|    142|    struct pem2der_ctx_st *ctx = vctx;
   90|    142|    const OSSL_PARAM *p;
   91|    142|    char *str;
   92|       |
   93|    142|    p = OSSL_PARAM_locate_const(params, OSSL_DECODER_PARAM_PROPERTIES);
  ------------------
  |  |  218|    142|# define OSSL_DECODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  126|    142|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
   94|    142|    str = ctx->propq;
   95|    142|    if (p != NULL
  ------------------
  |  Branch (95:9): [True: 0, False: 142]
  ------------------
   96|    142|        && !OSSL_PARAM_get_utf8_string(p, &str, sizeof(ctx->propq)))
  ------------------
  |  Branch (96:12): [True: 0, False: 0]
  ------------------
   97|      0|        return 0;
   98|       |
   99|    142|    p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA_STRUCTURE);
  ------------------
  |  |  351|    142|# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure"
  ------------------
  100|    142|    str = ctx->data_structure;
  101|    142|    if (p != NULL
  ------------------
  |  Branch (101:9): [True: 142, False: 0]
  ------------------
  102|    142|        && !OSSL_PARAM_get_utf8_string(p, &str, sizeof(ctx->data_structure)))
  ------------------
  |  Branch (102:12): [True: 0, False: 142]
  ------------------
  103|      0|        return 0;
  104|       |
  105|    142|    return 1;
  106|    142|}

decode_pvk2key.c:pvk2dsa_newctx:
  262|      2|    {                                                                   \
  263|      2|        return pvk2key_newctx(provctx, &pvk2##keytype##_desc);          \
  264|      2|    }                                                                   \
decode_pvk2key.c:pvk2key_newctx:
   69|      5|{
   70|      5|    struct pvk2key_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|      5|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   71|       |
   72|      5|    if (ctx != NULL) {
  ------------------
  |  Branch (72:9): [True: 5, False: 0]
  ------------------
   73|      5|        ctx->provctx = provctx;
   74|      5|        ctx->desc = desc;
   75|      5|    }
   76|      5|    return ctx;
   77|      5|}
decode_pvk2key.c:pvk2key_freectx:
   80|      5|{
   81|      5|    struct pvk2key_ctx_st *ctx = vctx;
   82|       |
   83|      5|    OPENSSL_free(ctx);
  ------------------
  |  |  115|      5|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   84|      5|}
decode_pvk2key.c:pvk2key_does_selection:
  109|    446|{
  110|    446|    if (selection == 0)
  ------------------
  |  Branch (110:9): [True: 0, False: 446]
  ------------------
  111|      0|        return 1;
  112|       |
  113|    446|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY)  != 0)
  ------------------
  |  |  640|    446|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (113:9): [True: 52, False: 394]
  ------------------
  114|     52|        return 1;
  115|       |
  116|    394|    return 0;
  117|    446|}
decode_pvk2key.c:pvk2rsa_newctx:
  262|      3|    {                                                                   \
  263|      3|        return pvk2key_newctx(provctx, &pvk2##keytype##_desc);          \
  264|      3|    }                                                                   \

ossl_spki2typespki_der_decode:
  100|  35.1k|{
  101|  35.1k|    const unsigned char *derp = der;
  102|  35.1k|    X509_PUBKEY *xpub = NULL;
  103|  35.1k|    X509_ALGOR *algor = NULL;
  104|  35.1k|    const ASN1_OBJECT *oid = NULL;
  105|  35.1k|    char dataname[OSSL_MAX_NAME_SIZE];
  106|  35.1k|    OSSL_PARAM params[6], *p = params;
  107|  35.1k|    int objtype = OSSL_OBJECT_PKEY;
  ------------------
  |  |   29|  35.1k|# define OSSL_OBJECT_PKEY               2 /* EVP_PKEY * */
  ------------------
  108|  35.1k|    int ok = 0;
  109|       |
  110|  35.1k|    xpub = ossl_d2i_X509_PUBKEY_INTERNAL(&derp, len, libctx, propq);
  111|       |
  112|  35.1k|    if (xpub == NULL) {
  ------------------
  |  Branch (112:9): [True: 9.44k, False: 25.6k]
  ------------------
  113|       |        /* We return "empty handed".  This is not an error. */
  114|  9.44k|        ok = 1;
  115|  9.44k|        goto end;
  116|  9.44k|    }
  117|       |
  118|  25.6k|    if (!X509_PUBKEY_get0_param(NULL, NULL, NULL, &algor, xpub))
  ------------------
  |  Branch (118:9): [True: 0, False: 25.6k]
  ------------------
  119|      0|        goto end;
  120|  25.6k|    X509_ALGOR_get0(&oid, NULL, NULL, algor);
  121|       |
  122|  25.6k|#ifndef OPENSSL_NO_EC
  123|       |    /* SM2 abuses the EC oid, so this could actually be SM2 */
  124|  25.6k|    if (OBJ_obj2nid(oid) == NID_X9_62_id_ecPublicKey
  ------------------
  |  |  178|  51.3k|#define NID_X9_62_id_ecPublicKey                408
  ------------------
  |  Branch (124:9): [True: 24.1k, False: 1.55k]
  ------------------
  125|  25.6k|            && ossl_x509_algor_is_sm2(algor))
  ------------------
  |  Branch (125:16): [True: 3, False: 24.1k]
  ------------------
  126|      3|        strcpy(dataname, "SM2");
  127|  25.6k|    else
  128|  25.6k|#endif
  129|  25.6k|    if (OBJ_obj2txt(dataname, sizeof(dataname), oid, 0) <= 0)
  ------------------
  |  Branch (129:9): [True: 0, False: 25.6k]
  ------------------
  130|      0|        goto end;
  131|       |
  132|  25.6k|    ossl_X509_PUBKEY_INTERNAL_free(xpub);
  133|  25.6k|    xpub = NULL;
  134|       |
  135|  25.6k|    *p++ =
  136|  25.6k|        OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_TYPE,
  ------------------
  |  |  352|  25.6k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  137|  25.6k|                                            dataname, 0);
  138|       |
  139|  25.6k|    *p++ = OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_INPUT_TYPE,
  ------------------
  |  |  354|  25.6k|# define OSSL_OBJECT_PARAM_INPUT_TYPE "input-type"
  ------------------
  140|  25.6k|                                            "DER", 0);
  141|       |
  142|  25.6k|    *p++ =
  143|  25.6k|        OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_STRUCTURE,
  ------------------
  |  |  351|  25.6k|# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure"
  ------------------
  144|  25.6k|                                            "SubjectPublicKeyInfo",
  145|  25.6k|                                            0);
  146|  25.6k|    *p++ =
  147|  25.6k|        OSSL_PARAM_construct_octet_string(OSSL_OBJECT_PARAM_DATA, der, len);
  ------------------
  |  |  350|  25.6k|# define OSSL_OBJECT_PARAM_DATA "data"
  ------------------
  148|  25.6k|    *p++ =
  149|  25.6k|        OSSL_PARAM_construct_int(OSSL_OBJECT_PARAM_TYPE, &objtype);
  ------------------
  |  |  356|  25.6k|# define OSSL_OBJECT_PARAM_TYPE "type"
  ------------------
  150|       |
  151|  25.6k|    *p = OSSL_PARAM_construct_end();
  152|       |
  153|  25.6k|    ok = data_cb(params, data_cbarg);
  154|       |
  155|  35.1k| end:
  156|  35.1k|    ossl_X509_PUBKEY_INTERNAL_free(xpub);
  157|  35.1k|    return ok;
  158|  25.6k|}
decode_spki2typespki.c:spki2typespki_newctx:
   40|  37.6k|{
   41|  37.6k|    struct spki2typespki_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|  37.6k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  37.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  37.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   42|       |
   43|  37.6k|    if (ctx != NULL)
  ------------------
  |  Branch (43:9): [True: 37.6k, False: 0]
  ------------------
   44|  37.6k|        ctx->provctx = provctx;
   45|  37.6k|    return ctx;
   46|  37.6k|}
decode_spki2typespki.c:spki2typespki_freectx:
   49|  37.6k|{
   50|  37.6k|    struct spki2typespki_ctx_st *ctx = vctx;
   51|       |
   52|  37.6k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  37.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  37.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  37.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   53|  37.6k|}
decode_spki2typespki.c:spki2typespki_decode:
   80|  37.6k|{
   81|  37.6k|    struct spki2typespki_ctx_st *ctx = vctx;
   82|  37.6k|    unsigned char *der;
   83|  37.6k|    long len;
   84|  37.6k|    int ok = 0;
   85|       |
   86|  37.6k|    if (!ossl_read_der(ctx->provctx, cin, &der, &len))
  ------------------
  |  Branch (86:9): [True: 2.51k, False: 35.1k]
  ------------------
   87|  2.51k|        return 1;
   88|       |
   89|  35.1k|    ok = ossl_spki2typespki_der_decode(der, len, selection, data_cb, data_cbarg,
   90|  35.1k|                                       pw_cb, pw_cbarg,
   91|  35.1k|                                       PROV_LIBCTX_OF(ctx->provctx), ctx->propq);
  ------------------
  |  |   31|  35.1k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
   92|  35.1k|    OPENSSL_free(der);
  ------------------
  |  |  115|  35.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  35.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  35.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|  35.1k|    return ok;
   94|  37.6k|}
decode_spki2typespki.c:spki2typespki_set_ctx_params:
   65|     45|{
   66|     45|    struct spki2typespki_ctx_st *ctx = vctx;
   67|     45|    const OSSL_PARAM *p;
   68|     45|    char *str = ctx->propq;
   69|       |
   70|     45|    p = OSSL_PARAM_locate_const(params, OSSL_DECODER_PARAM_PROPERTIES);
  ------------------
  |  |  218|     45|# define OSSL_DECODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  126|     45|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
   71|     45|    if (p != NULL && !OSSL_PARAM_get_utf8_string(p, &str, sizeof(ctx->propq)))
  ------------------
  |  Branch (71:9): [True: 0, False: 45]
  |  Branch (71:22): [True: 0, False: 0]
  ------------------
   72|      0|        return 0;
   73|       |
   74|     45|    return 1;
   75|     45|}

encode_key2any.c:key2any_newctx:
 1116|  28.0k|{
 1117|  28.0k|    KEY2ANY_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|  28.0k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  28.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  28.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1118|       |
 1119|  28.0k|    if (ctx != NULL) {
  ------------------
  |  Branch (1119:9): [True: 28.0k, False: 0]
  ------------------
 1120|  28.0k|        ctx->provctx = provctx;
 1121|  28.0k|        ctx->save_parameters = 1;
 1122|  28.0k|    }
 1123|       |
 1124|  28.0k|    return ctx;
 1125|  28.0k|}
encode_key2any.c:key2any_freectx:
 1128|  28.0k|{
 1129|  28.0k|    KEY2ANY_CTX *ctx = vctx;
 1130|       |
 1131|  28.0k|    ossl_pw_clear_passphrase_data(&ctx->pwdata);
 1132|  28.0k|    EVP_CIPHER_free(ctx->cipher);
 1133|  28.0k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  28.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  28.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  28.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1134|  28.0k|}
encode_key2any.c:key2any_set_ctx_params:
 1148|  28.0k|{
 1149|  28.0k|    KEY2ANY_CTX *ctx = vctx;
 1150|  28.0k|    OSSL_LIB_CTX *libctx = ossl_prov_ctx_get0_libctx(ctx->provctx);
 1151|  28.0k|    const OSSL_PARAM *cipherp =
 1152|  28.0k|        OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_CIPHER);
  ------------------
  |  |  250|  28.0k|# define OSSL_ENCODER_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  121|  28.0k|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
 1153|  28.0k|    const OSSL_PARAM *propsp =
 1154|  28.0k|        OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_PROPERTIES);
  ------------------
  |  |  252|  28.0k|# define OSSL_ENCODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  126|  28.0k|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
 1155|  28.0k|    const OSSL_PARAM *save_paramsp =
 1156|  28.0k|        OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_SAVE_PARAMETERS);
  ------------------
  |  |  253|  28.0k|# define OSSL_ENCODER_PARAM_SAVE_PARAMETERS "save-parameters"
  ------------------
 1157|       |
 1158|  28.0k|    if (cipherp != NULL) {
  ------------------
  |  Branch (1158:9): [True: 0, False: 28.0k]
  ------------------
 1159|      0|        const char *ciphername = NULL;
 1160|      0|        const char *props = NULL;
 1161|       |
 1162|      0|        if (!OSSL_PARAM_get_utf8_string_ptr(cipherp, &ciphername))
  ------------------
  |  Branch (1162:13): [True: 0, False: 0]
  ------------------
 1163|      0|            return 0;
 1164|      0|        if (propsp != NULL && !OSSL_PARAM_get_utf8_string_ptr(propsp, &props))
  ------------------
  |  Branch (1164:13): [True: 0, False: 0]
  |  Branch (1164:31): [True: 0, False: 0]
  ------------------
 1165|      0|            return 0;
 1166|       |
 1167|      0|        EVP_CIPHER_free(ctx->cipher);
 1168|      0|        ctx->cipher = NULL;
 1169|      0|        ctx->cipher_intent = ciphername != NULL;
 1170|      0|        if (ciphername != NULL
  ------------------
  |  Branch (1170:13): [True: 0, False: 0]
  ------------------
 1171|      0|            && ((ctx->cipher =
  ------------------
  |  Branch (1171:16): [True: 0, False: 0]
  ------------------
 1172|      0|                 EVP_CIPHER_fetch(libctx, ciphername, props)) == NULL))
 1173|      0|            return 0;
 1174|      0|    }
 1175|       |
 1176|  28.0k|    if (save_paramsp != NULL) {
  ------------------
  |  Branch (1176:9): [True: 28.0k, False: 0]
  ------------------
 1177|  28.0k|        if (!OSSL_PARAM_get_int(save_paramsp, &ctx->save_parameters))
  ------------------
  |  Branch (1177:13): [True: 0, False: 28.0k]
  ------------------
 1178|      0|            return 0;
 1179|  28.0k|    }
 1180|  28.0k|    return 1;
 1181|  28.0k|}
encode_key2any.c:rsa_to_type_specific_keypair_der_does_selection:
 1435|    276|    {                                                                       \
 1436|    276|        return key2any_check_selection(selection,                           \
 1437|    276|                                       DO_##kind##_selection_mask);         \
 1438|    276|    }                                                                       \
encode_key2any.c:key2any_check_selection:
 1184|  54.4k|{
 1185|       |    /*
 1186|       |     * The selections are kinda sorta "levels", i.e. each selection given
 1187|       |     * here is assumed to include those following.
 1188|       |     */
 1189|  54.4k|    int checks[] = {
 1190|  54.4k|        OSSL_KEYMGMT_SELECT_PRIVATE_KEY,
  ------------------
  |  |  640|  54.4k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
 1191|  54.4k|        OSSL_KEYMGMT_SELECT_PUBLIC_KEY,
  ------------------
  |  |  641|  54.4k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
 1192|  54.4k|        OSSL_KEYMGMT_SELECT_ALL_PARAMETERS
  ------------------
  |  |  647|  54.4k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  ------------------
  |  |  |  |  642|  54.4k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  |  |  648|  54.4k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  643|  54.4k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  ------------------
  ------------------
 1193|  54.4k|    };
 1194|  54.4k|    size_t i;
 1195|       |
 1196|       |    /* The decoder implementations made here support guessing */
 1197|  54.4k|    if (selection == 0)
  ------------------
  |  Branch (1197:9): [True: 0, False: 54.4k]
  ------------------
 1198|      0|        return 1;
 1199|       |
 1200|  54.4k|    for (i = 0; i < OSSL_NELEM(checks); i++) {
  ------------------
  |  |   14|  54.4k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1200:17): [True: 54.4k, False: 0]
  ------------------
 1201|  54.4k|        int check1 = (selection & checks[i]) != 0;
 1202|  54.4k|        int check2 = (selection_mask & checks[i]) != 0;
 1203|       |
 1204|       |        /*
 1205|       |         * If the caller asked for the currently checked bit(s), return
 1206|       |         * whether the decoder description says it's supported.
 1207|       |         */
 1208|  54.4k|        if (check1)
  ------------------
  |  Branch (1208:13): [True: 54.4k, False: 0]
  ------------------
 1209|  54.4k|            return check2;
 1210|  54.4k|    }
 1211|       |
 1212|       |    /* This should be dead code, but just to be safe... */
 1213|      0|    return 0;
 1214|  54.4k|}
encode_key2any.c:rsa_to_type_specific_keypair_der_encode:
 1446|    138|    {                                                                       \
 1447|    138|        /* We don't deal with abstract objects */                           \
 1448|    138|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1448:13): [True: 0, False: 138]
  ------------------
 1449|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);         \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1450|      0|            return 0;                                                       \
 1451|      0|        }                                                                   \
 1452|    138|        DO_##kind(impl, type, output)                                       \
 1453|    138|                                                                            \
 1454|    138|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);             \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1455|      0|        return 0;                                                           \
 1456|    138|    }                                                                       \
encode_key2any.c:key2any_encode:
 1223|  1.62k|{
 1224|  1.62k|    int ret = 0;
 1225|       |
 1226|  1.62k|    if (key == NULL) {
  ------------------
  |  Branch (1226:9): [True: 0, False: 1.62k]
  ------------------
 1227|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1228|  1.62k|    } else if (writer != NULL
  ------------------
  |  Branch (1228:16): [True: 1.62k, False: 0]
  ------------------
 1229|  1.62k|               && (checker == NULL || checker(key, type))) {
  ------------------
  |  Branch (1229:20): [True: 1.46k, False: 158]
  |  Branch (1229:39): [True: 158, False: 0]
  ------------------
 1230|  1.62k|        BIO *out = ossl_bio_new_from_core_bio(ctx->provctx, cout);
 1231|       |
 1232|  1.62k|        if (out != NULL
  ------------------
  |  Branch (1232:13): [True: 1.62k, False: 0]
  ------------------
 1233|  1.62k|            && (pwcb == NULL
  ------------------
  |  Branch (1233:17): [True: 0, False: 1.62k]
  ------------------
 1234|  1.62k|                || ossl_pw_set_ossl_passphrase_cb(&ctx->pwdata, pwcb, pwcbarg)))
  ------------------
  |  Branch (1234:20): [True: 1.62k, False: 0]
  ------------------
 1235|  1.62k|            ret =
 1236|  1.62k|                writer(out, key, type, pemname, key2paramstring, key2der, ctx);
 1237|       |
 1238|  1.62k|        BIO_free(out);
 1239|  1.62k|    } else {
 1240|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1241|      0|    }
 1242|  1.62k|    return ret;
 1243|  1.62k|}
encode_key2any.c:rsa_check_key_type:
 1007|    140|{
 1008|    140|    switch (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK)) {
  ------------------
  |  |  117|    140|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  |  Branch (1008:13): [True: 0, False: 140]
  ------------------
 1009|    138|    case RSA_FLAG_TYPE_RSA:
  ------------------
  |  |  118|    138|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  |  Branch (1009:5): [True: 138, False: 2]
  ------------------
 1010|    138|        return expected_type == EVP_PKEY_RSA;
  ------------------
  |  |   63|    138|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|    138|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
 1011|      2|    case RSA_FLAG_TYPE_RSASSAPSS:
  ------------------
  |  |  119|      2|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (1011:5): [True: 2, False: 138]
  ------------------
 1012|      2|        return expected_type == EVP_PKEY_RSA_PSS;
  ------------------
  |  |   65|      2|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      2|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
 1013|    140|    }
 1014|       |
 1015|       |    /* Currently unsupported RSA key type */
 1016|      0|    return EVP_PKEY_NONE;
  ------------------
  |  |   62|      0|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|      0|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1017|    140|}
encode_key2any.c:key_to_type_specific_der_bio:
  386|  1.38k|{
  387|  1.38k|    unsigned char *der = NULL;
  388|  1.38k|    int derlen;
  389|  1.38k|    int ret;
  390|       |
  391|  1.38k|    if ((derlen = k2d(key, &der, (void *)ctx)) <= 0) {
  ------------------
  |  Branch (391:9): [True: 212, False: 1.17k]
  ------------------
  392|    212|        ERR_raise(ERR_LIB_PROV, ERR_R_PROV_LIB);
  ------------------
  |  |  401|    212|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    212|    (ERR_new(),                                                 \
  |  |  |  |  404|    212|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    212|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    212|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    212|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    212|     ERR_set_error)
  |  |  ------------------
  ------------------
  393|    212|        return 0;
  394|    212|    }
  395|       |
  396|  1.17k|    ret = BIO_write(out, der, derlen);
  397|  1.17k|    OPENSSL_free(der);
  ------------------
  |  |  115|  1.17k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.17k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.17k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  398|  1.17k|    return ret > 0;
  399|  1.38k|}
encode_key2any.c:prepare_rsa_params:
  922|      2|{
  923|      2|    const RSA_PSS_PARAMS_30 *pss = ossl_rsa_get0_pss_params_30((RSA *)rsa);
  924|       |
  925|      2|    *pstr = NULL;
  926|       |
  927|      2|    switch (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK)) {
  ------------------
  |  |  117|      2|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  |  Branch (927:13): [True: 0, False: 2]
  ------------------
  928|      0|    case RSA_FLAG_TYPE_RSA:
  ------------------
  |  |  118|      0|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  |  Branch (928:5): [True: 0, False: 2]
  ------------------
  929|       |        /* If plain RSA, the parameters shall be NULL */
  930|      0|        *pstrtype = V_ASN1_NULL;
  ------------------
  |  |   67|      0|# define V_ASN1_NULL                     5
  ------------------
  931|      0|        return 1;
  932|      2|    case RSA_FLAG_TYPE_RSASSAPSS:
  ------------------
  |  |  119|      2|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (932:5): [True: 2, False: 0]
  ------------------
  933|      2|        if (ossl_rsa_pss_params_30_is_unrestricted(pss)) {
  ------------------
  |  Branch (933:13): [True: 0, False: 2]
  ------------------
  934|      0|            *pstrtype = V_ASN1_UNDEF;
  ------------------
  |  |   60|      0|# define V_ASN1_UNDEF                    -1
  ------------------
  935|      0|            return 1;
  936|      2|        } else {
  937|      2|            ASN1_STRING *astr = NULL;
  938|      2|            WPACKET pkt;
  939|      2|            unsigned char *str = NULL;
  940|      2|            size_t str_sz = 0;
  941|      2|            int i;
  942|       |
  943|      6|            for (i = 0; i < 2; i++) {
  ------------------
  |  Branch (943:25): [True: 4, False: 2]
  ------------------
  944|      4|                switch (i) {
  ------------------
  |  Branch (944:25): [True: 0, False: 4]
  ------------------
  945|      2|                case 0:
  ------------------
  |  Branch (945:17): [True: 2, False: 2]
  ------------------
  946|      2|                    if (!WPACKET_init_null_der(&pkt))
  ------------------
  |  Branch (946:25): [True: 0, False: 2]
  ------------------
  947|      0|                        goto err;
  948|      2|                    break;
  949|      2|                case 1:
  ------------------
  |  Branch (949:17): [True: 2, False: 2]
  ------------------
  950|      2|                    if ((str = OPENSSL_malloc(str_sz)) == NULL
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (950:25): [True: 0, False: 2]
  ------------------
  951|      2|                        || !WPACKET_init_der(&pkt, str, str_sz)) {
  ------------------
  |  Branch (951:28): [True: 0, False: 2]
  ------------------
  952|      0|                        WPACKET_cleanup(&pkt);
  953|      0|                        goto err;
  954|      0|                    }
  955|      2|                    break;
  956|      4|                }
  957|      4|                if (!ossl_DER_w_RSASSA_PSS_params(&pkt, -1, pss)
  ------------------
  |  Branch (957:21): [True: 0, False: 4]
  ------------------
  958|      4|                    || !WPACKET_finish(&pkt)
  ------------------
  |  Branch (958:24): [True: 0, False: 4]
  ------------------
  959|      4|                    || !WPACKET_get_total_written(&pkt, &str_sz)) {
  ------------------
  |  Branch (959:24): [True: 0, False: 4]
  ------------------
  960|      0|                    WPACKET_cleanup(&pkt);
  961|      0|                    goto err;
  962|      0|                }
  963|      4|                WPACKET_cleanup(&pkt);
  964|       |
  965|       |                /*
  966|       |                 * If no PSS parameters are going to be written, there's no
  967|       |                 * point going for another iteration.
  968|       |                 * This saves us from getting |str| allocated just to have it
  969|       |                 * immediately de-allocated.
  970|       |                 */
  971|      4|                if (str_sz == 0)
  ------------------
  |  Branch (971:21): [True: 0, False: 4]
  ------------------
  972|      0|                    break;
  973|      4|            }
  974|       |
  975|      2|            if ((astr = ASN1_STRING_new()) == NULL)
  ------------------
  |  Branch (975:17): [True: 0, False: 2]
  ------------------
  976|      0|                goto err;
  977|      2|            *pstrtype = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|      2|# define V_ASN1_SEQUENCE                 16
  ------------------
  978|      2|            ASN1_STRING_set0(astr, str, (int)str_sz);
  979|      2|            *pstr = astr;
  980|       |
  981|      2|            return 1;
  982|      0|         err:
  983|      0|            OPENSSL_free(str);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  984|      0|            return 0;
  985|      2|        }
  986|      2|    }
  987|       |
  988|       |    /* Currently unsupported RSA key type */
  989|      0|    return 0;
  990|      2|}
encode_key2any.c:rsa_prv_k2d:
  454|    140|    {                                               \
  455|    140|        return f(key, pder);                        \
  456|    140|    }
encode_key2any.c:dh_check_key_type:
  551|     18|{
  552|     18|    int type =
  553|     18|        DH_test_flags(dh, DH_FLAG_TYPE_DHX) ? EVP_PKEY_DHX : EVP_PKEY_DH;
  ------------------
  |  |  112|     18|#  define DH_FLAG_TYPE_DHX              0x1000
  ------------------
                      DH_test_flags(dh, DH_FLAG_TYPE_DHX) ? EVP_PKEY_DHX : EVP_PKEY_DH;
  ------------------
  |  |   72|     18|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5499|     18|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
                      DH_test_flags(dh, DH_FLAG_TYPE_DHX) ? EVP_PKEY_DHX : EVP_PKEY_DH;
  ------------------
  |  |   71|      0|# define EVP_PKEY_DH     NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|      0|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
  |  Branch (553:9): [True: 18, False: 0]
  ------------------
  554|       |
  555|     18|    return type == expected_type;
  556|     18|}
encode_key2any.c:dhx_to_type_specific_params_der_does_selection:
 1435|    216|    {                                                                       \
 1436|    216|        return key2any_check_selection(selection,                           \
 1437|    216|                                       DO_##kind##_selection_mask);         \
 1438|    216|    }                                                                       \
encode_key2any.c:dsa_to_type_specific_der_does_selection:
 1435|  1.03k|    {                                                                       \
 1436|  1.03k|        return key2any_check_selection(selection,                           \
 1437|  1.03k|                                       DO_##kind##_selection_mask);         \
 1438|  1.03k|    }                                                                       \
encode_key2any.c:dsa_to_type_specific_der_encode:
 1446|    517|    {                                                                       \
 1447|    517|        /* We don't deal with abstract objects */                           \
 1448|    517|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1448:13): [True: 0, False: 517]
  ------------------
 1449|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);         \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1450|      0|            return 0;                                                       \
 1451|      0|        }                                                                   \
 1452|    517|        DO_##kind(impl, type, output)                                       \
 1453|    517|                                                                            \
 1454|    517|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);             \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1455|      0|        return 0;                                                           \
 1456|    517|    }                                                                       \
encode_key2any.c:dsa_prv_k2d:
  454|    517|    {                                               \
  455|    517|        return f(key, pder);                        \
  456|    517|    }
encode_key2any.c:ec_to_type_specific_no_pub_der_does_selection:
 1435|  1.66k|    {                                                                       \
 1436|  1.66k|        return key2any_check_selection(selection,                           \
 1437|  1.66k|                                       DO_##kind##_selection_mask);         \
 1438|  1.66k|    }                                                                       \
encode_key2any.c:ec_to_type_specific_no_pub_der_encode:
 1446|    727|    {                                                                       \
 1447|    727|        /* We don't deal with abstract objects */                           \
 1448|    727|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1448:13): [True: 0, False: 727]
  ------------------
 1449|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);         \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1450|      0|            return 0;                                                       \
 1451|      0|        }                                                                   \
 1452|    727|        DO_##kind(impl, type, output)                                       \
 1453|    727|                                                                            \
 1454|    727|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);             \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1455|      0|        return 0;                                                           \
 1456|    727|    }                                                                       \
encode_key2any.c:prepare_ec_params:
  695|    212|{
  696|    212|    int curve_nid;
  697|    212|    const EC_GROUP *group = EC_KEY_get0_group(eckey);
  698|    212|    ASN1_OBJECT *params = NULL;
  699|       |
  700|    212|    if (group == NULL)
  ------------------
  |  Branch (700:9): [True: 0, False: 212]
  ------------------
  701|      0|        return 0;
  702|    212|    curve_nid = EC_GROUP_get_curve_name(group);
  703|    212|    if (curve_nid != NID_undef) {
  ------------------
  |  |   18|    212|#define NID_undef                       0
  ------------------
  |  Branch (703:9): [True: 162, False: 50]
  ------------------
  704|    162|        params = OBJ_nid2obj(curve_nid);
  705|    162|        if (params == NULL)
  ------------------
  |  Branch (705:13): [True: 0, False: 162]
  ------------------
  706|      0|            return 0;
  707|    162|    }
  708|       |
  709|    212|    if (curve_nid != NID_undef
  ------------------
  |  |   18|    424|#define NID_undef                       0
  ------------------
  |  Branch (709:9): [True: 162, False: 50]
  ------------------
  710|    212|        && (EC_GROUP_get_asn1_flag(group) & OPENSSL_EC_NAMED_CURVE)) {
  ------------------
  |  |   31|    162|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  |  Branch (710:12): [True: 162, False: 0]
  ------------------
  711|       |        /* The CHOICE came to namedCurve */
  712|    162|        if (OBJ_length(params) == 0) {
  ------------------
  |  Branch (712:13): [True: 0, False: 162]
  ------------------
  713|       |            /* Some curves might not have an associated OID */
  714|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_OID);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  715|      0|            ASN1_OBJECT_free(params);
  716|      0|            return 0;
  717|      0|        }
  718|    162|        *pstr = params;
  719|    162|        *pstrtype = V_ASN1_OBJECT;
  ------------------
  |  |   68|    162|# define V_ASN1_OBJECT                   6
  ------------------
  720|    162|        return 1;
  721|    162|    } else {
  722|       |        /* The CHOICE came to ecParameters */
  723|     50|        return prepare_ec_explicit_params(eckey, pstr, pstrtype);
  724|     50|    }
  725|    212|}
encode_key2any.c:prepare_ec_explicit_params:
  669|     50|{
  670|     50|    ASN1_STRING *params = ASN1_STRING_new();
  671|       |
  672|     50|    if (params == NULL) {
  ------------------
  |  Branch (672:9): [True: 0, False: 50]
  ------------------
  673|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  674|      0|        return 0;
  675|      0|    }
  676|       |
  677|     50|    params->length = i2d_ECParameters(eckey, &params->data);
  678|     50|    if (params->length <= 0) {
  ------------------
  |  Branch (678:9): [True: 0, False: 50]
  ------------------
  679|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  680|      0|        ASN1_STRING_free(params);
  681|      0|        return 0;
  682|      0|    }
  683|       |
  684|     50|    *pstrtype = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|     50|# define V_ASN1_SEQUENCE                 16
  ------------------
  685|     50|    *pstr = params;
  686|     50|    return 1;
  687|     50|}
encode_key2any.c:ec_prv_k2d:
  454|    731|    {                                               \
  455|    731|        return f(key, pder);                        \
  456|    731|    }
encode_key2any.c:sm2_to_type_specific_no_pub_der_does_selection:
 1435|      9|    {                                                                       \
 1436|      9|        return key2any_check_selection(selection,                           \
 1437|      9|                                       DO_##kind##_selection_mask);         \
 1438|      9|    }                                                                       \
encode_key2any.c:sm2_to_type_specific_no_pub_der_encode:
 1446|      4|    {                                                                       \
 1447|      4|        /* We don't deal with abstract objects */                           \
 1448|      4|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1448:13): [True: 0, False: 4]
  ------------------
 1449|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);         \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1450|      0|            return 0;                                                       \
 1451|      0|        }                                                                   \
 1452|      4|        DO_##kind(impl, type, output)                                       \
 1453|      4|                                                                            \
 1454|      4|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);             \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1455|      0|        return 0;                                                           \
 1456|      4|    }                                                                       \
encode_key2any.c:rsa_to_type_specific_keypair_pem_does_selection:
 1435|    276|    {                                                                       \
 1436|    276|        return key2any_check_selection(selection,                           \
 1437|    276|                                       DO_##kind##_selection_mask);         \
 1438|    276|    }                                                                       \
encode_key2any.c:dhx_to_type_specific_params_pem_does_selection:
 1435|    216|    {                                                                       \
 1436|    216|        return key2any_check_selection(selection,                           \
 1437|    216|                                       DO_##kind##_selection_mask);         \
 1438|    216|    }                                                                       \
encode_key2any.c:dsa_to_type_specific_pem_does_selection:
 1435|  1.03k|    {                                                                       \
 1436|  1.03k|        return key2any_check_selection(selection,                           \
 1437|  1.03k|                                       DO_##kind##_selection_mask);         \
 1438|  1.03k|    }                                                                       \
encode_key2any.c:ec_to_type_specific_no_pub_pem_does_selection:
 1435|  1.66k|    {                                                                       \
 1436|  1.66k|        return key2any_check_selection(selection,                           \
 1437|  1.66k|                                       DO_##kind##_selection_mask);         \
 1438|  1.66k|    }                                                                       \
encode_key2any.c:sm2_to_type_specific_no_pub_pem_does_selection:
 1435|      9|    {                                                                       \
 1436|      9|        return key2any_check_selection(selection,                           \
 1437|      9|                                       DO_##kind##_selection_mask);         \
 1438|      9|    }                                                                       \
encode_key2any.c:rsa_to_EncryptedPrivateKeyInfo_der_does_selection:
 1435|    276|    {                                                                       \
 1436|    276|        return key2any_check_selection(selection,                           \
 1437|    276|                                       DO_##kind##_selection_mask);         \
 1438|    276|    }                                                                       \
encode_key2any.c:key_to_p8info:
   90|    235|{
   91|       |    /* der, derlen store the key DER output and its length */
   92|    235|    unsigned char *der = NULL;
   93|    235|    int derlen;
   94|       |    /* The final PKCS#8 info */
   95|    235|    PKCS8_PRIV_KEY_INFO *p8info = NULL;
   96|       |
   97|    235|    if ((p8info = PKCS8_PRIV_KEY_INFO_new()) == NULL
  ------------------
  |  Branch (97:9): [True: 0, False: 235]
  ------------------
   98|    235|        || (derlen = k2d(key, &der, (void *)ctx)) <= 0
  ------------------
  |  Branch (98:12): [True: 212, False: 23]
  ------------------
   99|    235|        || !PKCS8_pkey_set0(p8info, OBJ_nid2obj(key_nid), 0,
  ------------------
  |  Branch (99:12): [True: 0, False: 23]
  ------------------
  100|    212|                            params_type, params, der, derlen)) {
  101|    212|        ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|    212|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    212|    (ERR_new(),                                                 \
  |  |  |  |  404|    212|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    212|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    212|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    212|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    212|     ERR_set_error)
  |  |  ------------------
  ------------------
  102|    212|        PKCS8_PRIV_KEY_INFO_free(p8info);
  103|    212|        OPENSSL_free(der);
  ------------------
  |  |  115|    212|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    212|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    212|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|    212|        p8info = NULL;
  105|    212|    }
  106|       |
  107|    235|    return p8info;
  108|    235|}
encode_key2any.c:free_asn1_data:
   75|    212|{
   76|    212|    switch (type) {
  ------------------
  |  Branch (76:13): [True: 0, False: 212]
  ------------------
   77|    162|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|    162|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (77:5): [True: 162, False: 50]
  ------------------
   78|    162|        ASN1_OBJECT_free(data);
   79|    162|        break;
   80|     50|    case V_ASN1_SEQUENCE:
  ------------------
  |  |   74|     50|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (80:5): [True: 50, False: 162]
  ------------------
   81|     50|        ASN1_STRING_free(data);
   82|     50|        break;
   83|    212|    }
   84|    212|}
encode_key2any.c:rsa_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1435|    276|    {                                                                       \
 1436|    276|        return key2any_check_selection(selection,                           \
 1437|    276|                                       DO_##kind##_selection_mask);         \
 1438|    276|    }                                                                       \
encode_key2any.c:rsa_to_PrivateKeyInfo_der_does_selection:
 1435|    276|    {                                                                       \
 1436|    276|        return key2any_check_selection(selection,                           \
 1437|    276|                                       DO_##kind##_selection_mask);         \
 1438|    276|    }                                                                       \
encode_key2any.c:key_to_pki_der_priv_bio:
  256|    235|{
  257|    235|    int ret = 0;
  258|    235|    void *str = NULL;
  259|    235|    int strtype = V_ASN1_UNDEF;
  ------------------
  |  |   60|    235|# define V_ASN1_UNDEF                    -1
  ------------------
  260|    235|    PKCS8_PRIV_KEY_INFO *p8info;
  261|       |
  262|    235|    if (ctx->cipher_intent)
  ------------------
  |  Branch (262:9): [True: 0, False: 235]
  ------------------
  263|      0|        return key_to_epki_der_priv_bio(out, key, key_nid, pemname,
  264|      0|                                        p2s, k2d, ctx);
  265|       |
  266|    235|    if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters,
  ------------------
  |  Branch (266:9): [True: 232, False: 3]
  |  Branch (266:24): [True: 0, False: 232]
  ------------------
  267|    232|                            &str, &strtype))
  268|      0|        return 0;
  269|       |
  270|    235|    p8info = key_to_p8info(key, key_nid, str, strtype, k2d, ctx);
  271|       |
  272|    235|    if (p8info != NULL)
  ------------------
  |  Branch (272:9): [True: 23, False: 212]
  ------------------
  273|     23|        ret = i2d_PKCS8_PRIV_KEY_INFO_bio(out, p8info);
  274|    212|    else
  275|    212|        free_asn1_data(strtype, str);
  276|       |
  277|    235|    PKCS8_PRIV_KEY_INFO_free(p8info);
  278|       |
  279|    235|    return ret;
  280|    235|}
encode_key2any.c:rsa_to_PrivateKeyInfo_pem_does_selection:
 1435|    276|    {                                                                       \
 1436|    276|        return key2any_check_selection(selection,                           \
 1437|    276|                                       DO_##kind##_selection_mask);         \
 1438|    276|    }                                                                       \
encode_key2any.c:rsa_to_SubjectPublicKeyInfo_der_does_selection:
 1435|  1.10k|    {                                                                       \
 1436|  1.10k|        return key2any_check_selection(selection,                           \
 1437|  1.10k|                                       DO_##kind##_selection_mask);         \
 1438|  1.10k|    }                                                                       \
encode_key2any.c:rsa_to_SubjectPublicKeyInfo_pem_does_selection:
 1435|  1.10k|    {                                                                       \
 1436|  1.10k|        return key2any_check_selection(selection,                           \
 1437|  1.10k|                                       DO_##kind##_selection_mask);         \
 1438|  1.10k|    }                                                                       \
encode_key2any.c:rsapss_to_EncryptedPrivateKeyInfo_der_does_selection:
 1435|      6|    {                                                                       \
 1436|      6|        return key2any_check_selection(selection,                           \
 1437|      6|                                       DO_##kind##_selection_mask);         \
 1438|      6|    }                                                                       \
encode_key2any.c:rsapss_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1435|      6|    {                                                                       \
 1436|      6|        return key2any_check_selection(selection,                           \
 1437|      6|                                       DO_##kind##_selection_mask);         \
 1438|      6|    }                                                                       \
encode_key2any.c:rsapss_to_PrivateKeyInfo_der_does_selection:
 1435|      6|    {                                                                       \
 1436|      6|        return key2any_check_selection(selection,                           \
 1437|      6|                                       DO_##kind##_selection_mask);         \
 1438|      6|    }                                                                       \
encode_key2any.c:rsapss_to_PrivateKeyInfo_der_encode:
 1446|      2|    {                                                                       \
 1447|      2|        /* We don't deal with abstract objects */                           \
 1448|      2|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1448:13): [True: 0, False: 2]
  ------------------
 1449|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);         \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1450|      0|            return 0;                                                       \
 1451|      0|        }                                                                   \
 1452|      2|        DO_##kind(impl, type, output)                                       \
 1453|      2|                                                                            \
 1454|      2|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);             \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1455|      0|        return 0;                                                           \
 1456|      2|    }                                                                       \
encode_key2any.c:rsapss_to_PrivateKeyInfo_pem_does_selection:
 1435|      6|    {                                                                       \
 1436|      6|        return key2any_check_selection(selection,                           \
 1437|      6|                                       DO_##kind##_selection_mask);         \
 1438|      6|    }                                                                       \
encode_key2any.c:rsapss_to_SubjectPublicKeyInfo_der_does_selection:
 1435|     24|    {                                                                       \
 1436|     24|        return key2any_check_selection(selection,                           \
 1437|     24|                                       DO_##kind##_selection_mask);         \
 1438|     24|    }                                                                       \
encode_key2any.c:rsapss_to_SubjectPublicKeyInfo_pem_does_selection:
 1435|     24|    {                                                                       \
 1436|     24|        return key2any_check_selection(selection,                           \
 1437|     24|                                       DO_##kind##_selection_mask);         \
 1438|     24|    }                                                                       \
encode_key2any.c:prepare_dh_params:
  463|     18|{
  464|     18|    ASN1_STRING *params = ASN1_STRING_new();
  465|       |
  466|     18|    if (params == NULL) {
  ------------------
  |  Branch (466:9): [True: 0, False: 18]
  ------------------
  467|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  468|      0|        return 0;
  469|      0|    }
  470|       |
  471|     18|    if (nid == EVP_PKEY_DHX)
  ------------------
  |  |   72|     18|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5499|     18|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
  |  Branch (471:9): [True: 18, False: 0]
  ------------------
  472|     18|        params->length = i2d_DHxparams(dh, &params->data);
  473|      0|    else
  474|      0|        params->length = i2d_DHparams(dh, &params->data);
  475|       |
  476|     18|    if (params->length <= 0) {
  ------------------
  |  Branch (476:9): [True: 0, False: 18]
  ------------------
  477|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  478|      0|        ASN1_STRING_free(params);
  479|      0|        return 0;
  480|      0|    }
  481|     18|    params->type = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|     18|# define V_ASN1_SEQUENCE                 16
  ------------------
  482|       |
  483|     18|    *pstr = params;
  484|     18|    *pstrtype = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|     18|# define V_ASN1_SEQUENCE                 16
  ------------------
  485|     18|    return 1;
  486|     18|}
encode_key2any.c:dh_pki_priv_to_der:
  512|     18|{
  513|     18|    const BIGNUM *bn = NULL;
  514|     18|    ASN1_INTEGER *priv_key = NULL;
  515|     18|    int ret;
  516|       |
  517|     18|    if ((bn = DH_get0_priv_key(dh)) == NULL) {
  ------------------
  |  Branch (517:9): [True: 0, False: 18]
  ------------------
  518|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  519|      0|        return 0;
  520|      0|    }
  521|     18|    if ((priv_key = BN_to_ASN1_INTEGER(bn, NULL)) == NULL) {
  ------------------
  |  Branch (521:9): [True: 0, False: 18]
  ------------------
  522|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_BN_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  523|      0|        return 0;
  524|      0|    }
  525|       |
  526|     18|    ret = i2d_ASN1_INTEGER(priv_key, pder);
  527|       |
  528|     18|    ASN1_STRING_clear_free(priv_key);
  529|     18|    return ret;
  530|     18|}
encode_key2any.c:dhx_to_EncryptedPrivateKeyInfo_der_does_selection:
 1435|     54|    {                                                                       \
 1436|     54|        return key2any_check_selection(selection,                           \
 1437|     54|                                       DO_##kind##_selection_mask);         \
 1438|     54|    }                                                                       \
encode_key2any.c:dhx_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1435|     54|    {                                                                       \
 1436|     54|        return key2any_check_selection(selection,                           \
 1437|     54|                                       DO_##kind##_selection_mask);         \
 1438|     54|    }                                                                       \
encode_key2any.c:dhx_to_PrivateKeyInfo_der_does_selection:
 1435|     54|    {                                                                       \
 1436|     54|        return key2any_check_selection(selection,                           \
 1437|     54|                                       DO_##kind##_selection_mask);         \
 1438|     54|    }                                                                       \
encode_key2any.c:dhx_to_PrivateKeyInfo_der_encode:
 1446|     18|    {                                                                       \
 1447|     18|        /* We don't deal with abstract objects */                           \
 1448|     18|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1448:13): [True: 0, False: 18]
  ------------------
 1449|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);         \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1450|      0|            return 0;                                                       \
 1451|      0|        }                                                                   \
 1452|     18|        DO_##kind(impl, type, output)                                       \
 1453|     18|                                                                            \
 1454|     18|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);             \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1455|      0|        return 0;                                                           \
 1456|     18|    }                                                                       \
encode_key2any.c:dhx_to_PrivateKeyInfo_pem_does_selection:
 1435|     54|    {                                                                       \
 1436|     54|        return key2any_check_selection(selection,                           \
 1437|     54|                                       DO_##kind##_selection_mask);         \
 1438|     54|    }                                                                       \
encode_key2any.c:dhx_to_SubjectPublicKeyInfo_der_does_selection:
 1435|    216|    {                                                                       \
 1436|    216|        return key2any_check_selection(selection,                           \
 1437|    216|                                       DO_##kind##_selection_mask);         \
 1438|    216|    }                                                                       \
encode_key2any.c:dhx_to_SubjectPublicKeyInfo_pem_does_selection:
 1435|    216|    {                                                                       \
 1436|    216|        return key2any_check_selection(selection,                           \
 1437|    216|                                       DO_##kind##_selection_mask);         \
 1438|    216|    }                                                                       \
encode_key2any.c:dsa_to_EncryptedPrivateKeyInfo_der_does_selection:
 1435|  1.03k|    {                                                                       \
 1436|  1.03k|        return key2any_check_selection(selection,                           \
 1437|  1.03k|                                       DO_##kind##_selection_mask);         \
 1438|  1.03k|    }                                                                       \
encode_key2any.c:dsa_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1435|  1.03k|    {                                                                       \
 1436|  1.03k|        return key2any_check_selection(selection,                           \
 1437|  1.03k|                                       DO_##kind##_selection_mask);         \
 1438|  1.03k|    }                                                                       \
encode_key2any.c:dsa_to_PrivateKeyInfo_der_does_selection:
 1435|  1.03k|    {                                                                       \
 1436|  1.03k|        return key2any_check_selection(selection,                           \
 1437|  1.03k|                                       DO_##kind##_selection_mask);         \
 1438|  1.03k|    }                                                                       \
encode_key2any.c:dsa_to_PrivateKeyInfo_pem_does_selection:
 1435|  1.03k|    {                                                                       \
 1436|  1.03k|        return key2any_check_selection(selection,                           \
 1437|  1.03k|                                       DO_##kind##_selection_mask);         \
 1438|  1.03k|    }                                                                       \
encode_key2any.c:dsa_to_SubjectPublicKeyInfo_der_does_selection:
 1435|  6.20k|    {                                                                       \
 1436|  6.20k|        return key2any_check_selection(selection,                           \
 1437|  6.20k|                                       DO_##kind##_selection_mask);         \
 1438|  6.20k|    }                                                                       \
encode_key2any.c:dsa_to_SubjectPublicKeyInfo_pem_does_selection:
 1435|  6.20k|    {                                                                       \
 1436|  6.20k|        return key2any_check_selection(selection,                           \
 1437|  6.20k|                                       DO_##kind##_selection_mask);         \
 1438|  6.20k|    }                                                                       \
encode_key2any.c:ec_to_EncryptedPrivateKeyInfo_der_does_selection:
 1435|  1.66k|    {                                                                       \
 1436|  1.66k|        return key2any_check_selection(selection,                           \
 1437|  1.66k|                                       DO_##kind##_selection_mask);         \
 1438|  1.66k|    }                                                                       \
encode_key2any.c:ec_pki_priv_to_der:
  739|    212|{
  740|    212|    EC_KEY *eckey = (EC_KEY *)veckey;
  741|    212|    unsigned int old_flags;
  742|    212|    int ret = 0;
  743|       |
  744|       |    /*
  745|       |     * For PKCS8 the curve name appears in the PKCS8_PRIV_KEY_INFO object
  746|       |     * as the pkeyalg->parameter field. (For a named curve this is an OID)
  747|       |     * The pkey field is an octet string that holds the encoded
  748|       |     * ECPrivateKey SEQUENCE with the optional parameters field omitted.
  749|       |     * We omit this by setting the EC_PKEY_NO_PARAMETERS flag.
  750|       |     */
  751|    212|    old_flags = EC_KEY_get_enc_flags(eckey); /* save old flags */
  752|    212|    EC_KEY_set_enc_flags(eckey, old_flags | EC_PKEY_NO_PARAMETERS);
  ------------------
  |  |  958|    212|#  define EC_PKEY_NO_PARAMETERS   0x001
  ------------------
  753|    212|    ret = i2d_ECPrivateKey(eckey, pder);
  754|    212|    EC_KEY_set_enc_flags(eckey, old_flags); /* restore old flags */
  755|    212|    return ret; /* return the length of the der encoded data */
  756|    212|}
encode_key2any.c:ec_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1435|  1.66k|    {                                                                       \
 1436|  1.66k|        return key2any_check_selection(selection,                           \
 1437|  1.66k|                                       DO_##kind##_selection_mask);         \
 1438|  1.66k|    }                                                                       \
encode_key2any.c:ec_to_PrivateKeyInfo_der_does_selection:
 1435|  1.66k|    {                                                                       \
 1436|  1.66k|        return key2any_check_selection(selection,                           \
 1437|  1.66k|                                       DO_##kind##_selection_mask);         \
 1438|  1.66k|    }                                                                       \
encode_key2any.c:ec_to_PrivateKeyInfo_der_encode:
 1446|    211|    {                                                                       \
 1447|    211|        /* We don't deal with abstract objects */                           \
 1448|    211|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1448:13): [True: 0, False: 211]
  ------------------
 1449|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);         \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1450|      0|            return 0;                                                       \
 1451|      0|        }                                                                   \
 1452|    211|        DO_##kind(impl, type, output)                                       \
 1453|    211|                                                                            \
 1454|    211|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);             \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1455|      0|        return 0;                                                           \
 1456|    211|    }                                                                       \
encode_key2any.c:ec_to_PrivateKeyInfo_pem_does_selection:
 1435|  1.66k|    {                                                                       \
 1436|  1.66k|        return key2any_check_selection(selection,                           \
 1437|  1.66k|                                       DO_##kind##_selection_mask);         \
 1438|  1.66k|    }                                                                       \
encode_key2any.c:ec_to_SubjectPublicKeyInfo_der_does_selection:
 1435|  4.99k|    {                                                                       \
 1436|  4.99k|        return key2any_check_selection(selection,                           \
 1437|  4.99k|                                       DO_##kind##_selection_mask);         \
 1438|  4.99k|    }                                                                       \
encode_key2any.c:ec_to_SubjectPublicKeyInfo_pem_does_selection:
 1435|  4.99k|    {                                                                       \
 1436|  4.99k|        return key2any_check_selection(selection,                           \
 1437|  4.99k|                                       DO_##kind##_selection_mask);         \
 1438|  4.99k|    }                                                                       \
encode_key2any.c:sm2_to_EncryptedPrivateKeyInfo_der_does_selection:
 1435|      9|    {                                                                       \
 1436|      9|        return key2any_check_selection(selection,                           \
 1437|      9|                                       DO_##kind##_selection_mask);         \
 1438|      9|    }                                                                       \
encode_key2any.c:sm2_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1435|      9|    {                                                                       \
 1436|      9|        return key2any_check_selection(selection,                           \
 1437|      9|                                       DO_##kind##_selection_mask);         \
 1438|      9|    }                                                                       \
encode_key2any.c:sm2_to_PrivateKeyInfo_der_does_selection:
 1435|      9|    {                                                                       \
 1436|      9|        return key2any_check_selection(selection,                           \
 1437|      9|                                       DO_##kind##_selection_mask);         \
 1438|      9|    }                                                                       \
encode_key2any.c:sm2_to_PrivateKeyInfo_der_encode:
 1446|      1|    {                                                                       \
 1447|      1|        /* We don't deal with abstract objects */                           \
 1448|      1|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1448:13): [True: 0, False: 1]
  ------------------
 1449|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);         \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1450|      0|            return 0;                                                       \
 1451|      0|        }                                                                   \
 1452|      1|        DO_##kind(impl, type, output)                                       \
 1453|      1|                                                                            \
 1454|      1|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);             \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1455|      0|        return 0;                                                           \
 1456|      1|    }                                                                       \
encode_key2any.c:sm2_to_PrivateKeyInfo_pem_does_selection:
 1435|      9|    {                                                                       \
 1436|      9|        return key2any_check_selection(selection,                           \
 1437|      9|                                       DO_##kind##_selection_mask);         \
 1438|      9|    }                                                                       \
encode_key2any.c:sm2_to_SubjectPublicKeyInfo_der_does_selection:
 1435|     18|    {                                                                       \
 1436|     18|        return key2any_check_selection(selection,                           \
 1437|     18|                                       DO_##kind##_selection_mask);         \
 1438|     18|    }                                                                       \
encode_key2any.c:sm2_to_SubjectPublicKeyInfo_pem_does_selection:
 1435|     18|    {                                                                       \
 1436|     18|        return key2any_check_selection(selection,                           \
 1437|     18|                                       DO_##kind##_selection_mask);         \
 1438|     18|    }                                                                       \
encode_key2any.c:ed25519_to_EncryptedPrivateKeyInfo_der_does_selection:
 1435|      6|    {                                                                       \
 1436|      6|        return key2any_check_selection(selection,                           \
 1437|      6|                                       DO_##kind##_selection_mask);         \
 1438|      6|    }                                                                       \
encode_key2any.c:ecx_pki_priv_to_der:
  811|      3|{
  812|      3|    const ECX_KEY *ecxkey = vecxkey;
  813|      3|    ASN1_OCTET_STRING oct;
  814|      3|    int keybloblen;
  815|       |
  816|      3|    if (ecxkey == NULL || ecxkey->privkey == NULL) {
  ------------------
  |  Branch (816:9): [True: 0, False: 3]
  |  Branch (816:27): [True: 0, False: 3]
  ------------------
  817|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  818|      0|        return 0;
  819|      0|    }
  820|       |
  821|      3|    oct.data = ecxkey->privkey;
  822|      3|    oct.length = ecxkey->keylen;
  823|      3|    oct.flags = 0;
  824|       |
  825|      3|    keybloblen = i2d_ASN1_OCTET_STRING(&oct, pder);
  826|      3|    if (keybloblen < 0) {
  ------------------
  |  Branch (826:9): [True: 0, False: 3]
  ------------------
  827|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  828|      0|        return 0;
  829|      0|    }
  830|       |
  831|      3|    return keybloblen;
  832|      3|}
encode_key2any.c:ed25519_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1435|      6|    {                                                                       \
 1436|      6|        return key2any_check_selection(selection,                           \
 1437|      6|                                       DO_##kind##_selection_mask);         \
 1438|      6|    }                                                                       \
encode_key2any.c:ed25519_to_PrivateKeyInfo_der_does_selection:
 1435|      6|    {                                                                       \
 1436|      6|        return key2any_check_selection(selection,                           \
 1437|      6|                                       DO_##kind##_selection_mask);         \
 1438|      6|    }                                                                       \
encode_key2any.c:ed25519_to_PrivateKeyInfo_der_encode:
 1446|      2|    {                                                                       \
 1447|      2|        /* We don't deal with abstract objects */                           \
 1448|      2|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1448:13): [True: 0, False: 2]
  ------------------
 1449|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);         \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1450|      0|            return 0;                                                       \
 1451|      0|        }                                                                   \
 1452|      2|        DO_##kind(impl, type, output)                                       \
 1453|      2|                                                                            \
 1454|      2|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);             \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1455|      0|        return 0;                                                           \
 1456|      2|    }                                                                       \
encode_key2any.c:ed25519_to_PrivateKeyInfo_pem_does_selection:
 1435|      6|    {                                                                       \
 1436|      6|        return key2any_check_selection(selection,                           \
 1437|      6|                                       DO_##kind##_selection_mask);         \
 1438|      6|    }                                                                       \
encode_key2any.c:ed25519_to_SubjectPublicKeyInfo_der_does_selection:
 1435|     12|    {                                                                       \
 1436|     12|        return key2any_check_selection(selection,                           \
 1437|     12|                                       DO_##kind##_selection_mask);         \
 1438|     12|    }                                                                       \
encode_key2any.c:ed25519_to_SubjectPublicKeyInfo_pem_does_selection:
 1435|     12|    {                                                                       \
 1436|     12|        return key2any_check_selection(selection,                           \
 1437|     12|                                       DO_##kind##_selection_mask);         \
 1438|     12|    }                                                                       \
encode_key2any.c:x25519_to_EncryptedPrivateKeyInfo_der_does_selection:
 1435|      3|    {                                                                       \
 1436|      3|        return key2any_check_selection(selection,                           \
 1437|      3|                                       DO_##kind##_selection_mask);         \
 1438|      3|    }                                                                       \
encode_key2any.c:x25519_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1435|      3|    {                                                                       \
 1436|      3|        return key2any_check_selection(selection,                           \
 1437|      3|                                       DO_##kind##_selection_mask);         \
 1438|      3|    }                                                                       \
encode_key2any.c:x25519_to_PrivateKeyInfo_der_does_selection:
 1435|      3|    {                                                                       \
 1436|      3|        return key2any_check_selection(selection,                           \
 1437|      3|                                       DO_##kind##_selection_mask);         \
 1438|      3|    }                                                                       \
encode_key2any.c:x25519_to_PrivateKeyInfo_der_encode:
 1446|      1|    {                                                                       \
 1447|      1|        /* We don't deal with abstract objects */                           \
 1448|      1|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1448:13): [True: 0, False: 1]
  ------------------
 1449|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);         \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1450|      0|            return 0;                                                       \
 1451|      0|        }                                                                   \
 1452|      1|        DO_##kind(impl, type, output)                                       \
 1453|      1|                                                                            \
 1454|      1|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);             \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1455|      0|        return 0;                                                           \
 1456|      1|    }                                                                       \
encode_key2any.c:x25519_to_PrivateKeyInfo_pem_does_selection:
 1435|      3|    {                                                                       \
 1436|      3|        return key2any_check_selection(selection,                           \
 1437|      3|                                       DO_##kind##_selection_mask);         \
 1438|      3|    }                                                                       \
encode_key2any.c:x25519_to_SubjectPublicKeyInfo_der_does_selection:
 1435|      6|    {                                                                       \
 1436|      6|        return key2any_check_selection(selection,                           \
 1437|      6|                                       DO_##kind##_selection_mask);         \
 1438|      6|    }                                                                       \
encode_key2any.c:x25519_to_SubjectPublicKeyInfo_pem_does_selection:
 1435|      6|    {                                                                       \
 1436|      6|        return key2any_check_selection(selection,                           \
 1437|      6|                                       DO_##kind##_selection_mask);         \
 1438|      6|    }                                                                       \
encode_key2any.c:rsa_to_RSA_der_does_selection:
 1435|    276|    {                                                                       \
 1436|    276|        return key2any_check_selection(selection,                           \
 1437|    276|                                       DO_##kind##_selection_mask);         \
 1438|    276|    }                                                                       \
encode_key2any.c:rsa_to_RSA_pem_does_selection:
 1435|    276|    {                                                                       \
 1436|    276|        return key2any_check_selection(selection,                           \
 1437|    276|                                       DO_##kind##_selection_mask);         \
 1438|    276|    }                                                                       \
encode_key2any.c:dhx_to_DHX_der_does_selection:
 1435|    216|    {                                                                       \
 1436|    216|        return key2any_check_selection(selection,                           \
 1437|    216|                                       DO_##kind##_selection_mask);         \
 1438|    216|    }                                                                       \
encode_key2any.c:dhx_to_DHX_pem_does_selection:
 1435|    216|    {                                                                       \
 1436|    216|        return key2any_check_selection(selection,                           \
 1437|    216|                                       DO_##kind##_selection_mask);         \
 1438|    216|    }                                                                       \
encode_key2any.c:dsa_to_DSA_der_does_selection:
 1435|  1.03k|    {                                                                       \
 1436|  1.03k|        return key2any_check_selection(selection,                           \
 1437|  1.03k|                                       DO_##kind##_selection_mask);         \
 1438|  1.03k|    }                                                                       \
encode_key2any.c:dsa_to_DSA_pem_does_selection:
 1435|  1.03k|    {                                                                       \
 1436|  1.03k|        return key2any_check_selection(selection,                           \
 1437|  1.03k|                                       DO_##kind##_selection_mask);         \
 1438|  1.03k|    }                                                                       \
encode_key2any.c:ec_to_EC_der_does_selection:
 1435|  1.66k|    {                                                                       \
 1436|  1.66k|        return key2any_check_selection(selection,                           \
 1437|  1.66k|                                       DO_##kind##_selection_mask);         \
 1438|  1.66k|    }                                                                       \
encode_key2any.c:ec_to_EC_pem_does_selection:
 1435|  1.66k|    {                                                                       \
 1436|  1.66k|        return key2any_check_selection(selection,                           \
 1437|  1.66k|                                       DO_##kind##_selection_mask);         \
 1438|  1.66k|    }                                                                       \
encode_key2any.c:rsa_to_PKCS1_der_does_selection:
 1435|    276|    {                                                                       \
 1436|    276|        return key2any_check_selection(selection,                           \
 1437|    276|                                       DO_##kind##_selection_mask);         \
 1438|    276|    }                                                                       \
encode_key2any.c:rsa_to_PKCS1_pem_does_selection:
 1435|    276|    {                                                                       \
 1436|    276|        return key2any_check_selection(selection,                           \
 1437|    276|                                       DO_##kind##_selection_mask);         \
 1438|    276|    }                                                                       \
encode_key2any.c:rsapss_to_PKCS1_der_does_selection:
 1435|      6|    {                                                                       \
 1436|      6|        return key2any_check_selection(selection,                           \
 1437|      6|                                       DO_##kind##_selection_mask);         \
 1438|      6|    }                                                                       \
encode_key2any.c:rsapss_to_PKCS1_pem_does_selection:
 1435|      6|    {                                                                       \
 1436|      6|        return key2any_check_selection(selection,                           \
 1437|      6|                                       DO_##kind##_selection_mask);         \
 1438|      6|    }                                                                       \
encode_key2any.c:dhx_to_X9_42_der_does_selection:
 1435|    216|    {                                                                       \
 1436|    216|        return key2any_check_selection(selection,                           \
 1437|    216|                                       DO_##kind##_selection_mask);         \
 1438|    216|    }                                                                       \
encode_key2any.c:dhx_to_X9_42_pem_does_selection:
 1435|    216|    {                                                                       \
 1436|    216|        return key2any_check_selection(selection,                           \
 1437|    216|                                       DO_##kind##_selection_mask);         \
 1438|    216|    }                                                                       \
encode_key2any.c:ec_to_X9_62_der_does_selection:
 1435|  1.66k|    {                                                                       \
 1436|  1.66k|        return key2any_check_selection(selection,                           \
 1437|  1.66k|                                       DO_##kind##_selection_mask);         \
 1438|  1.66k|    }                                                                       \
encode_key2any.c:ec_to_X9_62_pem_does_selection:
 1435|  1.66k|    {                                                                       \
 1436|  1.66k|        return key2any_check_selection(selection,                           \
 1437|  1.66k|                                       DO_##kind##_selection_mask);         \
 1438|  1.66k|    }                                                                       \

encode_key2blob.c:ec2blob_does_selection:
  140|  4.99k|    {                                                                   \
  141|  4.99k|        return key2blob_check_selection(selection,                      \
  142|  4.99k|                                        EVP_PKEY_##selection_name);     \
  143|  4.99k|    }                                                                   \
encode_key2blob.c:key2blob_check_selection:
   56|  5.01k|{
   57|       |    /*
   58|       |     * The selections are kinda sorta "levels", i.e. each selection given
   59|       |     * here is assumed to include those following.
   60|       |     */
   61|  5.01k|    int checks[] = {
   62|  5.01k|        OSSL_KEYMGMT_SELECT_PRIVATE_KEY,
  ------------------
  |  |  640|  5.01k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
   63|  5.01k|        OSSL_KEYMGMT_SELECT_PUBLIC_KEY,
  ------------------
  |  |  641|  5.01k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
   64|  5.01k|        OSSL_KEYMGMT_SELECT_ALL_PARAMETERS
  ------------------
  |  |  647|  5.01k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  ------------------
  |  |  |  |  642|  5.01k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  |  |  648|  5.01k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  643|  5.01k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  ------------------
  ------------------
   65|  5.01k|    };
   66|  5.01k|    size_t i;
   67|       |
   68|       |    /* The decoder implementations made here support guessing */
   69|  5.01k|    if (selection == 0)
  ------------------
  |  Branch (69:9): [True: 0, False: 5.01k]
  ------------------
   70|      0|        return 1;
   71|       |
   72|  5.01k|    for (i = 0; i < OSSL_NELEM(checks); i++) {
  ------------------
  |  |   14|  5.01k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (72:17): [True: 5.01k, False: 0]
  ------------------
   73|  5.01k|        int check1 = (selection & checks[i]) != 0;
   74|  5.01k|        int check2 = (selection_mask & checks[i]) != 0;
   75|       |
   76|       |        /*
   77|       |         * If the caller asked for the currently checked bit(s), return
   78|       |         * whether the decoder description says it's supported.
   79|       |         */
   80|  5.01k|        if (check1)
  ------------------
  |  Branch (80:13): [True: 5.01k, False: 0]
  ------------------
   81|  5.01k|            return check2;
   82|  5.01k|    }
   83|       |
   84|       |    /* This should be dead code, but just to be safe... */
   85|      0|    return 0;
   86|  5.01k|}
encode_key2blob.c:sm22blob_does_selection:
  140|     18|    {                                                                   \
  141|     18|        return key2blob_check_selection(selection,                      \
  142|     18|                                        EVP_PKEY_##selection_name);     \
  143|     18|    }                                                                   \

encode_key2ms.c:key2ms_newctx:
   72|  2.62k|{
   73|  2.62k|    struct key2ms_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|  2.62k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.62k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.62k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   74|       |
   75|  2.62k|    if (ctx != NULL) {
  ------------------
  |  Branch (75:9): [True: 2.62k, False: 0]
  ------------------
   76|  2.62k|        ctx->provctx = provctx;
   77|       |        /* This is the strongest encryption level */
   78|  2.62k|        ctx->pvk_encr_level = 2;
   79|  2.62k|    }
   80|  2.62k|    return ctx;
   81|  2.62k|}
encode_key2ms.c:key2ms_freectx:
   84|  2.62k|{
   85|  2.62k|    struct key2ms_ctx_st *ctx = vctx;
   86|       |
   87|  2.62k|    ossl_pw_clear_passphrase_data(&ctx->pwdata);
   88|  2.62k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  2.62k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.62k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.62k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   89|  2.62k|}
encode_key2ms.c:key2pvk_set_ctx_params:
  102|  1.31k|{
  103|  1.31k|    struct key2ms_ctx_st *ctx = vctx;
  104|  1.31k|    const OSSL_PARAM *p;
  105|       |
  106|  1.31k|    p = OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_ENCRYPT_LEVEL);
  ------------------
  |  |  251|  1.31k|# define OSSL_ENCODER_PARAM_ENCRYPT_LEVEL "encrypt-level"
  ------------------
  107|  1.31k|    if (p != NULL && !OSSL_PARAM_get_int(p, &ctx->pvk_encr_level))
  ------------------
  |  Branch (107:9): [True: 0, False: 1.31k]
  |  Branch (107:22): [True: 0, False: 0]
  ------------------
  108|      0|        return 0;
  109|  1.31k|    return 1;
  110|  1.31k|}
encode_key2ms.c:key2ms_does_selection:
  113|  2.62k|{
  114|  2.62k|    return (selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0;
  ------------------
  |  |  650|  2.62k|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  640|  2.62k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|  2.62k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  115|  2.62k|}

encode_key2text.c:key2text_newctx:
  619|  3.05k|{
  620|  3.05k|    return provctx;
  621|  3.05k|}
encode_key2text.c:key2text_freectx:
  624|  3.05k|{
  625|  3.05k|}
encode_key2text.c:key2text_encode:
  632|  1.40k|{
  633|  1.40k|    BIO *out = ossl_bio_new_from_core_bio(vctx, cout);
  634|  1.40k|    int ret;
  635|       |
  636|  1.40k|    if (out == NULL)
  ------------------
  |  Branch (636:9): [True: 0, False: 1.40k]
  ------------------
  637|      0|        return 0;
  638|       |
  639|  1.40k|    ret = key2text(out, key, selection);
  640|  1.40k|    BIO_free(out);
  641|       |
  642|  1.40k|    return ret;
  643|  1.40k|}
encode_key2text.c:dh_to_text:
   43|     18|{
   44|     18|    const DH *dh = key;
   45|     18|    const char *type_label = NULL;
   46|     18|    const BIGNUM *priv_key = NULL, *pub_key = NULL;
   47|     18|    const FFC_PARAMS *params = NULL;
   48|     18|    const BIGNUM *p = NULL;
   49|     18|    long length;
   50|       |
   51|     18|    if (out == NULL || dh == NULL) {
  ------------------
  |  Branch (51:9): [True: 0, False: 18]
  |  Branch (51:24): [True: 0, False: 18]
  ------------------
   52|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   53|      0|        return 0;
   54|      0|    }
   55|       |
   56|     18|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  640|     18|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (56:9): [True: 18, False: 0]
  ------------------
   57|     18|        type_label = "DH Private-Key";
   58|      0|    else if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
  ------------------
  |  |  641|      0|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (58:14): [True: 0, False: 0]
  ------------------
   59|      0|        type_label = "DH Public-Key";
   60|      0|    else if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
  ------------------
  |  |  642|      0|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (60:14): [True: 0, False: 0]
  ------------------
   61|      0|        type_label = "DH Parameters";
   62|       |
   63|     18|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  640|     18|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (63:9): [True: 18, False: 0]
  ------------------
   64|     18|        priv_key = DH_get0_priv_key(dh);
   65|     18|        if (priv_key == NULL) {
  ------------------
  |  Branch (65:13): [True: 0, False: 18]
  ------------------
   66|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   67|      0|            return 0;
   68|      0|        }
   69|     18|    }
   70|     18|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
  ------------------
  |  |  650|     18|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  640|     18|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|     18|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  |  Branch (70:9): [True: 18, False: 0]
  ------------------
   71|     18|        pub_key = DH_get0_pub_key(dh);
   72|     18|        if (pub_key == NULL) {
  ------------------
  |  Branch (72:13): [True: 0, False: 18]
  ------------------
   73|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   74|      0|            return 0;
   75|      0|        }
   76|     18|    }
   77|     18|    if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) {
  ------------------
  |  |  642|     18|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (77:9): [True: 18, False: 0]
  ------------------
   78|     18|        params = ossl_dh_get0_params((DH *)dh);
   79|     18|        if (params == NULL) {
  ------------------
  |  Branch (79:13): [True: 0, False: 18]
  ------------------
   80|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_PARAMETERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   81|      0|            return 0;
   82|      0|        }
   83|     18|    }
   84|       |
   85|     18|    p = DH_get0_p(dh);
   86|     18|    if (p == NULL) {
  ------------------
  |  Branch (86:9): [True: 0, False: 18]
  ------------------
   87|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   88|      0|        return 0;
   89|      0|    }
   90|       |
   91|     18|    if (BIO_printf(out, "%s: (%d bit)\n", type_label, BN_num_bits(p)) <= 0)
  ------------------
  |  Branch (91:9): [True: 0, False: 18]
  ------------------
   92|      0|        return 0;
   93|     18|    if (priv_key != NULL
  ------------------
  |  Branch (93:9): [True: 18, False: 0]
  ------------------
   94|     18|        && !ossl_bio_print_labeled_bignum(out, "private-key:", priv_key))
  ------------------
  |  Branch (94:12): [True: 0, False: 18]
  ------------------
   95|      0|        return 0;
   96|     18|    if (pub_key != NULL
  ------------------
  |  Branch (96:9): [True: 18, False: 0]
  ------------------
   97|     18|        && !ossl_bio_print_labeled_bignum(out, "public-key:", pub_key))
  ------------------
  |  Branch (97:12): [True: 0, False: 18]
  ------------------
   98|      0|        return 0;
   99|     18|    if (params != NULL
  ------------------
  |  Branch (99:9): [True: 18, False: 0]
  ------------------
  100|     18|        && !ossl_bio_print_ffc_params(out, params))
  ------------------
  |  Branch (100:12): [True: 0, False: 18]
  ------------------
  101|      0|        return 0;
  102|     18|    length = DH_get_length(dh);
  103|     18|    if (length > 0
  ------------------
  |  Branch (103:9): [True: 0, False: 18]
  ------------------
  104|     18|        && BIO_printf(out, "recommended-private-length: %ld bits\n",
  ------------------
  |  Branch (104:12): [True: 0, False: 0]
  ------------------
  105|      0|                      length) <= 0)
  106|      0|        return 0;
  107|       |
  108|     18|    return 1;
  109|     18|}
encode_key2text.c:dhx2text_encode:
  668|     18|    {                                                                   \
  669|     18|        /* We don't deal with abstract objects */                       \
  670|     18|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (670:13): [True: 0, False: 18]
  ------------------
  671|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);     \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  672|      0|            return 0;                                                   \
  673|      0|        }                                                               \
  674|     18|        return key2text_encode(vctx, key, selection, cout,              \
  675|     18|                               type##_to_text, cb, cbarg);              \
  676|     18|    }                                                                   \
encode_key2text.c:dsa2text_encode:
  668|    517|    {                                                                   \
  669|    517|        /* We don't deal with abstract objects */                       \
  670|    517|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (670:13): [True: 0, False: 517]
  ------------------
  671|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);     \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  672|      0|            return 0;                                                   \
  673|      0|        }                                                               \
  674|    517|        return key2text_encode(vctx, key, selection, cout,              \
  675|    517|                               type##_to_text, cb, cbarg);              \
  676|    517|    }                                                                   \
encode_key2text.c:dsa_to_text:
  116|    517|{
  117|    517|    const DSA *dsa = key;
  118|    517|    const char *type_label = NULL;
  119|    517|    const BIGNUM *priv_key = NULL, *pub_key = NULL;
  120|    517|    const FFC_PARAMS *params = NULL;
  121|    517|    const BIGNUM *p = NULL;
  122|       |
  123|    517|    if (out == NULL || dsa == NULL) {
  ------------------
  |  Branch (123:9): [True: 0, False: 517]
  |  Branch (123:24): [True: 0, False: 517]
  ------------------
  124|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  125|      0|        return 0;
  126|      0|    }
  127|       |
  128|    517|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  640|    517|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (128:9): [True: 517, False: 0]
  ------------------
  129|    517|        type_label = "Private-Key";
  130|      0|    else if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
  ------------------
  |  |  641|      0|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (130:14): [True: 0, False: 0]
  ------------------
  131|      0|        type_label = "Public-Key";
  132|      0|    else if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
  ------------------
  |  |  642|      0|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (132:14): [True: 0, False: 0]
  ------------------
  133|      0|        type_label = "DSA-Parameters";
  134|       |
  135|    517|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  640|    517|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (135:9): [True: 517, False: 0]
  ------------------
  136|    517|        priv_key = DSA_get0_priv_key(dsa);
  137|    517|        if (priv_key == NULL) {
  ------------------
  |  Branch (137:13): [True: 0, False: 517]
  ------------------
  138|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  139|      0|            return 0;
  140|      0|        }
  141|    517|    }
  142|    517|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
  ------------------
  |  |  650|    517|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  640|    517|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|    517|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  |  Branch (142:9): [True: 517, False: 0]
  ------------------
  143|    517|        pub_key = DSA_get0_pub_key(dsa);
  144|    517|        if (pub_key == NULL) {
  ------------------
  |  Branch (144:13): [True: 0, False: 517]
  ------------------
  145|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  146|      0|            return 0;
  147|      0|        }
  148|    517|    }
  149|    517|    if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) {
  ------------------
  |  |  642|    517|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (149:9): [True: 517, False: 0]
  ------------------
  150|    517|        params = ossl_dsa_get0_params((DSA *)dsa);
  151|    517|        if (params == NULL) {
  ------------------
  |  Branch (151:13): [True: 0, False: 517]
  ------------------
  152|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_PARAMETERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  153|      0|            return 0;
  154|      0|        }
  155|    517|    }
  156|       |
  157|    517|    p = DSA_get0_p(dsa);
  158|    517|    if (p == NULL) {
  ------------------
  |  Branch (158:9): [True: 0, False: 517]
  ------------------
  159|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  160|      0|        return 0;
  161|      0|    }
  162|       |
  163|    517|    if (BIO_printf(out, "%s: (%d bit)\n", type_label, BN_num_bits(p)) <= 0)
  ------------------
  |  Branch (163:9): [True: 0, False: 517]
  ------------------
  164|      0|        return 0;
  165|    517|    if (priv_key != NULL
  ------------------
  |  Branch (165:9): [True: 517, False: 0]
  ------------------
  166|    517|        && !ossl_bio_print_labeled_bignum(out, "priv:", priv_key))
  ------------------
  |  Branch (166:12): [True: 0, False: 517]
  ------------------
  167|      0|        return 0;
  168|    517|    if (pub_key != NULL
  ------------------
  |  Branch (168:9): [True: 517, False: 0]
  ------------------
  169|    517|        && !ossl_bio_print_labeled_bignum(out, "pub: ", pub_key))
  ------------------
  |  Branch (169:12): [True: 0, False: 517]
  ------------------
  170|      0|        return 0;
  171|    517|    if (params != NULL
  ------------------
  |  Branch (171:9): [True: 517, False: 0]
  ------------------
  172|    517|        && !ossl_bio_print_ffc_params(out, params))
  ------------------
  |  Branch (172:12): [True: 0, False: 517]
  ------------------
  173|      0|        return 0;
  174|       |
  175|    517|    return 1;
  176|    517|}
encode_key2text.c:ec2text_encode:
  668|    727|    {                                                                   \
  669|    727|        /* We don't deal with abstract objects */                       \
  670|    727|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (670:13): [True: 0, False: 727]
  ------------------
  671|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);     \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  672|      0|            return 0;                                                   \
  673|      0|        }                                                               \
  674|    727|        return key2text_encode(vctx, key, selection, cout,              \
  675|    727|                               type##_to_text, cb, cbarg);              \
  676|    727|    }                                                                   \
encode_key2text.c:ec_to_text:
  313|    731|{
  314|    731|    const EC_KEY *ec = key;
  315|    731|    const char *type_label = NULL;
  316|    731|    unsigned char *priv = NULL, *pub = NULL;
  317|    731|    size_t priv_len = 0, pub_len = 0;
  318|    731|    const EC_GROUP *group;
  319|    731|    int ret = 0;
  320|       |
  321|    731|    if (out == NULL || ec == NULL) {
  ------------------
  |  Branch (321:9): [True: 0, False: 731]
  |  Branch (321:24): [True: 0, False: 731]
  ------------------
  322|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  323|      0|        return 0;
  324|      0|    }
  325|       |
  326|    731|    if ((group = EC_KEY_get0_group(ec)) == NULL) {
  ------------------
  |  Branch (326:9): [True: 0, False: 731]
  ------------------
  327|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  328|      0|        return 0;
  329|      0|    }
  330|       |
  331|    731|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  640|    731|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (331:9): [True: 731, False: 0]
  ------------------
  332|    731|        type_label = "Private-Key";
  333|      0|    else if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
  ------------------
  |  |  641|      0|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (333:14): [True: 0, False: 0]
  ------------------
  334|      0|        type_label = "Public-Key";
  335|      0|    else if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
  ------------------
  |  |  642|      0|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (335:14): [True: 0, False: 0]
  ------------------
  336|      0|        if (EC_GROUP_get_curve_name(group) != NID_sm2)
  ------------------
  |  | 1232|      0|#define NID_sm2         1172
  ------------------
  |  Branch (336:13): [True: 0, False: 0]
  ------------------
  337|      0|            type_label = "EC-Parameters";
  338|       |
  339|    731|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  640|    731|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (339:9): [True: 731, False: 0]
  ------------------
  340|    731|        const BIGNUM *priv_key = EC_KEY_get0_private_key(ec);
  341|       |
  342|    731|        if (priv_key == NULL) {
  ------------------
  |  Branch (342:13): [True: 0, False: 731]
  ------------------
  343|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  344|      0|            goto err;
  345|      0|        }
  346|    731|        priv_len = EC_KEY_priv2buf(ec, &priv);
  347|    731|        if (priv_len == 0)
  ------------------
  |  Branch (347:13): [True: 205, False: 526]
  ------------------
  348|    205|            goto err;
  349|    731|    }
  350|    526|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
  ------------------
  |  |  650|    526|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  640|    526|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|    526|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  |  Branch (350:9): [True: 526, False: 0]
  ------------------
  351|    526|        const EC_POINT *pub_pt = EC_KEY_get0_public_key(ec);
  352|       |
  353|    526|        if (pub_pt == NULL) {
  ------------------
  |  Branch (353:13): [True: 0, False: 526]
  ------------------
  354|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  355|      0|            goto err;
  356|      0|        }
  357|       |
  358|    526|        pub_len = EC_KEY_key2buf(ec, EC_KEY_get_conv_form(ec), &pub, NULL);
  359|    526|        if (pub_len == 0)
  ------------------
  |  Branch (359:13): [True: 7, False: 519]
  ------------------
  360|      7|            goto err;
  361|    526|    }
  362|       |
  363|    519|    if (type_label != NULL
  ------------------
  |  Branch (363:9): [True: 519, False: 0]
  ------------------
  364|    519|        && BIO_printf(out, "%s: (%d bit)\n", type_label,
  ------------------
  |  Branch (364:12): [True: 0, False: 519]
  ------------------
  365|    519|                      EC_GROUP_order_bits(group)) <= 0)
  366|      0|        goto err;
  367|    519|    if (priv != NULL
  ------------------
  |  Branch (367:9): [True: 519, False: 0]
  ------------------
  368|    519|        && !ossl_bio_print_labeled_buf(out, "priv:", priv, priv_len))
  ------------------
  |  Branch (368:12): [True: 0, False: 519]
  ------------------
  369|      0|        goto err;
  370|    519|    if (pub != NULL
  ------------------
  |  Branch (370:9): [True: 519, False: 0]
  ------------------
  371|    519|        && !ossl_bio_print_labeled_buf(out, "pub:", pub, pub_len))
  ------------------
  |  Branch (371:12): [True: 0, False: 519]
  ------------------
  372|      0|        goto err;
  373|    519|    if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
  ------------------
  |  |  642|    519|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (373:9): [True: 519, False: 0]
  ------------------
  374|    519|        ret = ec_param_to_text(out, group, ossl_ec_key_get_libctx(ec));
  375|    731|err:
  376|    731|    OPENSSL_clear_free(priv, priv_len);
  ------------------
  |  |  113|    731|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    731|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    731|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  377|    731|    OPENSSL_free(pub);
  ------------------
  |  |  115|    731|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    731|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    731|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  378|    731|    return ret;
  379|    519|}
encode_key2text.c:ec_param_to_text:
  292|    519|{
  293|    519|    if (EC_GROUP_get_asn1_flag(group) & OPENSSL_EC_NAMED_CURVE) {
  ------------------
  |  |   31|    519|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  |  Branch (293:9): [True: 449, False: 70]
  ------------------
  294|    449|        const char *curve_name;
  295|    449|        int curve_nid = EC_GROUP_get_curve_name(group);
  296|       |
  297|       |        /* Explicit parameters */
  298|    449|        if (curve_nid == NID_undef)
  ------------------
  |  |   18|    449|#define NID_undef                       0
  ------------------
  |  Branch (298:13): [True: 0, False: 449]
  ------------------
  299|      0|            return 0;
  300|       |
  301|    449|        if (BIO_printf(out, "%s: %s\n", "ASN1 OID", OBJ_nid2sn(curve_nid)) <= 0)
  ------------------
  |  Branch (301:13): [True: 0, False: 449]
  ------------------
  302|      0|            return 0;
  303|       |
  304|    449|        curve_name = EC_curve_nid2nist(curve_nid);
  305|    449|        return (curve_name == NULL
  ------------------
  |  Branch (305:17): [True: 238, False: 211]
  ------------------
  306|    449|                || BIO_printf(out, "%s: %s\n", "NIST CURVE", curve_name) > 0);
  ------------------
  |  Branch (306:20): [True: 211, False: 0]
  ------------------
  307|    449|    } else {
  308|     70|        return ec_param_explicit_to_text(out, group, libctx);
  309|     70|    }
  310|    519|}
encode_key2text.c:ec_param_explicit_to_text:
  251|     70|{
  252|     70|    int ret = 0, tmp_nid;
  253|     70|    BN_CTX *ctx = NULL;
  254|     70|    const BIGNUM *order = NULL, *cofactor = NULL;
  255|     70|    const unsigned char *seed;
  256|     70|    size_t seed_len = 0;
  257|       |
  258|     70|    ctx = BN_CTX_new_ex(libctx);
  259|     70|    if (ctx == NULL)
  ------------------
  |  Branch (259:9): [True: 0, False: 70]
  ------------------
  260|      0|        return 0;
  261|     70|    BN_CTX_start(ctx);
  262|       |
  263|     70|    tmp_nid = EC_GROUP_get_field_type(group);
  264|     70|    order = EC_GROUP_get0_order(group);
  265|     70|    if (order == NULL)
  ------------------
  |  Branch (265:9): [True: 0, False: 70]
  ------------------
  266|      0|        goto err;
  267|       |
  268|     70|    seed = EC_GROUP_get0_seed(group);
  269|     70|    if (seed != NULL)
  ------------------
  |  Branch (269:9): [True: 18, False: 52]
  ------------------
  270|     18|        seed_len = EC_GROUP_get_seed_len(group);
  271|     70|    cofactor = EC_GROUP_get0_cofactor(group);
  272|       |
  273|       |    /* print the 'short name' of the field type */
  274|     70|    if (BIO_printf(out, "Field Type: %s\n", OBJ_nid2sn(tmp_nid)) <= 0
  ------------------
  |  Branch (274:9): [True: 0, False: 70]
  ------------------
  275|     70|        || !ec_param_explicit_curve_to_text(out, group, ctx)
  ------------------
  |  Branch (275:12): [True: 0, False: 70]
  ------------------
  276|     70|        || !ec_param_explicit_gen_to_text(out, group, ctx)
  ------------------
  |  Branch (276:12): [True: 0, False: 70]
  ------------------
  277|     70|        || !ossl_bio_print_labeled_bignum(out, "Order: ", order)
  ------------------
  |  Branch (277:12): [True: 0, False: 70]
  ------------------
  278|     70|        || (cofactor != NULL
  ------------------
  |  Branch (278:13): [True: 70, False: 0]
  ------------------
  279|     70|            && !ossl_bio_print_labeled_bignum(out, "Cofactor: ", cofactor))
  ------------------
  |  Branch (279:16): [True: 0, False: 70]
  ------------------
  280|     70|        || (seed != NULL
  ------------------
  |  Branch (280:13): [True: 18, False: 52]
  ------------------
  281|     70|            && !ossl_bio_print_labeled_buf(out, "Seed:", seed, seed_len)))
  ------------------
  |  Branch (281:16): [True: 0, False: 18]
  ------------------
  282|      0|        goto err;
  283|     70|    ret = 1;
  284|     70|err:
  285|     70|    BN_CTX_end(ctx);
  286|     70|    BN_CTX_free(ctx);
  287|     70|    return ret;
  288|     70|}
encode_key2text.c:ec_param_explicit_curve_to_text:
  184|     70|{
  185|     70|    const char *plabel = "Prime:";
  186|     70|    BIGNUM *p = NULL, *a = NULL, *b = NULL;
  187|       |
  188|     70|    p = BN_CTX_get(ctx);
  189|     70|    a = BN_CTX_get(ctx);
  190|     70|    b = BN_CTX_get(ctx);
  191|     70|    if (b == NULL
  ------------------
  |  Branch (191:9): [True: 0, False: 70]
  ------------------
  192|     70|        || !EC_GROUP_get_curve(group, p, a, b, ctx))
  ------------------
  |  Branch (192:12): [True: 0, False: 70]
  ------------------
  193|      0|        return 0;
  194|       |
  195|     70|    if (EC_GROUP_get_field_type(group) == NID_X9_62_characteristic_two_field) {
  ------------------
  |  |  156|     70|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (195:9): [True: 0, False: 70]
  ------------------
  196|      0|        int basis_type = EC_GROUP_get_basis_type(group);
  197|       |
  198|       |        /* print the 'short name' of the base type OID */
  199|      0|        if (basis_type == NID_undef
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (199:13): [True: 0, False: 0]
  ------------------
  200|      0|            || BIO_printf(out, "Basis Type: %s\n", OBJ_nid2sn(basis_type)) <= 0)
  ------------------
  |  Branch (200:16): [True: 0, False: 0]
  ------------------
  201|      0|            return 0;
  202|      0|        plabel = "Polynomial:";
  203|      0|    }
  204|     70|    return ossl_bio_print_labeled_bignum(out, plabel, p)
  ------------------
  |  Branch (204:12): [True: 70, False: 0]
  ------------------
  205|     70|        && ossl_bio_print_labeled_bignum(out, "A:   ", a)
  ------------------
  |  Branch (205:12): [True: 70, False: 0]
  ------------------
  206|     70|        && ossl_bio_print_labeled_bignum(out, "B:   ", b);
  ------------------
  |  Branch (206:12): [True: 70, False: 0]
  ------------------
  207|     70|}
encode_key2text.c:ec_param_explicit_gen_to_text:
  211|     70|{
  212|     70|    int ret;
  213|     70|    size_t buflen;
  214|     70|    point_conversion_form_t form;
  215|     70|    const EC_POINT *point = NULL;
  216|     70|    const char *glabel = NULL;
  217|     70|    unsigned char *buf = NULL;
  218|       |
  219|     70|    form = EC_GROUP_get_point_conversion_form(group);
  220|     70|    point = EC_GROUP_get0_generator(group);
  221|       |
  222|     70|    if (point == NULL)
  ------------------
  |  Branch (222:9): [True: 0, False: 70]
  ------------------
  223|      0|        return 0;
  224|       |
  225|     70|    switch (form) {
  226|     65|    case POINT_CONVERSION_COMPRESSED:
  ------------------
  |  Branch (226:5): [True: 65, False: 5]
  ------------------
  227|     65|       glabel = "Generator (compressed):";
  228|     65|       break;
  229|      4|    case POINT_CONVERSION_UNCOMPRESSED:
  ------------------
  |  Branch (229:5): [True: 4, False: 66]
  ------------------
  230|      4|        glabel = "Generator (uncompressed):";
  231|      4|        break;
  232|      1|    case POINT_CONVERSION_HYBRID:
  ------------------
  |  Branch (232:5): [True: 1, False: 69]
  ------------------
  233|      1|        glabel = "Generator (hybrid):";
  234|      1|        break;
  235|      0|    default:
  ------------------
  |  Branch (235:5): [True: 0, False: 70]
  ------------------
  236|      0|        return 0;
  237|     70|    }
  238|       |
  239|     70|    buflen = EC_POINT_point2buf(group, point, form, &buf, ctx);
  240|     70|    if (buflen == 0)
  ------------------
  |  Branch (240:9): [True: 0, False: 70]
  ------------------
  241|      0|        return 0;
  242|       |
  243|     70|    ret = ossl_bio_print_labeled_buf(out, glabel, buf, buflen);
  244|     70|    OPENSSL_clear_free(buf, buflen);
  ------------------
  |  |  113|     70|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     70|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     70|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  245|     70|    return ret;
  246|     70|}
encode_key2text.c:sm22text_encode:
  668|      4|    {                                                                   \
  669|      4|        /* We don't deal with abstract objects */                       \
  670|      4|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (670:13): [True: 0, False: 4]
  ------------------
  671|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);     \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  672|      0|            return 0;                                                   \
  673|      0|        }                                                               \
  674|      4|        return key2text_encode(vctx, key, selection, cout,              \
  675|      4|                               type##_to_text, cb, cbarg);              \
  676|      4|    }                                                                   \
encode_key2text.c:ed255192text_encode:
  668|      2|    {                                                                   \
  669|      2|        /* We don't deal with abstract objects */                       \
  670|      2|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (670:13): [True: 0, False: 2]
  ------------------
  671|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);     \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  672|      0|            return 0;                                                   \
  673|      0|        }                                                               \
  674|      2|        return key2text_encode(vctx, key, selection, cout,              \
  675|      2|                               type##_to_text, cb, cbarg);              \
  676|      2|    }                                                                   \
encode_key2text.c:ecx_to_text:
  386|      3|{
  387|      3|    const ECX_KEY *ecx = key;
  388|      3|    const char *type_label = NULL;
  389|       |
  390|      3|    if (out == NULL || ecx == NULL) {
  ------------------
  |  Branch (390:9): [True: 0, False: 3]
  |  Branch (390:24): [True: 0, False: 3]
  ------------------
  391|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  392|      0|        return 0;
  393|      0|    }
  394|       |
  395|      3|    switch (ecx->type) {
  ------------------
  |  Branch (395:13): [True: 0, False: 3]
  ------------------
  396|      1|    case ECX_KEY_TYPE_X25519:
  ------------------
  |  Branch (396:5): [True: 1, False: 2]
  ------------------
  397|      1|        type_label = "X25519";
  398|      1|        break;
  399|      0|    case ECX_KEY_TYPE_X448:
  ------------------
  |  Branch (399:5): [True: 0, False: 3]
  ------------------
  400|      0|        type_label = "X448";
  401|      0|        break;
  402|      2|    case ECX_KEY_TYPE_ED25519:
  ------------------
  |  Branch (402:5): [True: 2, False: 1]
  ------------------
  403|      2|        type_label = "ED25519";
  404|      2|        break;
  405|      0|    case ECX_KEY_TYPE_ED448:
  ------------------
  |  Branch (405:5): [True: 0, False: 3]
  ------------------
  406|      0|        type_label = "ED448";
  407|      0|        break;
  408|      3|    }
  409|       |
  410|      3|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  640|      3|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (410:9): [True: 3, False: 0]
  ------------------
  411|      3|        if (ecx->privkey == NULL) {
  ------------------
  |  Branch (411:13): [True: 0, False: 3]
  ------------------
  412|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  413|      0|            return 0;
  414|      0|        }
  415|       |
  416|      3|        if (BIO_printf(out, "%s Private-Key:\n", type_label) <= 0)
  ------------------
  |  Branch (416:13): [True: 0, False: 3]
  ------------------
  417|      0|            return 0;
  418|      3|        if (!ossl_bio_print_labeled_buf(out, "priv:", ecx->privkey, ecx->keylen))
  ------------------
  |  Branch (418:13): [True: 0, False: 3]
  ------------------
  419|      0|            return 0;
  420|      3|    } else if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
  ------------------
  |  |  641|      0|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (420:16): [True: 0, False: 0]
  ------------------
  421|       |        /* ecx->pubkey is an array, not a pointer... */
  422|      0|        if (!ecx->haspubkey) {
  ------------------
  |  Branch (422:13): [True: 0, False: 0]
  ------------------
  423|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  424|      0|            return 0;
  425|      0|        }
  426|       |
  427|      0|        if (BIO_printf(out, "%s Public-Key:\n", type_label) <= 0)
  ------------------
  |  Branch (427:13): [True: 0, False: 0]
  ------------------
  428|      0|            return 0;
  429|      0|    }
  430|       |
  431|      3|    if (!ossl_bio_print_labeled_buf(out, "pub:", ecx->pubkey, ecx->keylen))
  ------------------
  |  Branch (431:9): [True: 0, False: 3]
  ------------------
  432|      0|        return 0;
  433|       |
  434|      3|    return 1;
  435|      3|}
encode_key2text.c:x255192text_encode:
  668|      1|    {                                                                   \
  669|      1|        /* We don't deal with abstract objects */                       \
  670|      1|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (670:13): [True: 0, False: 1]
  ------------------
  671|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);     \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  672|      0|            return 0;                                                   \
  673|      0|        }                                                               \
  674|      1|        return key2text_encode(vctx, key, selection, cout,              \
  675|      1|                               type##_to_text, cb, cbarg);              \
  676|      1|    }                                                                   \
encode_key2text.c:rsa2text_encode:
  668|    138|    {                                                                   \
  669|    138|        /* We don't deal with abstract objects */                       \
  670|    138|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (670:13): [True: 0, False: 138]
  ------------------
  671|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);     \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  672|      0|            return 0;                                                   \
  673|      0|        }                                                               \
  674|    138|        return key2text_encode(vctx, key, selection, cout,              \
  675|    138|                               type##_to_text, cb, cbarg);              \
  676|    138|    }                                                                   \
encode_key2text.c:rsa_to_text:
  457|    140|{
  458|    140|    const RSA *rsa = key;
  459|    140|    const char *type_label = "RSA key";
  460|    140|    const char *modulus_label = NULL;
  461|    140|    const char *exponent_label = NULL;
  462|    140|    const BIGNUM *rsa_d = NULL, *rsa_n = NULL, *rsa_e = NULL;
  463|    140|    STACK_OF(BIGNUM_const) *factors = NULL;
  ------------------
  |  |   31|    140|# define STACK_OF(type) struct stack_st_##type
  ------------------
  464|    140|    STACK_OF(BIGNUM_const) *exps = NULL;
  ------------------
  |  |   31|    140|# define STACK_OF(type) struct stack_st_##type
  ------------------
  465|    140|    STACK_OF(BIGNUM_const) *coeffs = NULL;
  ------------------
  |  |   31|    140|# define STACK_OF(type) struct stack_st_##type
  ------------------
  466|    140|    int primes;
  467|    140|    const RSA_PSS_PARAMS_30 *pss_params = ossl_rsa_get0_pss_params_30((RSA *)rsa);
  468|    140|    int ret = 0;
  469|       |
  470|    140|    if (out == NULL || rsa == NULL) {
  ------------------
  |  Branch (470:9): [True: 0, False: 140]
  |  Branch (470:24): [True: 0, False: 140]
  ------------------
  471|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  472|      0|        goto err;
  473|      0|    }
  474|       |
  475|    140|    factors = sk_BIGNUM_const_new_null();
  476|    140|    exps = sk_BIGNUM_const_new_null();
  477|    140|    coeffs = sk_BIGNUM_const_new_null();
  478|       |
  479|    140|    if (factors == NULL || exps == NULL || coeffs == NULL) {
  ------------------
  |  Branch (479:9): [True: 0, False: 140]
  |  Branch (479:28): [True: 0, False: 140]
  |  Branch (479:44): [True: 0, False: 140]
  ------------------
  480|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  481|      0|        goto err;
  482|      0|    }
  483|       |
  484|    140|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  640|    140|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (484:9): [True: 140, False: 0]
  ------------------
  485|    140|        type_label = "Private-Key";
  486|    140|        modulus_label = "modulus:";
  487|    140|        exponent_label = "publicExponent:";
  488|    140|    } else if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
  ------------------
  |  |  641|      0|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (488:16): [True: 0, False: 0]
  ------------------
  489|      0|        type_label = "Public-Key";
  490|      0|        modulus_label = "Modulus:";
  491|      0|        exponent_label = "Exponent:";
  492|      0|    }
  493|       |
  494|    140|    RSA_get0_key(rsa, &rsa_n, &rsa_e, &rsa_d);
  495|    140|    ossl_rsa_get0_all_params((RSA *)rsa, factors, exps, coeffs);
  496|    140|    primes = sk_BIGNUM_const_num(factors);
  497|       |
  498|    140|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  640|    140|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (498:9): [True: 140, False: 0]
  ------------------
  499|    140|        if (BIO_printf(out, "%s: (%d bit, %d primes)\n",
  ------------------
  |  Branch (499:13): [True: 0, False: 140]
  ------------------
  500|    140|                       type_label, BN_num_bits(rsa_n), primes) <= 0)
  501|      0|            goto err;
  502|    140|    } else {
  503|      0|        if (BIO_printf(out, "%s: (%d bit)\n",
  ------------------
  |  Branch (503:13): [True: 0, False: 0]
  ------------------
  504|      0|                       type_label, BN_num_bits(rsa_n)) <= 0)
  505|      0|            goto err;
  506|      0|    }
  507|       |
  508|    140|    if (!ossl_bio_print_labeled_bignum(out, modulus_label, rsa_n))
  ------------------
  |  Branch (508:9): [True: 0, False: 140]
  ------------------
  509|      0|        goto err;
  510|    140|    if (!ossl_bio_print_labeled_bignum(out, exponent_label, rsa_e))
  ------------------
  |  Branch (510:9): [True: 0, False: 140]
  ------------------
  511|      0|        goto err;
  512|    140|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  640|    140|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (512:9): [True: 140, False: 0]
  ------------------
  513|    140|        int i;
  514|       |
  515|    140|        if (!ossl_bio_print_labeled_bignum(out, "privateExponent:", rsa_d))
  ------------------
  |  Branch (515:13): [True: 0, False: 140]
  ------------------
  516|      0|            goto err;
  517|    140|        if (!ossl_bio_print_labeled_bignum(out, "prime1:",
  ------------------
  |  Branch (517:13): [True: 0, False: 140]
  ------------------
  518|    140|                                           sk_BIGNUM_const_value(factors, 0)))
  519|      0|            goto err;
  520|    140|        if (!ossl_bio_print_labeled_bignum(out, "prime2:",
  ------------------
  |  Branch (520:13): [True: 0, False: 140]
  ------------------
  521|    140|                                           sk_BIGNUM_const_value(factors, 1)))
  522|      0|            goto err;
  523|    140|        if (!ossl_bio_print_labeled_bignum(out, "exponent1:",
  ------------------
  |  Branch (523:13): [True: 0, False: 140]
  ------------------
  524|    140|                                           sk_BIGNUM_const_value(exps, 0)))
  525|      0|            goto err;
  526|    140|        if (!ossl_bio_print_labeled_bignum(out, "exponent2:",
  ------------------
  |  Branch (526:13): [True: 0, False: 140]
  ------------------
  527|    140|                                           sk_BIGNUM_const_value(exps, 1)))
  528|      0|            goto err;
  529|    140|        if (!ossl_bio_print_labeled_bignum(out, "coefficient:",
  ------------------
  |  Branch (529:13): [True: 0, False: 140]
  ------------------
  530|    140|                                           sk_BIGNUM_const_value(coeffs, 0)))
  531|      0|            goto err;
  532|  1.44k|        for (i = 2; i < sk_BIGNUM_const_num(factors); i++) {
  ------------------
  |  Branch (532:21): [True: 1.30k, False: 140]
  ------------------
  533|  1.30k|            if (BIO_printf(out, "prime%d:", i + 1) <= 0)
  ------------------
  |  Branch (533:17): [True: 0, False: 1.30k]
  ------------------
  534|      0|                goto err;
  535|  1.30k|            if (!ossl_bio_print_labeled_bignum(out, NULL,
  ------------------
  |  Branch (535:17): [True: 0, False: 1.30k]
  ------------------
  536|  1.30k|                                               sk_BIGNUM_const_value(factors, i)))
  537|      0|                goto err;
  538|  1.30k|            if (BIO_printf(out, "exponent%d:", i + 1) <= 0)
  ------------------
  |  Branch (538:17): [True: 0, False: 1.30k]
  ------------------
  539|      0|                goto err;
  540|  1.30k|            if (!ossl_bio_print_labeled_bignum(out, NULL,
  ------------------
  |  Branch (540:17): [True: 0, False: 1.30k]
  ------------------
  541|  1.30k|                                               sk_BIGNUM_const_value(exps, i)))
  542|      0|                goto err;
  543|  1.30k|            if (BIO_printf(out, "coefficient%d:", i + 1) <= 0)
  ------------------
  |  Branch (543:17): [True: 0, False: 1.30k]
  ------------------
  544|      0|                goto err;
  545|  1.30k|            if (!ossl_bio_print_labeled_bignum(out, NULL,
  ------------------
  |  Branch (545:17): [True: 0, False: 1.30k]
  ------------------
  546|  1.30k|                                               sk_BIGNUM_const_value(coeffs, i - 1)))
  547|      0|                goto err;
  548|  1.30k|        }
  549|    140|    }
  550|       |
  551|    140|    if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0) {
  ------------------
  |  |  643|    140|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  ------------------
  |  Branch (551:9): [True: 140, False: 0]
  ------------------
  552|    140|        switch (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK)) {
  ------------------
  |  |  117|    140|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  |  Branch (552:17): [True: 0, False: 140]
  ------------------
  553|    138|        case RSA_FLAG_TYPE_RSA:
  ------------------
  |  |  118|    138|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  |  Branch (553:9): [True: 138, False: 2]
  ------------------
  554|    138|            if (!ossl_rsa_pss_params_30_is_unrestricted(pss_params)) {
  ------------------
  |  Branch (554:17): [True: 0, False: 138]
  ------------------
  555|      0|                if (BIO_printf(out, "(INVALID PSS PARAMETERS)\n") <= 0)
  ------------------
  |  Branch (555:21): [True: 0, False: 0]
  ------------------
  556|      0|                    goto err;
  557|      0|            }
  558|    138|            break;
  559|    138|        case RSA_FLAG_TYPE_RSASSAPSS:
  ------------------
  |  |  119|      2|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (559:9): [True: 2, False: 138]
  ------------------
  560|      2|            if (ossl_rsa_pss_params_30_is_unrestricted(pss_params)) {
  ------------------
  |  Branch (560:17): [True: 0, False: 2]
  ------------------
  561|      0|                if (BIO_printf(out, "No PSS parameter restrictions\n") <= 0)
  ------------------
  |  Branch (561:21): [True: 0, False: 0]
  ------------------
  562|      0|                    goto err;
  563|      2|            } else {
  564|      2|                int hashalg_nid = ossl_rsa_pss_params_30_hashalg(pss_params);
  565|      2|                int maskgenalg_nid =
  566|      2|                    ossl_rsa_pss_params_30_maskgenalg(pss_params);
  567|      2|                int maskgenhashalg_nid =
  568|      2|                    ossl_rsa_pss_params_30_maskgenhashalg(pss_params);
  569|      2|                int saltlen = ossl_rsa_pss_params_30_saltlen(pss_params);
  570|      2|                int trailerfield =
  571|      2|                    ossl_rsa_pss_params_30_trailerfield(pss_params);
  572|       |
  573|      2|                if (BIO_printf(out, "PSS parameter restrictions:\n") <= 0)
  ------------------
  |  Branch (573:21): [True: 0, False: 2]
  ------------------
  574|      0|                    goto err;
  575|      2|                if (BIO_printf(out, "  Hash Algorithm: %s%s\n",
  ------------------
  |  Branch (575:21): [True: 0, False: 2]
  ------------------
  576|      2|                               ossl_rsa_oaeppss_nid2name(hashalg_nid),
  577|      2|                               (hashalg_nid == NID_sha1
  ------------------
  |  | 2321|      2|#define NID_sha1                64
  ------------------
  |  Branch (577:33): [True: 2, False: 0]
  ------------------
  578|      2|                                ? " (default)" : "")) <= 0)
  579|      0|                    goto err;
  580|      2|                if (BIO_printf(out, "  Mask Algorithm: %s with %s%s\n",
  ------------------
  |  Branch (580:21): [True: 0, False: 2]
  ------------------
  581|      2|                               ossl_rsa_mgf_nid2name(maskgenalg_nid),
  582|      2|                               ossl_rsa_oaeppss_nid2name(maskgenhashalg_nid),
  583|      2|                               (maskgenalg_nid == NID_mgf1
  ------------------
  |  |  573|      4|#define NID_mgf1                911
  ------------------
  |  Branch (583:33): [True: 2, False: 0]
  ------------------
  584|      2|                                && maskgenhashalg_nid == NID_sha1
  ------------------
  |  | 2321|      2|#define NID_sha1                64
  ------------------
  |  Branch (584:36): [True: 2, False: 0]
  ------------------
  585|      2|                                ? " (default)" : "")) <= 0)
  586|      0|                    goto err;
  587|      2|                if (BIO_printf(out, "  Minimum Salt Length: %d%s\n",
  ------------------
  |  Branch (587:21): [True: 0, False: 2]
  ------------------
  588|      2|                               saltlen,
  589|      2|                               (saltlen == 20 ? " (default)" : "")) <= 0)
  ------------------
  |  Branch (589:33): [True: 2, False: 0]
  ------------------
  590|      0|                    goto err;
  591|      2|                if (BIO_printf(out, "  Trailer Field: 0x%x%s\n",
  ------------------
  |  Branch (591:21): [True: 0, False: 2]
  ------------------
  592|      2|                               trailerfield,
  593|      2|                               (trailerfield == 1 ? " (default)" : "")) <= 0)
  ------------------
  |  Branch (593:33): [True: 2, False: 0]
  ------------------
  594|      0|                    goto err;
  595|      2|            }
  596|      2|            break;
  597|    140|        }
  598|    140|    }
  599|       |
  600|    140|    ret = 1;
  601|    140| err:
  602|    140|    sk_BIGNUM_const_free(factors);
  603|    140|    sk_BIGNUM_const_free(exps);
  604|    140|    sk_BIGNUM_const_free(coeffs);
  605|    140|    return ret;
  606|    140|}
encode_key2text.c:rsapss2text_encode:
  668|      2|    {                                                                   \
  669|      2|        /* We don't deal with abstract objects */                       \
  670|      2|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (670:13): [True: 0, False: 2]
  ------------------
  671|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);     \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  672|      0|            return 0;                                                   \
  673|      0|        }                                                               \
  674|      2|        return key2text_encode(vctx, key, selection, cout,              \
  675|      2|                               type##_to_text, cb, cbarg);              \
  676|      2|    }                                                                   \

ossl_read_der:
   89|   466k|{
   90|   466k|    BUF_MEM *mem = NULL;
   91|   466k|    BIO *in = ossl_bio_new_from_core_bio(provctx, cin);
   92|   466k|    int ok;
   93|       |
   94|   466k|    if (in == NULL)
  ------------------
  |  Branch (94:9): [True: 0, False: 466k]
  ------------------
   95|      0|        return 0;
   96|   466k|    ok = (asn1_d2i_read_bio(in, &mem) >= 0);
   97|   466k|    if (ok) {
  ------------------
  |  Branch (97:9): [True: 373k, False: 92.5k]
  ------------------
   98|   373k|        *data = (unsigned char *)mem->data;
   99|   373k|        *len = (long)mem->length;
  100|   373k|        OPENSSL_free(mem);
  ------------------
  |  |  115|   373k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   373k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   373k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  101|   373k|    }
  102|   466k|    BIO_free(in);
  103|   466k|    return ok;
  104|   466k|}

ossl_ml_common_pkcs8_fmt_order:
   38|      3|{
   39|      3|    ML_COMMON_PKCS8_FMT_PREF *ret;
   40|      3|    int i, count = 0;
   41|      3|    const char *fmt = formats, *end;
   42|      3|    const char *sep = "\t ,";
   43|       |
   44|       |    /* Reserve an extra terminal slot with fmt == NULL */
   45|      3|    if ((ret = OPENSSL_zalloc((NUM_PKCS8_FORMATS + 1) * sizeof(*ret))) == NULL)
  ------------------
  |  |  104|      3|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (45:9): [True: 0, False: 3]
  ------------------
   46|      0|        return NULL;
   47|       |
   48|       |    /* Entries that match a format will get a non-zero preference. */
   49|     21|    for (i = 0; i < NUM_PKCS8_FORMATS; ++i) {
  ------------------
  |  |   67|     21|#define NUM_PKCS8_FORMATS   6
  ------------------
  |  Branch (49:17): [True: 18, False: 3]
  ------------------
   50|     18|        ret[i].fmt = &p8fmt[i];
   51|     18|        ret[i].pref = 0;
   52|     18|    }
   53|       |
   54|       |    /* Default to compile-time table order when none specified. */
   55|      3|    if (formats == NULL)
  ------------------
  |  Branch (55:9): [True: 3, False: 0]
  ------------------
   56|      3|        return ret;
   57|       |
   58|       |    /*
   59|       |     * Formats are case-insensitive, separated by spaces, tabs or commas.
   60|       |     * Duplicate formats are allowed, the first occurence determines the order.
   61|       |     */
   62|      0|    do {
   63|      0|        if (*(fmt += strspn(fmt, sep)) == '\0')
  ------------------
  |  Branch (63:13): [True: 0, False: 0]
  ------------------
   64|      0|            break;
   65|      0|        end = fmt + strcspn(fmt, sep);
   66|      0|        for (i = 0; i < NUM_PKCS8_FORMATS; ++i) {
  ------------------
  |  |   67|      0|#define NUM_PKCS8_FORMATS   6
  ------------------
  |  Branch (66:21): [True: 0, False: 0]
  ------------------
   67|       |            /* Skip slots already selected or with a different name. */
   68|      0|            if (ret[i].pref > 0
  ------------------
  |  Branch (68:17): [True: 0, False: 0]
  ------------------
   69|      0|                || OPENSSL_strncasecmp(ret[i].fmt->p8_name,
  ------------------
  |  Branch (69:20): [True: 0, False: 0]
  ------------------
   70|      0|                                       fmt, (end - fmt)) != 0)
   71|      0|                continue;
   72|       |            /* First time match */
   73|      0|            ret[i].pref = ++count;
   74|      0|            break;
   75|      0|        }
   76|      0|        fmt = end;
   77|      0|    } while (count < NUM_PKCS8_FORMATS);
  ------------------
  |  |   67|      0|#define NUM_PKCS8_FORMATS   6
  ------------------
  |  Branch (77:14): [True: 0, False: 0]
  ------------------
   78|       |
   79|       |    /* No formats matched, raise an error */
   80|      0|    if (count == 0) {
  ------------------
  |  Branch (80:9): [True: 0, False: 0]
  ------------------
   81|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   82|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_ML_DSA_NO_FORMAT,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_ML_DSA_NO_FORMAT,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_ML_DSA_NO_FORMAT,
  ------------------
  |  |  112|      0|# define PROV_R_ML_DSA_NO_FORMAT                          245
  ------------------
   83|      0|                       "no %s private key %s formats are enabled",
   84|      0|                       algorithm_name, direction);
   85|      0|        return NULL;
   86|      0|    }
   87|       |    /* Sort by preference, with 0's last */
   88|      0|    qsort(ret, NUM_PKCS8_FORMATS, sizeof(*ret), pref_cmp);
  ------------------
  |  |   67|      0|#define NUM_PKCS8_FORMATS   6
  ------------------
   89|       |    /* Terminate the list at first unselected entry, perhaps reserved slot. */
   90|      0|    ret[count].fmt = NULL;
   91|      0|    return ret;
   92|      0|}

ossl_ml_dsa_d2i_PUBKEY:
  109|      7|{
  110|      7|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(provctx);
  ------------------
  |  |   31|      7|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  111|      7|    const ML_COMMON_CODEC *codec;
  112|      7|    const ML_DSA_PARAMS *params;
  113|      7|    ML_DSA_KEY *ret;
  114|       |
  115|      7|    if ((params = ossl_ml_dsa_params_get(evp_type)) == NULL
  ------------------
  |  Branch (115:9): [True: 0, False: 7]
  ------------------
  116|      7|        || (codec = ml_dsa_get_codec(evp_type)) == NULL)
  ------------------
  |  Branch (116:12): [True: 0, False: 7]
  ------------------
  117|      0|        return NULL;
  118|      7|    if (pk_len != ML_COMMON_SPKI_OVERHEAD + (ossl_ssize_t) params->pk_len
  ------------------
  |  |   29|      7|#  define ML_COMMON_SPKI_OVERHEAD   22
  ------------------
  |  Branch (118:9): [True: 7, False: 0]
  ------------------
  119|      7|        || memcmp(pk, codec->spkifmt->asn1_prefix, ML_COMMON_SPKI_OVERHEAD) != 0)
  ------------------
  |  |   29|      0|#  define ML_COMMON_SPKI_OVERHEAD   22
  ------------------
  |  Branch (119:12): [True: 0, False: 0]
  ------------------
  120|      7|        return NULL;
  121|      0|    pk_len -= ML_COMMON_SPKI_OVERHEAD;
  ------------------
  |  |   29|      0|#  define ML_COMMON_SPKI_OVERHEAD   22
  ------------------
  122|      0|    pk += ML_COMMON_SPKI_OVERHEAD;
  ------------------
  |  |   29|      0|#  define ML_COMMON_SPKI_OVERHEAD   22
  ------------------
  123|       |
  124|      0|    if ((ret = ossl_ml_dsa_key_new(libctx, propq, evp_type)) == NULL)
  ------------------
  |  Branch (124:9): [True: 0, False: 0]
  ------------------
  125|      0|        return NULL;
  126|       |
  127|      0|    if (!ossl_ml_dsa_pk_decode(ret, pk, (size_t) pk_len)) {
  ------------------
  |  Branch (127:9): [True: 0, False: 0]
  ------------------
  128|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |   28|      0|# define PROV_R_BAD_ENCODING                              141
  ------------------
  129|      0|                       "errror parsing %s public key from input SPKI",
  130|      0|                       params->alg);
  131|      0|        ossl_ml_dsa_key_free(ret);
  132|      0|        return NULL;
  133|      0|    }
  134|       |
  135|      0|    return ret;
  136|      0|}
ossl_ml_dsa_d2i_PKCS8:
  142|  26.5k|{
  143|  26.5k|    const ML_DSA_PARAMS *v;
  144|  26.5k|    const ML_COMMON_CODEC *codec;
  145|  26.5k|    ML_COMMON_PKCS8_FMT_PREF *fmt_slots = NULL, *slot;
  146|  26.5k|    const ML_COMMON_PKCS8_FMT *p8fmt;
  147|  26.5k|    ML_DSA_KEY *key = NULL, *ret = NULL;
  148|  26.5k|    PKCS8_PRIV_KEY_INFO *p8inf = NULL;
  149|  26.5k|    const uint8_t *buf, *pos;
  150|  26.5k|    const X509_ALGOR *alg = NULL;
  151|  26.5k|    const char *formats;
  152|  26.5k|    int len, ptype;
  153|  26.5k|    uint32_t magic;
  154|  26.5k|    uint16_t seed_magic;
  155|  26.5k|    const uint8_t *seed = NULL;
  156|  26.5k|    const uint8_t *priv = NULL;
  157|       |
  158|       |    /* Which ML-DSA variant? */
  159|  26.5k|    if ((v = ossl_ml_dsa_params_get(evp_type)) == NULL
  ------------------
  |  Branch (159:9): [True: 0, False: 26.5k]
  ------------------
  160|  26.5k|        || (codec = ml_dsa_get_codec(evp_type)) == NULL)
  ------------------
  |  Branch (160:12): [True: 0, False: 26.5k]
  ------------------
  161|      0|        return 0;
  162|       |
  163|       |    /* Extract the key OID and any parameters. */
  164|  26.5k|    if ((p8inf = d2i_PKCS8_PRIV_KEY_INFO(NULL, &prvenc, prvlen)) == NULL)
  ------------------
  |  Branch (164:9): [True: 26.4k, False: 76]
  ------------------
  165|  26.4k|        return 0;
  166|       |    /* Shortest prefix is 4 bytes: seq tag/len  + octet string tag/len */
  167|     76|    if (!PKCS8_pkey_get0(NULL, &buf, &len, &alg, p8inf))
  ------------------
  |  Branch (167:9): [True: 0, False: 76]
  ------------------
  168|      0|        goto end;
  169|       |    /* Bail out early if this is some other key type. */
  170|     76|    if (OBJ_obj2nid(alg->algorithm) != evp_type)
  ------------------
  |  Branch (170:9): [True: 75, False: 1]
  ------------------
  171|     75|        goto end;
  172|       |
  173|       |    /* Get the list of enabled decoders. Their order is not important here. */
  174|      1|    formats = ossl_prov_ctx_get_param(
  175|      1|        provctx, OSSL_PKEY_PARAM_ML_DSA_INPUT_FORMATS, NULL);
  ------------------
  |  |  419|      1|# define OSSL_PKEY_PARAM_ML_DSA_INPUT_FORMATS "ml-dsa.input_formats"
  ------------------
  176|      1|    fmt_slots = ossl_ml_common_pkcs8_fmt_order(v->alg, codec->p8fmt,
  177|      1|                                               "input", formats);
  178|      1|    if (fmt_slots == NULL)
  ------------------
  |  Branch (178:9): [True: 0, False: 1]
  ------------------
  179|      0|        goto end;
  180|       |
  181|       |    /* Parameters must be absent. */
  182|      1|    X509_ALGOR_get0(NULL, &ptype, NULL, alg);
  183|      1|    if (ptype != V_ASN1_UNDEF) {
  ------------------
  |  |   60|      1|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (183:9): [True: 1, False: 0]
  ------------------
  184|      1|        ERR_raise_data(ERR_LIB_PROV, PROV_R_UNEXPECTED_KEY_PARAMETERS,
  ------------------
  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      1|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_UNEXPECTED_KEY_PARAMETERS,
  ------------------
  |  |  118|      1|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_UNEXPECTED_KEY_PARAMETERS,
  ------------------
  |  |  153|      1|# define PROV_R_UNEXPECTED_KEY_PARAMETERS                 249
  ------------------
  185|      1|                       "unexpected parameters with a PKCS#8 %s private key",
  186|      1|                       v->alg);
  187|      1|        goto end;
  188|      1|    }
  189|      0|    if ((ossl_ssize_t)len < (ossl_ssize_t)sizeof(magic))
  ------------------
  |  Branch (189:9): [True: 0, False: 0]
  ------------------
  190|      0|        goto end;
  191|       |
  192|       |    /* Find the matching p8 info slot, that also has the expected length. */
  193|      0|    pos = OPENSSL_load_u32_be(&magic, buf);
  194|      0|    for (slot = fmt_slots; (p8fmt = slot->fmt) != NULL; ++slot) {
  ------------------
  |  Branch (194:28): [True: 0, False: 0]
  ------------------
  195|      0|        if (len != (ossl_ssize_t)p8fmt->p8_bytes)
  ------------------
  |  Branch (195:13): [True: 0, False: 0]
  ------------------
  196|      0|            continue;
  197|      0|        if (p8fmt->p8_shift == sizeof(magic)
  ------------------
  |  Branch (197:13): [True: 0, False: 0]
  ------------------
  198|      0|            || (magic >> (p8fmt->p8_shift * 8)) == p8fmt->p8_magic) {
  ------------------
  |  Branch (198:16): [True: 0, False: 0]
  ------------------
  199|      0|            pos -= p8fmt->p8_shift;
  200|      0|            break;
  201|      0|        }
  202|      0|    }
  203|      0|    if (p8fmt == NULL
  ------------------
  |  Branch (203:9): [True: 0, False: 0]
  ------------------
  204|      0|        || (p8fmt->seed_length > 0 && p8fmt->seed_length != ML_DSA_SEED_BYTES)
  ------------------
  |  |   21|      0|# define ML_DSA_SEED_BYTES 32
  ------------------
  |  Branch (204:13): [True: 0, False: 0]
  |  Branch (204:39): [True: 0, False: 0]
  ------------------
  205|      0|        || (p8fmt->priv_length > 0 && p8fmt->priv_length != v->sk_len)
  ------------------
  |  Branch (205:13): [True: 0, False: 0]
  |  Branch (205:39): [True: 0, False: 0]
  ------------------
  206|      0|        || (p8fmt->pub_length > 0 && p8fmt->pub_length != v->pk_len)) {
  ------------------
  |  Branch (206:13): [True: 0, False: 0]
  |  Branch (206:38): [True: 0, False: 0]
  ------------------
  207|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_ML_DSA_NO_FORMAT,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_ML_DSA_NO_FORMAT,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_ML_DSA_NO_FORMAT,
  ------------------
  |  |  112|      0|# define PROV_R_ML_DSA_NO_FORMAT                          245
  ------------------
  208|      0|                       "no matching enabled %s private key input formats",
  209|      0|                       v->alg);
  210|      0|        goto end;
  211|      0|    }
  212|       |
  213|      0|    if (p8fmt->seed_length > 0) {
  ------------------
  |  Branch (213:9): [True: 0, False: 0]
  ------------------
  214|       |        /* Check |seed| tag/len, if not subsumed by |magic|. */
  215|      0|        if (pos + sizeof(uint16_t) == buf + p8fmt->seed_offset) {
  ------------------
  |  Branch (215:13): [True: 0, False: 0]
  ------------------
  216|      0|            pos = OPENSSL_load_u16_be(&seed_magic, pos);
  217|      0|            if (seed_magic != p8fmt->seed_magic)
  ------------------
  |  Branch (217:17): [True: 0, False: 0]
  ------------------
  218|      0|                goto end;
  219|      0|        } else if (pos != buf + p8fmt->seed_offset) {
  ------------------
  |  Branch (219:20): [True: 0, False: 0]
  ------------------
  220|      0|            goto end;
  221|      0|        }
  222|      0|        pos += ML_DSA_SEED_BYTES;
  ------------------
  |  |   21|      0|# define ML_DSA_SEED_BYTES 32
  ------------------
  223|      0|    }
  224|      0|    if (p8fmt->priv_length > 0) {
  ------------------
  |  Branch (224:9): [True: 0, False: 0]
  ------------------
  225|       |        /* Check |priv| tag/len */
  226|      0|        if (pos + sizeof(uint32_t) == buf + p8fmt->priv_offset) {
  ------------------
  |  Branch (226:13): [True: 0, False: 0]
  ------------------
  227|      0|            pos = OPENSSL_load_u32_be(&magic, pos);
  228|      0|            if (magic != p8fmt->priv_magic)
  ------------------
  |  Branch (228:17): [True: 0, False: 0]
  ------------------
  229|      0|                goto end;
  230|      0|        } else if (pos != buf + p8fmt->priv_offset) {
  ------------------
  |  Branch (230:20): [True: 0, False: 0]
  ------------------
  231|      0|            goto end;
  232|      0|        }
  233|      0|        pos += v->sk_len;
  234|      0|    }
  235|      0|    if (p8fmt->pub_length > 0) {
  ------------------
  |  Branch (235:9): [True: 0, False: 0]
  ------------------
  236|      0|        if (pos != buf + p8fmt->pub_offset)
  ------------------
  |  Branch (236:13): [True: 0, False: 0]
  ------------------
  237|      0|            goto end;
  238|      0|        pos += v->pk_len;
  239|      0|    }
  240|      0|    if (pos != buf + len)
  ------------------
  |  Branch (240:9): [True: 0, False: 0]
  ------------------
  241|      0|        goto end;
  242|       |
  243|       |    /*
  244|       |     * Collect the seed and/or key into a "decoded" private key object,
  245|       |     * to be turned into a real key on provider "load" or "import".
  246|       |     */
  247|      0|    if ((key = ossl_prov_ml_dsa_new(provctx, propq, evp_type)) == NULL)
  ------------------
  |  Branch (247:9): [True: 0, False: 0]
  ------------------
  248|      0|        goto end;
  249|      0|    if (p8fmt->seed_length > 0)
  ------------------
  |  Branch (249:9): [True: 0, False: 0]
  ------------------
  250|      0|        seed = buf + p8fmt->seed_offset;
  251|      0|    if (p8fmt->priv_length > 0)
  ------------------
  |  Branch (251:9): [True: 0, False: 0]
  ------------------
  252|      0|        priv = buf + p8fmt->priv_offset;
  253|       |    /* Any OQS public key content is ignored */
  254|       |
  255|      0|    if (ossl_ml_dsa_set_prekey(key, 0, 0,
  ------------------
  |  Branch (255:9): [True: 0, False: 0]
  ------------------
  256|      0|                               seed, ML_DSA_SEED_BYTES, priv, v->sk_len))
  ------------------
  |  |   21|      0|# define ML_DSA_SEED_BYTES 32
  ------------------
  257|      0|        ret = key;
  258|       |
  259|     76| end:
  260|     76|    OPENSSL_free(fmt_slots);
  ------------------
  |  |  115|     76|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     76|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     76|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  261|     76|    PKCS8_PRIV_KEY_INFO_free(p8inf);
  262|     76|    if (ret == NULL)
  ------------------
  |  Branch (262:9): [True: 76, False: 0]
  ------------------
  263|     76|        ossl_ml_dsa_key_free(key);
  264|     76|    return ret;
  265|      0|}
ml_dsa_codecs.c:ml_dsa_get_codec:
   94|  26.5k|{
   95|  26.5k|    switch (evp_type) {
  ------------------
  |  Branch (95:13): [True: 0, False: 26.5k]
  ------------------
   96|  8.85k|    case EVP_PKEY_ML_DSA_44:
  ------------------
  |  |   86|  8.85k|# define EVP_PKEY_ML_DSA_44 NID_ML_DSA_44
  |  |  ------------------
  |  |  |  | 3436|  8.85k|#define NID_ML_DSA_44           1457
  |  |  ------------------
  ------------------
  |  Branch (96:5): [True: 8.85k, False: 17.7k]
  ------------------
   97|  8.85k|        return &codecs[ML_DSA_44_CODEC];
  ------------------
  |  |   79|  8.85k|#define ML_DSA_44_CODEC    0
  ------------------
   98|  8.85k|    case EVP_PKEY_ML_DSA_65:
  ------------------
  |  |   87|  8.85k|# define EVP_PKEY_ML_DSA_65 NID_ML_DSA_65
  |  |  ------------------
  |  |  |  | 3441|  8.85k|#define NID_ML_DSA_65           1458
  |  |  ------------------
  ------------------
  |  Branch (98:5): [True: 8.85k, False: 17.7k]
  ------------------
   99|  8.85k|        return &codecs[ML_DSA_65_CODEC];
  ------------------
  |  |   80|  8.85k|#define ML_DSA_65_CODEC    1
  ------------------
  100|  8.85k|    case EVP_PKEY_ML_DSA_87:
  ------------------
  |  |   88|  8.85k|# define EVP_PKEY_ML_DSA_87 NID_ML_DSA_87
  |  |  ------------------
  |  |  |  | 3446|  8.85k|#define NID_ML_DSA_87           1459
  |  |  ------------------
  ------------------
  |  Branch (100:5): [True: 8.85k, False: 17.7k]
  ------------------
  101|  8.85k|        return &codecs[ML_DSA_87_CODEC];
  ------------------
  |  |   81|  8.85k|#define ML_DSA_87_CODEC    2
  ------------------
  102|  26.5k|    }
  103|      0|    return NULL;
  104|  26.5k|}

ossl_ml_kem_d2i_PUBKEY:
  106|      7|{
  107|      7|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(provctx);
  ------------------
  |  |   31|      7|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  108|      7|    const ML_KEM_VINFO *v;
  109|      7|    const ML_COMMON_CODEC *codec;
  110|      7|    const ML_COMMON_SPKI_FMT *vspki;
  111|      7|    ML_KEM_KEY *ret;
  112|       |
  113|      7|    if ((v = ossl_ml_kem_get_vinfo(evp_type)) == NULL
  ------------------
  |  Branch (113:9): [True: 0, False: 7]
  ------------------
  114|      7|        || (codec = ml_kem_get_codec(evp_type)) == NULL)
  ------------------
  |  Branch (114:12): [True: 0, False: 7]
  ------------------
  115|      0|        return NULL;
  116|      7|    vspki = codec->spkifmt;
  117|      7|    if (publen != ML_COMMON_SPKI_OVERHEAD + (ossl_ssize_t) v->pubkey_bytes
  ------------------
  |  |   29|      7|#  define ML_COMMON_SPKI_OVERHEAD   22
  ------------------
  |  Branch (117:9): [True: 7, False: 0]
  ------------------
  118|      7|        || memcmp(pubenc, vspki->asn1_prefix, ML_COMMON_SPKI_OVERHEAD) != 0)
  ------------------
  |  |   29|      0|#  define ML_COMMON_SPKI_OVERHEAD   22
  ------------------
  |  Branch (118:12): [True: 0, False: 0]
  ------------------
  119|      7|        return NULL;
  120|      0|    publen -= ML_COMMON_SPKI_OVERHEAD;
  ------------------
  |  |   29|      0|#  define ML_COMMON_SPKI_OVERHEAD   22
  ------------------
  121|      0|    pubenc += ML_COMMON_SPKI_OVERHEAD;
  ------------------
  |  |   29|      0|#  define ML_COMMON_SPKI_OVERHEAD   22
  ------------------
  122|       |
  123|      0|    if ((ret = ossl_ml_kem_key_new(libctx, propq, evp_type)) == NULL)
  ------------------
  |  Branch (123:9): [True: 0, False: 0]
  ------------------
  124|      0|        return NULL;
  125|       |
  126|      0|    if (!ossl_ml_kem_parse_public_key(pubenc, (size_t) publen, ret)) {
  ------------------
  |  Branch (126:9): [True: 0, False: 0]
  ------------------
  127|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |   28|      0|# define PROV_R_BAD_ENCODING                              141
  ------------------
  128|      0|                       "errror parsing %s public key from input SPKI",
  129|      0|                       v->algorithm_name);
  130|      0|        ossl_ml_kem_key_free(ret);
  131|      0|        return NULL;
  132|      0|    }
  133|       |
  134|      0|    return ret;
  135|      0|}
ossl_ml_kem_d2i_PKCS8:
  141|  26.5k|{
  142|  26.5k|    const ML_KEM_VINFO *v;
  143|  26.5k|    const ML_COMMON_CODEC *codec;
  144|  26.5k|    ML_COMMON_PKCS8_FMT_PREF *fmt_slots = NULL, *slot;
  145|  26.5k|    const ML_COMMON_PKCS8_FMT *p8fmt;
  146|  26.5k|    ML_KEM_KEY *key = NULL, *ret = NULL;
  147|  26.5k|    PKCS8_PRIV_KEY_INFO *p8inf = NULL;
  148|  26.5k|    const uint8_t *buf, *pos;
  149|  26.5k|    const X509_ALGOR *alg = NULL;
  150|  26.5k|    const char *formats;
  151|  26.5k|    int len, ptype;
  152|  26.5k|    uint32_t magic;
  153|  26.5k|    uint16_t seed_magic;
  154|       |
  155|       |    /* Which ML-KEM variant? */
  156|  26.5k|    if ((v = ossl_ml_kem_get_vinfo(evp_type)) == NULL
  ------------------
  |  Branch (156:9): [True: 0, False: 26.5k]
  ------------------
  157|  26.5k|        || (codec = ml_kem_get_codec(evp_type)) == NULL)
  ------------------
  |  Branch (157:12): [True: 0, False: 26.5k]
  ------------------
  158|      0|        return 0;
  159|       |
  160|       |    /* Extract the key OID and any parameters. */
  161|  26.5k|    if ((p8inf = d2i_PKCS8_PRIV_KEY_INFO(NULL, &prvenc, prvlen)) == NULL)
  ------------------
  |  Branch (161:9): [True: 26.4k, False: 77]
  ------------------
  162|  26.4k|        return 0;
  163|       |    /* Shortest prefix is 4 bytes: seq tag/len  + octet string tag/len */
  164|     77|    if (!PKCS8_pkey_get0(NULL, &buf, &len, &alg, p8inf))
  ------------------
  |  Branch (164:9): [True: 0, False: 77]
  ------------------
  165|      0|        goto end;
  166|       |    /* Bail out early if this is some other key type. */
  167|     77|    if (OBJ_obj2nid(alg->algorithm) != evp_type)
  ------------------
  |  Branch (167:9): [True: 75, False: 2]
  ------------------
  168|     75|        goto end;
  169|       |
  170|       |    /* Get the list of enabled decoders. Their order is not important here. */
  171|      2|    formats = ossl_prov_ctx_get_param(
  172|      2|        provctx, OSSL_PKEY_PARAM_ML_KEM_INPUT_FORMATS, NULL);
  ------------------
  |  |  425|      2|# define OSSL_PKEY_PARAM_ML_KEM_INPUT_FORMATS "ml-kem.input_formats"
  ------------------
  173|      2|    fmt_slots = ossl_ml_common_pkcs8_fmt_order(v->algorithm_name, codec->p8fmt,
  174|      2|                                               "input", formats);
  175|      2|    if (fmt_slots == NULL)
  ------------------
  |  Branch (175:9): [True: 0, False: 2]
  ------------------
  176|      0|        goto end;
  177|       |
  178|       |    /* Parameters must be absent. */
  179|      2|    X509_ALGOR_get0(NULL, &ptype, NULL, alg);
  180|      2|    if (ptype != V_ASN1_UNDEF) {
  ------------------
  |  |   60|      2|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (180:9): [True: 2, False: 0]
  ------------------
  181|      2|        ERR_raise_data(ERR_LIB_PROV, PROV_R_UNEXPECTED_KEY_PARAMETERS,
  ------------------
  |  |  403|      2|    (ERR_new(),                                                 \
  |  |  404|      2|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      2|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      2|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_UNEXPECTED_KEY_PARAMETERS,
  ------------------
  |  |  118|      2|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_UNEXPECTED_KEY_PARAMETERS,
  ------------------
  |  |  153|      2|# define PROV_R_UNEXPECTED_KEY_PARAMETERS                 249
  ------------------
  182|      2|                       "unexpected parameters with a PKCS#8 %s private key",
  183|      2|                       v->algorithm_name);
  184|      2|        goto end;
  185|      2|    }
  186|      0|    if ((ossl_ssize_t)len < (ossl_ssize_t)sizeof(magic))
  ------------------
  |  Branch (186:9): [True: 0, False: 0]
  ------------------
  187|      0|        goto end;
  188|       |
  189|       |    /* Find the matching p8 info slot, that also has the expected length. */
  190|      0|    pos = OPENSSL_load_u32_be(&magic, buf);
  191|      0|    for (slot = fmt_slots; (p8fmt = slot->fmt) != NULL; ++slot) {
  ------------------
  |  Branch (191:28): [True: 0, False: 0]
  ------------------
  192|      0|        if (len != (ossl_ssize_t)p8fmt->p8_bytes)
  ------------------
  |  Branch (192:13): [True: 0, False: 0]
  ------------------
  193|      0|            continue;
  194|      0|        if (p8fmt->p8_shift == sizeof(magic)
  ------------------
  |  Branch (194:13): [True: 0, False: 0]
  ------------------
  195|      0|            || (magic >> (p8fmt->p8_shift * 8)) == p8fmt->p8_magic) {
  ------------------
  |  Branch (195:16): [True: 0, False: 0]
  ------------------
  196|      0|            pos -= p8fmt->p8_shift;
  197|      0|            break;
  198|      0|        }
  199|      0|    }
  200|      0|    if (p8fmt == NULL
  ------------------
  |  Branch (200:9): [True: 0, False: 0]
  ------------------
  201|      0|        || (p8fmt->seed_length > 0 && p8fmt->seed_length != ML_KEM_SEED_BYTES)
  ------------------
  |  |   48|      0|# define ML_KEM_SEED_BYTES      (ML_KEM_RANDOM_BYTES * 2) /* Keygen (d, z) */
  |  |  ------------------
  |  |  |  |   47|      0|# define ML_KEM_RANDOM_BYTES    32 /* rho, sigma, ... */
  |  |  ------------------
  ------------------
  |  Branch (201:13): [True: 0, False: 0]
  |  Branch (201:39): [True: 0, False: 0]
  ------------------
  202|      0|        || (p8fmt->priv_length > 0 && p8fmt->priv_length != v->prvkey_bytes)
  ------------------
  |  Branch (202:13): [True: 0, False: 0]
  |  Branch (202:39): [True: 0, False: 0]
  ------------------
  203|      0|        || (p8fmt->pub_length > 0 && p8fmt->pub_length != v->pubkey_bytes)) {
  ------------------
  |  Branch (203:13): [True: 0, False: 0]
  |  Branch (203:38): [True: 0, False: 0]
  ------------------
  204|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_ML_KEM_NO_FORMAT,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_ML_KEM_NO_FORMAT,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_ML_KEM_NO_FORMAT,
  ------------------
  |  |  113|      0|# define PROV_R_ML_KEM_NO_FORMAT                          246
  ------------------
  205|      0|                       "no matching enabled %s private key input formats",
  206|      0|                       v->algorithm_name);
  207|      0|        goto end;
  208|      0|    }
  209|       |
  210|      0|    if (p8fmt->seed_length > 0) {
  ------------------
  |  Branch (210:9): [True: 0, False: 0]
  ------------------
  211|       |        /* Check |seed| tag/len, if not subsumed by |magic|. */
  212|      0|        if (pos + sizeof(uint16_t) == buf + p8fmt->seed_offset) {
  ------------------
  |  Branch (212:13): [True: 0, False: 0]
  ------------------
  213|      0|            pos = OPENSSL_load_u16_be(&seed_magic, pos);
  214|      0|            if (seed_magic != p8fmt->seed_magic)
  ------------------
  |  Branch (214:17): [True: 0, False: 0]
  ------------------
  215|      0|                goto end;
  216|      0|        } else if (pos != buf + p8fmt->seed_offset) {
  ------------------
  |  Branch (216:20): [True: 0, False: 0]
  ------------------
  217|      0|            goto end;
  218|      0|        }
  219|      0|        pos += ML_KEM_SEED_BYTES;
  ------------------
  |  |   48|      0|# define ML_KEM_SEED_BYTES      (ML_KEM_RANDOM_BYTES * 2) /* Keygen (d, z) */
  |  |  ------------------
  |  |  |  |   47|      0|# define ML_KEM_RANDOM_BYTES    32 /* rho, sigma, ... */
  |  |  ------------------
  ------------------
  220|      0|    }
  221|      0|    if (p8fmt->priv_length > 0) {
  ------------------
  |  Branch (221:9): [True: 0, False: 0]
  ------------------
  222|       |        /* Check |priv| tag/len */
  223|      0|        if (pos + sizeof(uint32_t) == buf + p8fmt->priv_offset) {
  ------------------
  |  Branch (223:13): [True: 0, False: 0]
  ------------------
  224|      0|            pos = OPENSSL_load_u32_be(&magic, pos);
  225|      0|            if (magic != p8fmt->priv_magic)
  ------------------
  |  Branch (225:17): [True: 0, False: 0]
  ------------------
  226|      0|                goto end;
  227|      0|        } else if (pos != buf + p8fmt->priv_offset) {
  ------------------
  |  Branch (227:20): [True: 0, False: 0]
  ------------------
  228|      0|            goto end;
  229|      0|        }
  230|      0|        pos += v->prvkey_bytes;
  231|      0|    }
  232|      0|    if (p8fmt->pub_length > 0) {
  ------------------
  |  Branch (232:9): [True: 0, False: 0]
  ------------------
  233|      0|        if (pos != buf + p8fmt->pub_offset)
  ------------------
  |  Branch (233:13): [True: 0, False: 0]
  ------------------
  234|      0|            goto end;
  235|      0|        pos += v->pubkey_bytes;
  236|      0|    }
  237|      0|    if (pos != buf + len)
  ------------------
  |  Branch (237:9): [True: 0, False: 0]
  ------------------
  238|      0|        goto end;
  239|       |
  240|       |    /*
  241|       |     * Collect the seed and/or key into a "decoded" private key object,
  242|       |     * to be turned into a real key on provider "load" or "import".
  243|       |     */
  244|      0|    if ((key = ossl_prov_ml_kem_new(provctx, propq, evp_type)) == NULL)
  ------------------
  |  Branch (244:9): [True: 0, False: 0]
  ------------------
  245|      0|        goto end;
  246|       |
  247|      0|    if (p8fmt->seed_length > 0) {
  ------------------
  |  Branch (247:9): [True: 0, False: 0]
  ------------------
  248|      0|        if (!ossl_ml_kem_set_seed(buf + p8fmt->seed_offset,
  ------------------
  |  Branch (248:13): [True: 0, False: 0]
  ------------------
  249|      0|                                  ML_KEM_SEED_BYTES, key)) {
  ------------------
  |  |   48|      0|# define ML_KEM_SEED_BYTES      (ML_KEM_RANDOM_BYTES * 2) /* Keygen (d, z) */
  |  |  ------------------
  |  |  |  |   47|      0|# define ML_KEM_RANDOM_BYTES    32 /* rho, sigma, ... */
  |  |  ------------------
  ------------------
  250|      0|            ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  121|      0|# define ERR_LIB_OSSL_DECODER    60
  ------------------
                          ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  354|      0|# define ERR_R_INTERNAL_ERROR                    (259|ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  350|      0|# define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  236|      0|# define ERR_RFLAG_FATAL                (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  251|      0|                           "error storing %s private key seed",
  252|      0|                           v->algorithm_name);
  253|      0|            goto end;
  254|      0|        }
  255|      0|    }
  256|      0|    if (p8fmt->priv_length > 0) {
  ------------------
  |  Branch (256:9): [True: 0, False: 0]
  ------------------
  257|      0|        if ((key->encoded_dk = OPENSSL_malloc(p8fmt->priv_length)) == NULL) {
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (257:13): [True: 0, False: 0]
  ------------------
  258|      0|            ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY,
  ------------------
  |  |   73|      0|# define PROV_R_INVALID_KEY                               158
  ------------------
  259|      0|                           "error parsing %s private key",
  260|      0|                           v->algorithm_name);
  261|      0|            goto end;
  262|      0|        }
  263|      0|        memcpy(key->encoded_dk, buf + p8fmt->priv_offset, p8fmt->priv_length);
  264|      0|    }
  265|       |    /* Any OQS public key content is ignored */
  266|      0|    ret = key;
  267|       |
  268|     77| end:
  269|     77|    OPENSSL_free(fmt_slots);
  ------------------
  |  |  115|     77|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     77|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     77|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  270|     77|    PKCS8_PRIV_KEY_INFO_free(p8inf);
  271|     77|    if (ret == NULL)
  ------------------
  |  Branch (271:9): [True: 77, False: 0]
  ------------------
  272|     77|        ossl_ml_kem_key_free(key);
  273|     77|    return ret;
  274|      0|}
ml_kem_codecs.c:ml_kem_get_codec:
   91|  26.5k|{
   92|  26.5k|    switch (evp_type) {
  ------------------
  |  Branch (92:13): [True: 0, False: 26.5k]
  ------------------
   93|  8.85k|    case EVP_PKEY_ML_KEM_512:
  ------------------
  |  |   93|  8.85k|# define EVP_PKEY_ML_KEM_512            NID_ML_KEM_512
  |  |  ------------------
  |  |  |  | 6613|  8.85k|#define NID_ML_KEM_512          1454
  |  |  ------------------
  ------------------
  |  Branch (93:5): [True: 8.85k, False: 17.7k]
  ------------------
   94|  8.85k|        return &codecs[ML_KEM_512_CODEC];
  ------------------
  |  |   76|  8.85k|#define ML_KEM_512_CODEC    0
  ------------------
   95|  8.85k|    case EVP_PKEY_ML_KEM_768:
  ------------------
  |  |  103|  8.85k|# define EVP_PKEY_ML_KEM_768            NID_ML_KEM_768
  |  |  ------------------
  |  |  |  | 6618|  8.85k|#define NID_ML_KEM_768          1455
  |  |  ------------------
  ------------------
  |  Branch (95:5): [True: 8.85k, False: 17.7k]
  ------------------
   96|  8.85k|        return &codecs[ML_KEM_768_CODEC];
  ------------------
  |  |   77|  8.85k|#define ML_KEM_768_CODEC    1
  ------------------
   97|  8.85k|    case EVP_PKEY_ML_KEM_1024:
  ------------------
  |  |  113|  8.85k|# define EVP_PKEY_ML_KEM_1024           NID_ML_KEM_1024
  |  |  ------------------
  |  |  |  | 6623|  8.85k|#define NID_ML_KEM_1024         1456
  |  |  ------------------
  ------------------
  |  Branch (97:5): [True: 8.85k, False: 17.7k]
  ------------------
   98|  8.85k|        return &codecs[ML_KEM_1024_CODEC];
  ------------------
  |  |   78|  8.85k|#define ML_KEM_1024_CODEC   2
  ------------------
   99|  26.5k|    }
  100|      0|    return NULL;
  101|  26.5k|}

md5_prov.c:md5_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
md5_sha1_prov.c:md5_sha1_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
null_prov.c:nullmd_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
ripemd_prov.c:ripemd160_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha1_newctx:
   55|  6.59k|static void *name##_newctx(void *prov_ctx)                                     \
   56|  6.59k|{                                                                              \
   57|  6.59k|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |  104|  6.59k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  6.59k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  6.59k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 6.59k, False: 0]
  ------------------
   58|  6.59k|    return ctx;                                                                \
   59|  6.59k|}                                                                              \
sha2_prov.c:sha1_internal_final:
   41|  6.59k|                                 size_t outsz)                                 \
   42|  6.59k|{                                                                              \
   43|  6.59k|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 6.59k, False: 0]
  |  Branch (43:35): [True: 6.59k, False: 0]
  |  Branch (43:56): [True: 6.59k, False: 0]
  ------------------
   44|  6.59k|        *outl = dgstsize;                                                      \
   45|  6.59k|        return 1;                                                              \
   46|  6.59k|    }                                                                          \
   47|  6.59k|    return 0;                                                                  \
   48|  6.59k|}
sha2_prov.c:sha1_freectx:
   60|  6.59k|static void name##_freectx(void *vctx)                                         \
   61|  6.59k|{                                                                              \
   62|  6.59k|    CTX *ctx = (CTX *)vctx;                                                    \
   63|  6.59k|    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
  ------------------
  |  |  113|  6.59k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  6.59k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  6.59k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|  6.59k|}                                                                              \
sha2_prov.c:sha1_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha1_internal_init:
  111|  6.59k|static int name##_internal_init(void *ctx, const OSSL_PARAM params[])          \
  112|  6.59k|{                                                                              \
  113|  6.59k|    return ossl_prov_is_running()                                              \
  ------------------
  |  Branch (113:12): [True: 6.59k, False: 0]
  ------------------
  114|  6.59k|           && init(ctx)                                                        \
  ------------------
  |  Branch (114:15): [True: 6.59k, False: 0]
  ------------------
  115|  6.59k|           && set_ctx_params(ctx, params);                                     \
  ------------------
  |  Branch (115:15): [True: 6.59k, False: 0]
  ------------------
  116|  6.59k|}                                                                              \
sha2_prov.c:sha224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha256_192_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha512_newctx:
   55|      4|static void *name##_newctx(void *prov_ctx)                                     \
   56|      4|{                                                                              \
   57|      4|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 4, False: 0]
  ------------------
   58|      4|    return ctx;                                                                \
   59|      4|}                                                                              \
sha2_prov.c:sha512_internal_final:
   41|      4|                                 size_t outsz)                                 \
   42|      4|{                                                                              \
   43|      4|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 4, False: 0]
  |  Branch (43:35): [True: 4, False: 0]
  |  Branch (43:56): [True: 4, False: 0]
  ------------------
   44|      4|        *outl = dgstsize;                                                      \
   45|      4|        return 1;                                                              \
   46|      4|    }                                                                          \
   47|      4|    return 0;                                                                  \
   48|      4|}
sha2_prov.c:sha512_freectx:
   60|      4|static void name##_freectx(void *vctx)                                         \
   61|      4|{                                                                              \
   62|      4|    CTX *ctx = (CTX *)vctx;                                                    \
   63|      4|    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
  ------------------
  |  |  113|      4|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|      4|}                                                                              \
sha2_prov.c:sha512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha512_internal_init:
   98|      4|                                ossl_unused const OSSL_PARAM params[])         \
   99|      4|{                                                                              \
  100|      4|    return ossl_prov_is_running() && init(ctx);                                \
  ------------------
  |  Branch (100:12): [True: 4, False: 0]
  |  Branch (100:38): [True: 4, False: 0]
  ------------------
  101|      4|}                                                                              \
sha2_prov.c:sha512_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha512_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:shake_128_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:shake_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_kmac_128_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_kmac_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sm3_prov.c:sm3_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}

dh_kmgmt.c:dh_load:
  827|     83|{
  828|     83|    DH *dh = NULL;
  829|       |
  830|     83|    if (ossl_prov_is_running() && reference_sz == sizeof(dh)) {
  ------------------
  |  Branch (830:9): [True: 83, False: 0]
  |  Branch (830:35): [True: 83, False: 0]
  ------------------
  831|       |        /* The contents of the reference is the address to our object */
  832|     83|        dh = *(DH **)reference;
  833|       |        /* We grabbed, so we detach it */
  834|     83|        *(DH **)reference = NULL;
  835|     83|        return dh;
  836|     83|    }
  837|      0|    return NULL;
  838|     83|}
dh_kmgmt.c:dh_freedata:
  126|     83|{
  127|     83|    DH_free(keydata);
  128|     83|}
dh_kmgmt.c:dh_get_params:
  316|     83|{
  317|     83|    DH *dh = key;
  318|     83|    OSSL_PARAM *p;
  319|       |
  320|     83|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  360|     83|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (320:9): [True: 83, False: 0]
  ------------------
  321|     83|        && !OSSL_PARAM_set_int(p, DH_bits(dh)))
  ------------------
  |  Branch (321:12): [True: 0, False: 83]
  ------------------
  322|      0|        return 0;
  323|     83|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  487|     83|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (323:9): [True: 83, False: 0]
  ------------------
  324|     83|        && !OSSL_PARAM_set_int(p, DH_security_bits(dh)))
  ------------------
  |  Branch (324:12): [True: 0, False: 83]
  ------------------
  325|      0|        return 0;
  326|     83|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  416|     83|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (326:9): [True: 83, False: 0]
  ------------------
  327|     83|        && !OSSL_PARAM_set_int(p, DH_size(dh)))
  ------------------
  |  Branch (327:12): [True: 0, False: 83]
  ------------------
  328|      0|        return 0;
  329|     83|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL) {
  ------------------
  |  |  390|     83|# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
  ------------------
  |  Branch (329:9): [True: 0, False: 83]
  ------------------
  330|      0|        if (p->data_type != OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|      0|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (330:13): [True: 0, False: 0]
  ------------------
  331|      0|            return 0;
  332|      0|        p->return_size = ossl_dh_key2buf(dh, (unsigned char **)&p->data,
  333|      0|                                         p->data_size, 0);
  334|      0|        if (p->return_size == 0)
  ------------------
  |  Branch (334:13): [True: 0, False: 0]
  ------------------
  335|      0|            return 0;
  336|      0|    }
  337|     83|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_CATEGORY)) != NULL)
  ------------------
  |  |  488|     83|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  127|     83|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  |  Branch (337:9): [True: 83, False: 0]
  ------------------
  338|     83|        if (!OSSL_PARAM_set_int(p, 0))
  ------------------
  |  Branch (338:13): [True: 0, False: 83]
  ------------------
  339|      0|            return 0;
  340|       |
  341|     83|    return ossl_dh_params_todata(dh, NULL, params)
  ------------------
  |  Branch (341:12): [True: 83, False: 0]
  ------------------
  342|     83|        && ossl_dh_key_todata(dh, NULL, params, 1);
  ------------------
  |  Branch (342:12): [True: 83, False: 0]
  ------------------
  343|     83|}
dh_kmgmt.c:dh_has:
  131|     18|{
  132|     18|    const DH *dh = keydata;
  133|     18|    int ok = 1;
  134|       |
  135|     18|    if (!ossl_prov_is_running() || dh == NULL)
  ------------------
  |  Branch (135:9): [True: 0, False: 18]
  |  Branch (135:36): [True: 0, False: 18]
  ------------------
  136|      0|        return 0;
  137|     18|    if ((selection & DH_POSSIBLE_SELECTIONS) == 0)
  ------------------
  |  |   52|     18|    (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)
  |  |  ------------------
  |  |  |  |  650|     18|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  640|     18|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  |  |  ------------------
  |  |  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|     18|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)
  |  |  ------------------
  |  |  |  |  642|     18|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  ------------------
  |  Branch (137:9): [True: 0, False: 18]
  ------------------
  138|      0|        return 1; /* the selection is not missing */
  139|       |
  140|     18|    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
  ------------------
  |  |  641|     18|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (140:9): [True: 0, False: 18]
  ------------------
  141|      0|        ok = ok && (DH_get0_pub_key(dh) != NULL);
  ------------------
  |  Branch (141:14): [True: 0, False: 0]
  |  Branch (141:20): [True: 0, False: 0]
  ------------------
  142|     18|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  640|     18|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (142:9): [True: 18, False: 0]
  ------------------
  143|     18|        ok = ok && (DH_get0_priv_key(dh) != NULL);
  ------------------
  |  Branch (143:14): [True: 18, False: 0]
  |  Branch (143:20): [True: 18, False: 0]
  ------------------
  144|     18|    if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
  ------------------
  |  |  642|     18|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (144:9): [True: 0, False: 18]
  ------------------
  145|      0|        ok = ok && (DH_get0_p(dh) != NULL && DH_get0_g(dh) != NULL);
  ------------------
  |  Branch (145:14): [True: 0, False: 0]
  |  Branch (145:21): [True: 0, False: 0]
  |  Branch (145:46): [True: 0, False: 0]
  ------------------
  146|     18|    return ok;
  147|     18|}

dsa_kmgmt.c:dsa_load:
  707|    519|{
  708|    519|    DSA *dsa = NULL;
  709|       |
  710|    519|    if (ossl_prov_is_running() && reference_sz == sizeof(dsa)) {
  ------------------
  |  Branch (710:9): [True: 519, False: 0]
  |  Branch (710:35): [True: 519, False: 0]
  ------------------
  711|       |        /* The contents of the reference is the address to our object */
  712|    519|        dsa = *(DSA **)reference;
  713|       |        /* We grabbed, so we detach it */
  714|    519|        *(DSA **)reference = NULL;
  715|    519|        return dsa;
  716|    519|    }
  717|      0|    return NULL;
  718|    519|}
dsa_kmgmt.c:dsa_freedata:
  129|    519|{
  130|    519|    DSA_free(keydata);
  131|    519|}
dsa_kmgmt.c:dsa_get_params:
  316|    519|{
  317|    519|    DSA *dsa = key;
  318|    519|    OSSL_PARAM *p;
  319|       |
  320|    519|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  360|    519|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (320:9): [True: 519, False: 0]
  ------------------
  321|    519|        && !OSSL_PARAM_set_int(p, DSA_bits(dsa)))
  ------------------
  |  Branch (321:12): [True: 0, False: 519]
  ------------------
  322|      0|        return 0;
  323|    519|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  487|    519|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (323:9): [True: 519, False: 0]
  ------------------
  324|    519|        && !OSSL_PARAM_set_int(p, DSA_security_bits(dsa)))
  ------------------
  |  Branch (324:12): [True: 0, False: 519]
  ------------------
  325|      0|        return 0;
  326|    519|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  416|    519|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (326:9): [True: 519, False: 0]
  ------------------
  327|    519|        && !OSSL_PARAM_set_int(p, DSA_size(dsa)))
  ------------------
  |  Branch (327:12): [True: 0, False: 519]
  ------------------
  328|      0|        return 0;
  329|    519|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  362|    519|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (329:9): [True: 0, False: 519]
  ------------------
  330|    519|        && !OSSL_PARAM_set_utf8_string(p, DSA_DEFAULT_MD))
  ------------------
  |  |   51|      0|#define DSA_DEFAULT_MD "SHA256"
  ------------------
  |  Branch (330:12): [True: 0, False: 0]
  ------------------
  331|      0|        return 0;
  332|    519|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_CATEGORY)) != NULL
  ------------------
  |  |  488|    519|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  127|    519|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  |  Branch (332:9): [True: 519, False: 0]
  ------------------
  333|    519|        && !OSSL_PARAM_set_int(p, 0))
  ------------------
  |  Branch (333:12): [True: 0, False: 519]
  ------------------
  334|      0|        return 0;
  335|    519|    return ossl_ffc_params_todata(ossl_dsa_get0_params(dsa), NULL, params)
  ------------------
  |  Branch (335:12): [True: 519, False: 0]
  ------------------
  336|    519|           && dsa_key_todata(dsa, NULL, params, 1);
  ------------------
  |  Branch (336:15): [True: 519, False: 0]
  ------------------
  337|    519|}
dsa_kmgmt.c:dsa_key_todata:
  103|    519|{
  104|    519|    const BIGNUM *priv = NULL, *pub = NULL;
  105|       |
  106|    519|    if (dsa == NULL)
  ------------------
  |  Branch (106:9): [True: 0, False: 519]
  ------------------
  107|      0|        return 0;
  108|       |
  109|    519|    DSA_get0_key(dsa, &pub, &priv);
  110|    519|    if (include_private
  ------------------
  |  Branch (110:9): [True: 519, False: 0]
  ------------------
  111|    519|        && priv != NULL
  ------------------
  |  Branch (111:12): [True: 517, False: 2]
  ------------------
  112|    519|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PRIV_KEY, priv))
  ------------------
  |  |  431|    517|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  |  Branch (112:12): [True: 0, False: 517]
  ------------------
  113|      0|        return 0;
  114|    519|    if (pub != NULL
  ------------------
  |  Branch (114:9): [True: 519, False: 0]
  ------------------
  115|    519|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PUB_KEY, pub))
  ------------------
  |  |  433|    519|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  |  Branch (115:12): [True: 0, False: 519]
  ------------------
  116|      0|        return 0;
  117|       |
  118|    519|    return 1;
  119|    519|}
dsa_kmgmt.c:dsa_has:
  134|    517|{
  135|    517|    const DSA *dsa = keydata;
  136|    517|    int ok = 1;
  137|       |
  138|    517|    if (!ossl_prov_is_running() || dsa == NULL)
  ------------------
  |  Branch (138:9): [True: 0, False: 517]
  |  Branch (138:36): [True: 0, False: 517]
  ------------------
  139|      0|        return 0;
  140|    517|    if ((selection & DSA_POSSIBLE_SELECTIONS) == 0)
  ------------------
  |  |   53|    517|    (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)
  |  |  ------------------
  |  |  |  |  650|    517|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  640|    517|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  |  |  ------------------
  |  |  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|    517|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)
  |  |  ------------------
  |  |  |  |  642|    517|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  ------------------
  |  Branch (140:9): [True: 0, False: 517]
  ------------------
  141|      0|        return 1; /* the selection is not missing */
  142|       |
  143|    517|    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
  ------------------
  |  |  641|    517|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (143:9): [True: 0, False: 517]
  ------------------
  144|      0|        ok = ok && (DSA_get0_pub_key(dsa) != NULL);
  ------------------
  |  Branch (144:14): [True: 0, False: 0]
  |  Branch (144:20): [True: 0, False: 0]
  ------------------
  145|    517|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  640|    517|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (145:9): [True: 517, False: 0]
  ------------------
  146|    517|        ok = ok && (DSA_get0_priv_key(dsa) != NULL);
  ------------------
  |  Branch (146:14): [True: 517, False: 0]
  |  Branch (146:20): [True: 517, False: 0]
  ------------------
  147|    517|    if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
  ------------------
  |  |  642|    517|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (147:9): [True: 0, False: 517]
  ------------------
  148|      0|        ok = ok && (DSA_get0_p(dsa) != NULL && DSA_get0_g(dsa) != NULL);
  ------------------
  |  Branch (148:14): [True: 0, False: 0]
  |  Branch (148:21): [True: 0, False: 0]
  |  Branch (148:48): [True: 0, False: 0]
  ------------------
  149|    517|    return ok;
  150|    517|}

ec_kmgmt.c:ec_load:
 1440|  7.49k|{
 1441|  7.49k|    return common_load(reference, reference_sz, 0);
 1442|  7.49k|}
ec_kmgmt.c:common_load:
 1422|  7.50k|{
 1423|  7.50k|    EC_KEY *ec = NULL;
 1424|       |
 1425|  7.50k|    if (ossl_prov_is_running() && reference_sz == sizeof(ec)) {
  ------------------
  |  Branch (1425:9): [True: 7.50k, False: 0]
  |  Branch (1425:35): [True: 7.50k, False: 0]
  ------------------
 1426|       |        /* The contents of the reference is the address to our object */
 1427|  7.50k|        ec = *(EC_KEY **)reference;
 1428|       |
 1429|  7.50k|        if (!common_check_sm2(ec, sm2_wanted))
  ------------------
  |  Branch (1429:13): [True: 0, False: 7.50k]
  ------------------
 1430|      0|            return NULL;
 1431|       |
 1432|       |        /* We grabbed, so we detach it */
 1433|  7.50k|        *(EC_KEY **)reference = NULL;
 1434|  7.50k|        return ec;
 1435|  7.50k|    }
 1436|      0|    return NULL;
 1437|  7.50k|}
ec_kmgmt.c:common_check_sm2:
  379|  7.50k|{
  380|  7.50k|    const EC_GROUP *ecg = NULL;
  381|       |
  382|       |    /*
  383|       |     * sm2_wanted: import the keys or domparams only on SM2 Curve
  384|       |     * !sm2_wanted: import the keys or domparams only not on SM2 Curve
  385|       |     */
  386|  7.50k|    if ((ecg = EC_KEY_get0_group(ec)) == NULL
  ------------------
  |  Branch (386:9): [True: 0, False: 7.50k]
  ------------------
  387|  7.50k|        || (sm2_wanted ^ (EC_GROUP_get_curve_name(ecg) == NID_sm2)))
  ------------------
  |  | 1232|  7.50k|#define NID_sm2         1172
  ------------------
  |  Branch (387:12): [True: 0, False: 7.50k]
  ------------------
  388|      0|        return 0;
  389|  7.50k|    return 1;
  390|  7.50k|}
ec_kmgmt.c:ec_freedata:
  302|  7.50k|{
  303|  7.50k|    EC_KEY_free(keydata);
  304|  7.50k|}
ec_kmgmt.c:ec_get_params:
  774|  7.49k|{
  775|  7.49k|    return common_get_params(key, params, 0);
  776|  7.49k|}
ec_kmgmt.c:common_get_params:
  640|  7.50k|{
  641|  7.50k|    int ret = 0;
  642|  7.50k|    EC_KEY *eck = key;
  643|  7.50k|    const EC_GROUP *ecg = NULL;
  644|  7.50k|    OSSL_PARAM *p;
  645|  7.50k|    unsigned char *pub_key = NULL, *genbuf = NULL;
  646|  7.50k|    OSSL_LIB_CTX *libctx;
  647|  7.50k|    const char *propq;
  648|  7.50k|    BN_CTX *bnctx = NULL;
  649|       |
  650|  7.50k|    ecg = EC_KEY_get0_group(eck);
  651|  7.50k|    if (ecg == NULL) {
  ------------------
  |  Branch (651:9): [True: 0, False: 7.50k]
  ------------------
  652|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_NO_PARAMETERS_SET);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  653|      0|        return 0;
  654|      0|    }
  655|       |
  656|  7.50k|    libctx = ossl_ec_key_get_libctx(eck);
  657|  7.50k|    propq = ossl_ec_key_get0_propq(eck);
  658|       |
  659|  7.50k|    bnctx = BN_CTX_new_ex(libctx);
  660|  7.50k|    if (bnctx == NULL)
  ------------------
  |  Branch (660:9): [True: 0, False: 7.50k]
  ------------------
  661|      0|        return 0;
  662|  7.50k|    BN_CTX_start(bnctx);
  663|       |
  664|  7.50k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  416|  7.50k|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (664:9): [True: 7.50k, False: 0]
  ------------------
  665|  7.50k|        && !OSSL_PARAM_set_int(p, ECDSA_size(eck)))
  ------------------
  |  Branch (665:12): [True: 0, False: 7.50k]
  ------------------
  666|      0|        goto err;
  667|  7.50k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  360|  7.50k|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (667:9): [True: 7.50k, False: 0]
  ------------------
  668|  7.50k|        && !OSSL_PARAM_set_int(p, EC_GROUP_order_bits(ecg)))
  ------------------
  |  Branch (668:12): [True: 0, False: 7.50k]
  ------------------
  669|      0|        goto err;
  670|  7.50k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL) {
  ------------------
  |  |  487|  7.50k|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (670:9): [True: 7.50k, False: 0]
  ------------------
  671|  7.50k|        int ecbits, sec_bits;
  672|       |
  673|  7.50k|        ecbits = EC_GROUP_order_bits(ecg);
  674|       |
  675|       |        /*
  676|       |         * The following estimates are based on the values published
  677|       |         * in Table 2 of "NIST Special Publication 800-57 Part 1 Revision 4"
  678|       |         * at http://dx.doi.org/10.6028/NIST.SP.800-57pt1r4 .
  679|       |         *
  680|       |         * Note that the above reference explicitly categorizes algorithms in a
  681|       |         * discrete set of values {80, 112, 128, 192, 256}, and that it is
  682|       |         * relevant only for NIST approved Elliptic Curves, while OpenSSL
  683|       |         * applies the same logic also to other curves.
  684|       |         *
  685|       |         * Classifications produced by other standardazing bodies might differ,
  686|       |         * so the results provided for "bits of security" by this provider are
  687|       |         * to be considered merely indicative, and it is the users'
  688|       |         * responsibility to compare these values against the normative
  689|       |         * references that may be relevant for their intent and purposes.
  690|       |         */
  691|  7.50k|        if (ecbits >= 512)
  ------------------
  |  Branch (691:13): [True: 59, False: 7.44k]
  ------------------
  692|     59|            sec_bits = 256;
  693|  7.44k|        else if (ecbits >= 384)
  ------------------
  |  Branch (693:18): [True: 60, False: 7.38k]
  ------------------
  694|     60|            sec_bits = 192;
  695|  7.38k|        else if (ecbits >= 256)
  ------------------
  |  Branch (695:18): [True: 69, False: 7.31k]
  ------------------
  696|     69|            sec_bits = 128;
  697|  7.31k|        else if (ecbits >= 224)
  ------------------
  |  Branch (697:18): [True: 232, False: 7.08k]
  ------------------
  698|    232|            sec_bits = 112;
  699|  7.08k|        else if (ecbits >= 160)
  ------------------
  |  Branch (699:18): [True: 160, False: 6.92k]
  ------------------
  700|    160|            sec_bits = 80;
  701|  6.92k|        else
  702|  6.92k|            sec_bits = ecbits / 2;
  703|       |
  704|  7.50k|        if (!OSSL_PARAM_set_int(p, sec_bits))
  ------------------
  |  Branch (704:13): [True: 0, False: 7.50k]
  ------------------
  705|      0|            goto err;
  706|  7.50k|    }
  707|  7.50k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_CATEGORY)) != NULL)
  ------------------
  |  |  488|  7.50k|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  127|  7.50k|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  |  Branch (707:9): [True: 7.50k, False: 0]
  ------------------
  708|  7.50k|        if (!OSSL_PARAM_set_int(p, 0))
  ------------------
  |  Branch (708:13): [True: 0, False: 7.50k]
  ------------------
  709|      0|            goto err;
  710|       |
  711|  7.50k|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (711:9): [True: 0, False: 7.50k]
  ------------------
  712|  7.50k|                               OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS))
  ------------------
  |  |  378|  7.50k|# define OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS "decoded-from-explicit"
  ------------------
  713|  7.50k|            != NULL) {
  714|      0|        int explicitparams = EC_KEY_decoded_from_explicit_params(eck);
  715|       |
  716|      0|        if (explicitparams < 0
  ------------------
  |  Branch (716:13): [True: 0, False: 0]
  ------------------
  717|      0|             || !OSSL_PARAM_set_int(p, explicitparams))
  ------------------
  |  Branch (717:17): [True: 0, False: 0]
  ------------------
  718|      0|            goto err;
  719|      0|    }
  720|       |
  721|  7.50k|    if (!sm2) {
  ------------------
  |  Branch (721:9): [True: 7.49k, False: 5]
  ------------------
  722|  7.49k|        if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  362|  7.49k|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (722:13): [True: 0, False: 7.49k]
  ------------------
  723|  7.49k|                && !OSSL_PARAM_set_utf8_string(p, EC_DEFAULT_MD))
  ------------------
  |  |   75|      0|#define EC_DEFAULT_MD "SHA256"
  ------------------
  |  Branch (723:20): [True: 0, False: 0]
  ------------------
  724|      0|            goto err;
  725|  7.49k|    } else {
  726|      5|        if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  362|      5|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (726:13): [True: 0, False: 5]
  ------------------
  727|      5|                && !OSSL_PARAM_set_utf8_string(p, SM2_DEFAULT_MD))
  ------------------
  |  |   78|      0|#define SM2_DEFAULT_MD "SM3"
  ------------------
  |  Branch (727:20): [True: 0, False: 0]
  ------------------
  728|      0|            goto err;
  729|      5|    }
  730|       |
  731|       |    /* SM2 doesn't support this PARAM */
  732|  7.50k|    if (!sm2) {
  ------------------
  |  Branch (732:9): [True: 7.49k, False: 5]
  ------------------
  733|  7.49k|        p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_USE_COFACTOR_ECDH);
  ------------------
  |  |  490|  7.49k|# define OSSL_PKEY_PARAM_USE_COFACTOR_ECDH OSSL_PKEY_PARAM_USE_COFACTOR_FLAG
  |  |  ------------------
  |  |  |  |  491|  7.49k|# define OSSL_PKEY_PARAM_USE_COFACTOR_FLAG "use-cofactor-flag"
  |  |  ------------------
  ------------------
  734|  7.49k|        if (p != NULL) {
  ------------------
  |  Branch (734:13): [True: 0, False: 7.49k]
  ------------------
  735|      0|            int ecdh_cofactor_mode = 0;
  736|       |
  737|      0|            ecdh_cofactor_mode =
  738|      0|                (EC_KEY_get_flags(eck) & EC_FLAG_COFACTOR_ECDH) ? 1 : 0;
  ------------------
  |  |  963|      0|#  define EC_FLAG_COFACTOR_ECDH          0x1000
  ------------------
  |  Branch (738:17): [True: 0, False: 0]
  ------------------
  739|       |
  740|      0|            if (!OSSL_PARAM_set_int(p, ecdh_cofactor_mode))
  ------------------
  |  Branch (740:17): [True: 0, False: 0]
  ------------------
  741|      0|                goto err;
  742|      0|        }
  743|  7.49k|    }
  744|  7.50k|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (744:9): [True: 0, False: 7.50k]
  ------------------
  745|  7.50k|                               OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL) {
  ------------------
  |  |  390|  7.50k|# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
  ------------------
  746|      0|        const EC_POINT *ecp = EC_KEY_get0_public_key(key);
  747|       |
  748|      0|        if (ecp == NULL) {
  ------------------
  |  Branch (748:13): [True: 0, False: 0]
  ------------------
  749|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  750|      0|            goto err;
  751|      0|        }
  752|      0|        p->return_size = EC_POINT_point2oct(ecg, ecp,
  753|      0|                                            POINT_CONVERSION_UNCOMPRESSED,
  754|      0|                                            p->data, p->data_size, bnctx);
  755|      0|        if (p->return_size == 0)
  ------------------
  |  Branch (755:13): [True: 0, False: 0]
  ------------------
  756|      0|            goto err;
  757|      0|    }
  758|       |
  759|  7.50k|    ret = ec_get_ecm_params(ecg, params)
  ------------------
  |  Branch (759:11): [True: 7.50k, False: 0]
  ------------------
  760|  7.50k|          && ossl_ec_group_todata(ecg, NULL, params, libctx, propq, bnctx,
  ------------------
  |  Branch (760:14): [True: 7.50k, False: 0]
  ------------------
  761|  7.50k|                                  &genbuf)
  762|  7.50k|          && key_to_params(eck, NULL, params, 1, &pub_key)
  ------------------
  |  Branch (762:14): [True: 7.50k, False: 0]
  ------------------
  763|  7.50k|          && otherparams_to_params(eck, NULL, params);
  ------------------
  |  Branch (763:14): [True: 7.50k, False: 0]
  ------------------
  764|  7.50k|err:
  765|  7.50k|    OPENSSL_free(genbuf);
  ------------------
  |  |  115|  7.50k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  7.50k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  7.50k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  766|  7.50k|    OPENSSL_free(pub_key);
  ------------------
  |  |  115|  7.50k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  7.50k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  7.50k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  767|  7.50k|    BN_CTX_end(bnctx);
  768|  7.50k|    BN_CTX_free(bnctx);
  769|  7.50k|    return ret;
  770|  7.50k|}
ec_kmgmt.c:ec_get_ecm_params:
  588|  7.50k|{
  589|       |#ifdef OPENSSL_NO_EC2M
  590|       |    return 1;
  591|       |#else
  592|  7.50k|    int ret = 0, m;
  593|  7.50k|    unsigned int k1 = 0, k2 = 0, k3 = 0;
  594|  7.50k|    int basis_nid;
  595|  7.50k|    const char *basis_name = NULL;
  596|  7.50k|    int fid = EC_GROUP_get_field_type(group);
  597|       |
  598|  7.50k|    if (fid != NID_X9_62_characteristic_two_field)
  ------------------
  |  |  156|  7.50k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (598:9): [True: 674, False: 6.83k]
  ------------------
  599|    674|        return 1;
  600|       |
  601|  6.83k|    basis_nid = EC_GROUP_get_basis_type(group);
  602|  6.83k|    if (basis_nid == NID_X9_62_tpBasis)
  ------------------
  |  |  168|  6.83k|#define NID_X9_62_tpBasis               682
  ------------------
  |  Branch (602:9): [True: 196, False: 6.63k]
  ------------------
  603|    196|        basis_name = SN_X9_62_tpBasis;
  ------------------
  |  |  167|    196|#define SN_X9_62_tpBasis                "tpBasis"
  ------------------
  604|  6.63k|    else if (basis_nid == NID_X9_62_ppBasis)
  ------------------
  |  |  172|  6.63k|#define NID_X9_62_ppBasis               683
  ------------------
  |  Branch (604:14): [True: 6.63k, False: 0]
  ------------------
  605|  6.63k|        basis_name = SN_X9_62_ppBasis;
  ------------------
  |  |  171|  6.63k|#define SN_X9_62_ppBasis                "ppBasis"
  ------------------
  606|      0|    else
  607|      0|        goto err;
  608|       |
  609|  6.83k|    m = EC_GROUP_get_degree(group);
  610|  6.83k|    if (!ossl_param_build_set_int(NULL, params, OSSL_PKEY_PARAM_EC_CHAR2_M, m)
  ------------------
  |  |  371|  6.83k|# define OSSL_PKEY_PARAM_EC_CHAR2_M "m"
  ------------------
  |  Branch (610:9): [True: 0, False: 6.83k]
  ------------------
  611|  6.83k|        || !ossl_param_build_set_utf8_string(NULL, params,
  ------------------
  |  Branch (611:12): [True: 0, False: 6.83k]
  ------------------
  612|  6.83k|                                             OSSL_PKEY_PARAM_EC_CHAR2_TYPE,
  ------------------
  |  |  376|  6.83k|# define OSSL_PKEY_PARAM_EC_CHAR2_TYPE "basis-type"
  ------------------
  613|  6.83k|                                             basis_name))
  614|      0|        goto err;
  615|       |
  616|  6.83k|    if (basis_nid == NID_X9_62_tpBasis) {
  ------------------
  |  |  168|  6.83k|#define NID_X9_62_tpBasis               682
  ------------------
  |  Branch (616:9): [True: 196, False: 6.63k]
  ------------------
  617|    196|        if (!EC_GROUP_get_trinomial_basis(group, &k1)
  ------------------
  |  Branch (617:13): [True: 0, False: 196]
  ------------------
  618|    196|            || !ossl_param_build_set_int(NULL, params,
  ------------------
  |  Branch (618:16): [True: 0, False: 196]
  ------------------
  619|    196|                                         OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS,
  ------------------
  |  |  375|    196|# define OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS "tp"
  ------------------
  620|    196|                                         (int)k1))
  621|      0|            goto err;
  622|  6.63k|    } else {
  623|  6.63k|        if (!EC_GROUP_get_pentanomial_basis(group, &k1, &k2, &k3)
  ------------------
  |  Branch (623:13): [True: 0, False: 6.63k]
  ------------------
  624|  6.63k|            || !ossl_param_build_set_int(NULL, params,
  ------------------
  |  Branch (624:16): [True: 0, False: 6.63k]
  ------------------
  625|  6.63k|                                         OSSL_PKEY_PARAM_EC_CHAR2_PP_K1, (int)k1)
  ------------------
  |  |  372|  6.63k|# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K1 "k1"
  ------------------
  626|  6.63k|            || !ossl_param_build_set_int(NULL, params,
  ------------------
  |  Branch (626:16): [True: 0, False: 6.63k]
  ------------------
  627|  6.63k|                                         OSSL_PKEY_PARAM_EC_CHAR2_PP_K2, (int)k2)
  ------------------
  |  |  373|  6.63k|# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K2 "k2"
  ------------------
  628|  6.63k|            || !ossl_param_build_set_int(NULL, params,
  ------------------
  |  Branch (628:16): [True: 0, False: 6.63k]
  ------------------
  629|  6.63k|                                         OSSL_PKEY_PARAM_EC_CHAR2_PP_K3, (int)k3))
  ------------------
  |  |  374|  6.63k|# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K3 "k3"
  ------------------
  630|      0|            goto err;
  631|  6.63k|    }
  632|  6.83k|    ret = 1;
  633|  6.83k|err:
  634|  6.83k|    return ret;
  635|  6.83k|#endif /* OPENSSL_NO_EC2M */
  636|  6.83k|}
ec_kmgmt.c:key_to_params:
  117|  7.50k|{
  118|  7.50k|    BIGNUM *x = NULL, *y = NULL;
  119|  7.50k|    const BIGNUM *priv_key = NULL;
  120|  7.50k|    const EC_POINT *pub_point = NULL;
  121|  7.50k|    const EC_GROUP *ecg = NULL;
  122|  7.50k|    size_t pub_key_len = 0;
  123|  7.50k|    int ret = 0;
  124|  7.50k|    BN_CTX *bnctx = NULL;
  125|       |
  126|  7.50k|    if (eckey == NULL
  ------------------
  |  Branch (126:9): [True: 0, False: 7.50k]
  ------------------
  127|  7.50k|        || (ecg = EC_KEY_get0_group(eckey)) == NULL)
  ------------------
  |  Branch (127:12): [True: 0, False: 7.50k]
  ------------------
  128|      0|        return 0;
  129|       |
  130|  7.50k|    priv_key = EC_KEY_get0_private_key(eckey);
  131|  7.50k|    pub_point = EC_KEY_get0_public_key(eckey);
  132|       |
  133|  7.50k|    if (pub_point != NULL) {
  ------------------
  |  Branch (133:9): [True: 7.50k, False: 0]
  ------------------
  134|  7.50k|        OSSL_PARAM *p = NULL, *px = NULL, *py = NULL;
  135|       |        /*
  136|       |         * EC_POINT_point2buf() can generate random numbers in some
  137|       |         * implementations so we need to ensure we use the correct libctx.
  138|       |         */
  139|  7.50k|        bnctx = BN_CTX_new_ex(ossl_ec_key_get_libctx(eckey));
  140|  7.50k|        if (bnctx == NULL)
  ------------------
  |  Branch (140:13): [True: 0, False: 7.50k]
  ------------------
  141|      0|            goto err;
  142|       |
  143|       |
  144|       |        /* If we are doing a get then check first before decoding the point */
  145|  7.50k|        if (tmpl == NULL) {
  ------------------
  |  Branch (145:13): [True: 7.50k, False: 0]
  ------------------
  146|  7.50k|            p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_PUB_KEY);
  ------------------
  |  |  433|  7.50k|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  147|  7.50k|            px = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_EC_PUB_X);
  ------------------
  |  |  387|  7.50k|# define OSSL_PKEY_PARAM_EC_PUB_X "qx"
  ------------------
  148|  7.50k|            py = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_EC_PUB_Y);
  ------------------
  |  |  388|  7.50k|# define OSSL_PKEY_PARAM_EC_PUB_Y "qy"
  ------------------
  149|  7.50k|        }
  150|       |
  151|  7.50k|        if (p != NULL || tmpl != NULL) {
  ------------------
  |  Branch (151:13): [True: 0, False: 7.50k]
  |  Branch (151:26): [True: 0, False: 7.50k]
  ------------------
  152|       |            /* convert pub_point to a octet string according to the SECG standard */
  153|      0|            point_conversion_form_t format = EC_KEY_get_conv_form(eckey);
  154|       |
  155|      0|            if ((pub_key_len = EC_POINT_point2buf(ecg, pub_point,
  ------------------
  |  Branch (155:17): [True: 0, False: 0]
  ------------------
  156|      0|                                                  format,
  157|      0|                                                  pub_key, bnctx)) == 0
  158|      0|                || !ossl_param_build_set_octet_string(tmpl, p,
  ------------------
  |  Branch (158:20): [True: 0, False: 0]
  ------------------
  159|      0|                                                      OSSL_PKEY_PARAM_PUB_KEY,
  ------------------
  |  |  433|      0|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  160|      0|                                                      *pub_key, pub_key_len))
  161|      0|                goto err;
  162|      0|        }
  163|  7.50k|        if (px != NULL || py != NULL) {
  ------------------
  |  Branch (163:13): [True: 0, False: 7.50k]
  |  Branch (163:27): [True: 0, False: 7.50k]
  ------------------
  164|      0|            if (px != NULL) {
  ------------------
  |  Branch (164:17): [True: 0, False: 0]
  ------------------
  165|      0|                x = BN_CTX_get(bnctx);
  166|      0|                if (x == NULL)
  ------------------
  |  Branch (166:21): [True: 0, False: 0]
  ------------------
  167|      0|                    goto err;
  168|      0|            }
  169|      0|            if (py != NULL) {
  ------------------
  |  Branch (169:17): [True: 0, False: 0]
  ------------------
  170|      0|                y = BN_CTX_get(bnctx);
  171|      0|                if (y == NULL)
  ------------------
  |  Branch (171:21): [True: 0, False: 0]
  ------------------
  172|      0|                    goto err;
  173|      0|            }
  174|       |
  175|      0|            if (!EC_POINT_get_affine_coordinates(ecg, pub_point, x, y, bnctx))
  ------------------
  |  Branch (175:17): [True: 0, False: 0]
  ------------------
  176|      0|                goto err;
  177|      0|            if (px != NULL
  ------------------
  |  Branch (177:17): [True: 0, False: 0]
  ------------------
  178|      0|                && !ossl_param_build_set_bn(tmpl, px,
  ------------------
  |  Branch (178:20): [True: 0, False: 0]
  ------------------
  179|      0|                                            OSSL_PKEY_PARAM_EC_PUB_X, x))
  ------------------
  |  |  387|      0|# define OSSL_PKEY_PARAM_EC_PUB_X "qx"
  ------------------
  180|      0|                goto err;
  181|      0|            if (py != NULL
  ------------------
  |  Branch (181:17): [True: 0, False: 0]
  ------------------
  182|      0|                && !ossl_param_build_set_bn(tmpl, py,
  ------------------
  |  Branch (182:20): [True: 0, False: 0]
  ------------------
  183|      0|                                            OSSL_PKEY_PARAM_EC_PUB_Y, y))
  ------------------
  |  |  388|      0|# define OSSL_PKEY_PARAM_EC_PUB_Y "qy"
  ------------------
  184|      0|                goto err;
  185|      0|        }
  186|  7.50k|    }
  187|       |
  188|  7.50k|    if (priv_key != NULL && include_private) {
  ------------------
  |  Branch (188:9): [True: 731, False: 6.77k]
  |  Branch (188:29): [True: 731, False: 0]
  ------------------
  189|    731|        size_t sz;
  190|    731|        int ecbits;
  191|       |
  192|       |        /*
  193|       |         * Key import/export should never leak the bit length of the secret
  194|       |         * scalar in the key.
  195|       |         *
  196|       |         * For this reason, on export we use padded BIGNUMs with fixed length.
  197|       |         *
  198|       |         * When importing we also should make sure that, even if short lived,
  199|       |         * the newly created BIGNUM is marked with the BN_FLG_CONSTTIME flag as
  200|       |         * soon as possible, so that any processing of this BIGNUM might opt for
  201|       |         * constant time implementations in the backend.
  202|       |         *
  203|       |         * Setting the BN_FLG_CONSTTIME flag alone is never enough, we also have
  204|       |         * to preallocate the BIGNUM internal buffer to a fixed public size big
  205|       |         * enough that operations performed during the processing never trigger
  206|       |         * a realloc which would leak the size of the scalar through memory
  207|       |         * accesses.
  208|       |         *
  209|       |         * Fixed Length
  210|       |         * ------------
  211|       |         *
  212|       |         * The order of the large prime subgroup of the curve is our choice for
  213|       |         * a fixed public size, as that is generally the upper bound for
  214|       |         * generating a private key in EC cryptosystems and should fit all valid
  215|       |         * secret scalars.
  216|       |         *
  217|       |         * For padding on export we just use the bit length of the order
  218|       |         * converted to bytes (rounding up).
  219|       |         *
  220|       |         * For preallocating the BIGNUM storage we look at the number of "words"
  221|       |         * required for the internal representation of the order, and we
  222|       |         * preallocate 2 extra "words" in case any of the subsequent processing
  223|       |         * might temporarily overflow the order length.
  224|       |         */
  225|    731|        ecbits = EC_GROUP_order_bits(ecg);
  226|    731|        if (ecbits <= 0)
  ------------------
  |  Branch (226:13): [True: 0, False: 731]
  ------------------
  227|      0|            goto err;
  228|    731|        sz = (ecbits + 7) / 8;
  229|       |
  230|    731|        if (!ossl_param_build_set_bn_pad(tmpl, params,
  ------------------
  |  Branch (230:13): [True: 0, False: 731]
  ------------------
  231|    731|                                         OSSL_PKEY_PARAM_PRIV_KEY,
  ------------------
  |  |  431|    731|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  232|    731|                                         priv_key, sz))
  233|      0|            goto err;
  234|    731|    }
  235|  7.50k|    ret = 1;
  236|  7.50k| err:
  237|  7.50k|    BN_CTX_free(bnctx);
  238|  7.50k|    return ret;
  239|  7.50k|}
ec_kmgmt.c:otherparams_to_params:
  244|  7.50k|{
  245|  7.50k|    int ecdh_cofactor_mode = 0, group_check = 0;
  246|  7.50k|    const char *name = NULL;
  247|  7.50k|    point_conversion_form_t format;
  248|       |
  249|  7.50k|    if (ec == NULL)
  ------------------
  |  Branch (249:9): [True: 0, False: 7.50k]
  ------------------
  250|      0|        return 0;
  251|       |
  252|  7.50k|    format = EC_KEY_get_conv_form(ec);
  253|  7.50k|    name = ossl_ec_pt_format_id2name((int)format);
  254|  7.50k|    if (name != NULL
  ------------------
  |  Branch (254:9): [True: 7.47k, False: 26]
  ------------------
  255|  7.50k|        && !ossl_param_build_set_utf8_string(tmpl, params,
  ------------------
  |  Branch (255:12): [True: 0, False: 7.47k]
  ------------------
  256|  7.47k|                                             OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT,
  ------------------
  |  |  386|  7.47k|# define OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT "point-format"
  ------------------
  257|  7.47k|                                             name))
  258|      0|        return 0;
  259|       |
  260|  7.50k|    group_check = EC_KEY_get_flags(ec) & EC_FLAG_CHECK_NAMED_GROUP_MASK;
  ------------------
  |  |  967|  7.50k|    (EC_FLAG_CHECK_NAMED_GROUP | EC_FLAG_CHECK_NAMED_GROUP_NIST)
  |  |  ------------------
  |  |  |  |  964|  7.50k|#  define EC_FLAG_CHECK_NAMED_GROUP      0x2000
  |  |  ------------------
  |  |                   (EC_FLAG_CHECK_NAMED_GROUP | EC_FLAG_CHECK_NAMED_GROUP_NIST)
  |  |  ------------------
  |  |  |  |  965|  7.50k|#  define EC_FLAG_CHECK_NAMED_GROUP_NIST 0x4000
  |  |  ------------------
  ------------------
  261|  7.50k|    name = ossl_ec_check_group_type_id2name(group_check);
  262|  7.50k|    if (name != NULL
  ------------------
  |  Branch (262:9): [True: 7.50k, False: 0]
  ------------------
  263|  7.50k|        && !ossl_param_build_set_utf8_string(tmpl, params,
  ------------------
  |  Branch (263:12): [True: 0, False: 7.50k]
  ------------------
  264|  7.50k|                                             OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE,
  ------------------
  |  |  382|  7.50k|# define OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE "group-check"
  ------------------
  265|  7.50k|                                             name))
  266|      0|        return 0;
  267|       |
  268|  7.50k|    if ((EC_KEY_get_enc_flags(ec) & EC_PKEY_NO_PUBKEY) != 0
  ------------------
  |  |  959|  7.50k|#  define EC_PKEY_NO_PUBKEY       0x002
  ------------------
  |  Branch (268:9): [True: 563, False: 6.94k]
  ------------------
  269|  7.50k|            && !ossl_param_build_set_int(tmpl, params,
  ------------------
  |  Branch (269:16): [True: 0, False: 563]
  ------------------
  270|    563|                                         OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, 0))
  ------------------
  |  |  383|    563|# define OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC "include-public"
  ------------------
  271|      0|        return 0;
  272|       |
  273|  7.50k|    ecdh_cofactor_mode =
  274|  7.50k|        (EC_KEY_get_flags(ec) & EC_FLAG_COFACTOR_ECDH) ? 1 : 0;
  ------------------
  |  |  963|  7.50k|#  define EC_FLAG_COFACTOR_ECDH          0x1000
  ------------------
  |  Branch (274:9): [True: 0, False: 7.50k]
  ------------------
  275|  7.50k|    return ossl_param_build_set_int(tmpl, params,
  276|  7.50k|                                    OSSL_PKEY_PARAM_USE_COFACTOR_ECDH,
  ------------------
  |  |  490|  7.50k|# define OSSL_PKEY_PARAM_USE_COFACTOR_ECDH OSSL_PKEY_PARAM_USE_COFACTOR_FLAG
  |  |  ------------------
  |  |  |  |  491|  7.50k|# define OSSL_PKEY_PARAM_USE_COFACTOR_FLAG "use-cofactor-flag"
  |  |  ------------------
  ------------------
  277|  7.50k|                                    ecdh_cofactor_mode);
  278|  7.50k|}
ec_kmgmt.c:ec_has:
  308|    731|{
  309|    731|    const EC_KEY *ec = keydata;
  310|    731|    int ok = 1;
  311|       |
  312|    731|    if (!ossl_prov_is_running() || ec == NULL)
  ------------------
  |  Branch (312:9): [True: 0, False: 731]
  |  Branch (312:36): [True: 0, False: 731]
  ------------------
  313|      0|        return 0;
  314|    731|    if ((selection & EC_POSSIBLE_SELECTIONS) == 0)
  ------------------
  |  |   77|    731|    (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS)
  |  |  ------------------
  |  |  |  |  650|    731|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  640|    731|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  |  |  ------------------
  |  |  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|    731|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS)
  |  |  ------------------
  |  |  |  |  647|    731|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  642|    731|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  ------------------
  |  |  |  |  648|    731|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  643|    731|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (314:9): [True: 0, False: 731]
  ------------------
  315|      0|        return 1; /* the selection is not missing */
  316|       |
  317|    731|    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
  ------------------
  |  |  641|    731|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (317:9): [True: 0, False: 731]
  ------------------
  318|      0|        ok = ok && (EC_KEY_get0_public_key(ec) != NULL);
  ------------------
  |  Branch (318:14): [True: 0, False: 0]
  |  Branch (318:20): [True: 0, False: 0]
  ------------------
  319|    731|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  640|    731|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (319:9): [True: 731, False: 0]
  ------------------
  320|    731|        ok = ok && (EC_KEY_get0_private_key(ec) != NULL);
  ------------------
  |  Branch (320:14): [True: 731, False: 0]
  |  Branch (320:20): [True: 731, False: 0]
  ------------------
  321|    731|    if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
  ------------------
  |  |  642|    731|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (321:9): [True: 0, False: 731]
  ------------------
  322|      0|        ok = ok && (EC_KEY_get0_group(ec) != NULL);
  ------------------
  |  Branch (322:14): [True: 0, False: 0]
  |  Branch (322:20): [True: 0, False: 0]
  ------------------
  323|       |    /*
  324|       |     * We consider OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS to always be
  325|       |     * available, so no extra check is needed other than the previous one
  326|       |     * against EC_POSSIBLE_SELECTIONS.
  327|       |     */
  328|    731|    return ok;
  329|    731|}
ec_kmgmt.c:sm2_load:
 1447|      5|{
 1448|      5|    return common_load(reference, reference_sz, 1);
 1449|      5|}
ec_kmgmt.c:sm2_get_params:
  866|      5|{
  867|      5|    return common_get_params(key, params, 1);
  868|      5|}

ecx_kmgmt.c:x25519_get_params:
  337|      2|{
  338|      2|    return ecx_get_params(key, params, X25519_BITS, X25519_SECURITY_BITS,
  ------------------
  |  |   33|      2|#  define X25519_BITS           253
  ------------------
                  return ecx_get_params(key, params, X25519_BITS, X25519_SECURITY_BITS,
  ------------------
  |  |   34|      2|#  define X25519_SECURITY_BITS  128
  ------------------
  339|      2|                          X25519_KEYLEN);
  ------------------
  |  |   26|      2|#  define X25519_KEYLEN         32
  ------------------
  340|      2|}
ecx_kmgmt.c:ecx_get_params:
  288|      7|{
  289|      7|    ECX_KEY *ecx = key;
  290|      7|    OSSL_PARAM *p;
  291|       |
  292|      7|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  360|      7|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (292:9): [True: 7, False: 0]
  ------------------
  293|      7|        && !OSSL_PARAM_set_int(p, bits))
  ------------------
  |  Branch (293:12): [True: 0, False: 7]
  ------------------
  294|      0|        return 0;
  295|      7|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  487|      7|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (295:9): [True: 7, False: 0]
  ------------------
  296|      7|        && !OSSL_PARAM_set_int(p, secbits))
  ------------------
  |  Branch (296:12): [True: 0, False: 7]
  ------------------
  297|      0|        return 0;
  298|      7|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  416|      7|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (298:9): [True: 7, False: 0]
  ------------------
  299|      7|        && !OSSL_PARAM_set_int(p, size))
  ------------------
  |  Branch (299:12): [True: 0, False: 7]
  ------------------
  300|      0|        return 0;
  301|      7|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL
  ------------------
  |  |  390|      7|# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
  ------------------
  |  Branch (301:9): [True: 0, False: 7]
  ------------------
  302|      7|            && (ecx->type == ECX_KEY_TYPE_X25519
  ------------------
  |  Branch (302:17): [True: 0, False: 0]
  ------------------
  303|      0|                || ecx->type == ECX_KEY_TYPE_X448)) {
  ------------------
  |  Branch (303:20): [True: 0, False: 0]
  ------------------
  304|      0|        if (!OSSL_PARAM_set_octet_string(p, ecx->pubkey, ecx->keylen))
  ------------------
  |  Branch (304:13): [True: 0, False: 0]
  ------------------
  305|      0|            return 0;
  306|      0|    }
  307|      7|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (307:9): [True: 7, False: 0]
  ------------------
  308|      7|                               OSSL_PKEY_PARAM_SECURITY_CATEGORY)) != NULL
  ------------------
  |  |  488|      7|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  127|      7|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  309|      7|        && !OSSL_PARAM_set_int(p, 0))
  ------------------
  |  Branch (309:12): [True: 0, False: 7]
  ------------------
  310|      0|            return 0;
  311|       |#ifdef FIPS_MODULE
  312|       |    {
  313|       |        /* X25519 and X448 are not approved */
  314|       |        int approved = 0;
  315|       |
  316|       |        p = OSSL_PARAM_locate(params, OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR);
  317|       |        if (p != NULL && !OSSL_PARAM_set_int(p, approved))
  318|       |            return 0;
  319|       |    }
  320|       |#endif
  321|       |
  322|      7|    return key_to_params(ecx, NULL, params, 1);
  323|      7|}
ecx_kmgmt.c:key_to_params:
  216|      7|{
  217|      7|    if (key == NULL)
  ------------------
  |  Branch (217:9): [True: 0, False: 7]
  ------------------
  218|      0|        return 0;
  219|       |
  220|      7|    if (!ossl_param_build_set_octet_string(tmpl, params,
  ------------------
  |  Branch (220:9): [True: 0, False: 7]
  ------------------
  221|      7|                                           OSSL_PKEY_PARAM_PUB_KEY,
  ------------------
  |  |  433|      7|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  222|      7|                                           key->pubkey, key->keylen))
  223|      0|        return 0;
  224|       |
  225|      7|    if (include_private
  ------------------
  |  Branch (225:9): [True: 7, False: 0]
  ------------------
  226|      7|        && key->privkey != NULL
  ------------------
  |  Branch (226:12): [True: 3, False: 4]
  ------------------
  227|      7|        && !ossl_param_build_set_octet_string(tmpl, params,
  ------------------
  |  Branch (227:12): [True: 0, False: 3]
  ------------------
  228|      3|                                              OSSL_PKEY_PARAM_PRIV_KEY,
  ------------------
  |  |  431|      3|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  229|      3|                                              key->privkey, key->keylen))
  230|      0|        return 0;
  231|       |
  232|      7|    return 1;
  233|      7|}
ecx_kmgmt.c:ecx_has:
  128|      3|{
  129|      3|    const ECX_KEY *key = keydata;
  130|      3|    int ok = 0;
  131|       |
  132|      3|    if (ossl_prov_is_running() && key != NULL) {
  ------------------
  |  Branch (132:9): [True: 3, False: 0]
  |  Branch (132:35): [True: 3, False: 0]
  ------------------
  133|       |        /*
  134|       |         * ECX keys always have all the parameters they need (i.e. none).
  135|       |         * Therefore we always return with 1, if asked about parameters.
  136|       |         */
  137|      3|        ok = 1;
  138|       |
  139|      3|        if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
  ------------------
  |  |  641|      3|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (139:13): [True: 0, False: 3]
  ------------------
  140|      0|            ok = ok && key->haspubkey;
  ------------------
  |  Branch (140:18): [True: 0, False: 0]
  |  Branch (140:24): [True: 0, False: 0]
  ------------------
  141|       |
  142|      3|        if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  640|      3|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (142:13): [True: 3, False: 0]
  ------------------
  143|      3|            ok = ok && key->privkey != NULL;
  ------------------
  |  Branch (143:18): [True: 3, False: 0]
  |  Branch (143:24): [True: 3, False: 0]
  ------------------
  144|      3|    }
  145|      3|    return ok;
  146|      3|}
ecx_kmgmt.c:ecx_load:
  862|      7|{
  863|      7|    ECX_KEY *key = NULL;
  864|       |
  865|      7|    if (ossl_prov_is_running() && reference_sz == sizeof(key)) {
  ------------------
  |  Branch (865:9): [True: 7, False: 0]
  |  Branch (865:35): [True: 7, False: 0]
  ------------------
  866|       |        /* The contents of the reference is the address to our object */
  867|      7|        key = *(ECX_KEY **)reference;
  868|       |        /* We grabbed, so we detach it */
  869|      7|        *(ECX_KEY **)reference = NULL;
  870|      7|        return key;
  871|      7|    }
  872|      0|    return NULL;
  873|      7|}
ecx_kmgmt.c:x448_get_params:
  343|      1|{
  344|      1|    return ecx_get_params(key, params, X448_BITS, X448_SECURITY_BITS,
  ------------------
  |  |   36|      1|#  define X448_BITS             448
  ------------------
                  return ecx_get_params(key, params, X448_BITS, X448_SECURITY_BITS,
  ------------------
  |  |   37|      1|#  define X448_SECURITY_BITS    224
  ------------------
  345|      1|                          X448_KEYLEN);
  ------------------
  |  |   27|      1|#  define X448_KEYLEN           56
  ------------------
  346|      1|}
ecx_kmgmt.c:ed25519_get_params:
  349|      3|{
  350|      3|    return ecx_get_params(key, params, ED25519_BITS, ED25519_SECURITY_BITS,
  ------------------
  |  |   39|      3|#  define ED25519_BITS          256
  ------------------
                  return ecx_get_params(key, params, ED25519_BITS, ED25519_SECURITY_BITS,
  ------------------
  |  |   41|      3|#  define ED25519_SECURITY_BITS 128
  ------------------
  |  Branch (350:12): [True: 3, False: 0]
  ------------------
  351|      3|                          ED25519_SIGSIZE)
  ------------------
  |  |   42|      3|#  define ED25519_SIGSIZE       64
  ------------------
  352|      3|        && ed_get_params(key, params);
  ------------------
  |  Branch (352:12): [True: 3, False: 0]
  ------------------
  353|      3|}
ecx_kmgmt.c:ed_get_params:
  326|      4|{
  327|      4|    OSSL_PARAM *p;
  328|       |
  329|      4|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (329:9): [True: 0, False: 4]
  ------------------
  330|      4|                               OSSL_PKEY_PARAM_MANDATORY_DIGEST)) != NULL
  ------------------
  |  |  414|      4|# define OSSL_PKEY_PARAM_MANDATORY_DIGEST "mandatory-digest"
  ------------------
  331|      4|        && !OSSL_PARAM_set_utf8_string(p, ""))
  ------------------
  |  Branch (331:12): [True: 0, False: 0]
  ------------------
  332|      0|        return 0;
  333|      4|    return 1;
  334|      4|}
ecx_kmgmt.c:ed448_get_params:
  356|      1|{
  357|      1|    return ecx_get_params(key, params, ED448_BITS, ED448_SECURITY_BITS,
  ------------------
  |  |   44|      1|#  define ED448_BITS            456
  ------------------
                  return ecx_get_params(key, params, ED448_BITS, ED448_SECURITY_BITS,
  ------------------
  |  |   46|      1|#  define ED448_SECURITY_BITS   224
  ------------------
  |  Branch (357:12): [True: 1, False: 0]
  ------------------
  358|      1|                          ED448_SIGSIZE)
  ------------------
  |  |   47|      1|#  define ED448_SIGSIZE         114
  ------------------
  359|      1|        && ed_get_params(key, params);
  ------------------
  |  Branch (359:12): [True: 1, False: 0]
  ------------------
  360|      1|}

rsa_kmgmt.c:rsa_load:
  676|    181|{
  677|    181|    return common_load(reference, reference_sz, RSA_FLAG_TYPE_RSA);
  ------------------
  |  |  118|    181|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  678|    181|}
rsa_kmgmt.c:common_load:
  658|    187|{
  659|    187|    RSA *rsa = NULL;
  660|       |
  661|    187|    if (ossl_prov_is_running() && reference_sz == sizeof(rsa)) {
  ------------------
  |  Branch (661:9): [True: 187, False: 0]
  |  Branch (661:35): [True: 187, False: 0]
  ------------------
  662|       |        /* The contents of the reference is the address to our object */
  663|    187|        rsa = *(RSA **)reference;
  664|       |
  665|    187|        if (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK) != expected_rsa_type)
  ------------------
  |  |  117|    187|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  |  Branch (665:13): [True: 0, False: 187]
  ------------------
  666|      0|            return NULL;
  667|       |
  668|       |        /* We grabbed, so we detach it */
  669|    187|        *(RSA **)reference = NULL;
  670|    187|        return rsa;
  671|    187|    }
  672|      0|    return NULL;
  673|    187|}
rsa_kmgmt.c:rsa_freedata:
  110|    187|{
  111|    187|    RSA_free(keydata);
  112|    187|}
rsa_kmgmt.c:rsa_get_params:
  330|    187|{
  331|    187|    RSA *rsa = key;
  332|    187|    const RSA_PSS_PARAMS_30 *pss_params = ossl_rsa_get0_pss_params_30(rsa);
  333|    187|    int rsa_type = RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK);
  ------------------
  |  |  117|    187|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  334|    187|    OSSL_PARAM *p;
  335|    187|    int empty = RSA_get0_n(rsa) == NULL;
  336|       |
  337|    187|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  360|    187|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (337:9): [True: 187, False: 0]
  ------------------
  338|    187|        && (empty || !OSSL_PARAM_set_int(p, RSA_bits(rsa))))
  ------------------
  |  Branch (338:13): [True: 0, False: 187]
  |  Branch (338:22): [True: 0, False: 187]
  ------------------
  339|      0|        return 0;
  340|    187|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  487|    187|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (340:9): [True: 187, False: 0]
  ------------------
  341|    187|        && (empty || !OSSL_PARAM_set_int(p, RSA_security_bits(rsa))))
  ------------------
  |  Branch (341:13): [True: 0, False: 187]
  |  Branch (341:22): [True: 0, False: 187]
  ------------------
  342|      0|        return 0;
  343|    187|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  416|    187|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (343:9): [True: 187, False: 0]
  ------------------
  344|    187|        && (empty || !OSSL_PARAM_set_int(p, RSA_size(rsa))))
  ------------------
  |  Branch (344:13): [True: 0, False: 187]
  |  Branch (344:22): [True: 0, False: 187]
  ------------------
  345|      0|        return 0;
  346|    187|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_CATEGORY)) != NULL)
  ------------------
  |  |  488|    187|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  127|    187|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  |  Branch (346:9): [True: 187, False: 0]
  ------------------
  347|    187|        if (!OSSL_PARAM_set_int(p, 0))
  ------------------
  |  Branch (347:13): [True: 0, False: 187]
  ------------------
  348|      0|            return 0;
  349|       |
  350|       |    /*
  351|       |     * For restricted RSA-PSS keys, we ignore the default digest request.
  352|       |     * With RSA-OAEP keys, this may need to be amended.
  353|       |     */
  354|    187|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  362|    187|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (354:9): [True: 0, False: 187]
  ------------------
  355|    187|        && (rsa_type != RSA_FLAG_TYPE_RSASSAPSS
  ------------------
  |  |  119|      0|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (355:13): [True: 0, False: 0]
  ------------------
  356|      0|            || ossl_rsa_pss_params_30_is_unrestricted(pss_params))) {
  ------------------
  |  Branch (356:16): [True: 0, False: 0]
  ------------------
  357|      0|        if (!OSSL_PARAM_set_utf8_string(p, RSA_DEFAULT_MD))
  ------------------
  |  |   54|      0|#define RSA_DEFAULT_MD "SHA256"
  ------------------
  |  Branch (357:13): [True: 0, False: 0]
  ------------------
  358|      0|            return 0;
  359|      0|    }
  360|       |
  361|       |    /*
  362|       |     * For non-RSA-PSS keys, we ignore the mandatory digest request.
  363|       |     * With RSA-OAEP keys, this may need to be amended.
  364|       |     */
  365|    187|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (365:9): [True: 0, False: 187]
  ------------------
  366|    187|                               OSSL_PKEY_PARAM_MANDATORY_DIGEST)) != NULL
  ------------------
  |  |  414|    187|# define OSSL_PKEY_PARAM_MANDATORY_DIGEST "mandatory-digest"
  ------------------
  367|    187|        && rsa_type == RSA_FLAG_TYPE_RSASSAPSS
  ------------------
  |  |  119|    187|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (367:12): [True: 0, False: 0]
  ------------------
  368|    187|        && !ossl_rsa_pss_params_30_is_unrestricted(pss_params)) {
  ------------------
  |  Branch (368:12): [True: 0, False: 0]
  ------------------
  369|      0|        const char *mdname =
  370|      0|            ossl_rsa_oaeppss_nid2name(ossl_rsa_pss_params_30_hashalg(pss_params));
  371|       |
  372|      0|        if (mdname == NULL || !OSSL_PARAM_set_utf8_string(p, mdname))
  ------------------
  |  Branch (372:13): [True: 0, False: 0]
  |  Branch (372:31): [True: 0, False: 0]
  ------------------
  373|      0|            return 0;
  374|      0|    }
  375|    187|    return (rsa_type != RSA_FLAG_TYPE_RSASSAPSS
  ------------------
  |  |  119|    374|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (375:13): [True: 181, False: 6]
  ------------------
  376|    187|            || ossl_rsa_pss_params_30_todata(pss_params, NULL, params))
  ------------------
  |  Branch (376:16): [True: 6, False: 0]
  ------------------
  377|    187|        && ossl_rsa_todata(rsa, NULL, params, 1);
  ------------------
  |  Branch (377:12): [True: 187, False: 0]
  ------------------
  378|    187|}
rsa_kmgmt.c:rsa_has:
  115|    140|{
  116|    140|    const RSA *rsa = keydata;
  117|    140|    int ok = 1;
  118|       |
  119|    140|    if (rsa == NULL || !ossl_prov_is_running())
  ------------------
  |  Branch (119:9): [True: 0, False: 140]
  |  Branch (119:24): [True: 0, False: 140]
  ------------------
  120|      0|        return 0;
  121|    140|    if ((selection & RSA_POSSIBLE_SELECTIONS) == 0)
  ------------------
  |  |   56|    140|    (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  650|    140|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  640|    140|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  |  |  ------------------
  |  |  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|    140|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  643|    140|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  ------------------
  ------------------
  |  Branch (121:9): [True: 0, False: 140]
  ------------------
  122|      0|        return 1; /* the selection is not missing */
  123|       |
  124|       |    /* OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS are always available even if empty */
  125|    140|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0)
  ------------------
  |  |  650|    140|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  640|    140|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|    140|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  |  Branch (125:9): [True: 140, False: 0]
  ------------------
  126|    140|        ok = ok && (RSA_get0_n(rsa) != NULL);
  ------------------
  |  Branch (126:14): [True: 140, False: 0]
  |  Branch (126:20): [True: 140, False: 0]
  ------------------
  127|    140|    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
  ------------------
  |  |  641|    140|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (127:9): [True: 0, False: 140]
  ------------------
  128|      0|        ok = ok && (RSA_get0_e(rsa) != NULL);
  ------------------
  |  Branch (128:14): [True: 0, False: 0]
  |  Branch (128:20): [True: 0, False: 0]
  ------------------
  129|    140|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  640|    140|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (129:9): [True: 140, False: 0]
  ------------------
  130|    140|        ok = ok && (RSA_get0_d(rsa) != NULL);
  ------------------
  |  Branch (130:14): [True: 140, False: 0]
  |  Branch (130:20): [True: 140, False: 0]
  ------------------
  131|    140|    return ok;
  132|    140|}
rsa_kmgmt.c:rsapss_load:
  681|      6|{
  682|      6|    return common_load(reference, reference_sz, RSA_FLAG_TYPE_RSASSAPSS);
  ------------------
  |  |  119|      6|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  683|      6|}

ossl_prov_drbg_nonce_ctx_new:
  272|      4|{
  273|      4|    PROV_DRBG_NONCE_GLOBAL *dngbl = OPENSSL_zalloc(sizeof(*dngbl));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  274|       |
  275|      4|    if (dngbl == NULL)
  ------------------
  |  Branch (275:9): [True: 0, False: 4]
  ------------------
  276|      0|        return NULL;
  277|       |
  278|      4|    dngbl->rand_nonce_lock = CRYPTO_THREAD_lock_new();
  279|      4|    if (dngbl->rand_nonce_lock == NULL) {
  ------------------
  |  Branch (279:9): [True: 0, False: 4]
  ------------------
  280|      0|        OPENSSL_free(dngbl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  281|      0|        return NULL;
  282|      0|    }
  283|       |
  284|      4|    return dngbl;
  285|      4|}
ossl_prov_drbg_nonce_ctx_free:
  288|      2|{
  289|      2|    PROV_DRBG_NONCE_GLOBAL *dngbl = vdngbl;
  290|       |
  291|      2|    if (dngbl == NULL)
  ------------------
  |  Branch (291:9): [True: 0, False: 2]
  ------------------
  292|      0|        return;
  293|       |
  294|      2|    CRYPTO_THREAD_lock_free(dngbl->rand_nonce_lock);
  295|       |
  296|      2|    OPENSSL_free(dngbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  297|      2|}

seed_src.c:seed_src_new:
   47|      1|{
   48|      1|    PROV_SEED_SRC *s;
   49|       |
   50|      1|    if (parent != NULL) {
  ------------------
  |  Branch (50:9): [True: 0, False: 1]
  ------------------
   51|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_SEED_SOURCES_MUST_NOT_HAVE_A_PARENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   52|      0|        return NULL;
   53|      0|    }
   54|       |
   55|      1|    s = OPENSSL_zalloc(sizeof(*s));
  ------------------
  |  |  104|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   56|      1|    if (s == NULL)
  ------------------
  |  Branch (56:9): [True: 0, False: 1]
  ------------------
   57|      0|        return NULL;
   58|       |
   59|      1|    s->provctx = provctx;
   60|      1|    s->state = EVP_RAND_STATE_UNINITIALISED;
  ------------------
  |  | 1347|      1|# define EVP_RAND_STATE_UNINITIALISED    0
  ------------------
   61|      1|    return s;
   62|      1|}
seed_src.c:seed_src_free:
   65|      1|{
   66|      1|    OPENSSL_free(vseed);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|      1|}
seed_src.c:seed_src_instantiate:
   73|      1|{
   74|      1|    PROV_SEED_SRC *s = (PROV_SEED_SRC *)vseed;
   75|       |
   76|      1|    s->state = EVP_RAND_STATE_READY;
  ------------------
  |  | 1348|      1|# define EVP_RAND_STATE_READY            1
  ------------------
   77|      1|    return 1;
   78|      1|}
seed_src.c:seed_src_lock:
  221|      1|{
  222|      1|    return 1;
  223|      1|}
seed_src.c:seed_src_unlock:
  226|      1|{
  227|      1|}

ossl_rand_pool_init:
  570|      1|{
  571|      1|    size_t i;
  572|       |
  573|      5|    for (i = 0; i < OSSL_NELEM(random_devices); i++)
  ------------------
  |  |   14|      5|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (573:17): [True: 4, False: 1]
  ------------------
  574|      4|        random_devices[i].fd = -1;
  575|       |
  576|      1|    return 1;
  577|      1|}
ossl_rand_pool_cleanup:
  580|      1|{
  581|      1|    size_t i;
  582|       |
  583|      5|    for (i = 0; i < OSSL_NELEM(random_devices); i++)
  ------------------
  |  |   14|      5|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (583:17): [True: 4, False: 1]
  ------------------
  584|      4|        close_random_device(i);
  585|      1|}
rand_unix.c:close_random_device:
  561|      4|{
  562|      4|    struct random_device *rd = &random_devices[n];
  563|       |
  564|      4|    if (check_random_device(rd))
  ------------------
  |  Branch (564:9): [True: 0, False: 4]
  ------------------
  565|      0|        close(rd->fd);
  566|      4|    rd->fd = -1;
  567|      4|}
rand_unix.c:check_random_device:
  516|      4|{
  517|      4|    struct stat st;
  518|       |
  519|      4|    return rd->fd != -1
  ------------------
  |  Branch (519:12): [True: 0, False: 4]
  ------------------
  520|      4|           && fstat(rd->fd, &st) != -1
  ------------------
  |  Branch (520:15): [True: 0, False: 0]
  ------------------
  521|      4|           && rd->dev == st.st_dev
  ------------------
  |  Branch (521:15): [True: 0, False: 0]
  ------------------
  522|      4|           && rd->ino == st.st_ino
  ------------------
  |  Branch (522:15): [True: 0, False: 0]
  ------------------
  523|      4|           && ((rd->mode ^ st.st_mode) & ~(S_IRWXU | S_IRWXG | S_IRWXO)) == 0
  ------------------
  |  Branch (523:15): [True: 0, False: 0]
  ------------------
  524|      4|           && rd->rdev == st.st_rdev;
  ------------------
  |  Branch (524:15): [True: 0, False: 0]
  ------------------
  525|      4|}

ossl_prov_is_running:
   20|  29.5k|{
   21|  29.5k|    return 1;
   22|  29.5k|}

ssl_sort_cipher_list:
 3308|      2|{
 3309|      2|    qsort(tls13_ciphers, TLS13_NUM_CIPHERS, sizeof(tls13_ciphers[0]),
  ------------------
  |  |   26|      2|#define TLS13_NUM_CIPHERS       OSSL_NELEM(tls13_ciphers)
  |  |  ------------------
  |  |  |  |   14|      2|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3310|      2|          cipher_compare);
 3311|      2|    qsort(ssl3_ciphers, SSL3_NUM_CIPHERS, sizeof(ssl3_ciphers[0]),
  ------------------
  |  |   27|      2|#define SSL3_NUM_CIPHERS        OSSL_NELEM(ssl3_ciphers)
  |  |  ------------------
  |  |  |  |   14|      2|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3312|      2|          cipher_compare);
 3313|      2|    qsort(ssl3_scsvs, SSL3_NUM_SCSVS, sizeof(ssl3_scsvs[0]), cipher_compare);
  ------------------
  |  |   28|      2|#define SSL3_NUM_SCSVS          OSSL_NELEM(ssl3_scsvs)
  |  |  ------------------
  |  |  |  |   14|      2|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3314|      2|}
ssl3_get_cipher_by_id:
 4252|    433|{
 4253|    433|    SSL_CIPHER c;
 4254|    433|    const SSL_CIPHER *cp;
 4255|       |
 4256|    433|    c.id = id;
 4257|    433|    cp = OBJ_bsearch_ssl_cipher_id(&c, tls13_ciphers, TLS13_NUM_CIPHERS);
  ------------------
  |  |   26|    433|#define TLS13_NUM_CIPHERS       OSSL_NELEM(tls13_ciphers)
  |  |  ------------------
  |  |  |  |   14|    433|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 4258|    433|    if (cp != NULL)
  ------------------
  |  Branch (4258:9): [True: 128, False: 305]
  ------------------
 4259|    128|        return cp;
 4260|    305|    cp = OBJ_bsearch_ssl_cipher_id(&c, ssl3_ciphers, SSL3_NUM_CIPHERS);
  ------------------
  |  |   27|    305|#define SSL3_NUM_CIPHERS        OSSL_NELEM(ssl3_ciphers)
  |  |  ------------------
  |  |  |  |   14|    305|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 4261|    305|    if (cp != NULL)
  ------------------
  |  Branch (4261:9): [True: 295, False: 10]
  ------------------
 4262|    295|        return cp;
 4263|     10|    return OBJ_bsearch_ssl_cipher_id(&c, ssl3_scsvs, SSL3_NUM_SCSVS);
  ------------------
  |  |   28|     10|#define SSL3_NUM_SCSVS          OSSL_NELEM(ssl3_scsvs)
  |  |  ------------------
  |  |  |  |   14|     10|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 4264|    305|}
s3_lib.c:cipher_compare:
 3298|  1.94k|{
 3299|  1.94k|    const SSL_CIPHER *ap = (const SSL_CIPHER *)a;
 3300|  1.94k|    const SSL_CIPHER *bp = (const SSL_CIPHER *)b;
 3301|       |
 3302|  1.94k|    if (ap->id == bp->id)
  ------------------
  |  Branch (3302:9): [True: 0, False: 1.94k]
  ------------------
 3303|      0|        return 0;
 3304|  1.94k|    return ap->id < bp->id ? -1 : 1;
  ------------------
  |  Branch (3304:12): [True: 1.25k, False: 694]
  ------------------
 3305|  1.94k|}

i2d_SSL_SESSION:
  110|    414|{
  111|       |
  112|    414|    SSL_SESSION_ASN1 as;
  113|       |
  114|    414|    ASN1_OCTET_STRING cipher;
  115|    414|    unsigned char cipher_data[2];
  116|    414|    ASN1_OCTET_STRING master_key, session_id, sid_ctx;
  117|       |
  118|    414|#ifndef OPENSSL_NO_COMP
  119|    414|    ASN1_OCTET_STRING comp_id;
  120|    414|    unsigned char comp_id_data;
  121|    414|#endif
  122|    414|    ASN1_OCTET_STRING tlsext_hostname, tlsext_tick;
  123|    414|#ifndef OPENSSL_NO_SRP
  124|    414|    ASN1_OCTET_STRING srp_username;
  125|    414|#endif
  126|    414|#ifndef OPENSSL_NO_PSK
  127|    414|    ASN1_OCTET_STRING psk_identity, psk_identity_hint;
  128|    414|#endif
  129|    414|    ASN1_OCTET_STRING alpn_selected;
  130|    414|    ASN1_OCTET_STRING ticket_appdata;
  131|    414|    ASN1_OCTET_STRING peer_rpk;
  132|       |
  133|    414|    long l;
  134|    414|    int ret;
  135|       |
  136|    414|    if ((in == NULL) || ((in->cipher == NULL) && (in->cipher_id == 0)))
  ------------------
  |  Branch (136:9): [True: 0, False: 414]
  |  Branch (136:26): [True: 0, False: 414]
  |  Branch (136:50): [True: 0, False: 0]
  ------------------
  137|      0|        return 0;
  138|       |
  139|    414|    memset(&as, 0, sizeof(as));
  140|       |
  141|    414|    as.version = SSL_SESSION_ASN1_VERSION;
  ------------------
  |  |   59|    414|# define SSL_SESSION_ASN1_VERSION 0x0001
  ------------------
  142|    414|    as.ssl_version = in->ssl_version;
  143|       |
  144|    414|    as.kex_group = in->kex_group;
  145|       |
  146|    414|    if (in->cipher == NULL)
  ------------------
  |  Branch (146:9): [True: 0, False: 414]
  ------------------
  147|      0|        l = in->cipher_id;
  148|    414|    else
  149|    414|        l = in->cipher->id;
  150|    414|    cipher_data[0] = ((unsigned char)(l >> 8L)) & 0xff;
  151|    414|    cipher_data[1] = ((unsigned char)(l)) & 0xff;
  152|       |
  153|    414|    ssl_session_oinit(&as.cipher, &cipher, cipher_data, 2);
  154|       |
  155|    414|#ifndef OPENSSL_NO_COMP
  156|    414|    if (in->compress_meth) {
  ------------------
  |  Branch (156:9): [True: 1, False: 413]
  ------------------
  157|      1|        comp_id_data = (unsigned char)in->compress_meth;
  158|      1|        ssl_session_oinit(&as.comp_id, &comp_id, &comp_id_data, 1);
  159|      1|    }
  160|    414|#endif
  161|       |
  162|    414|    ssl_session_oinit(&as.master_key, &master_key,
  163|    414|                      in->master_key, in->master_key_length);
  164|       |
  165|    414|    ssl_session_oinit(&as.session_id, &session_id,
  166|    414|                      in->session_id, in->session_id_length);
  167|       |
  168|    414|    ssl_session_oinit(&as.session_id_context, &sid_ctx,
  169|    414|                      in->sid_ctx, in->sid_ctx_length);
  170|       |
  171|    414|    as.time = (int64_t)ossl_time_to_time_t(in->time);
  172|    414|    as.timeout = (int64_t)ossl_time2seconds(in->timeout);
  ------------------
  |  |   43|    414|#define ossl_time2seconds(t) (ossl_time2ticks(t) / OSSL_TIME_SECOND)
  |  |  ------------------
  |  |  |  |   31|    414|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  ------------------
  ------------------
  173|    414|    as.verify_result = in->verify_result;
  174|       |
  175|    414|    as.peer = in->peer;
  176|       |
  177|    414|    as.peer_rpk = NULL;
  178|    414|    peer_rpk.data = NULL;
  179|    414|    if (in->peer_rpk != NULL) {
  ------------------
  |  Branch (179:9): [True: 0, False: 414]
  ------------------
  180|      0|        peer_rpk.length = i2d_PUBKEY(in->peer_rpk, &peer_rpk.data);
  181|      0|        if (peer_rpk.length > 0 && peer_rpk.data != NULL)
  ------------------
  |  Branch (181:13): [True: 0, False: 0]
  |  Branch (181:36): [True: 0, False: 0]
  ------------------
  182|      0|            as.peer_rpk = &peer_rpk;
  183|      0|    }
  184|       |
  185|    414|    ssl_session_sinit(&as.tlsext_hostname, &tlsext_hostname,
  186|    414|                      in->ext.hostname);
  187|    414|    if (in->ext.tick) {
  ------------------
  |  Branch (187:9): [True: 8, False: 406]
  ------------------
  188|      8|        ssl_session_oinit(&as.tlsext_tick, &tlsext_tick,
  189|      8|                          in->ext.tick, in->ext.ticklen);
  190|      8|    }
  191|    414|    if (in->ext.tick_lifetime_hint > 0)
  ------------------
  |  Branch (191:9): [True: 119, False: 295]
  ------------------
  192|    119|        as.tlsext_tick_lifetime_hint = in->ext.tick_lifetime_hint;
  193|    414|    as.tlsext_tick_age_add = in->ext.tick_age_add;
  194|    414|#ifndef OPENSSL_NO_PSK
  195|    414|    ssl_session_sinit(&as.psk_identity_hint, &psk_identity_hint,
  196|    414|                      in->psk_identity_hint);
  197|    414|    ssl_session_sinit(&as.psk_identity, &psk_identity, in->psk_identity);
  198|    414|#endif                          /* OPENSSL_NO_PSK */
  199|    414|#ifndef OPENSSL_NO_SRP
  200|    414|    ssl_session_sinit(&as.srp_username, &srp_username, in->srp_username);
  201|    414|#endif                          /* OPENSSL_NO_SRP */
  202|       |
  203|    414|    as.flags = in->flags;
  204|    414|    as.max_early_data = in->ext.max_early_data;
  205|       |
  206|    414|    if (in->ext.alpn_selected == NULL)
  ------------------
  |  Branch (206:9): [True: 413, False: 1]
  ------------------
  207|    413|        as.alpn_selected = NULL;
  208|      1|    else
  209|      1|        ssl_session_oinit(&as.alpn_selected, &alpn_selected,
  210|      1|                          in->ext.alpn_selected, in->ext.alpn_selected_len);
  211|       |
  212|    414|    as.tlsext_max_fragment_len_mode = in->ext.max_fragment_len_mode;
  213|       |
  214|    414|    if (in->ticket_appdata == NULL)
  ------------------
  |  Branch (214:9): [True: 413, False: 1]
  ------------------
  215|    413|        as.ticket_appdata = NULL;
  216|      1|    else
  217|      1|        ssl_session_oinit(&as.ticket_appdata, &ticket_appdata,
  218|      1|                          in->ticket_appdata, in->ticket_appdata_len);
  219|       |
  220|    414|    ret = i2d_SSL_SESSION_ASN1(&as, pp);
  221|    414|    OPENSSL_free(peer_rpk.data);
  ------------------
  |  |  115|    414|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    414|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    414|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  222|    414|    return ret;
  223|    414|}
d2i_SSL_SESSION:
  259|  12.7k|{
  260|  12.7k|    return d2i_SSL_SESSION_ex(a, pp, length, NULL, NULL);
  261|  12.7k|}
d2i_SSL_SESSION_ex:
  265|  12.7k|{
  266|  12.7k|    long id;
  267|  12.7k|    size_t tmpl;
  268|  12.7k|    const unsigned char *p = *pp;
  269|  12.7k|    SSL_SESSION_ASN1 *as = NULL;
  270|  12.7k|    SSL_SESSION *ret = NULL;
  271|       |
  272|  12.7k|    as = d2i_SSL_SESSION_ASN1(NULL, &p, length);
  273|       |    /* ASN.1 code returns suitable error */
  274|  12.7k|    if (as == NULL)
  ------------------
  |  Branch (274:9): [True: 12.2k, False: 479]
  ------------------
  275|  12.2k|        goto err;
  276|       |
  277|    479|    if (a == NULL || *a == NULL) {
  ------------------
  |  Branch (277:9): [True: 479, False: 0]
  |  Branch (277:22): [True: 0, False: 0]
  ------------------
  278|    479|        ret = SSL_SESSION_new();
  279|    479|        if (ret == NULL)
  ------------------
  |  Branch (279:13): [True: 0, False: 479]
  ------------------
  280|      0|            goto err;
  281|    479|    } else {
  282|      0|        ret = *a;
  283|      0|    }
  284|       |
  285|    479|    if (as->version != SSL_SESSION_ASN1_VERSION) {
  ------------------
  |  |   59|    479|# define SSL_SESSION_ASN1_VERSION 0x0001
  ------------------
  |  Branch (285:9): [True: 1, False: 478]
  ------------------
  286|      1|        ERR_raise(ERR_LIB_SSL, SSL_R_UNKNOWN_SSL_VERSION);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
  287|      1|        goto err;
  288|      1|    }
  289|       |
  290|    478|    if ((as->ssl_version >> 8) != SSL3_VERSION_MAJOR
  ------------------
  |  |  216|    956|# define SSL3_VERSION_MAJOR              0x03
  ------------------
  |  Branch (290:9): [True: 72, False: 406]
  ------------------
  291|    478|        && (as->ssl_version >> 8) != DTLS1_VERSION_MAJOR
  ------------------
  |  |   32|    550|# define DTLS1_VERSION_MAJOR             0xFE
  ------------------
  |  Branch (291:12): [True: 47, False: 25]
  ------------------
  292|    478|        && as->ssl_version != DTLS1_BAD_VER) {
  ------------------
  |  |   30|     47|# define DTLS1_BAD_VER                   0x0100
  ------------------
  |  Branch (292:12): [True: 43, False: 4]
  ------------------
  293|     43|        ERR_raise(ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION);
  ------------------
  |  |  401|     43|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     43|    (ERR_new(),                                                 \
  |  |  |  |  404|     43|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     43|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     43|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     43|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     43|     ERR_set_error)
  |  |  ------------------
  ------------------
  294|     43|        goto err;
  295|     43|    }
  296|       |
  297|    435|    ret->ssl_version = (int)as->ssl_version;
  298|       |
  299|    435|    ret->kex_group = as->kex_group;
  300|       |
  301|    435|    if (as->cipher->length != 2) {
  ------------------
  |  Branch (301:9): [True: 2, False: 433]
  ------------------
  302|      2|        ERR_raise(ERR_LIB_SSL, SSL_R_CIPHER_CODE_WRONG_LENGTH);
  ------------------
  |  |  401|      2|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      2|    (ERR_new(),                                                 \
  |  |  |  |  404|      2|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      2|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      2|     ERR_set_error)
  |  |  ------------------
  ------------------
  303|      2|        goto err;
  304|      2|    }
  305|       |
  306|    433|    id = 0x03000000L | ((unsigned long)as->cipher->data[0] << 8L)
  307|    433|                     | (unsigned long)as->cipher->data[1];
  308|       |
  309|    433|    ret->cipher_id = id;
  310|    433|    ret->cipher = ssl3_get_cipher_by_id(id);
  311|    433|    if (ret->cipher == NULL)
  ------------------
  |  Branch (311:9): [True: 9, False: 424]
  ------------------
  312|      9|        goto err;
  313|       |
  314|    424|    if (!ssl_session_memcpy(ret->session_id, &ret->session_id_length,
  ------------------
  |  Branch (314:9): [True: 1, False: 423]
  ------------------
  315|    424|                            as->session_id, SSL3_MAX_SSL_SESSION_ID_LENGTH))
  ------------------
  |  |  134|    424|# define SSL3_MAX_SSL_SESSION_ID_LENGTH          32
  ------------------
  316|      1|        goto err;
  317|       |
  318|    423|    if (!ssl_session_memcpy(ret->master_key, &tmpl,
  ------------------
  |  Branch (318:9): [True: 5, False: 418]
  ------------------
  319|    423|                            as->master_key, TLS13_MAX_RESUMPTION_PSK_LENGTH))
  ------------------
  |  |  449|    423|# define TLS13_MAX_RESUMPTION_PSK_LENGTH      512
  ------------------
  320|      5|        goto err;
  321|       |
  322|    418|    ret->master_key_length = tmpl;
  323|       |
  324|    418|    if (as->time != 0)
  ------------------
  |  Branch (324:9): [True: 102, False: 316]
  ------------------
  325|    102|        ret->time = ossl_time_from_time_t(as->time);
  326|    316|    else
  327|    316|        ret->time = ossl_time_now();
  328|       |
  329|    418|    if (as->timeout != 0)
  ------------------
  |  Branch (329:9): [True: 142, False: 276]
  ------------------
  330|    142|        ret->timeout = ossl_seconds2time(as->timeout);
  ------------------
  |  |   42|    142|#define ossl_seconds2time(s) ossl_ticks2time((s) * OSSL_TIME_SECOND)
  |  |  ------------------
  |  |  |  |   31|    142|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  ------------------
  ------------------
  331|    276|    else
  332|    276|        ret->timeout = ossl_seconds2time(3);
  ------------------
  |  |   42|    276|#define ossl_seconds2time(s) ossl_ticks2time((s) * OSSL_TIME_SECOND)
  |  |  ------------------
  |  |  |  |   31|    276|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  ------------------
  ------------------
  333|    418|    ssl_session_calculate_timeout(ret);
  334|       |
  335|    418|    X509_free(ret->peer);
  336|    418|    ret->peer = as->peer;
  337|    418|    as->peer = NULL;
  338|       |
  339|    418|    EVP_PKEY_free(ret->peer_rpk);
  340|    418|    ret->peer_rpk = NULL;
  341|    418|    if (as->peer_rpk != NULL) {
  ------------------
  |  Branch (341:9): [True: 2, False: 416]
  ------------------
  342|      2|        const unsigned char *data = as->peer_rpk->data;
  343|       |
  344|       |        /*
  345|       |         * |data| is incremented; we don't want to lose original ptr
  346|       |         */
  347|      2|        ret->peer_rpk = d2i_PUBKEY_ex(NULL, &data, as->peer_rpk->length, libctx, propq);
  348|      2|        if (ret->peer_rpk == NULL)
  ------------------
  |  Branch (348:13): [True: 2, False: 0]
  ------------------
  349|      2|            goto err;
  350|      2|    }
  351|       |
  352|    416|    if (!ssl_session_memcpy(ret->sid_ctx, &ret->sid_ctx_length,
  ------------------
  |  Branch (352:9): [True: 1, False: 415]
  ------------------
  353|    416|                            as->session_id_context, SSL_MAX_SID_CTX_LENGTH))
  ------------------
  |  |   62|    416|# define SSL_MAX_SID_CTX_LENGTH                  32
  ------------------
  354|      1|        goto err;
  355|       |
  356|       |    /* NB: this defaults to zero which is X509_V_OK */
  357|    415|    ret->verify_result = as->verify_result;
  358|       |
  359|    415|    if (!ssl_session_strndup(&ret->ext.hostname, as->tlsext_hostname))
  ------------------
  |  Branch (359:9): [True: 0, False: 415]
  ------------------
  360|      0|        goto err;
  361|       |
  362|    415|#ifndef OPENSSL_NO_PSK
  363|    415|    if (!ssl_session_strndup(&ret->psk_identity_hint, as->psk_identity_hint))
  ------------------
  |  Branch (363:9): [True: 0, False: 415]
  ------------------
  364|      0|        goto err;
  365|    415|    if (!ssl_session_strndup(&ret->psk_identity, as->psk_identity))
  ------------------
  |  Branch (365:9): [True: 0, False: 415]
  ------------------
  366|      0|        goto err;
  367|    415|#endif
  368|       |
  369|    415|    ret->ext.tick_lifetime_hint = (unsigned long)as->tlsext_tick_lifetime_hint;
  370|    415|    ret->ext.tick_age_add = as->tlsext_tick_age_add;
  371|    415|    OPENSSL_free(ret->ext.tick);
  ------------------
  |  |  115|    415|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    415|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    415|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  372|    415|    if (as->tlsext_tick != NULL) {
  ------------------
  |  Branch (372:9): [True: 8, False: 407]
  ------------------
  373|      8|        ret->ext.tick = as->tlsext_tick->data;
  374|      8|        ret->ext.ticklen = as->tlsext_tick->length;
  375|      8|        as->tlsext_tick->data = NULL;
  376|    407|    } else {
  377|    407|        ret->ext.tick = NULL;
  378|    407|    }
  379|    415|#ifndef OPENSSL_NO_COMP
  380|    415|    if (as->comp_id) {
  ------------------
  |  Branch (380:9): [True: 2, False: 413]
  ------------------
  381|      2|        if (as->comp_id->length != 1) {
  ------------------
  |  Branch (381:13): [True: 1, False: 1]
  ------------------
  382|      1|            ERR_raise(ERR_LIB_SSL, SSL_R_BAD_LENGTH);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
  383|      1|            goto err;
  384|      1|        }
  385|      1|        ret->compress_meth = as->comp_id->data[0];
  386|    413|    } else {
  387|    413|        ret->compress_meth = 0;
  388|    413|    }
  389|    414|#endif
  390|       |
  391|    414|#ifndef OPENSSL_NO_SRP
  392|    414|    if (!ssl_session_strndup(&ret->srp_username, as->srp_username))
  ------------------
  |  Branch (392:9): [True: 0, False: 414]
  ------------------
  393|      0|        goto err;
  394|    414|#endif                          /* OPENSSL_NO_SRP */
  395|       |    /* Flags defaults to zero which is fine */
  396|    414|    ret->flags = (int32_t)as->flags;
  397|    414|    ret->ext.max_early_data = as->max_early_data;
  398|       |
  399|    414|    OPENSSL_free(ret->ext.alpn_selected);
  ------------------
  |  |  115|    414|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    414|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    414|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  400|    414|    if (as->alpn_selected != NULL) {
  ------------------
  |  Branch (400:9): [True: 1, False: 413]
  ------------------
  401|      1|        ret->ext.alpn_selected = as->alpn_selected->data;
  402|      1|        ret->ext.alpn_selected_len = as->alpn_selected->length;
  403|      1|        as->alpn_selected->data = NULL;
  404|    413|    } else {
  405|    413|        ret->ext.alpn_selected = NULL;
  406|    413|        ret->ext.alpn_selected_len = 0;
  407|    413|    }
  408|       |
  409|    414|    ret->ext.max_fragment_len_mode = as->tlsext_max_fragment_len_mode;
  410|       |
  411|    414|    OPENSSL_free(ret->ticket_appdata);
  ------------------
  |  |  115|    414|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    414|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    414|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  412|    414|    if (as->ticket_appdata != NULL) {
  ------------------
  |  Branch (412:9): [True: 1, False: 413]
  ------------------
  413|      1|        ret->ticket_appdata = as->ticket_appdata->data;
  414|      1|        ret->ticket_appdata_len = as->ticket_appdata->length;
  415|      1|        as->ticket_appdata->data = NULL;
  416|    413|    } else {
  417|    413|        ret->ticket_appdata = NULL;
  418|    413|        ret->ticket_appdata_len = 0;
  419|    413|    }
  420|       |
  421|    414|    M_ASN1_free_of(as, SSL_SESSION_ASN1);
  ------------------
  |  |  930|    414|                ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type))
  |  |  ------------------
  |  |  |  |  364|    414|    ((void*) (1 ? p : (type*)0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:15): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type))
  |  |  ------------------
  |  |  |  |  427|    414|# define ASN1_ITEM_rptr(ref) (ref##_it())
  |  |  ------------------
  ------------------
  422|       |
  423|    414|    if ((a != NULL) && (*a == NULL))
  ------------------
  |  Branch (423:9): [True: 0, False: 414]
  |  Branch (423:24): [True: 0, False: 0]
  ------------------
  424|      0|        *a = ret;
  425|    414|    *pp = p;
  426|    414|    return ret;
  427|       |
  428|  12.3k| err:
  429|  12.3k|    M_ASN1_free_of(as, SSL_SESSION_ASN1);
  ------------------
  |  |  930|  12.3k|                ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type))
  |  |  ------------------
  |  |  |  |  364|  12.3k|    ((void*) (1 ? p : (type*)0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:15): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type))
  |  |  ------------------
  |  |  |  |  427|  12.3k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  |  |  ------------------
  ------------------
  430|  12.3k|    if ((a == NULL) || (*a != ret))
  ------------------
  |  Branch (430:9): [True: 12.3k, False: 0]
  |  Branch (430:24): [True: 0, False: 0]
  ------------------
  431|  12.3k|        SSL_SESSION_free(ret);
  432|  12.3k|    return NULL;
  433|    414|}
ssl_asn1.c:ssl_session_oinit:
   92|  1.73k|{
   93|  1.73k|    os->data = (unsigned char *)data; /* justified cast: data is not modified */
   94|  1.73k|    os->length = (int)len;
   95|  1.73k|    os->flags = 0;
   96|  1.73k|    *dest = os;
   97|  1.73k|}
ssl_asn1.c:ssl_session_sinit:
  102|  1.65k|{
  103|  1.65k|    if (data != NULL)
  ------------------
  |  Branch (103:9): [True: 66, False: 1.59k]
  ------------------
  104|     66|        ssl_session_oinit(dest, os, (const unsigned char *)data, strlen(data));
  105|  1.59k|    else
  106|  1.59k|        *dest = NULL;
  107|  1.65k|}
ssl_asn1.c:ssl_session_memcpy:
  245|  1.26k|{
  246|  1.26k|    if (src == NULL || src->length == 0) {
  ------------------
  |  Branch (246:9): [True: 407, False: 856]
  |  Branch (246:24): [True: 576, False: 280]
  ------------------
  247|    983|        *pdstlen = 0;
  248|    983|        return 1;
  249|    983|    }
  250|    280|    if (src->length < 0 || src->length > (int)maxlen)
  ------------------
  |  Branch (250:9): [True: 0, False: 280]
  |  Branch (250:28): [True: 7, False: 273]
  ------------------
  251|      7|        return 0;
  252|    273|    memcpy(dst, src->data, src->length);
  253|    273|    *pdstlen = src->length;
  254|    273|    return 1;
  255|    280|}
ssl_asn1.c:ssl_session_strndup:
  230|  1.65k|{
  231|  1.65k|    OPENSSL_free(*pdst);
  ------------------
  |  |  115|  1.65k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.65k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.65k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  232|  1.65k|    *pdst = NULL;
  233|  1.65k|    if (src == NULL)
  ------------------
  |  Branch (233:9): [True: 1.59k, False: 66]
  ------------------
  234|  1.59k|        return 1;
  235|     66|    *pdst = OPENSSL_strndup((char *)src->data, src->length);
  ------------------
  |  |  121|     66|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     66|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     66|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  236|     66|    if (*pdst == NULL)
  ------------------
  |  Branch (236:9): [True: 0, False: 66]
  ------------------
  237|      0|        return 0;
  238|     66|    return 1;
  239|     66|}

ssl_cipher_get_evp:
  502|      1|{
  503|      1|    int i;
  504|      1|    const SSL_CIPHER *c;
  505|       |
  506|      1|    c = s->cipher;
  507|      1|    if (c == NULL)
  ------------------
  |  Branch (507:9): [True: 0, False: 1]
  ------------------
  508|      0|        return 0;
  509|      1|    if (comp != NULL) {
  ------------------
  |  Branch (509:9): [True: 1, False: 0]
  ------------------
  510|      1|        SSL_COMP ctmp;
  511|      1|        STACK_OF(SSL_COMP) *comp_methods;
  ------------------
  |  |   31|      1|# define STACK_OF(type) struct stack_st_##type
  ------------------
  512|       |
  513|      1|        *comp = NULL;
  514|      1|        ctmp.id = s->compress_meth;
  515|      1|        comp_methods = SSL_COMP_get_compression_methods();
  516|      1|        if (comp_methods != NULL) {
  ------------------
  |  Branch (516:13): [True: 1, False: 0]
  ------------------
  517|      1|            i = sk_SSL_COMP_find(comp_methods, &ctmp);
  ------------------
  |  |   84|      1|#define sk_SSL_COMP_find(sk, ptr) OPENSSL_sk_find(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
  ------------------
  518|      1|            if (i >= 0)
  ------------------
  |  Branch (518:17): [True: 0, False: 1]
  ------------------
  519|      0|                *comp = sk_SSL_COMP_value(comp_methods, i);
  ------------------
  |  |   68|      0|#define sk_SSL_COMP_value(sk, idx) ((SSL_COMP *)OPENSSL_sk_value(ossl_check_const_SSL_COMP_sk_type(sk), (idx)))
  ------------------
  520|      1|        }
  521|       |        /* If were only interested in comp then return success */
  522|      1|        if ((enc == NULL) && (md == NULL))
  ------------------
  |  Branch (522:13): [True: 1, False: 0]
  |  Branch (522:30): [True: 1, False: 0]
  ------------------
  523|      1|            return 1;
  524|      1|    }
  525|       |
  526|      0|    if ((enc == NULL) || (md == NULL))
  ------------------
  |  Branch (526:9): [True: 0, False: 0]
  |  Branch (526:26): [True: 0, False: 0]
  ------------------
  527|      0|        return 0;
  528|       |
  529|      0|    if (!ssl_cipher_get_evp_cipher(ctx, c, enc))
  ------------------
  |  Branch (529:9): [True: 0, False: 0]
  ------------------
  530|      0|        return 0;
  531|       |
  532|      0|    if (!ssl_cipher_get_evp_md_mac(ctx, c, md, mac_pkey_type,
  ------------------
  |  Branch (532:9): [True: 0, False: 0]
  ------------------
  533|      0|                                   mac_secret_size)) {
  534|      0|        ssl_evp_cipher_free(*enc);
  535|      0|        return 0;
  536|      0|    }
  537|       |
  538|      0|    if ((*enc != NULL)
  ------------------
  |  Branch (538:9): [True: 0, False: 0]
  ------------------
  539|      0|        && (*md != NULL
  ------------------
  |  Branch (539:13): [True: 0, False: 0]
  ------------------
  540|      0|            || (EVP_CIPHER_get_flags(*enc) & EVP_CIPH_FLAG_AEAD_CIPHER))
  ------------------
  |  |  368|      0|# define         EVP_CIPH_FLAG_AEAD_CIPHER       0x200000
  ------------------
  |  Branch (540:16): [True: 0, False: 0]
  ------------------
  541|      0|        && (c->algorithm_mac == SSL_AEAD
  ------------------
  |  |  175|      0|# define SSL_AEAD                0x00000040U
  ------------------
  |  Branch (541:13): [True: 0, False: 0]
  ------------------
  542|      0|            || mac_pkey_type == NULL || *mac_pkey_type != NID_undef)) {
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (542:16): [True: 0, False: 0]
  |  Branch (542:41): [True: 0, False: 0]
  ------------------
  543|      0|        const EVP_CIPHER *evp = NULL;
  544|       |
  545|      0|        if (use_etm
  ------------------
  |  Branch (545:13): [True: 0, False: 0]
  ------------------
  546|      0|                || s->ssl_version >> 8 != TLS1_VERSION_MAJOR
  ------------------
  |  |   42|      0|# define TLS1_VERSION_MAJOR              0x03
  ------------------
  |  Branch (546:20): [True: 0, False: 0]
  ------------------
  547|      0|                || s->ssl_version < TLS1_VERSION)
  ------------------
  |  |   24|      0|# define TLS1_VERSION                    0x0301
  ------------------
  |  Branch (547:20): [True: 0, False: 0]
  ------------------
  548|      0|            return 1;
  549|       |
  550|      0|        if (c->algorithm_enc == SSL_RC4
  ------------------
  |  |  132|      0|# define SSL_RC4                 0x00000004U
  ------------------
  |  Branch (550:13): [True: 0, False: 0]
  ------------------
  551|      0|                && c->algorithm_mac == SSL_MD5)
  ------------------
  |  |  168|      0|# define SSL_MD5                 0x00000001U
  ------------------
  |  Branch (551:20): [True: 0, False: 0]
  ------------------
  552|      0|            evp = ssl_evp_cipher_fetch(ctx->libctx, NID_rc4_hmac_md5,
  ------------------
  |  | 5427|      0|#define NID_rc4_hmac_md5                915
  ------------------
  553|      0|                                       ctx->propq);
  554|      0|        else if (c->algorithm_enc == SSL_AES128
  ------------------
  |  |  136|      0|# define SSL_AES128              0x00000040U
  ------------------
  |  Branch (554:18): [True: 0, False: 0]
  ------------------
  555|      0|                    && c->algorithm_mac == SSL_SHA1)
  ------------------
  |  |  169|      0|# define SSL_SHA1                0x00000002U
  ------------------
  |  Branch (555:24): [True: 0, False: 0]
  ------------------
  556|      0|            evp = ssl_evp_cipher_fetch(ctx->libctx,
  557|      0|                                       NID_aes_128_cbc_hmac_sha1,
  ------------------
  |  | 5431|      0|#define NID_aes_128_cbc_hmac_sha1               916
  ------------------
  558|      0|                                       ctx->propq);
  559|      0|        else if (c->algorithm_enc == SSL_AES256
  ------------------
  |  |  137|      0|# define SSL_AES256              0x00000080U
  ------------------
  |  Branch (559:18): [True: 0, False: 0]
  ------------------
  560|      0|                    && c->algorithm_mac == SSL_SHA1)
  ------------------
  |  |  169|      0|# define SSL_SHA1                0x00000002U
  ------------------
  |  Branch (560:24): [True: 0, False: 0]
  ------------------
  561|      0|             evp = ssl_evp_cipher_fetch(ctx->libctx,
  562|      0|                                        NID_aes_256_cbc_hmac_sha1,
  ------------------
  |  | 5439|      0|#define NID_aes_256_cbc_hmac_sha1               918
  ------------------
  563|      0|                                        ctx->propq);
  564|      0|        else if (c->algorithm_enc == SSL_AES128
  ------------------
  |  |  136|      0|# define SSL_AES128              0x00000040U
  ------------------
  |  Branch (564:18): [True: 0, False: 0]
  ------------------
  565|      0|                    && c->algorithm_mac == SSL_SHA256)
  ------------------
  |  |  172|      0|# define SSL_SHA256              0x00000010U
  ------------------
  |  Branch (565:24): [True: 0, False: 0]
  ------------------
  566|      0|            evp = ssl_evp_cipher_fetch(ctx->libctx,
  567|      0|                                       NID_aes_128_cbc_hmac_sha256,
  ------------------
  |  | 5443|      0|#define NID_aes_128_cbc_hmac_sha256             948
  ------------------
  568|      0|                                       ctx->propq);
  569|      0|        else if (c->algorithm_enc == SSL_AES256
  ------------------
  |  |  137|      0|# define SSL_AES256              0x00000080U
  ------------------
  |  Branch (569:18): [True: 0, False: 0]
  ------------------
  570|      0|                    && c->algorithm_mac == SSL_SHA256)
  ------------------
  |  |  172|      0|# define SSL_SHA256              0x00000010U
  ------------------
  |  Branch (570:24): [True: 0, False: 0]
  ------------------
  571|      0|            evp = ssl_evp_cipher_fetch(ctx->libctx,
  572|      0|                                       NID_aes_256_cbc_hmac_sha256,
  ------------------
  |  | 5451|      0|#define NID_aes_256_cbc_hmac_sha256             950
  ------------------
  573|      0|                                       ctx->propq);
  574|       |
  575|      0|        if (evp != NULL) {
  ------------------
  |  Branch (575:13): [True: 0, False: 0]
  ------------------
  576|      0|            ssl_evp_cipher_free(*enc);
  577|      0|            ssl_evp_md_free(*md);
  578|      0|            *enc = evp;
  579|      0|            *md = NULL;
  580|      0|        }
  581|      0|        return 1;
  582|      0|    }
  583|       |
  584|      0|    return 0;
  585|      0|}
SSL_COMP_get_compression_methods:
 1980|      3|{
 1981|      3|    STACK_OF(SSL_COMP) **rv;
  ------------------
  |  |   31|      3|# define STACK_OF(type) struct stack_st_##type
  ------------------
 1982|       |
 1983|      3|    rv = (STACK_OF(SSL_COMP) **)OSSL_LIB_CTX_get_data(NULL,
 1984|      3|                                     OSSL_LIB_CTX_COMP_METHODS);
  ------------------
  |  |  121|      3|# define OSSL_LIB_CTX_COMP_METHODS                  21
  ------------------
 1985|      3|    if (rv != NULL)
  ------------------
  |  Branch (1985:9): [True: 3, False: 0]
  ------------------
 1986|      3|        return *rv;
 1987|      0|    else
 1988|      0|        return NULL;
 1989|      3|}

OPENSSL_init_ssl:
   47|    481|{
   48|    481|    static int stoperrset = 0;
   49|       |
   50|    481|    if (stopped) {
  ------------------
  |  Branch (50:9): [True: 0, False: 481]
  ------------------
   51|      0|        if (!stoperrset) {
  ------------------
  |  Branch (51:13): [True: 0, False: 0]
  ------------------
   52|       |            /*
   53|       |             * We only ever set this once to avoid getting into an infinite
   54|       |             * loop where the error system keeps trying to init and fails so
   55|       |             * sets an error etc
   56|       |             */
   57|      0|            stoperrset = 1;
   58|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   59|      0|        }
   60|      0|        return 0;
   61|      0|    }
   62|       |
   63|    481|    opts |= OPENSSL_INIT_ADD_ALL_CIPHERS
  ------------------
  |  |  468|    481|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
   64|    481|         |  OPENSSL_INIT_ADD_ALL_DIGESTS;
  ------------------
  |  |  469|    481|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
   65|    481|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
   66|    481|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG) == 0)
  ------------------
  |  |  473|    481|# define OPENSSL_INIT_NO_LOAD_CONFIG         0x00000080L
  ------------------
  |  Branch (66:9): [True: 481, False: 0]
  ------------------
   67|    481|        opts |= OPENSSL_INIT_LOAD_CONFIG;
  ------------------
  |  |  472|    481|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
   68|    481|#endif
   69|       |
   70|    481|    if (!OPENSSL_init_crypto(opts, settings))
  ------------------
  |  Branch (70:9): [True: 0, False: 481]
  ------------------
   71|      0|        return 0;
   72|       |
   73|    481|    if (!RUN_ONCE(&ssl_base, ossl_init_ssl_base))
  ------------------
  |  |  130|    481|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 481, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (73:9): [True: 0, False: 481]
  ------------------
   74|      0|        return 0;
   75|       |
   76|    481|    return 1;
   77|    481|}
ssl_init.c:ossl_init_ssl_base:
   25|      2|{
   26|      2|#ifndef OPENSSL_NO_COMP
   27|      2|    OSSL_TRACE(INIT, "ossl_init_ssl_base: "
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   28|      2|               "SSL_COMP_get_compression_methods()\n");
   29|       |    /*
   30|       |     * This will initialise the built-in compression algorithms. The value
   31|       |     * returned is a STACK_OF(SSL_COMP), but that can be discarded safely
   32|       |     */
   33|      2|    SSL_COMP_get_compression_methods();
   34|      2|#endif
   35|      2|    ssl_sort_cipher_list();
   36|      2|    OSSL_TRACE(INIT, "ossl_init_ssl_base: SSL_add_ssl_module()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   37|      2|    ssl_base_inited = 1;
   38|      2|    return 1;
   39|      2|}

ssl_cipher_id_cmp:
 3251|  3.06k|{
 3252|  3.06k|    if (a->id > b->id)
  ------------------
  |  Branch (3252:9): [True: 933, False: 2.13k]
  ------------------
 3253|    933|        return 1;
 3254|  2.13k|    if (a->id < b->id)
  ------------------
  |  Branch (3254:9): [True: 1.70k, False: 424]
  ------------------
 3255|  1.70k|        return -1;
 3256|    424|    return 0;
 3257|  2.13k|}
ssl_protocol_to_string:
 5035|    414|{
 5036|    414|    switch (version) {
 5037|      6|    case TLS1_3_VERSION:
  ------------------
  |  |   27|      6|# define TLS1_3_VERSION                  0x0304
  ------------------
  |  Branch (5037:5): [True: 6, False: 408]
  ------------------
 5038|      6|        return "TLSv1.3";
 5039|       |
 5040|     11|    case TLS1_2_VERSION:
  ------------------
  |  |   26|     11|# define TLS1_2_VERSION                  0x0303
  ------------------
  |  Branch (5040:5): [True: 11, False: 403]
  ------------------
 5041|     11|        return "TLSv1.2";
 5042|       |
 5043|     15|    case TLS1_1_VERSION:
  ------------------
  |  |   25|     15|# define TLS1_1_VERSION                  0x0302
  ------------------
  |  Branch (5043:5): [True: 15, False: 399]
  ------------------
 5044|     15|        return "TLSv1.1";
 5045|       |
 5046|     10|    case TLS1_VERSION:
  ------------------
  |  |   24|     10|# define TLS1_VERSION                    0x0301
  ------------------
  |  Branch (5046:5): [True: 10, False: 404]
  ------------------
 5047|     10|        return "TLSv1";
 5048|       |
 5049|      4|    case SSL3_VERSION:
  ------------------
  |  |   23|      4|# define SSL3_VERSION                    0x0300
  ------------------
  |  Branch (5049:5): [True: 4, False: 410]
  ------------------
 5050|      4|        return "SSLv3";
 5051|       |
 5052|      3|    case DTLS1_BAD_VER:
  ------------------
  |  |   30|      3|# define DTLS1_BAD_VER                   0x0100
  ------------------
  |  Branch (5052:5): [True: 3, False: 411]
  ------------------
 5053|      3|        return "DTLSv0.9";
 5054|       |
 5055|      1|    case DTLS1_VERSION:
  ------------------
  |  |   28|      1|# define DTLS1_VERSION                   0xFEFF
  ------------------
  |  Branch (5055:5): [True: 1, False: 413]
  ------------------
 5056|      1|        return "DTLSv1";
 5057|       |
 5058|      4|    case DTLS1_2_VERSION:
  ------------------
  |  |   29|      4|# define DTLS1_2_VERSION                 0xFEFD
  ------------------
  |  Branch (5058:5): [True: 4, False: 410]
  ------------------
 5059|      4|        return "DTLSv1.2";
 5060|       |
 5061|    360|    default:
  ------------------
  |  Branch (5061:5): [True: 360, False: 54]
  ------------------
 5062|    360|        return "unknown";
 5063|    414|    }
 5064|    414|}

ssl_session_calculate_timeout:
   49|    897|{
   50|    897|    ss->calc_timeout = ossl_time_add(ss->time, ss->timeout);
   51|    897|}
SSL_SESSION_new:
  103|    479|{
  104|    479|    SSL_SESSION *ss;
  105|       |
  106|    479|    if (!OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL))
  ------------------
  |  | 2807|    479|# define OPENSSL_INIT_LOAD_SSL_STRINGS       0x00200000L
  ------------------
  |  Branch (106:9): [True: 0, False: 479]
  ------------------
  107|      0|        return NULL;
  108|       |
  109|    479|    ss = OPENSSL_zalloc(sizeof(*ss));
  ------------------
  |  |  104|    479|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    479|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    479|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  110|    479|    if (ss == NULL)
  ------------------
  |  Branch (110:9): [True: 0, False: 479]
  ------------------
  111|      0|        return NULL;
  112|       |
  113|    479|    ss->ext.max_fragment_len_mode = TLSEXT_max_fragment_length_UNSPECIFIED;
  ------------------
  |  |  235|    479|# define TLSEXT_max_fragment_length_UNSPECIFIED 255
  ------------------
  114|    479|    ss->verify_result = 1;      /* avoid 0 (= X509_V_OK) just in case */
  115|       |   /* 5 minute timeout by default */
  116|    479|    ss->timeout = ossl_seconds2time(60 * 5 + 4);
  ------------------
  |  |   42|    479|#define ossl_seconds2time(s) ossl_ticks2time((s) * OSSL_TIME_SECOND)
  |  |  ------------------
  |  |  |  |   31|    479|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  ------------------
  ------------------
  117|    479|    ss->time = ossl_time_now();
  118|    479|    ssl_session_calculate_timeout(ss);
  119|    479|    if (!CRYPTO_NEW_REF(&ss->references, 1)) {
  ------------------
  |  Branch (119:9): [True: 0, False: 479]
  ------------------
  120|      0|        OPENSSL_free(ss);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  121|      0|        return NULL;
  122|      0|    }
  123|       |
  124|    479|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, ss, &ss->ex_data)) {
  ------------------
  |  |  231|    479|# define CRYPTO_EX_INDEX_SSL_SESSION      2
  ------------------
  |  Branch (124:9): [True: 0, False: 479]
  ------------------
  125|      0|        CRYPTO_FREE_REF(&ss->references);
  126|      0|        OPENSSL_free(ss);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  127|      0|        return NULL;
  128|      0|    }
  129|    479|    return ss;
  130|    479|}
SSL_SESSION_free:
  849|  12.7k|{
  850|  12.7k|    int i;
  851|       |
  852|  12.7k|    if (ss == NULL)
  ------------------
  |  Branch (852:9): [True: 12.2k, False: 479]
  ------------------
  853|  12.2k|        return;
  854|    479|    CRYPTO_DOWN_REF(&ss->references, &i);
  855|    479|    REF_PRINT_COUNT("SSL_SESSION", i, ss);
  ------------------
  |  |  301|    479|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|    479|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|    479|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    479|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  856|    479|    if (i > 0)
  ------------------
  |  Branch (856:9): [True: 0, False: 479]
  ------------------
  857|      0|        return;
  858|    479|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|    479|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 479]
  |  |  ------------------
  ------------------
  859|       |
  860|    479|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, ss, &ss->ex_data);
  ------------------
  |  |  231|    479|# define CRYPTO_EX_INDEX_SSL_SESSION      2
  ------------------
  861|       |
  862|    479|    OPENSSL_cleanse(ss->master_key, sizeof(ss->master_key));
  863|    479|    OPENSSL_cleanse(ss->session_id, sizeof(ss->session_id));
  864|    479|    X509_free(ss->peer);
  865|    479|    EVP_PKEY_free(ss->peer_rpk);
  866|    479|    OSSL_STACK_OF_X509_free(ss->peer_chain);
  867|    479|    OPENSSL_free(ss->ext.hostname);
  ------------------
  |  |  115|    479|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    479|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    479|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  868|    479|    OPENSSL_free(ss->ext.tick);
  ------------------
  |  |  115|    479|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    479|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    479|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  869|    479|#ifndef OPENSSL_NO_PSK
  870|    479|    OPENSSL_free(ss->psk_identity_hint);
  ------------------
  |  |  115|    479|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    479|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    479|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  871|    479|    OPENSSL_free(ss->psk_identity);
  ------------------
  |  |  115|    479|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    479|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    479|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  872|    479|#endif
  873|    479|#ifndef OPENSSL_NO_SRP
  874|    479|    OPENSSL_free(ss->srp_username);
  ------------------
  |  |  115|    479|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    479|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    479|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  875|    479|#endif
  876|    479|    OPENSSL_free(ss->ext.alpn_selected);
  ------------------
  |  |  115|    479|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    479|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    479|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  877|    479|    OPENSSL_free(ss->ticket_appdata);
  ------------------
  |  |  115|    479|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    479|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    479|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  878|    479|    CRYPTO_FREE_REF(&ss->references);
  879|    479|    OPENSSL_clear_free(ss, sizeof(*ss));
  ------------------
  |  |  113|    479|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    479|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    479|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  880|    479|}

SSL_SESSION_print:
   35|    414|{
   36|    414|    size_t i;
   37|    414|    const char *s;
   38|    414|    int istls13;
   39|       |
   40|    414|    if (x == NULL)
  ------------------
  |  Branch (40:9): [True: 0, False: 414]
  ------------------
   41|      0|        goto err;
   42|    414|    istls13 = (x->ssl_version == TLS1_3_VERSION);
  ------------------
  |  |   27|    414|# define TLS1_3_VERSION                  0x0304
  ------------------
   43|    414|    if (BIO_puts(bp, "SSL-Session:\n") <= 0)
  ------------------
  |  Branch (43:9): [True: 0, False: 414]
  ------------------
   44|      0|        goto err;
   45|    414|    s = ssl_protocol_to_string(x->ssl_version);
   46|    414|    if (BIO_printf(bp, "    Protocol  : %s\n", s) <= 0)
  ------------------
  |  Branch (46:9): [True: 0, False: 414]
  ------------------
   47|      0|        goto err;
   48|       |
   49|    414|    if (x->cipher == NULL) {
  ------------------
  |  Branch (49:9): [True: 0, False: 414]
  ------------------
   50|      0|        if (((x->cipher_id) & 0xff000000) == 0x02000000) {
  ------------------
  |  Branch (50:13): [True: 0, False: 0]
  ------------------
   51|      0|            if (BIO_printf(bp, "    Cipher    : %06lX\n",
  ------------------
  |  Branch (51:17): [True: 0, False: 0]
  ------------------
   52|      0|                           x->cipher_id & 0xffffff) <= 0)
   53|      0|                goto err;
   54|      0|        } else {
   55|      0|            if (BIO_printf(bp, "    Cipher    : %04lX\n",
  ------------------
  |  Branch (55:17): [True: 0, False: 0]
  ------------------
   56|      0|                           x->cipher_id & 0xffff) <= 0)
   57|      0|                goto err;
   58|      0|        }
   59|    414|    } else {
   60|    414|        if (BIO_printf(bp, "    Cipher    : %s\n",
  ------------------
  |  Branch (60:13): [True: 0, False: 414]
  ------------------
   61|    414|                       ((x->cipher->name == NULL) ? "unknown"
  ------------------
  |  Branch (61:25): [True: 0, False: 414]
  ------------------
   62|    414|                                                  : x->cipher->name)) <= 0)
   63|      0|            goto err;
   64|    414|    }
   65|    414|    if (BIO_puts(bp, "    Session-ID: ") <= 0)
  ------------------
  |  Branch (65:9): [True: 0, False: 414]
  ------------------
   66|      0|        goto err;
   67|    753|    for (i = 0; i < x->session_id_length; i++) {
  ------------------
  |  Branch (67:17): [True: 339, False: 414]
  ------------------
   68|    339|        if (BIO_printf(bp, "%02X", x->session_id[i]) <= 0)
  ------------------
  |  Branch (68:13): [True: 0, False: 339]
  ------------------
   69|      0|            goto err;
   70|    339|    }
   71|    414|    if (BIO_puts(bp, "\n    Session-ID-ctx: ") <= 0)
  ------------------
  |  Branch (71:9): [True: 0, False: 414]
  ------------------
   72|      0|        goto err;
   73|    468|    for (i = 0; i < x->sid_ctx_length; i++) {
  ------------------
  |  Branch (73:17): [True: 54, False: 414]
  ------------------
   74|     54|        if (BIO_printf(bp, "%02X", x->sid_ctx[i]) <= 0)
  ------------------
  |  Branch (74:13): [True: 0, False: 54]
  ------------------
   75|      0|            goto err;
   76|     54|    }
   77|    414|    if (istls13) {
  ------------------
  |  Branch (77:9): [True: 6, False: 408]
  ------------------
   78|      6|        if (BIO_puts(bp, "\n    Resumption PSK: ") <= 0)
  ------------------
  |  Branch (78:13): [True: 0, False: 6]
  ------------------
   79|      0|            goto err;
   80|    408|    } else if (BIO_puts(bp, "\n    Master-Key: ") <= 0)
  ------------------
  |  Branch (80:16): [True: 0, False: 408]
  ------------------
   81|      0|        goto err;
   82|  4.85k|    for (i = 0; i < x->master_key_length; i++) {
  ------------------
  |  Branch (82:17): [True: 4.44k, False: 414]
  ------------------
   83|  4.44k|        if (BIO_printf(bp, "%02X", x->master_key[i]) <= 0)
  ------------------
  |  Branch (83:13): [True: 0, False: 4.44k]
  ------------------
   84|      0|            goto err;
   85|  4.44k|    }
   86|    414|#ifndef OPENSSL_NO_PSK
   87|    414|    if (BIO_puts(bp, "\n    PSK identity: ") <= 0)
  ------------------
  |  Branch (87:9): [True: 0, False: 414]
  ------------------
   88|      0|        goto err;
   89|    414|    if (BIO_printf(bp, "%s", x->psk_identity ? x->psk_identity : "None") <= 0)
  ------------------
  |  Branch (89:9): [True: 1, False: 413]
  |  Branch (89:30): [True: 37, False: 377]
  ------------------
   90|      1|        goto err;
   91|    413|    if (BIO_puts(bp, "\n    PSK identity hint: ") <= 0)
  ------------------
  |  Branch (91:9): [True: 0, False: 413]
  ------------------
   92|      0|        goto err;
   93|    413|    if (BIO_printf
  ------------------
  |  Branch (93:9): [True: 1, False: 412]
  ------------------
   94|    413|        (bp, "%s", x->psk_identity_hint ? x->psk_identity_hint : "None") <= 0)
  ------------------
  |  Branch (94:20): [True: 4, False: 409]
  ------------------
   95|      1|        goto err;
   96|    412|#endif
   97|    412|#ifndef OPENSSL_NO_SRP
   98|    412|    if (BIO_puts(bp, "\n    SRP username: ") <= 0)
  ------------------
  |  Branch (98:9): [True: 0, False: 412]
  ------------------
   99|      0|        goto err;
  100|    412|    if (BIO_printf(bp, "%s", x->srp_username ? x->srp_username : "None") <= 0)
  ------------------
  |  Branch (100:9): [True: 2, False: 410]
  |  Branch (100:30): [True: 24, False: 388]
  ------------------
  101|      2|        goto err;
  102|    410|#endif
  103|    410|    if (x->ext.tick_lifetime_hint) {
  ------------------
  |  Branch (103:9): [True: 119, False: 291]
  ------------------
  104|    119|        if (BIO_printf(bp,
  ------------------
  |  Branch (104:13): [True: 0, False: 119]
  ------------------
  105|    119|                       "\n    TLS session ticket lifetime hint: %ld (seconds)",
  106|    119|                       x->ext.tick_lifetime_hint) <= 0)
  107|      0|            goto err;
  108|    119|    }
  109|    410|    if (x->ext.tick) {
  ------------------
  |  Branch (109:9): [True: 8, False: 402]
  ------------------
  110|      8|        if (BIO_puts(bp, "\n    TLS session ticket:\n") <= 0)
  ------------------
  |  Branch (110:13): [True: 0, False: 8]
  ------------------
  111|      0|            goto err;
  112|      8|        if (BIO_dump_indent
  ------------------
  |  Branch (112:13): [True: 1, False: 7]
  ------------------
  113|      8|            (bp, (const char *)x->ext.tick, (int)x->ext.ticklen, 4)
  114|      8|            <= 0)
  115|      1|            goto err;
  116|      8|    }
  117|    409|#ifndef OPENSSL_NO_COMP
  118|    409|    if (x->compress_meth != 0) {
  ------------------
  |  Branch (118:9): [True: 1, False: 408]
  ------------------
  119|      1|        SSL_COMP *comp = NULL;
  120|       |
  121|      1|        if (!ssl_cipher_get_evp(NULL, x, NULL, NULL, NULL, NULL, &comp, 0))
  ------------------
  |  Branch (121:13): [True: 0, False: 1]
  ------------------
  122|      0|            goto err;
  123|      1|        if (comp == NULL) {
  ------------------
  |  Branch (123:13): [True: 1, False: 0]
  ------------------
  124|      1|            if (BIO_printf(bp, "\n    Compression: %d", x->compress_meth) <= 0)
  ------------------
  |  Branch (124:17): [True: 0, False: 1]
  ------------------
  125|      0|                goto err;
  126|      1|        } else {
  127|      0|            if (BIO_printf(bp, "\n    Compression: %d (%s)", comp->id,
  ------------------
  |  Branch (127:17): [True: 0, False: 0]
  ------------------
  128|      0|                           comp->name) <= 0)
  129|      0|                goto err;
  130|      0|        }
  131|      1|    }
  132|    409|#endif
  133|    409|    if (!ossl_time_is_zero(x->time)) {
  ------------------
  |  Branch (133:9): [True: 407, False: 2]
  ------------------
  134|    407|        if (BIO_printf(bp, "\n    Start Time: %lld",
  ------------------
  |  Branch (134:13): [True: 0, False: 407]
  ------------------
  135|    407|                       (long long)ossl_time_to_time_t(x->time)) <= 0)
  136|      0|            goto err;
  137|    407|    }
  138|    409|    if (!ossl_time_is_zero(x->timeout)) {
  ------------------
  |  Branch (138:9): [True: 408, False: 1]
  ------------------
  139|    408|        if (BIO_printf(bp, "\n    Timeout   : %lld (sec)",
  ------------------
  |  Branch (139:13): [True: 0, False: 408]
  ------------------
  140|    408|                       (long long)ossl_time2seconds(x->timeout)) <= 0)
  ------------------
  |  |   43|    408|#define ossl_time2seconds(t) (ossl_time2ticks(t) / OSSL_TIME_SECOND)
  |  |  ------------------
  |  |  |  |   31|    408|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  ------------------
  ------------------
  141|      0|            goto err;
  142|    408|    }
  143|    409|    if (BIO_puts(bp, "\n") <= 0)
  ------------------
  |  Branch (143:9): [True: 0, False: 409]
  ------------------
  144|      0|        goto err;
  145|       |
  146|    409|    if (BIO_puts(bp, "    Verify return code: ") <= 0)
  ------------------
  |  Branch (146:9): [True: 0, False: 409]
  ------------------
  147|      0|        goto err;
  148|    409|    if (BIO_printf(bp, "%ld (%s)\n", x->verify_result,
  ------------------
  |  Branch (148:9): [True: 0, False: 409]
  ------------------
  149|    409|                   X509_verify_cert_error_string(x->verify_result)) <= 0)
  150|      0|        goto err;
  151|       |
  152|    409|    if (BIO_printf(bp, "    Extended master secret: %s\n",
  ------------------
  |  Branch (152:9): [True: 0, False: 409]
  ------------------
  153|    409|                   x->flags & SSL_SESS_FLAG_EXTMS ? "yes" : "no") <= 0)
  ------------------
  |  |  568|    409|# define SSL_SESS_FLAG_EXTMS             0x1
  ------------------
  |  Branch (153:20): [True: 1, False: 408]
  ------------------
  154|      0|        goto err;
  155|       |
  156|    409|    if (istls13) {
  ------------------
  |  Branch (156:9): [True: 6, False: 403]
  ------------------
  157|      6|        if (BIO_printf(bp, "    Max Early Data: %u\n",
  ------------------
  |  Branch (157:13): [True: 0, False: 6]
  ------------------
  158|      6|                       (unsigned int)x->ext.max_early_data) <= 0)
  159|      0|            goto err;
  160|      6|    }
  161|       |
  162|    409|    return 1;
  163|      5| err:
  164|      5|    return 0;
  165|    409|}

